(()=>{var UM=Object.create;var{getPrototypeOf:qM,defineProperty:i6,getOwnPropertyNames:U1,getOwnPropertyDescriptor:GM}=Object,q1=Object.prototype.hasOwnProperty;var XM=(J,Q,$)=>{$=J!=null?UM(qM(J)):{};let Z=Q||!J||!J.__esModule?i6($,"default",{value:J,enumerable:!0}):$;for(let K of U1(J))if(!q1.call(Z,K))i6(Z,K,{get:()=>J[K],enumerable:!0});return Z},H1=new WeakMap,R3=(J)=>{var Q=H1.get(J),$;if(Q)return Q;if(Q=i6({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function")U1(J).map((Z)=>!q1.call(Q,Z)&&i6(Q,Z,{get:()=>J[Z],enumerable:!($=GM(J,Z))||$.enumerable}));return H1.set(J,Q),Q},YM=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var UJ=(J,Q)=>{for(var $ in Q)i6(J,$,{get:Q[$],enumerable:!0,configurable:!0,set:(Z)=>Q[$]=()=>Z})};var VO=YM((lZ,B5)=>{(function J(Q,$){if(typeof lZ==="object"&&typeof B5==="object")B5.exports=$();else if(typeof define==="function"&&define.amd)define([],$);else if(typeof lZ==="object")lZ.rive=$();else Q.rive=$()})(lZ,()=>{return(()=>{var J=[,(K,W,H)=>{H.r(W),H.d(W,{default:()=>q});var U=(()=>{var X=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:void 0;return function(F={}){var N=F,L,Y;N.ready=new Promise((G,O)=>{L=G,Y=O});function B(){function G(g){let n=z;D=O=0,z=new Map,n.forEach((J0)=>{try{J0(g)}catch(i){console.error(i)}}),this.ob(),E&&E.Qb()}let O=0,D=0,z=new Map,E=null,h=null;this.requestAnimationFrame=function(g){O||(O=requestAnimationFrame(G.bind(this)));let n=++D;return z.set(n,g),n},this.cancelAnimationFrame=function(g){z.delete(g),O&&z.size==0&&(cancelAnimationFrame(O),O=0)},this.Ob=function(g){h&&(document.body.remove(h),h=null),g||(h=document.createElement("div"),h.style.backgroundColor="black",h.style.position="fixed",h.style.right=0,h.style.top=0,h.style.color="white",h.style.padding="4px",h.innerHTML="RIVE FPS",g=function(n){h.innerHTML="RIVE FPS "+n.toFixed(1)},document.body.appendChild(h)),E=new function(){let n=0,J0=0;this.Qb=function(){var i=performance.now();J0?(++n,i-=J0,1000>8,G.has(D)&&clearTimeout(G.get(D)),G.set(D,setTimeout(function(){G.delete(D),G.length==0?O=-1/0:D==O&&(O=Math.max(...G.keys()),console.assert(O{let h=N.ptrToFileAsset(E);return h.isImage?N.ptrToImageAsset(E):h.isFont?N.ptrToFontAsset(E):h.isAudio?N.ptrToAudioAsset(E):h},N.CustomFileAssetLoader=D.extend("CustomFileAssetLoader",{__construct:function({loadContents:E}){this.__parent.__construct.call(this),this.Eb=E},loadContents:function(E,h){return E=N.ptrToAsset(E),this.Eb(E,h)}}),N.CDNFileAssetLoader=D.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(E){let h=N.ptrToAsset(E);if(E=h.cdnUuid,E==="")return!1;return function(g,n){var J0=new XMLHttpRequest;J0.responseType="arraybuffer",J0.onreadystatechange=function(){J0.readyState==4&&J0.status==200&&n(J0)},J0.open("GET",g,!0),J0.send(null)}(h.cdnBaseUrl+"/"+E,(g)=>{h.decode(new Uint8Array(g.response))}),!0}}),N.FallbackFileAssetLoader=D.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.kb=[]},addLoader:function(E){this.kb.push(E)},loadContents:function(E,h){for(let g of this.kb)if(g.loadContents(E,h))return!0;return!1}});let z=N.computeAlignment;N.computeAlignment=function(E,h,g,n,J0=1){return z.call(this,E,h,g,n,J0)}};let A=N.onRuntimeInitialized;N.onRuntimeInitialized=function(){function G(G0){this.F=G0,this.Db=G0.getContext("2d"),this.Gb=z,this.S=[],this.la=0,this.clear=function(){console.assert(this.la==0),this.S=[],E.delete(this)},this.save=function(){++this.la,this.S.push(z.save.bind(z))},this.restore=function(){0=v0)){L0=1<<(0>=L0?0:32-Math.clz32(L0-1));for(h0=1<<(0>=h0?0:32-Math.clz32(h0-1));h0*L0$U.La-g7.La),v0=new N.DynamicRectanizer(G0);for(n9=0;n9w9){console.assert(m9>n9);break}HJ.ra=w9&65535,HJ.sa=w9>>16}HJ=J0.push(v0.drawWidth()),w9=i.push(v0.drawHeight()),console.assert(HJ>=v0.drawWidth()),console.assert(w9>=v0.drawHeight()),console.assert(HJ<=G0),console.assert(w9<=G0),z.F.width!=HJ&&(z.F.width=HJ),z.F.height!=w9&&(z.F.height=w9),z.clear();for(HJ=n9;HJ{this.Hb||n.call(this,G0.Gb)}):n.call(this,G0)};let J0=new M,i=new M,F0=new B;N.requestAnimationFrame=F0.requestAnimationFrame.bind(F0),N.cancelAnimationFrame=F0.cancelAnimationFrame.bind(F0),N.enableFPSCounter=F0.Ob.bind(F0),F0.ob=D,N.resolveAnimationFrame=D;let B0=N.load;N.load=function(G0,L0,h0=!0){let v0=new N.FallbackFileAssetLoader;return L0!==void 0&&v0.addLoader(L0),h0&&(L0=new N.CDNFileAssetLoader,v0.addLoader(L0)),Promise.resolve(B0(G0,v0))};let C0=N.WebGL2Renderer.prototype.clear;N.WebGL2Renderer.prototype.clear=function(){aH(this.Na);let G0=this.F;if(this.Oa!=G0.width||this.ab!=G0.height)this.resize(G0.width,G0.height),this.Oa=G0.width,this.ab=G0.height;C0.call(this)},N.decodeImage=function(G0,L0){G0=N.decodeWebGL2Image(G0),L0(G0)};let r=N.Renderer.prototype.align;N.Renderer.prototype.align=function(G0,L0,h0,v0,p0=1){r.call(this,G0,L0,h0,v0,p0)}};var I=Object.assign({},N),P="./this.program",j=typeof window=="object",T=typeof importScripts=="function",w="",_,S;if(j||T)T?w=self.location.href:typeof document!="undefined"&&document.currentScript&&(w=document.currentScript.src),X&&(w=X),w.indexOf("blob:")!==0?w=w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):w="",T&&(S=(G)=>{var O=new XMLHttpRequest;return O.open("GET",G,!1),O.responseType="arraybuffer",O.send(null),new Uint8Array(O.response)}),_=(G,O,D)=>{var z=new XMLHttpRequest;z.open("GET",G,!0),z.responseType="arraybuffer",z.onload=()=>{z.status==200||z.status==0&&z.response?O(z.response):D()},z.onerror=D,z.send(null)};var y=N.print||console.log.bind(console),f=N.printErr||console.error.bind(console);Object.assign(N,I),I=null,N.thisProgram&&(P=N.thisProgram);var u;N.wasmBinary&&(u=N.wasmBinary);var v=N.noExitRuntime||!0;typeof WebAssembly!="object"&&g0("no native wasm support detected");var m,l,H0=!1,N0,Q0,Z0,D0,b,Y0,V0,f0;function z0(){var G=m.buffer;N.HEAP8=N0=new Int8Array(G),N.HEAP16=Z0=new Int16Array(G),N.HEAP32=b=new Int32Array(G),N.HEAPU8=Q0=new Uint8Array(G),N.HEAPU16=D0=new Uint16Array(G),N.HEAPU32=Y0=new Uint32Array(G),N.HEAPF32=V0=new Float32Array(G),N.HEAPF64=f0=new Float64Array(G)}var i0,x0=[],o0=[],m0=[];function D9(){var G=N.preRun.shift();x0.unshift(G)}var N9=0,J9=null,Z9=null;function g0(G){if(N.onAbort)N.onAbort(G);throw G="Aborted("+G+")",f(G),H0=!0,G=new WebAssembly.RuntimeError(G+". Build with -sASSERTIONS for more info."),Y(G),G}function $0(G){return G.startsWith("data:application/octet-stream;base64,")}var M0="webgl2_advanced.wasm";if(!$0(M0)){var K9=M0;M0=N.locateFile?N.locateFile(K9,w):w+K9}function o(G){if(G==M0&&u)return new Uint8Array(u);if(S)return S(G);throw"both async and sync fetching of the wasm failed"}function A9(G){if(!u&&(j||T)){if(typeof fetch=="function"&&!G.startsWith("file://"))return fetch(G,{credentials:"same-origin"}).then((O)=>{if(!O.ok)throw"failed to load wasm binary file at '"+G+"'";return O.arrayBuffer()}).catch(()=>o(G));if(_)return new Promise((O,D)=>{_(G,(z)=>O(new Uint8Array(z)),D)})}return Promise.resolve().then(()=>o(G))}function PJ(G,O,D){return A9(G).then((z)=>WebAssembly.instantiate(z,O)).then((z)=>z).then(D,(z)=>{f("failed to asynchronously prepare wasm: "+z),g0(z)})}function vJ(G,O){var D=M0;return u||typeof WebAssembly.instantiateStreaming!="function"||$0(D)||D.startsWith("file://")||typeof fetch!="function"?PJ(D,G,O):fetch(D,{credentials:"same-origin"}).then((z)=>WebAssembly.instantiateStreaming(z,G).then(O,function(E){return f("wasm streaming compile failed: "+E),f("falling back to ArrayBuffer instantiation"),PJ(D,G,O)}))}var O9,C,R={535063:(G,O,D,z,E)=>{if(typeof window==="undefined"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.h==="undefined"){window.h={Ga:0},window.h.I={},window.h.I.Ea=G,window.h.I.capture=O,window.h.I.Ra=D,window.h.ja={},window.h.ja.stopped=z,window.h.ja.xb=E;let h=window.h;h.D=[],h.rc=function(g){for(var n=0;n{Q1(n.pb)},(J0)=>{console.error("Failed to resume audiocontext",J0)})}h.Za.map(function(J0){document.removeEventListener(J0,h.unlock,!0)})},h.Za.map(function(g){document.addEventListener(g,h.unlock,!0)})}return window.h.Ga+=1,1},537241:()=>{typeof window.h!=="undefined"&&(window.h.Za.map(function(G){document.removeEventListener(G,window.h.unlock,!0)}),--window.h.Ga,window.h.Ga===0&&delete window.h)},537545:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,537649:()=>{try{var G=new(window.AudioContext||window.webkitAudioContext),O=G.sampleRate;return G.close(),O}catch(D){return 0}},537820:(G,O,D,z,E,h)=>{if(typeof window.h==="undefined")return-1;var g={},n={};return G==window.h.I.Ea&&D!=0&&(n.sampleRate=D),g.J=new(window.AudioContext||window.webkitAudioContext)(n),g.J.suspend(),g.state=window.h.ja.stopped,D=0,G!=window.h.I.Ea&&(D=O),g.Z=g.J.createScriptProcessor(z,D,O),g.Z.onaudioprocess=function(J0){if(g.wa==null||g.wa.length==0)g.wa=new Float32Array(V0.buffer,E,z*O);if(G==window.h.I.capture||G==window.h.I.Ra){for(var i=0;iwindow.h.va(G).J.sampleRate,540770:(G)=>{G=window.h.va(G),G.Z!==void 0&&(G.Z.onaudioprocess=function(){},G.Z.disconnect(),G.Z=void 0),G.Ha!==void 0&&(G.Ha.disconnect(),G.Ha=void 0),G.J.close(),G.J=void 0,G.pb=void 0},541170:(G)=>{window.h.Bb(G)},541220:(G)=>{G=window.h.va(G),G.J.resume(),G.state=window.h.ja.xb},541359:(G)=>{G=window.h.va(G),G.J.suspend(),G.state=window.h.ja.stopped}},k=(G)=>{for(;0{for(var D=0,z=G.length-1;0<=z;z--){var E=G[z];E==="."?G.splice(z,1):E===".."?(G.splice(z,1),D++):D&&(G.splice(z,1),D--)}if(O)for(;D;D--)G.unshift("..");return G},c=(G)=>{var O=G.charAt(0)==="/",D=G.substr(-1)==="/";return(G=x(G.split("/").filter((z)=>!!z),!O).join("/"))||O||(G="."),G&&D&&(G+="/"),(O?"/":"")+G},s=(G)=>{var O=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(G).slice(1);if(G=O[0],O=O[1],!G&&!O)return".";return O&&(O=O.substr(0,O.length-1)),G+O},K0=(G)=>{if(G==="/")return"/";G=c(G),G=G.replace(/\/$/,"");var O=G.lastIndexOf("/");return O===-1?G:G.substr(O+1)},j0=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return(G)=>crypto.getRandomValues(G);g0("initRandomDevice")},_0=(G)=>(_0=j0())(G);function I0(){for(var G="",O=!1,D=arguments.length-1;-1<=D&&!O;D--){if(O=0<=D?arguments[D]:"/",typeof O!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!O)return"";G=O+"/"+G,O=O.charAt(0)==="/"}return G=x(G.split("/").filter((z)=>!!z),!O).join("/"),(O?"/":"")+G||"."}var T0=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0,c0=(G,O,D)=>{var z=O+D;for(D=O;G[D]&&!(D>=z);)++D;if(16E?z+=String.fromCharCode(E):(E-=65536,z+=String.fromCharCode(55296|E>>10,56320|E&1023))}}else z+=String.fromCharCode(E)}return z},M9=[],W9=(G)=>{for(var O=0,D=0;D=z?O++:2047>=z?O+=2:55296<=z&&57343>=z?(O+=4,++D):O+=3}return O},b9=(G,O,D,z)=>{if(!(0=g){var n=G.charCodeAt(++h);g=65536+((g&1023)<<10)|n&1023}if(127>=g){if(D>=z)break;O[D++]=g}else{if(2047>=g){if(D+1>=z)break;O[D++]=192|g>>6}else{if(65535>=g){if(D+2>=z)break;O[D++]=224|g>>12}else{if(D+3>=z)break;O[D++]=240|g>>18,O[D++]=128|g>>12&63}O[D++]=128|g>>6&63}O[D++]=128|g&63}}return O[D]=0,D-E};function l9(G,O){var D=Array(W9(G)+1);return G=b9(G,D,0,D.length),O&&(D.length=G),D}var E9=[];function S0(G,O){E9[G]={input:[],G:[],V:O},WJ(G,y9)}var y9={open:function(G){var O=E9[G.node.Fa];if(!O)throw new a(43);G.s=O,G.seekable=!1},close:function(G){G.s.V.ua(G.s)},ua:function(G){G.s.V.ua(G.s)},read:function(G,O,D,z){if(!G.s||!G.s.V.jb)throw new a(60);for(var E=0,h=0;h=O||(O=Math.max(O,D*(1048576>D?2:1.125)>>>0),D!=0&&(O=Math.max(O,256)),D=G.j,G.j=new Uint8Array(O),0=G.node.v)return 0;if(G=Math.min(G.node.v-E,z),8O)throw new a(28);return O},ta(G,O,D){g9(G.node,O+D),G.node.v=Math.max(G.node.v,O+D)},lb(G,O,D,z,E){if((G.node.mode&61440)!==32768)throw new a(43);if(G=G.node.j,E&2||G.buffer!==N0.buffer){if(0{if(G=I0(G),!G)return{path:"",node:null};if(O=Object.assign({hb:!0,Wa:0},O),8!!g);for(var D=d,z="/",E=0;E{for(var O;;){if(G===G.parent)return G=G.U.mb,O?G[G.length-1]!=="/"?`${G}/${O}`:G+O:G;O=O?`${G.name}/${O}`:G.name,G=G.parent}},E0=(G,O)=>{for(var D=0,z=0;z>>0)%U0.length},u0=(G,O)=>{var D;if(D=(D=l0(G,"x"))?D:G.l.ma?0:2)throw new a(D,G);for(D=U0[E0(G.id,O)];D;D=D.ec){var z=D.name;if(D.parent.id===G.id&&z===O)return D}return G.l.ma(G,O)},H9=(G,O,D,z)=>{return G=new aX(G,O,D,z),O=E0(G.parent.id,G.name),G.ec=U0[O],U0[O]=G},q9=(G)=>{var O=["r","w","rw"][G&3];return G&512&&(O+="w"),O},l0=(G,O)=>{if(t)return 0;if(!O.includes("r")||G.mode&292){if(O.includes("w")&&!(G.mode&146)||O.includes("x")&&!(G.mode&73))return 2}else return 2;return 0},r0=(G,O)=>{try{return u0(G,O),20}catch(D){}return l0(G,"wx")},z9=()=>{for(var G=0;4096>=G;G++)if(!p[G])return G;throw new a(33)},b0=(G)=>{if(G=p[G],!G)throw new a(8);return G},FJ=(G,O=-1)=>{return L7||(L7=function(){this.h={}},L7.prototype={},Object.defineProperties(L7.prototype,{object:{get(){return this.node},set(D){this.node=D}},flags:{get(){return this.h.flags},set(D){this.h.flags=D}},position:{get(){return this.h.position},set(D){this.h.position=D}}})),G=Object.assign(new L7,G),O==-1&&(O=z9()),G.X=O,p[O]=G},u9={open:(G)=>{G.m=X0[G.node.Fa].m,G.m.open&&G.m.open(G)},ba:()=>{throw new a(70)}},WJ=(G,O)=>{X0[G]={m:O}},DJ=(G,O)=>{var D=O==="/",z=!O;if(D&&d)throw new a(10);if(!D&&!z){var E=R0(O,{hb:!1});if(O=E.path,E=E.node,E.Da)throw new a(10);if((E.mode&61440)!==16384)throw new a(54)}O={type:G,Nc:{},mb:O,dc:[]},G=G.U(O),G.U=O,O.root=G,D?d=G:E&&(E.Da=O,E.U&&E.U.dc.push(O))},C9=(G,O,D)=>{var z=R0(G,{parent:!0}).node;if(G=K0(G),!G||G==="."||G==="..")throw new a(28);var E=r0(z,G);if(E)throw new a(E);if(!z.l.Ca)throw new a(63);return z.l.Ca(z,G,O,D)},v8=(G,O,D)=>{typeof D=="undefined"&&(D=O,O=438),C9(G,O|8192,D)},YQ=(G,O)=>{if(!I0(G))throw new a(44);var D=R0(O,{parent:!0}).node;if(!D)throw new a(44);O=K0(O);var z=r0(D,O);if(z)throw new a(z);if(!D.l.Ia)throw new a(63);D.l.Ia(D,O,G)},jJ=(G)=>{if(G=R0(G).node,!G)throw new a(44);if(!G.l.na)throw new a(28);return I0(w0(G.parent),G.l.na(G))},d9=(G,O,D)=>{if(G==="")throw new a(44);if(typeof O=="string"){var z={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[O];if(typeof z=="undefined")throw Error(`Unknown file open mode: ${O}`);O=z}if(D=O&64?(typeof D=="undefined"?438:D)&4095|32768:0,typeof G=="object")var E=G;else{G=c(G);try{E=R0(G,{gb:!(O&131072)}).node}catch(h){}}if(z=!1,O&64)if(E){if(O&128)throw new a(20)}else E=C9(G,D,0),z=!0;if(!E)throw new a(44);if((E.mode&61440)===8192&&(O&=-513),O&65536&&(E.mode&61440)!==16384)throw new a(54);if(!z&&(D=E?(E.mode&61440)===40960?32:(E.mode&61440)===16384&&(q9(O)!=="r"||O&512)?31:l0(E,q9(O)):44))throw new a(D);if(O&512&&!z){if(D=E,D=typeof D=="string"?R0(D,{gb:!0}).node:D,!D.l.P)throw new a(63);if((D.mode&61440)===16384)throw new a(31);if((D.mode&61440)!==32768)throw new a(28);if(z=l0(D,"w"))throw new a(z);D.l.P(D,{size:0,timestamp:Date.now()})}return O&=-131713,E=FJ({node:E,path:w0(E),flags:O,seekable:!0,position:0,m:E.m,sc:[],error:!1}),E.m.open&&E.m.open(E),!N.logReadFiles||O&1||(E8||(E8={}),(G in E8)||(E8[G]=1)),E},A8=(G,O,D)=>{if(G.X===null)throw new a(8);if(!G.seekable||!G.m.ba)throw new a(70);if(D!=0&&D!=1&&D!=2)throw new a(28);G.position=G.m.ba(G,O,D),G.sc=[]},y$=()=>{a||(a=function(G,O){this.name="ErrnoError",this.node=O,this.ic=function(D){this.aa=D},this.ic(G),this.message="FS error"},a.prototype=Error(),a.prototype.constructor=a,[44].forEach((G)=>{W0[G]=new a(G),W0[G].stack=""}))},g6,$7=(G,O,D)=>{G=c("/dev/"+G);var z=O0(!!O,!!D);Y8||(Y8=64);var E=Y8++<<8|0;WJ(E,{open:(h)=>{h.seekable=!1},close:()=>{D&&D.buffer&&D.buffer.length&&D(10)},read:(h,g,n,J0)=>{for(var i=0,F0=0;F0{for(var i=0;i>2]}function EX(G){if(G===void 0)return"_unknown";G=G.replace(/[^a-zA-Z0-9_]/g,"$");var O=G.charCodeAt(0);return 48<=O&&57>=O?`_${G}`:G}function RK(G,O){return G=EX(G),{[G]:function(){return O.apply(this,arguments)}}[G]}function CX(){this.M=[void 0],this.ib=[]}var g8=new CX,w$=void 0;function n0(G){throw new w$(G)}var Z7=(G)=>{return G||n0("Cannot use deleted val. handle = "+G),g8.get(G).value},R7=(G)=>{switch(G){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return g8.ta({ub:1,value:G})}};function PX(G){var O=Error,D=RK(G,function(z){this.name=G,this.message=z,z=Error(z).stack,z!==void 0&&(this.stack=this.toString()+` `+z.replace(/^Error(:[^\n]*)?\n/,""))});return D.prototype=Object.create(O.prototype),D.prototype.constructor=D,D.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},D}var jX=void 0,TX=void 0;function a9(G){for(var O="";Q0[G];)O+=TX[Q0[G++]];return O}var d6=[];function dH(){for(;d6.length;){var G=d6.pop();G.g.ia=!1,G.delete()}}var m6=void 0,x7={};function mH(G,O){for(O===void 0&&n0("ptr should not be undefined");G.A;)O=G.pa(O),G=G.A;return O}var oQ={};function SX(G){G=K1(G);var O=a9(G);return v7(G),O}function c6(G,O){var D=oQ[G];return D===void 0&&n0(O+" has unknown type "+SX(G)),D}function BK(){}var cH=!1;function _X(G){--G.count.value,G.count.value===0&&(G.H?G.L.W(G.H):G.u.i.W(G.o))}function yX(G,O,D){if(O===D)return G;if(D.A===void 0)return null;return G=yX(G,O,D.A),G===null?null:D.Mb(G)}var wX={};function vB(G,O){return O=mH(G,O),x7[O]}var hX=void 0;function MK(G){throw new hX(G)}function zK(G,O){return O.u&&O.o||MK("makeClassHandle requires ptr and ptrType"),!!O.L!==!!O.H&&MK("Both smartPtrType and smartPtr must be specified"),O.count={value:1},h$(Object.create(G,{g:{value:O}}))}function h$(G){if(typeof FinalizationRegistry==="undefined")return h$=(O)=>O,G;return cH=new FinalizationRegistry((O)=>{_X(O.g)}),h$=(O)=>{var D=O.g;return D.H&&cH.register(O,{g:D},O),O},BK=(O)=>{cH.unregister(O)},h$(G)}var kK={};function p6(G){for(;G.length;){var O=G.pop();G.pop()(O)}}function l6(G){return this.fromWireType(b[G>>2])}var x$={},VK={};function C8(G,O,D){function z(n){n=D(n),n.length!==G.length&&MK("Mismatched type converter count");for(var J0=0;J0{oQ.hasOwnProperty(n)?E[J0]=oQ[n]:(h.push(n),x$.hasOwnProperty(n)||(x$[n]=[]),x$[n].push(()=>{E[J0]=oQ[n],++g,g===h.length&&z(E)}))}),h.length===0&&z(E)}function AK(G){switch(G){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${G}`)}}function gB(G,O,D={}){var z=O.name;if(G||n0(`type "${z}" must have a positive integer typeid pointer`),oQ.hasOwnProperty(G)){if(D.Xb)return;n0(`Cannot register type '${z}' twice`)}oQ[G]=O,delete VK[G],x$.hasOwnProperty(G)&&(O=x$[G],delete x$[G],O.forEach((E)=>E()))}function B7(G,O,D={}){if(!("argPackAdvance"in O))throw new TypeError("registerType registeredInstance requires argPackAdvance");gB(G,O,D)}function pH(G){n0(G.g.u.i.name+" instance already deleted")}function NQ(){}function lH(G,O,D){if(G[O].B===void 0){var z=G[O];G[O]=function(){return G[O].B.hasOwnProperty(arguments.length)||n0(`Function '${D}' called with an invalid number of arguments (${arguments.length}) - expects one of (${G[O].B})!`),G[O].B[arguments.length].apply(this,arguments)},G[O].B=[],G[O].B[z.ha]=z}}function nH(G,O,D){N.hasOwnProperty(G)?((D===void 0||N[G].B!==void 0&&N[G].B[D]!==void 0)&&n0(`Cannot register public name '${G}' twice`),lH(N,G,G),N.hasOwnProperty(D)&&n0(`Cannot register multiple overloads of a function with the same number of arguments (${D})!`),N[G].B[D]=O):(N[G]=O,D!==void 0&&(N[G].Mc=D))}function uB(G,O,D,z,E,h,g,n){this.name=G,this.constructor=O,this.N=D,this.W=z,this.A=E,this.Rb=h,this.pa=g,this.Mb=n,this.qb=[]}function IK(G,O,D){for(;O!==D;)O.pa||n0(`Expected null or instance of ${D.name}, got an instance of ${O.name}`),G=O.pa(G),O=O.A;return G}function dB(G,O){if(O===null)return this.Ta&&n0(`null is not a valid ${this.name}`),0;return O.g||n0(`Cannot pass "${sH(O)}" as a ${this.name}`),O.g.o||n0(`Cannot pass deleted object as a pointer of type ${this.name}`),IK(O.g.o,O.g.u.i,this.i)}function mB(G,O){if(O===null){if(this.Ta&&n0(`null is not a valid ${this.name}`),this.ya){var D=this.Va();return G!==null&&G.push(this.W,D),D}return 0}if(O.g||n0(`Cannot pass "${sH(O)}" as a ${this.name}`),O.g.o||n0(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.xa&&O.g.u.xa&&n0(`Cannot convert argument of type ${O.g.L?O.g.L.name:O.g.u.name} to parameter type ${this.name}`),D=IK(O.g.o,O.g.u.i,this.i),this.ya)switch(O.g.H===void 0&&n0("Passing raw pointer to smart pointer is illegal"),this.mc){case 0:O.g.L===this?D=O.g.H:n0(`Cannot convert argument of type ${O.g.L?O.g.L.name:O.g.u.name} to parameter type ${this.name}`);break;case 1:D=O.g.H;break;case 2:if(O.g.L===this)D=O.g.H;else{var z=O.clone();D=this.hc(D,R7(function(){z.delete()})),G!==null&&G.push(this.W,D)}break;default:n0("Unsupporting sharing policy")}return D}function cB(G,O){if(O===null)return this.Ta&&n0(`null is not a valid ${this.name}`),0;return O.g||n0(`Cannot pass "${sH(O)}" as a ${this.name}`),O.g.o||n0(`Cannot pass deleted object as a pointer of type ${this.name}`),O.g.u.xa&&n0(`Cannot convert argument of type ${O.g.u.name} to parameter type ${this.name}`),IK(O.g.o,O.g.u.i,this.i)}function f7(G,O,D,z){this.name=G,this.i=O,this.Ta=D,this.xa=z,this.ya=!1,this.W=this.hc=this.Va=this.sb=this.mc=this.fc=void 0,O.A!==void 0?this.toWireType=mB:(this.toWireType=z?dB:cB,this.K=null)}function xX(G,O,D){N.hasOwnProperty(G)||MK("Replacing nonexistant public symbol"),N[G].B!==void 0&&D!==void 0?N[G].B[D]=O:(N[G]=O,N[G].ha=D)}var EK=[],fX=(G)=>{var O=EK[G];return O||(G>=EK.length&&(EK.length=G+1),EK[G]=O=i0.get(G)),O},pB=(G,O)=>{var D=[];return function(){if(D.length=0,Object.assign(D,arguments),G.includes("j")){var z=N["dynCall_"+G];z=D&&D.length?z.apply(null,[O].concat(D)):z.call(null,O)}else z=fX(O).apply(null,D);return z}};function gJ(G,O){G=a9(G);var D=G.includes("j")?pB(G,O):fX(O);return typeof D!="function"&&n0(`unknown function pointer with signature ${G}: ${O}`),D}var bX=void 0;function b7(G,O){function D(h){E[h]||oQ[h]||(VK[h]?VK[h].forEach(D):(z.push(h),E[h]=!0))}var z=[],E={};throw O.forEach(D),new bX(`${G}: `+z.map(SX).join([", "]))}function CK(G,O,D,z,E){var h=O.length;2>h&&n0("argTypes array size mismatch! Must at least get return value and 'this' types!");var g=O[1]!==null&&D!==null,n=!1;for(D=1;D>2]);return D}function vX(G,O,D){return G instanceof Object||n0(`${D} with invalid "this": ${G}`),G instanceof O.i.constructor||n0(`${D} incompatible with "this" of type ${G.constructor.name}`),G.g.o||n0(`cannot call emscripten binding method ${D} on deleted object`),IK(G.g.o,G.g.u.i,O.i)}function oH(G){G>=g8.h&&--g8.get(G).ub===0&&g8.Wb(G)}function lB(G,O,D){switch(O){case 0:return function(z){return this.fromWireType((D?N0:Q0)[z])};case 1:return function(z){return this.fromWireType((D?Z0:D0)[z>>1])};case 2:return function(z){return this.fromWireType((D?b:Y0)[z>>2])};default:throw new TypeError("Unknown integer type: "+G)}}function sH(G){if(G===null)return"null";var O=typeof G;return O==="object"||O==="array"||O==="function"?G.toString():""+G}function nB(G,O){switch(O){case 2:return function(D){return this.fromWireType(V0[D>>2])};case 3:return function(D){return this.fromWireType(f0[D>>3])};default:throw new TypeError("Unknown float type: "+G)}}function oB(G,O,D){switch(O){case 0:return D?function(z){return N0[z]}:function(z){return Q0[z]};case 1:return D?function(z){return Z0[z>>1]}:function(z){return D0[z>>1]};case 2:return D?function(z){return b[z>>2]}:function(z){return Y0[z>>2]};default:throw new TypeError("Unknown integer type: "+G)}}var gX=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,sB=(G,O)=>{var D=G>>1;for(var z=D+O/2;!(D>=z)&&D0[D];)++D;if(D<<=1,32=O/2);++z){var E=Z0[G+2*z>>1];if(E==0)break;D+=String.fromCharCode(E)}return D},iB=(G,O,D)=>{if(D===void 0&&(D=2147483647),2>D)return 0;D-=2;var z=O;D=D<2*G.length?D/2:G.length;for(var E=0;E>1]=G.charCodeAt(E),O+=2;return Z0[O>>1]=0,O-z},rB=(G)=>2*G.length,aB=(G,O)=>{for(var D=0,z="";!(D>=O/4);){var E=b[G+4*D>>2];if(E==0)break;++D,65536<=E?(E-=65536,z+=String.fromCharCode(55296|E>>10,56320|E&1023)):z+=String.fromCharCode(E)}return z},tB=(G,O,D)=>{if(D===void 0&&(D=2147483647),4>D)return 0;var z=O;D=z+D-4;for(var E=0;E=h){var g=G.charCodeAt(++E);h=65536+((h&1023)<<10)|g&1023}if(b[O>>2]=h,O+=4,O+4>D)break}return b[O>>2]=0,O-z},eB=(G)=>{for(var O=0,D=0;D=z&&++D,O+=4}return O},JM={};function iH(G){var O=JM[G];return O===void 0?a9(G):O}var jK=[];function QM(G){var O=jK.length;return jK.push(G),O}function $M(G,O){for(var D=Array(G),z=0;z>2],"parameter "+z);return D}var uX=[],rH=[];function dX(G){G.Dc=G.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")}function mX(G){G.Ic=G.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")}var cX=1,n6=[],K7=[],TK=[],o6=[],f$=[],sQ=[],SK=[],kJ=[],pX={};function uJ(G){yK||(yK=G)}function _K(G){for(var O=cX++,D=G.length;DG.version||!O.eb)O.eb=O.getExtension("EXT_disjoint_timer_query");lX(O),(O.getSupportedExtensions()||[]).forEach(function(D){D.includes("lose_context")||D.includes("debug")||O.getExtension(D)})}}var yK,M7;function lX(G){G.Kc=G.getExtension("WEBGL_multi_draw")}var tH={},nX=()=>{if(!eH){var G={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:P||"./this.program"},O;for(O in tH)tH[O]===void 0?delete G[O]:G[O]=tH[O];var D=[];for(O in G)D.push(`${O}=${G[O]}`);eH=D}return eH},eH,JU=[];function s6(G,O,D,z){for(var E=0;E>2]=g}}function WM(G,O){if(O){var D=void 0;switch(G){case 36346:D=1;break;case 36344:return;case 34814:case 36345:D=0;break;case 34466:var z=q0.getParameter(34467);D=z?z.length:0;break;case 33309:if(2>M7.version){uJ(1282);return}D=2*(q0.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>M7.version){uJ(1280);return}D=G==33307?3:0}if(D===void 0)switch(z=q0.getParameter(G),typeof z){case"number":D=z;break;case"boolean":D=z?1:0;break;case"string":uJ(1280);return;case"object":if(z===null)switch(G){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:D=0;break;default:uJ(1280);return}else{if(z instanceof Float32Array||z instanceof Uint32Array||z instanceof Int32Array||z instanceof Array){for(G=0;G>2]=z[G];return}try{D=z.name|0}catch(E){uJ(1280),f("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+G+")! (error: "+E+")");return}}break;default:uJ(1280),f("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+G+") and it returns "+z+" of type "+typeof z+"!");return}b[O>>2]=D}else uJ(1281)}var wK=(G)=>{var O=W9(G)+1,D=fK(O);return D&&b9(G,Q0,D,O),D};function oX(G){return G.slice(-1)=="]"&&G.lastIndexOf("[")}function sX(G){return G-=5120,G==0?N0:G==1?Q0:G==2?Z0:G==4?b:G==6?V0:G==5||G==28922||G==28520||G==30779||G==30782?Y0:D0}var hK=(G)=>G%4===0&&(G%100!==0||G%400===0),iX=[31,29,31,30,31,30,31,31,30,31,30,31],rX=[31,28,31,30,31,30,31,31,30,31,30,31],HM=(G,O,D,z)=>{function E(r,G0,L0){for(r=typeof r=="number"?r.toString():r||"";r.lengthv0?-1:0h0-r.getDate())G0-=h0-r.getDate()+1,r.setDate(1),11>L0?r.setMonth(L0+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else{r.setDate(r.getDate()+G0);break}}return L0=new Date(r.getFullYear()+1,0,4),G0=n(new Date(r.getFullYear(),0,4)),L0=n(L0),0>=g(G0,r)?0>=g(L0,r)?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var i=b[z+40>>2];z={pc:b[z>>2],oc:b[z+4>>2],Ja:b[z+8>>2],Xa:b[z+12>>2],Ka:b[z+16>>2],ea:b[z+20>>2],R:b[z+24>>2],da:b[z+28>>2],Pc:b[z+32>>2],nc:b[z+36>>2],qc:i?i?c0(Q0,i):"":""},D=D?c0(Q0,D):"",i={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var F0 in i)D=D.replace(new RegExp(F0,"g"),i[F0]);var B0="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),C0="January February March April May June July August September October November December".split(" ");i={"%a":(r)=>B0[r.R].substring(0,3),"%A":(r)=>B0[r.R],"%b":(r)=>C0[r.Ka].substring(0,3),"%B":(r)=>C0[r.Ka],"%C":(r)=>h((r.ea+1900)/100|0,2),"%d":(r)=>h(r.Xa,2),"%e":(r)=>E(r.Xa,2," "),"%g":(r)=>J0(r).toString().substring(2),"%G":(r)=>J0(r),"%H":(r)=>h(r.Ja,2),"%I":(r)=>{return r=r.Ja,r==0?r=12:12{for(var G0=0,L0=0;L0<=r.Ka-1;G0+=(hK(r.ea+1900)?iX:rX)[L0++]);return h(r.Xa+G0,3)},"%m":(r)=>h(r.Ka+1,2),"%M":(r)=>h(r.oc,2),"%n":()=>` `,"%p":(r)=>0<=r.Ja&&12>r.Ja?"AM":"PM","%S":(r)=>h(r.pc,2),"%t":()=>"\t","%u":(r)=>r.R||7,"%U":(r)=>h(Math.floor((r.da+7-r.R)/7),2),"%V":(r)=>{var G0=Math.floor((r.da+7-(r.R+6)%7)/7);if(2>=(r.R+371-r.da-2)%7&&G0++,G0)G0==53&&(L0=(r.R+371-r.da)%7,L0==4||L0==3&&hK(r.ea)||(G0=1));else{G0=52;var L0=(r.R+7-r.da-1)%7;(L0==4||L0==5&&hK(r.ea%400-1))&&G0++}return h(G0,2)},"%w":(r)=>r.R,"%W":(r)=>h(Math.floor((r.da+7-(r.R+6)%7)/7),2),"%y":(r)=>(r.ea+1900).toString().substring(2),"%Y":(r)=>r.ea+1900,"%z":(r)=>{r=r.nc;var G0=0<=r;return r=Math.abs(r)/60,(G0?"+":"-")+String("0000"+(r/60*100+r%60)).slice(-4)},"%Z":(r)=>r.qc,"%%":()=>"%"},D=D.replace(/%%/g,"\x00\x00");for(F0 in i)D.includes(F0)&&(D=D.replace(new RegExp(F0,"g"),i[F0](z)));if(D=D.replace(/\0\0/g,"%"),F0=l9(D,!1),F0.length>O)return 0;return N0.set(F0,G),F0.length-1};function aX(G,O,D,z){G||(G=this),this.parent=G,this.U=G.U,this.Da=null,this.id=e++,this.name=O,this.mode=D,this.l={},this.m={},this.Fa=z}Object.defineProperties(aX.prototype,{read:{get:function(){return(this.mode&365)===365},set:function(G){G?this.mode|=365:this.mode&=-366}},write:{get:function(){return(this.mode&146)===146},set:function(G){G?this.mode|=146:this.mode&=-147}}}),y$(),U0=Array(4096),DJ(y0,"/"),C9("/tmp",16895,0),C9("/home",16895,0),C9("/home/web_user",16895,0),(()=>{C9("/dev",16895,0),WJ(259,{read:()=>0,write:(z,E,h,g)=>g}),v8("/dev/null",259),S0(1280,L9),S0(1536,v9),v8("/dev/tty",1280),v8("/dev/tty1",1536);var G=new Uint8Array(1024),O=0,D=()=>{return O===0&&(O=_0(G).byteLength),G[--O]};$7("random",D),$7("urandom",D),C9("/dev/shm",16895,0),C9("/dev/shm/tmp",16895,0)})(),(()=>{C9("/proc",16895,0);var G=C9("/proc/self",16895,0);C9("/proc/self/fd",16895,0),DJ({U:()=>{var O=H9(G,"fd",16895,73);return O.l={ma:(D,z)=>{var E=b0(+z);return D={parent:null,U:{mb:"fake"},l:{na:()=>E.path}},D.parent=D}},O}},"/proc/self/fd")})(),Object.assign(CX.prototype,{get(G){return this.M[G]},has(G){return this.M[G]!==void 0},ta(G){var O=this.ib.pop()||this.M.length;return this.M[O]=G,O},Wb(G){this.M[G]=void 0,this.ib.push(G)}}),w$=N.BindingError=class extends Error{constructor(G){super(G);this.name="BindingError"}},g8.M.push({value:void 0},{value:null},{value:!0},{value:!1}),g8.h=g8.M.length,N.count_emval_handles=function(){for(var G=0,O=g8.h;OxK;++xK)tX[xK]=String.fromCharCode(xK);TX=tX,N.getInheritedInstanceCount=function(){return Object.keys(x7).length},N.getLiveInheritedInstances=function(){var G=[],O;for(O in x7)x7.hasOwnProperty(O)&&G.push(x7[O]);return G},N.flushPendingDeletes=dH,N.setDelayFunction=function(G){m6=G,d6.length&&m6&&m6(dH)},hX=N.InternalError=class extends Error{constructor(G){super(G);this.name="InternalError"}},NQ.prototype.isAliasOf=function(G){if(!(this instanceof NQ&&G instanceof NQ))return!1;var O=this.g.u.i,D=this.g.o,z=G.g.u.i;for(G=G.g.o;O.A;)D=O.pa(D),O=O.A;for(;z.A;)G=z.pa(G),z=z.A;return O===z&&D===G},NQ.prototype.clone=function(){if(this.g.o||pH(this),this.g.ka)return this.g.count.value+=1,this;var G=h$,O=Object,D=O.create,z=Object.getPrototypeOf(this),E=this.g;return G=G(D.call(O,z,{g:{value:{count:E.count,ia:E.ia,ka:E.ka,o:E.o,u:E.u,H:E.H,L:E.L}}})),G.g.count.value+=1,G.g.ia=!1,G},NQ.prototype.delete=function(){this.g.o||pH(this),this.g.ia&&!this.g.ka&&n0("Object already scheduled for deletion"),BK(this),_X(this.g),this.g.ka||(this.g.H=void 0,this.g.o=void 0)},NQ.prototype.isDeleted=function(){return!this.g.o},NQ.prototype.deleteLater=function(){return this.g.o||pH(this),this.g.ia&&!this.g.ka&&n0("Object already scheduled for deletion"),d6.push(this),d6.length===1&&m6&&m6(dH),this.g.ia=!0,this},f7.prototype.Sb=function(G){return this.sb&&(G=this.sb(G)),G},f7.prototype.cb=function(G){this.W&&this.W(G)},f7.prototype.argPackAdvance=8,f7.prototype.readValueFromPointer=l6,f7.prototype.deleteObject=function(G){if(G!==null)G.delete()},f7.prototype.fromWireType=function(G){function O(){return this.ya?zK(this.i.N,{u:this.fc,o:D,L:this,H:G}):zK(this.i.N,{u:this,o:G})}var D=this.Sb(G);if(!D)return this.cb(G),null;var z=vB(this.i,D);if(z!==void 0){if(z.g.count.value===0)return z.g.o=D,z.g.H=G,z.clone();return z=z.clone(),this.cb(G),z}if(z=this.i.Rb(D),z=wX[z],!z)return O.call(this);z=this.xa?z.Jb:z.pointerType;var E=yX(D,this.i,z.i);return E===null?O.call(this):this.ya?zK(z.i.N,{u:z,o:E,L:this,H:G}):zK(z.i.N,{u:z,o:E})},bX=N.UnboundTypeError=PX("UnboundTypeError");for(var q0,QU=0;32>QU;++QU)JU.push(Array(QU));var eX={__syscall_fcntl64:function(G,O,D){u6=D;try{var z=b0(G);switch(O){case 0:var E=h7();return 0>E?-28:FJ(z,E).X;case 1:case 2:return 0;case 3:return z.flags;case 4:return E=h7(),z.flags|=E,0;case 5:return E=h7(),Z0[E+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return b[J1()>>2]=28,-1;default:return-28}}catch(h){if(typeof I8=="undefined"||h.name!=="ErrnoError")throw h;return-h.aa}},__syscall_ioctl:function(G,O,D){u6=D;try{var z=b0(G);switch(O){case 21509:return z.s?0:-59;case 21505:if(!z.s)return-59;if(z.s.V.$b){O=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var E=h7();b[E>>2]=25856,b[E+4>>2]=5,b[E+8>>2]=191,b[E+12>>2]=35387;for(var h=0;32>h;h++)N0[E+h+17>>0]=O[h]||0}return 0;case 21510:case 21511:case 21512:return z.s?0:-59;case 21506:case 21507:case 21508:if(!z.s)return-59;if(z.s.V.ac)for(E=h7(),O=[],h=0;32>h;h++)O.push(N0[E+h+17>>0]);return 0;case 21519:if(!z.s)return-59;return E=h7(),b[E>>2]=0;case 21520:return z.s?-28:-59;case 21531:if(E=h7(),!z.m.Zb)throw new a(59);return z.m.Zb(z,O,E);case 21523:if(!z.s)return-59;return z.s.V.bc&&(h=[24,80],E=h7(),Z0[E>>1]=h[0],Z0[E+2>>1]=h[1]),0;case 21524:return z.s?0:-59;case 21515:return z.s?0:-59;default:return-28}}catch(g){if(typeof I8=="undefined"||g.name!=="ErrnoError")throw g;return-g.aa}},__syscall_openat:function(G,O,D,z){u6=z;try{O=O?c0(Q0,O):"";var E=O;if(E.charAt(0)==="/")O=E;else{var h=G===-100?"/":b0(G).path;if(E.length==0)throw new a(44);O=c(h+"/"+E)}var g=z?h7():0;return d9(O,D,g).X}catch(n){if(typeof I8=="undefined"||n.name!=="ErrnoError")throw n;return-n.aa}},_embind_create_inheriting_constructor:function(G,O,D){G=a9(G),O=c6(O,"wrapper"),D=Z7(D);var z=[].slice,E=O.i,h=E.N,g=E.A.N,n=E.A.constructor;G=RK(G,function(){E.A.qb.forEach(function(i){if(this[i]===g[i])throw new jX(`Pure virtual function ${i} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:h}),this.__construct.apply(this,z.call(arguments))}),h.__construct=function(){this===h&&n0("Pass correct 'this' to __construct");var i=n.implement.apply(void 0,[this].concat(z.call(arguments)));BK(i);var F0=i.g;i.notifyOnDestruction(),F0.ka=!0,Object.defineProperties(this,{g:{value:F0}}),h$(this),i=F0.o,i=mH(E,i),x7.hasOwnProperty(i)?n0(`Tried to register registered instance: ${i}`):x7[i]=this},h.__destruct=function(){this===h&&n0("Pass correct 'this' to __destruct"),BK(this);var i=this.g.o;i=mH(E,i),x7.hasOwnProperty(i)?delete x7[i]:n0(`Tried to unregister unregistered instance: ${i}`)},G.prototype=Object.create(h);for(var J0 in D)G.prototype[J0]=D[J0];return R7(G)},_embind_finalize_value_object:function(G){var O=kK[G];delete kK[G];var{Va:D,W:z,fb:E}=O,h=E.map((g)=>g.Vb).concat(E.map((g)=>g.kc));C8([G],h,(g)=>{var n={};return E.forEach((J0,i)=>{var F0=g[i],B0=J0.Tb,C0=J0.Ub,r=g[i+E.length],G0=J0.jc,L0=J0.lc;n[J0.Pb]={read:(h0)=>F0.fromWireType(B0(C0,h0)),write:(h0,v0)=>{var p0=[];G0(L0,h0,r.toWireType(p0,v0)),p6(p0)}}}),[{name:O.name,fromWireType:function(J0){var i={},F0;for(F0 in n)i[F0]=n[F0].read(J0);return z(J0),i},toWireType:function(J0,i){for(var F0 in n)if(!(F0 in i))throw new TypeError(`Missing field: "${F0}"`);var B0=D();for(F0 in n)n[F0].write(B0,i[F0]);return J0!==null&&J0.push(z,B0),B0},argPackAdvance:8,readValueFromPointer:l6,K:z}]})},_embind_register_bigint:function(){},_embind_register_bool:function(G,O,D,z,E){var h=AK(D);O=a9(O),B7(G,{name:O,fromWireType:function(g){return!!g},toWireType:function(g,n){return n?z:E},argPackAdvance:8,readValueFromPointer:function(g){if(D===1)var n=N0;else if(D===2)n=Z0;else if(D===4)n=b;else throw new TypeError("Unknown boolean type size: "+O);return this.fromWireType(n[g>>h])},K:null})},_embind_register_class:function(G,O,D,z,E,h,g,n,J0,i,F0,B0,C0){F0=a9(F0),h=gJ(E,h),n&&(n=gJ(g,n)),i&&(i=gJ(J0,i)),C0=gJ(B0,C0);var r=EX(F0);nH(r,function(){b7(`Cannot construct ${F0} due to unbound types`,[z])}),C8([G,O,D],z?[z]:[],function(G0){if(G0=G0[0],z)var L0=G0.i,h0=L0.N;else h0=NQ.prototype;G0=RK(r,function(){if(Object.getPrototypeOf(this)!==v0)throw new w$("Use 'new' to construct "+F0);if(p0.$===void 0)throw new w$(F0+" has no accessible constructor");var n9=p0.$[arguments.length];if(n9===void 0)throw new w$(`Tried to invoke ctor of ${F0} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(p0.$).toString()}) parameters instead!`);return n9.apply(this,arguments)});var v0=Object.create(h0,{constructor:{value:G0}});G0.prototype=v0;var p0=new uB(F0,G0,v0,C0,L0,h,n,i);p0.A&&(p0.A.qa===void 0&&(p0.A.qa=[]),p0.A.qa.push(p0)),L0=new f7(F0,p0,!0,!1),h0=new f7(F0+"*",p0,!1,!1);var m9=new f7(F0+" const*",p0,!1,!0);return wX[G]={pointerType:h0,Jb:m9},xX(r,G0),[L0,h0,m9]})},_embind_register_class_class_function:function(G,O,D,z,E,h,g){var n=PK(D,z);O=a9(O),h=gJ(E,h),C8([],[G],function(J0){function i(){b7(`Cannot call ${F0} due to unbound types`,n)}J0=J0[0];var F0=`${J0.name}.${O}`;O.startsWith("@@")&&(O=Symbol[O.substring(2)]);var B0=J0.i.constructor;return B0[O]===void 0?(i.ha=D-1,B0[O]=i):(lH(B0,O,F0),B0[O].B[D-1]=i),C8([],n,function(C0){if(C0=CK(F0,[C0[0],null].concat(C0.slice(1)),null,h,g),B0[O].B===void 0?(C0.ha=D-1,B0[O]=C0):B0[O].B[D-1]=C0,J0.i.qa)for(let r of J0.i.qa)r.constructor.hasOwnProperty(O)||(r.constructor[O]=C0);return[]}),[]})},_embind_register_class_class_property:function(G,O,D,z,E,h,g,n){O=a9(O),h=gJ(E,h),C8([],[G],function(J0){J0=J0[0];var i=`${J0.name}.${O}`,F0={get(){b7(`Cannot access ${i} due to unbound types`,[D])},enumerable:!0,configurable:!0};return F0.set=n?()=>{b7(`Cannot access ${i} due to unbound types`,[D])}:()=>{n0(`${i} is a read-only property`)},Object.defineProperty(J0.i.constructor,O,F0),C8([],[D],function(B0){B0=B0[0];var C0={get(){return B0.fromWireType(h(z))},enumerable:!0};return n&&(n=gJ(g,n),C0.set=(r)=>{var G0=[];n(z,B0.toWireType(G0,r)),p6(G0)}),Object.defineProperty(J0.i.constructor,O,C0),[]}),[]})},_embind_register_class_constructor:function(G,O,D,z,E,h){var g=PK(O,D);E=gJ(z,E),C8([],[G],function(n){n=n[0];var J0=`constructor ${n.name}`;if(n.i.$===void 0&&(n.i.$=[]),n.i.$[O-1]!==void 0)throw new w$(`Cannot register multiple constructors with identical number of parameters (${O-1}) for class '${n.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return n.i.$[O-1]=()=>{b7(`Cannot construct ${n.name} due to unbound types`,g)},C8([],g,function(i){return i.splice(1,0,null),n.i.$[O-1]=CK(J0,i,null,E,h),[]}),[]})},_embind_register_class_function:function(G,O,D,z,E,h,g,n){var J0=PK(D,z);O=a9(O),h=gJ(E,h),C8([],[G],function(i){function F0(){b7(`Cannot call ${B0} due to unbound types`,J0)}i=i[0];var B0=`${i.name}.${O}`;O.startsWith("@@")&&(O=Symbol[O.substring(2)]),n&&i.i.qb.push(O);var C0=i.i.N,r=C0[O];return r===void 0||r.B===void 0&&r.className!==i.name&&r.ha===D-2?(F0.ha=D-2,F0.className=i.name,C0[O]=F0):(lH(C0,O,B0),C0[O].B[D-2]=F0),C8([],J0,function(G0){return G0=CK(B0,G0,i,h,g),C0[O].B===void 0?(G0.ha=D-2,C0[O]=G0):C0[O].B[D-2]=G0,[]}),[]})},_embind_register_class_property:function(G,O,D,z,E,h,g,n,J0,i){O=a9(O),E=gJ(z,E),C8([],[G],function(F0){F0=F0[0];var B0=`${F0.name}.${O}`,C0={get(){b7(`Cannot access ${B0} due to unbound types`,[D,g])},enumerable:!0,configurable:!0};return C0.set=J0?()=>{b7(`Cannot access ${B0} due to unbound types`,[D,g])}:()=>{n0(B0+" is a read-only property")},Object.defineProperty(F0.i.N,O,C0),C8([],J0?[D,g]:[D],function(r){var G0=r[0],L0={get(){var v0=vX(this,F0,B0+" getter");return G0.fromWireType(E(h,v0))},enumerable:!0};if(J0){J0=gJ(n,J0);var h0=r[1];L0.set=function(v0){var p0=vX(this,F0,B0+" setter"),m9=[];J0(i,p0,h0.toWireType(m9,v0)),p6(m9)}}return Object.defineProperty(F0.i.N,O,L0),[]}),[]})},_embind_register_emval:function(G,O){O=a9(O),B7(G,{name:O,fromWireType:function(D){var z=Z7(D);return oH(D),z},toWireType:function(D,z){return R7(z)},argPackAdvance:8,readValueFromPointer:l6,K:null})},_embind_register_enum:function(G,O,D,z){function E(){}D=AK(D),O=a9(O),E.values={},B7(G,{name:O,constructor:E,fromWireType:function(h){return this.constructor.values[h]},toWireType:function(h,g){return g.value},argPackAdvance:8,readValueFromPointer:lB(O,D,z),K:null}),nH(O,E)},_embind_register_enum_value:function(G,O,D){var z=c6(G,"enum");O=a9(O),G=z.constructor,z=Object.create(z.constructor.prototype,{value:{value:D},constructor:{value:RK(`${z.name}_${O}`,function(){})}}),G.values[D]=z,G[O]=z},_embind_register_float:function(G,O,D){D=AK(D),O=a9(O),B7(G,{name:O,fromWireType:function(z){return z},toWireType:function(z,E){return E},argPackAdvance:8,readValueFromPointer:nB(O,D),K:null})},_embind_register_function:function(G,O,D,z,E,h){var g=PK(O,D);G=a9(G),E=gJ(z,E),nH(G,function(){b7(`Cannot call ${G} due to unbound types`,g)},O-1),C8([],g,function(n){return xX(G,CK(G,[n[0],null].concat(n.slice(1)),null,E,h),O-1),[]})},_embind_register_integer:function(G,O,D,z,E){O=a9(O),E===-1&&(E=4294967295),E=AK(D);var h=(n)=>n;if(z===0){var g=32-8*D;h=(n)=>n<>>g}D=O.includes("unsigned")?function(n,J0){return J0>>>0}:function(n,J0){return J0},B7(G,{name:O,fromWireType:h,toWireType:D,argPackAdvance:8,readValueFromPointer:oB(O,E,z!==0),K:null})},_embind_register_memory_view:function(G,O,D){function z(h){h>>=2;var g=Y0;return new E(g.buffer,g[h+1],g[h])}var E=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][O];D=a9(D),B7(G,{name:D,fromWireType:z,argPackAdvance:8,readValueFromPointer:z},{Xb:!0})},_embind_register_std_string:function(G,O){O=a9(O);var D=O==="std::string";B7(G,{name:O,fromWireType:function(z){var E=Y0[z>>2],h=z+4;if(D)for(var g=h,n=0;n<=E;++n){var J0=h+n;if(n==E||Q0[J0]==0){if(g=g?c0(Q0,g,J0-g):"",i===void 0)var i=g;else i+=String.fromCharCode(0),i+=g;g=J0+1}}else{i=Array(E);for(n=0;n>2]=g,D&&h)b9(E,Q0,J0,g+1);else if(h)for(h=0;hD0,n=1;else O===4&&(z=aB,E=tB,h=eB,g=()=>Y0,n=2);B7(G,{name:D,fromWireType:function(J0){for(var i=Y0[J0>>2],F0=g(),B0,C0=J0+4,r=0;r<=i;++r){var G0=J0+4+r*O;if(r==i||F0[G0>>n]==0)C0=z(C0,G0-C0),B0===void 0?B0=C0:(B0+=String.fromCharCode(0),B0+=C0),C0=G0+O}return v7(J0),B0},toWireType:function(J0,i){typeof i!="string"&&n0(`Cannot pass non-string to C++ string type ${D}`);var F0=h(i),B0=fK(4+F0+O);return Y0[B0>>2]=F0>>n,E(i,B0+4,F0+O),J0!==null&&J0.push(v7,B0),B0},argPackAdvance:8,readValueFromPointer:l6,K:function(J0){v7(J0)}})},_embind_register_value_object:function(G,O,D,z,E,h){kK[G]={name:a9(O),Va:gJ(D,z),W:gJ(E,h),fb:[]}},_embind_register_value_object_field:function(G,O,D,z,E,h,g,n,J0,i){kK[G].fb.push({Pb:a9(O),Vb:D,Tb:gJ(z,E),Ub:h,kc:g,jc:gJ(n,J0),lc:i})},_embind_register_void:function(G,O){O=a9(O),B7(G,{cc:!0,name:O,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},_emscripten_get_now_is_monotonic:()=>!0,_emval_as:function(G,O,D){G=Z7(G),O=c6(O,"emval::as");var z=[],E=R7(z);return Y0[D>>2]=E,O.toWireType(z,G)},_emval_call_method:function(G,O,D,z,E){G=jK[G],O=Z7(O),D=iH(D);var h=[];return Y0[z>>2]=R7(h),G(O,D,h,E)},_emval_call_void_method:function(G,O,D,z){G=jK[G],O=Z7(O),D=iH(D),G(O,D,null,z)},_emval_decref:oH,_emval_get_method_caller:function(G,O){var D=$M(G,O),z=D[0];O=z.name+"_$"+D.slice(1).map(function(g){return g.name}).join("_")+"$";var E=uX[O];if(E!==void 0)return E;var h=Array(G-1);return E=QM((g,n,J0,i)=>{for(var F0=0,B0=0;B0{g0("")},beginPixelLocalStorageWEBGL:function(G,O,D){(G=kJ[G].C.ca)&&G.beginPixelLocalStorageWEBGL(N.HEAPU32.subarray(D,D+O))},decode_image:function(G,O,D){var z=N.images;z||(z=new Map,N.images=z);var E=new Image;z.set(G,E),O=N.HEAP8.subarray(O,O+D),D=new Uint8Array(D),D.set(O),E.src=URL.createObjectURL(new Blob([D],{type:"image/png"})),E.onload=function(){N._setWebImage(G,E.width,E.height)}},delete_image:function(G){var O=N.images;O&&O.get(G)&&O.delete(G)},emscripten_asm_const_int:(G,O,D)=>{rH.length=0;var z;for(D>>=2;z=Q0[O++];)D+=z!=105&D,rH.push(z==105?b[D]:f0[D++>>1]),++D;return R[G].apply(null,rH)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:()=>performance.now(),emscripten_memcpy_big:(G,O,D)=>Q0.copyWithin(G,O,O+D),emscripten_resize_heap:(G)=>{var O=Q0.length;if(G>>>=0,2147483648=D;D*=2){var z=O*(1+0.2/D);z=Math.min(z,G+100663296);var E=Math;z=Math.max(G,z);J:{E=E.min.call(E,2147483648,z+(65536-z%65536)%65536)-m.buffer.byteLength+65535>>>16;try{m.grow(E),z0();var h=1;break J}catch(g){}h=void 0}if(h)return!0}return!1},emscripten_webgl_enable_extension:function(G,O){return G=kJ[G],O=O?c0(Q0,O):"",O.startsWith("GL_")&&(O=O.substr(3)),O=="WEBGL_draw_instanced_base_vertex_base_instance"&&dX(q0),O=="WEBGL_multi_draw_instanced_base_vertex_base_instance"&&mX(q0),O=="WEBGL_multi_draw"&&lX(q0),!!G.C.getExtension(O)},emscripten_webgl_get_current_context:function(){return M7?M7.handle:0},emscripten_webgl_make_context_current:function(G){return aH(G)?0:-5},enable_WEBGL_provoking_vertex:function(G){return G=kJ[G].C,G.rb=G.getExtension("WEBGL_provoking_vertex"),!!G.rb},enable_WEBGL_shader_pixel_local_storage_coherent:function(G){return G=kJ[G].C,G.ca=G.getExtension("WEBGL_shader_pixel_local_storage"),!(!G.ca||!G.ca.isCoherent())},endPixelLocalStorageWEBGL:function(G,O,D){(G=kJ[G].C.ca)&&G.endPixelLocalStorageWEBGL(N.HEAPU32.subarray(D,D+O))},environ_get:(G,O)=>{var D=0;return nX().forEach(function(z,E){var h=O+D;E=Y0[G+4*E>>2]=h;for(h=0;h>0]=z.charCodeAt(h);N0[E>>0]=0,D+=z.length+1}),0},environ_sizes_get:(G,O)=>{var D=nX();Y0[G>>2]=D.length;var z=0;return D.forEach(function(E){z+=E.length+1}),Y0[O>>2]=z,0},fd_close:function(G){try{var O=b0(G);if(O.X===null)throw new a(8);O.Sa&&(O.Sa=null);try{O.m.close&&O.m.close(O)}catch(D){throw D}finally{p[O.X]=null}return O.X=null,0}catch(D){if(typeof I8=="undefined"||D.name!=="ErrnoError")throw D;return D.aa}},fd_read:function(G,O,D,z){try{J:{var E=b0(G);G=O;for(var h,g=O=0;g>2],J0=Y0[G+4>>2];G+=8;var i=E,F0=n,B0=J0,C0=h,r=N0;if(0>B0||0>C0)throw new a(28);if(i.X===null)throw new a(8);if((i.flags&2097155)===1)throw new a(8);if((i.node.mode&61440)===16384)throw new a(31);if(!i.m.read)throw new a(28);var G0=typeof C0!="undefined";if(!G0)C0=i.position;else if(!i.seekable)throw new a(70);var L0=i.m.read(i,r,F0,B0,C0);G0||(i.position+=L0);var h0=L0;if(0>h0){var v0=-1;break J}if(O+=h0,h0>2]=v0,0}catch(p0){if(typeof I8=="undefined"||p0.name!=="ErrnoError")throw p0;return p0.aa}},fd_seek:function(G,O,D,z,E){O=D+2097152>>>0<4194305-!!O?(O>>>0)+4294967296*D:NaN;try{if(isNaN(O))return 61;var h=b0(G);return A8(h,O,z),C=[h.position>>>0,(O9=h.position,1<=+Math.abs(O9)?0>>0:~~+Math.ceil((O9-+(~~O9>>>0))/4294967296)>>>0:0)],b[E>>2]=C[0],b[E+4>>2]=C[1],h.Sa&&O===0&&z===0&&(h.Sa=null),0}catch(g){if(typeof I8=="undefined"||g.name!=="ErrnoError")throw g;return g.aa}},fd_write:function(G,O,D,z){try{J:{var E=b0(G);G=O;for(var h,g=O=0;g>2],J0=Y0[G+4>>2];G+=8;var i=E,F0=n,B0=J0,C0=h,r=N0;if(0>B0||0>C0)throw new a(28);if(i.X===null)throw new a(8);if((i.flags&2097155)===0)throw new a(8);if((i.node.mode&61440)===16384)throw new a(31);if(!i.m.write)throw new a(28);i.seekable&&i.flags&1024&&A8(i,0,2);var G0=typeof C0!="undefined";if(!G0)C0=i.position;else if(!i.seekable)throw new a(70);var L0=i.m.write(i,r,F0,B0,C0,void 0);G0||(i.position+=L0);var h0=L0;if(0>h0){var v0=-1;break J}O+=h0,typeof h!=="undefined"&&(h+=h0)}v0=O}return Y0[z>>2]=v0,0}catch(p0){if(typeof I8=="undefined"||p0.name!=="ErrnoError")throw p0;return p0.aa}},framebufferPixelLocalClearValuefvWEBGL:function(G,O,D,z,E,h){(G=kJ[G].C.ca)&&G.framebufferPixelLocalClearValuefvWEBGL(O,[D,z,E,h])},framebufferTexturePixelLocalStorageWEBGL:function(G,O,D,z,E){(G=kJ[G].C.ca)&&G.framebufferTexturePixelLocalStorageWEBGL(O,f$[D],z,E)},getFramebufferPixelLocalStorageParameterivWEBGL:function(G,O,D){return(G=kJ[G].C.ca)?G.getFramebufferPixelLocalStorageParameterWEBGL(O,D):0},glActiveTexture:function(G){q0.activeTexture(G)},glAttachShader:function(G,O){q0.attachShader(K7[G],sQ[O])},glBindBuffer:function(G,O){G==35051?q0.Pa=O:G==35052&&(q0.Qa=O),q0.bindBuffer(G,n6[O])},glBindBufferRange:function(G,O,D,z,E){q0.bindBufferRange(G,O,n6[D],z,E)},glBindFramebuffer:function(G,O){q0.bindFramebuffer(G,TK[O])},glBindRenderbuffer:function(G,O){q0.bindRenderbuffer(G,o6[O])},glBindTexture:function(G,O){q0.bindTexture(G,f$[O])},glBindVertexArray:function(G){q0.bindVertexArray(SK[G])},glBlendEquation:function(G){q0.blendEquation(G)},glBlendFunc:function(G,O){q0.blendFunc(G,O)},glBlitFramebuffer:function(G,O,D,z,E,h,g,n,J0,i){q0.blitFramebuffer(G,O,D,z,E,h,g,n,J0,i)},glBufferData:function(G,O,D,z){D&&O?q0.bufferData(G,Q0,z,D,O):q0.bufferData(G,O,z)},glBufferSubData:function(G,O,D,z){D&&q0.bufferSubData(G,O,Q0,z,D)},glClear:function(G){q0.clear(G)},glClearBufferfv:function(G,O,D){q0.clearBufferfv(G,O,V0,D>>2)},glClearBufferuiv:function(G,O,D){q0.clearBufferuiv(G,O,Y0,D>>2)},glClearColor:function(G,O,D,z){q0.clearColor(G,O,D,z)},glClearDepthf:function(G){q0.clearDepth(G)},glClearStencil:function(G){q0.clearStencil(G)},glColorMask:function(G,O,D,z){q0.colorMask(!!G,!!O,!!D,!!z)},glCompileShader:function(G){q0.compileShader(sQ[G])},glCreateProgram:function(){var G=_K(K7),O=q0.createProgram();return O.name=G,O.Ba=O.za=O.Aa=0,O.Ya=1,K7[G]=O,G},glCreateShader:function(G){var O=_K(sQ);return sQ[O]=q0.createShader(G),O},glCullFace:function(G){q0.cullFace(G)},glDeleteBuffers:function(G,O){for(var D=0;D>2],E=n6[z];E&&(q0.deleteBuffer(E),E.name=0,n6[z]=null,z==q0.Pa&&(q0.Pa=0),z==q0.Qa&&(q0.Qa=0))}},glDeleteFramebuffers:function(G,O){for(var D=0;D>2],E=TK[z];E&&(q0.deleteFramebuffer(E),E.name=0,TK[z]=null)}},glDeleteProgram:function(G){if(G){var O=K7[G];O?(q0.deleteProgram(O),O.name=0,K7[G]=null):uJ(1281)}},glDeleteRenderbuffers:function(G,O){for(var D=0;D>2],E=o6[z];E&&(q0.deleteRenderbuffer(E),E.name=0,o6[z]=null)}},glDeleteShader:function(G){if(G){var O=sQ[G];O?(q0.deleteShader(O),sQ[G]=null):uJ(1281)}},glDeleteTextures:function(G,O){for(var D=0;D>2],E=f$[z];E&&(q0.deleteTexture(E),E.name=0,f$[z]=null)}},glDeleteVertexArrays:function(G,O){for(var D=0;D>2];q0.deleteVertexArray(SK[z]),SK[z]=null}},glDepthFunc:function(G){q0.depthFunc(G)},glDepthMask:function(G){q0.depthMask(!!G)},glDepthRangef:function(G,O){q0.depthRange(G,O)},glDisable:function(G){q0.disable(G)},glDrawArrays:function(G,O,D){q0.drawArrays(G,O,D)},glDrawArraysInstanced:function(G,O,D,z){q0.drawArraysInstanced(G,O,D,z)},glDrawBuffers:function(G,O){for(var D=JU[G],z=0;z>2];q0.drawBuffers(D)},glDrawElements:function(G,O,D,z){q0.drawElements(G,O,D,z)},glDrawElementsInstanced:function(G,O,D,z,E){q0.drawElementsInstanced(G,O,D,z,E)},glEnable:function(G){q0.enable(G)},glEnableVertexAttribArray:function(G){q0.enableVertexAttribArray(G)},glFlush:function(){q0.flush()},glFramebufferRenderbuffer:function(G,O,D,z){q0.framebufferRenderbuffer(G,O,D,o6[z])},glFramebufferTexture2D:function(G,O,D,z,E){q0.framebufferTexture2D(G,O,D,f$[z],E)},glFrontFace:function(G){q0.frontFace(G)},glGenBuffers:function(G,O){s6(G,O,"createBuffer",n6)},glGenFramebuffers:function(G,O){s6(G,O,"createFramebuffer",TK)},glGenRenderbuffers:function(G,O){s6(G,O,"createRenderbuffer",o6)},glGenTextures:function(G,O){s6(G,O,"createTexture",f$)},glGenVertexArrays:function(G,O){s6(G,O,"createVertexArray",SK)},glGenerateMipmap:function(G){q0.generateMipmap(G)},glGetError:function(){var G=q0.getError()||yK;return yK=0,G},glGetIntegerv:function(G,O){WM(G,O)},glGetProgramiv:function(G,O,D){if(D)if(G>=cX)uJ(1281);else if(G=K7[G],O==35716)G=q0.getProgramInfoLog(G),G===null&&(G="(unknown error)"),b[D>>2]=G.length+1;else if(O==35719){if(!G.Ba)for(O=0;O>2]=G.Ba}else if(O==35722){if(!G.za)for(O=0;O>2]=G.za}else if(O==35381){if(!G.Aa)for(O=0;O>2]=G.Aa}else b[D>>2]=q0.getProgramParameter(G,O);else uJ(1281)},glGetString:function(G){var O=pX[G];if(!O){switch(G){case 7939:O=q0.getSupportedExtensions()||[],O=O.concat(O.map(function(z){return"GL_"+z})),O=wK(O.join(" "));break;case 7936:case 7937:case 37445:case 37446:(O=q0.getParameter(G))||uJ(1280),O=O&&wK(O);break;case 7938:O=wK("OpenGL ES 3.0 ("+q0.getParameter(7938)+")");break;case 35724:O=q0.getParameter(35724);var D=O.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);D!==null&&(D[1].length==3&&(D[1]+="0"),O="OpenGL ES GLSL ES "+D[1]+" ("+O+")"),O=wK(O);break;default:uJ(1280)}pX[G]=O}return O},glGetUniformBlockIndex:function(G,O){return q0.getUniformBlockIndex(K7[G],O?c0(Q0,O):"")},glGetUniformLocation:function(G,O){if(O=O?c0(Q0,O):"",G=K7[G]){var D=G,z=D.oa,E=D.zb,h;if(!z)for(D.oa=z={},D.yb={},h=0;h>>0,E=O.slice(0,h)),(E=G.zb[E])&&z>2];q0.invalidateFramebuffer(G,z)},glLinkProgram:function(G){G=K7[G],q0.linkProgram(G),G.oa=0,G.zb={}},glPixelStorei:function(G,O){q0.pixelStorei(G,O)},glReadPixels:function(G,O,D,z,E,h,g){if(q0.Pa)q0.readPixels(G,O,D,z,E,h,g);else{var n=sX(h);q0.readPixels(G,O,D,z,E,h,n,g>>31-Math.clz32(n.BYTES_PER_ELEMENT))}},glRenderbufferStorageMultisample:function(G,O,D,z,E){q0.renderbufferStorageMultisample(G,O,D,z,E)},glScissor:function(G,O,D,z){q0.scissor(G,O,D,z)},glShaderSource:function(G,O,D,z){for(var E="",h=0;h>2]:-1,n=b[D+4*h>>2];g=n?c0(Q0,n,0>g?void 0:g):"",E+=g}q0.shaderSource(sQ[G],E)},glStencilFunc:function(G,O,D){q0.stencilFunc(G,O,D)},glStencilFuncSeparate:function(G,O,D,z){q0.stencilFuncSeparate(G,O,D,z)},glStencilMask:function(G){q0.stencilMask(G)},glStencilOp:function(G,O,D){q0.stencilOp(G,O,D)},glStencilOpSeparate:function(G,O,D,z){q0.stencilOpSeparate(G,O,D,z)},glTexParameteri:function(G,O,D){q0.texParameteri(G,O,D)},glTexStorage2D:function(G,O,D,z,E){q0.texStorage2D(G,O,D,z,E)},glTexSubImage2D:function(G,O,D,z,E,h,g,n,J0){if(q0.Qa)q0.texSubImage2D(G,O,D,z,E,h,g,n,J0);else if(J0){var i=sX(n);q0.texSubImage2D(G,O,D,z,E,h,g,n,i,J0>>31-Math.clz32(i.BYTES_PER_ELEMENT))}else q0.texSubImage2D(G,O,D,z,E,h,g,n,null)},glUniform1i:function(G,O){var D=q0,z=D.uniform1i,E=q0.Kb;if(E){var h=E.oa[G];typeof h=="number"&&(E.oa[G]=h=q0.getUniformLocation(E,E.yb[G]+(0HM(G,O,D,z),upload_image:function(G,O){var D=N.images;D&&(O=D.get(O))&&(G=kJ[G].C,G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),G.texImage2D(G.TEXTURE_2D,0,G.RGBA,G.RGBA,G.UNSIGNED_BYTE,O),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1))}};(function(){function G(D){if(l=D=D.exports,m=l.memory,z0(),i0=l.__indirect_function_table,o0.unshift(l.__wasm_call_ctors),N9--,N.monitorRunDependencies&&N.monitorRunDependencies(N9),N9==0&&(J9!==null&&(clearInterval(J9),J9=null),Z9)){var z=Z9;Z9=null,z()}return D}var O={env:eX,wasi_snapshot_preview1:eX};if(N9++,N.monitorRunDependencies&&N.monitorRunDependencies(N9),N.instantiateWasm)try{return N.instantiateWasm(O,G)}catch(D){f("Module.instantiateWasm callback failed with error: "+D),Y(D)}return vJ(O,function(D){G(D.instance)}).catch(Y),{}})();var v7=(G)=>(v7=l.free)(G),fK=(G)=>(fK=l.malloc)(G);N._setWebImage=(G,O,D)=>(N._setWebImage=l.setWebImage)(G,O,D);var J1=()=>(J1=l.__errno_location)(),Q1=N._ma_device__on_notification_unlocked=(G)=>(Q1=N._ma_device__on_notification_unlocked=l.ma_device__on_notification_unlocked)(G);N._ma_malloc_emscripten=(G,O)=>(N._ma_malloc_emscripten=l.ma_malloc_emscripten)(G,O),N._ma_free_emscripten=(G,O)=>(N._ma_free_emscripten=l.ma_free_emscripten)(G,O);var $1=N._ma_device_process_pcm_frames_capture__webaudio=(G,O,D)=>($1=N._ma_device_process_pcm_frames_capture__webaudio=l.ma_device_process_pcm_frames_capture__webaudio)(G,O,D),Z1=N._ma_device_process_pcm_frames_playback__webaudio=(G,O,D)=>(Z1=N._ma_device_process_pcm_frames_playback__webaudio=l.ma_device_process_pcm_frames_playback__webaudio)(G,O,D),K1=(G)=>(K1=l.__getTypeName)(G);N.__embind_initialize_bindings=()=>(N.__embind_initialize_bindings=l._embind_initialize_bindings)(),N.dynCall_iiiji=(G,O,D,z,E,h)=>(N.dynCall_iiiji=l.dynCall_iiiji)(G,O,D,z,E,h),N.dynCall_iij=(G,O,D,z)=>(N.dynCall_iij=l.dynCall_iij)(G,O,D,z),N.dynCall_iiji=(G,O,D,z,E)=>(N.dynCall_iiji=l.dynCall_iiji)(G,O,D,z,E),N.dynCall_jii=(G,O,D)=>(N.dynCall_jii=l.dynCall_jii)(G,O,D),N.dynCall_vijj=(G,O,D,z,E,h)=>(N.dynCall_vijj=l.dynCall_vijj)(G,O,D,z,E,h),N.dynCall_jiji=(G,O,D,z,E)=>(N.dynCall_jiji=l.dynCall_jiji)(G,O,D,z,E),N.dynCall_viijii=(G,O,D,z,E,h,g)=>(N.dynCall_viijii=l.dynCall_viijii)(G,O,D,z,E,h,g),N.dynCall_iiiiij=(G,O,D,z,E,h,g)=>(N.dynCall_iiiiij=l.dynCall_iiiiij)(G,O,D,z,E,h,g),N.dynCall_iiiiijj=(G,O,D,z,E,h,g,n,J0)=>(N.dynCall_iiiiijj=l.dynCall_iiiiijj)(G,O,D,z,E,h,g,n,J0),N.dynCall_iiiiiijj=(G,O,D,z,E,h,g,n,J0,i)=>(N.dynCall_iiiiiijj=l.dynCall_iiiiiijj)(G,O,D,z,E,h,g,n,J0,i),N.___start_em_js=532308,N.___stop_em_js=535063;var bK;Z9=function G(){bK||W1(),bK||(Z9=G)};function W1(){function G(){if(!bK&&(bK=!0,N.calledRun=!0,!H0)){if(N.noFSInit||g6||(g6=!0,y$(),N.stdin=N.stdin,N.stdout=N.stdout,N.stderr=N.stderr,N.stdin?$7("stdin",N.stdin):YQ("/dev/tty","/dev/stdin"),N.stdout?$7("stdout",null,N.stdout):YQ("/dev/tty","/dev/stdout"),N.stderr?$7("stderr",null,N.stderr):YQ("/dev/tty1","/dev/stderr"),d9("/dev/stdin",0),d9("/dev/stdout",1),d9("/dev/stderr",1)),t=!1,k(o0),L(N),N.onRuntimeInitialized)N.onRuntimeInitialized();if(N.postRun)for(typeof N.postRun=="function"&&(N.postRun=[N.postRun]);N.postRun.length;){var O=N.postRun.shift();m0.unshift(O)}k(m0)}}if(!(0{K.exports=JSON.parse(`{"name":"@rive-app/webgl2","version":"2.31.6","description":"Rive's webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso (https://rive.app)","Maxwell Talbot (https://rive.app)","Arthur Vivian (https://rive.app)","Umberto Sonnino (https://rive.app)","Matthew Sullivan (mailto:matt.j.sullivan@gmail.com)","Chris Dalton (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`)},(K,W,H)=>{H.r(W),H.d(W,{Animation:()=>U.Animation});var U=H(4)},(K,W,H)=>{H.r(W),H.d(W,{Animation:()=>U});var U=function(){function q(X,F,N,L){this.animation=X,this.artboard=F,this.playing=L,this.loopCount=0,this.scrubTo=null,this.instance=new N.LinearAnimationInstance(X,F)}return Object.defineProperty(q.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"time",{get:function(){return this.instance.time},set:function(X){this.instance.time=X},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:!1,configurable:!0}),q.prototype.advance=function(X){if(this.scrubTo===null)this.instance.advance(X);else this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null},q.prototype.apply=function(X){this.instance.apply(X)},q.prototype.cleanup=function(){this.instance.delete()},q}()},(K,W,H)=>{H.r(W),H.d(W,{AudioAssetWrapper:()=>X.AudioAssetWrapper,AudioWrapper:()=>X.AudioWrapper,BLANK_URL:()=>q.BLANK_URL,CustomFileAssetLoaderWrapper:()=>X.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>X.FileAssetWrapper,FileFinalizer:()=>X.FileFinalizer,FontAssetWrapper:()=>X.FontAssetWrapper,FontWrapper:()=>X.FontWrapper,ImageAssetWrapper:()=>X.ImageAssetWrapper,ImageWrapper:()=>X.ImageWrapper,createFinalization:()=>X.createFinalization,finalizationRegistry:()=>X.finalizationRegistry,registerTouchInteractions:()=>U.registerTouchInteractions,sanitizeUrl:()=>q.sanitizeUrl});var U=H(6),q=H(7),X=H(8)},(K,W,H)=>{H.r(W),H.d(W,{registerTouchInteractions:()=>X});var U=void 0,q=function(F,N){var L,Y;if(["touchstart","touchmove"].indexOf(F.type)>-1&&((L=F.touches)===null||L===void 0?void 0:L.length)){if(!N)F.preventDefault();return{clientX:F.touches[0].clientX,clientY:F.touches[0].clientY}}else if(F.type==="touchend"&&((Y=F.changedTouches)===null||Y===void 0?void 0:Y.length))return{clientX:F.changedTouches[0].clientX,clientY:F.changedTouches[0].clientY};else return{clientX:F.clientX,clientY:F.clientY}},X=function(F){var{canvas:N,artboard:L,stateMachines:Y}=F,B=Y===void 0?[]:Y,M=F.renderer,V=F.rive,A=F.fit,I=F.alignment,P=F.isTouchScrollEnabled,j=P===void 0?!1:P,T=F.layoutScaleFactor,w=T===void 0?1:T;if(!N||!B.length||!M||!V||!L||typeof window==="undefined")return null;var _=null,S=!1,y=function(u){if(S&&u instanceof MouseEvent){if(u.type=="mouseup")S=!1;return}S=j&&u.type==="touchend"&&_==="touchstart",_=u.type;var v=u.currentTarget.getBoundingClientRect(),m=q(u,j),l=m.clientX,H0=m.clientY;if(!l&&!H0)return;var N0=l-v.left,Q0=H0-v.top,Z0=V.computeAlignment(A,I,{minX:0,minY:0,maxX:v.width,maxY:v.height},L.bounds,w),D0=new V.Mat2D;Z0.invert(D0);var b=new V.Vec2D(N0,Q0),Y0=V.mapXY(D0,b),V0=Y0.x(),f0=Y0.y();switch(Y0.delete(),D0.delete(),b.delete(),Z0.delete(),u.type){case"mouseout":for(var z0=0,i0=B;z0{H.r(W),H.d(W,{BLANK_URL:()=>Y,sanitizeUrl:()=>V});var U=/^([^\w]*)(javascript|data|vbscript)/im,q=/&#(\w+)(^\w|;)?/g,X=/&(newline|tab);/gi,F=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,N=/^.+(:|:)/gim,L=[".","/"],Y="about:blank";function B(A){return L.indexOf(A[0])>-1}function M(A){var I=A.replace(F,"");return I.replace(q,function(P,j){return String.fromCharCode(j)})}function V(A){if(!A)return Y;var I=M(A).replace(X,"").replace(F,"").trim();if(!I)return Y;if(B(I))return I;var P=I.match(N);if(!P)return I;var j=P[0];if(U.test(j))return Y;return I}},(K,W,H)=>{H.r(W),H.d(W,{AudioAssetWrapper:()=>A,AudioWrapper:()=>L,CustomFileAssetLoaderWrapper:()=>B,FileAssetWrapper:()=>M,FileFinalizer:()=>q,FontAssetWrapper:()=>I,FontWrapper:()=>Y,ImageAssetWrapper:()=>V,ImageWrapper:()=>N,createFinalization:()=>w,finalizationRegistry:()=>T});var U=function(){var _=function(S,y){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var v in u)if(Object.prototype.hasOwnProperty.call(u,v))f[v]=u[v]},_(S,y)};return function(S,y){if(typeof y!=="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");_(S,y);function f(){this.constructor=S}S.prototype=y===null?Object.create(y):(f.prototype=y.prototype,new f)}}(),q=function(){function _(S){this.selfUnref=!1,this._file=S}return _.prototype.unref=function(){if(this._file)this._file.unref()},_}(),X=function(){function _(S){this._finalizableObject=S}return _.prototype.unref=function(){this._finalizableObject.unref()},_}(),F=function(){function _(){this.selfUnref=!1}return _.prototype.unref=function(){},_}(),N=function(_){U(S,_);function S(y){var f=_.call(this)||this;return f._nativeImage=y,f}return Object.defineProperty(S.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),S.prototype.unref=function(){if(this.selfUnref)this._nativeImage.unref()},S}(F),L=function(_){U(S,_);function S(y){var f=_.call(this)||this;return f._nativeAudio=y,f}return Object.defineProperty(S.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),S.prototype.unref=function(){if(this.selfUnref)this._nativeAudio.unref()},S}(F),Y=function(_){U(S,_);function S(y){var f=_.call(this)||this;return f._nativeFont=y,f}return Object.defineProperty(S.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),S.prototype.unref=function(){if(this.selfUnref)this._nativeFont.unref()},S}(F),B=function(){function _(S,y){this._assetLoaderCallback=y,this.assetLoader=new S.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return _.prototype.loadContents=function(S,y){var f;if(S.isImage)f=new V(S);else if(S.isAudio)f=new A(S);else if(S.isFont)f=new I(S);return this._assetLoaderCallback(f,y)},_}(),M=function(){function _(S){this._nativeFileAsset=S}return _.prototype.decode=function(S){this._nativeFileAsset.decode(S)},Object.defineProperty(_.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),_}(),V=function(_){U(S,_);function S(){return _!==null&&_.apply(this,arguments)||this}return S.prototype.setRenderImage=function(y){this._nativeFileAsset.setRenderImage(y.nativeImage)},S}(M),A=function(_){U(S,_);function S(){return _!==null&&_.apply(this,arguments)||this}return S.prototype.setAudioSource=function(y){this._nativeFileAsset.setAudioSource(y.nativeAudio)},S}(M),I=function(_){U(S,_);function S(){return _!==null&&_.apply(this,arguments)||this}return S.prototype.setFont=function(y){this._nativeFileAsset.setFont(y.nativeFont)},S}(M),P=function(){function _(S){}return _.prototype.register=function(S){S.selfUnref=!0},_.prototype.unregister=function(S){},_}(),j=typeof FinalizationRegistry!=="undefined"?FinalizationRegistry:P,T=new j(function(_){_===null||_===void 0||_.unref()}),w=function(_,S){var y=new X(S);T.register(_,y)}}],Q={};function $(K){var W=Q[K];if(W!==void 0)return W.exports;var H=Q[K]={exports:{}};return J[K](H,H.exports,$),H.exports}(()=>{$.d=(K,W)=>{for(var H in W)if($.o(W,H)&&!$.o(K,H))Object.defineProperty(K,H,{enumerable:!0,get:W[H]})}})(),(()=>{$.o=(K,W)=>Object.prototype.hasOwnProperty.call(K,W)})(),(()=>{$.r=(K)=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag)Object.defineProperty(K,Symbol.toStringTag,{value:"Module"});Object.defineProperty(K,"__esModule",{value:!0})}})();var Z={};return(()=>{$.r(Z),$.d(Z,{Alignment:()=>V,DataEnum:()=>f0,EventType:()=>y,Fit:()=>M,Layout:()=>A,LoopType:()=>f,Rive:()=>Y0,RiveEventType:()=>T,RiveFile:()=>b,RuntimeLoader:()=>I,StateMachineInput:()=>j,StateMachineInputType:()=>P,Testing:()=>A9,ViewModel:()=>V0,ViewModelInstance:()=>i0,ViewModelInstanceArtboard:()=>M0,ViewModelInstanceAssetImage:()=>$0,ViewModelInstanceBoolean:()=>D9,ViewModelInstanceColor:()=>g0,ViewModelInstanceEnum:()=>J9,ViewModelInstanceList:()=>Z9,ViewModelInstanceNumber:()=>m0,ViewModelInstanceString:()=>o0,ViewModelInstanceTrigger:()=>N9,ViewModelInstanceValue:()=>x0,decodeAudio:()=>PJ,decodeFont:()=>O9,decodeImage:()=>vJ});var K=$(1),W=$(2),H=$(3),U=$(5),q=function(){var C=function(R,k){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,c){x.__proto__=c}||function(x,c){for(var s in c)if(Object.prototype.hasOwnProperty.call(c,s))x[s]=c[s]},C(R,k)};return function(R,k){if(typeof k!=="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");C(R,k);function x(){this.constructor=R}R.prototype=k===null?Object.create(k):(x.prototype=k.prototype,new x)}}(),X=function(){return X=Object.assign||function(C){for(var R,k=1,x=arguments.length;k0&&s[s.length-1]))&&(I0[0]===6||I0[0]===2)){k=0;continue}if(I0[0]===3&&(!s||I0[1]>s[0]&&I0[1]0)(k=C.callBackQueue.shift())===null||k===void 0||k(C.runtime)}).catch(function(R){var k={message:(R===null||R===void 0?void 0:R.message)||"Unknown error",type:(R===null||R===void 0?void 0:R.name)||"Error",wasmError:R instanceof WebAssembly.CompileError||R instanceof WebAssembly.RuntimeError,originalError:R};console.debug("Rive WASM load error details:",k);var x="https://cdn.jsdelivr.net/npm/".concat(W.name,"@").concat(W.version,"/rive_fallback.wasm");if(C.wasmURL.toLowerCase()!==x)console.warn("Failed to load WASM from ".concat(C.wasmURL," (").concat(k.message,"), trying jsdelivr as a backup")),C.setWasmUrl(x),C.loadRuntime();else{var c=["Could not load Rive WASM file from ".concat(C.wasmURL," or ").concat(x,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",` Error details:`,"- Type: ".concat(k.type),"- Message: ".concat(k.message),"- WebAssembly-specific error: ".concat(k.wasmError),` To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join(` `);console.error(c)}})},C.getInstance=function(R){if(!C.isLoading)C.isLoading=!0,C.loadRuntime();if(!C.runtime)C.callBackQueue.push(R);else R(C.runtime)},C.awaitInstance=function(){return new Promise(function(R){return C.getInstance(function(k){return R(k)})})},C.setWasmUrl=function(R){C.wasmURL=R},C.getWasmUrl=function(){return C.wasmURL},C.isLoading=!1,C.callBackQueue=[],C.wasmURL="https://unpkg.com/".concat(W.name,"@").concat(W.version,"/rive.wasm"),C}(),P;(function(C){C[C.Number=56]="Number",C[C.Trigger=58]="Trigger",C[C.Boolean=59]="Boolean"})(P||(P={}));var j=function(){function C(R,k){this.type=R,this.runtimeInput=k}return Object.defineProperty(C.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(R){this.runtimeInput.value=R},enumerable:!1,configurable:!0}),C.prototype.fire=function(){if(this.type===P.Trigger)this.runtimeInput.fire()},C.prototype.delete=function(){this.runtimeInput=null},C}(),T;(function(C){C[C.General=128]="General",C[C.OpenUrl=131]="OpenUrl"})(T||(T={}));var w=function(){function C(R){this.nativeArtboard=R}return C}(),_=function(){function C(R,k,x,c){this.stateMachine=R,this.playing=x,this.artboard=c,this.inputs=[],this.instance=new k.StateMachineInstance(R,c),this.initInputs(k)}return Object.defineProperty(C.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"statesChanged",{get:function(){var R=[];for(var k=0;k=0||_0>=0)if(j0>=0)this.animations[j0].playing=k;else this.stateMachines[_0].playing=k;else{var I0=this.artboard.animationByName(R[K0]);if(I0){var T0=new H.Animation(I0,this.artboard,this.runtime,k);T0.advance(0),T0.apply(1),this.animations.push(T0)}else{var c0=this.artboard.stateMachineByName(R[K0]);if(c0){var M9=new _(c0,this.runtime,k,this.artboard);this.stateMachines.push(M9)}}}}}if(x)if(k)this.eventManager.fire({type:y.Play,data:this.playing});else this.eventManager.fire({type:y.Pause,data:this.paused});return k?this.playing:this.paused},C.prototype.initLinearAnimations=function(R,k){var x=this.animations.map(function(_0){return _0.name});for(var c=0;c=0)this.animations[s].playing=k;else{var K0=this.artboard.animationByName(R[c]);if(K0){var j0=new H.Animation(K0,this.artboard,this.runtime,k);j0.advance(0),j0.apply(1),this.animations.push(j0)}else console.error("Animation with name ".concat(R[c]," not found."))}}},C.prototype.initStateMachines=function(R,k){var x=this.stateMachines.map(function(_0){return _0.name});for(var c=0;c=0)this.stateMachines[s].playing=k;else{var K0=this.artboard.stateMachineByName(R[c]);if(K0){var j0=new _(K0,this.runtime,k,this.artboard);this.stateMachines.push(j0)}else console.warn("State Machine with name ".concat(R[c]," not found.")),this.initLinearAnimations([R[c]],k)}}},C.prototype.play=function(R){return this.add(R,!0)},C.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(R){if(!R.playing)R.advanceAndApply(0)})},C.prototype.pause=function(R){return this.add(R,!1)},C.prototype.scrub=function(R,k){var x=this.animations.filter(function(c){return R.includes(c.name)});return x.forEach(function(c){return c.scrubTo=k}),x.map(function(c){return c.name})},Object.defineProperty(C.prototype,"playing",{get:function(){return this.animations.filter(function(R){return R.playing}).map(function(R){return R.name}).concat(this.stateMachines.filter(function(R){return R.playing}).map(function(R){return R.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"paused",{get:function(){return this.animations.filter(function(R){return!R.playing}).map(function(R){return R.name}).concat(this.stateMachines.filter(function(R){return!R.playing}).map(function(R){return R.name}))},enumerable:!1,configurable:!0}),C.prototype.stop=function(R){var k=this;R=o(R);var x=[];if(R.length===0)x=this.animations.map(function(K0){return K0.name}).concat(this.stateMachines.map(function(K0){return K0.name})),this.animations.forEach(function(K0){return K0.cleanup()}),this.stateMachines.forEach(function(K0){return K0.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var c=this.animations.filter(function(K0){return R.includes(K0.name)});c.forEach(function(K0){K0.cleanup(),k.animations.splice(k.animations.indexOf(K0),1)});var s=this.stateMachines.filter(function(K0){return R.includes(K0.name)});s.forEach(function(K0){K0.cleanup(),k.stateMachines.splice(k.stateMachines.indexOf(K0),1)}),x=c.map(function(K0){return K0.name}).concat(s.map(function(K0){return K0.name}))}return this.eventManager.fire({type:y.Stop,data:x}),x},Object.defineProperty(C.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(R,k){return R||k.playing},!1)||this.stateMachines.reduce(function(R,k){return R||k.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:!1,configurable:!0}),C.prototype.atLeastOne=function(R,k){if(k===void 0)k=!0;var x;if(this.animations.length===0&&this.stateMachines.length===0){if(this.artboard.animationCount()>0)this.add([x=this.artboard.animationByIndex(0).name],R,k);else if(this.artboard.stateMachineCount()>0)this.add([x=this.artboard.stateMachineByIndex(0).name],R,k)}return x},C.prototype.handleLooping=function(){for(var R=0,k=this.animations.filter(function(c){return c.playing});R1)this.eventManager.fire({type:y.Loop,data:{animation:x.name,type:f.PingPong}}),x.loopCount=0}},C.prototype.handleStateChanges=function(){var R=[];for(var k=0,x=this.stateMachines.filter(function(s){return s.playing});k0)this.eventManager.fire({type:y.StateChange,data:R})},C.prototype.handleAdvancing=function(R){this.eventManager.fire({type:y.Advance,data:R})},C}(),y;(function(C){C.Load="load",C.LoadError="loaderror",C.Play="play",C.Pause="pause",C.Stop="stop",C.Loop="loop",C.Draw="draw",C.Advance="advance",C.StateChange="statechange",C.RiveEvent="riveevent",C.AudioStatusChange="audiostatuschange"})(y||(y={}));var f;(function(C){C.OneShot="oneshot",C.Loop="loop",C.PingPong="pingpong"})(f||(f={}));var u=function(){function C(R){if(R===void 0)R=[];this.listeners=R}return C.prototype.getListeners=function(R){return this.listeners.filter(function(k){return k.type===R})},C.prototype.add=function(R){if(!this.listeners.includes(R))this.listeners.push(R)},C.prototype.remove=function(R){for(var k=0;k0){var R=this.queue.shift();if(R===null||R===void 0?void 0:R.action)R.action();if(R===null||R===void 0?void 0:R.event)this.eventManager.fire(R.event)}},C}(),m;(function(C){C[C.AVAILABLE=0]="AVAILABLE",C[C.UNAVAILABLE=1]="UNAVAILABLE"})(m||(m={}));var l=function(C){q(R,C);function R(){var k=C!==null&&C.apply(this,arguments)||this;return k._started=!1,k._enabled=!1,k._status=m.UNAVAILABLE,k}return R.prototype.delay=function(k){return F(this,void 0,void 0,function(){return N(this,function(x){return[2,new Promise(function(c){return setTimeout(c,k)})]})})},R.prototype.timeout=function(){return F(this,void 0,void 0,function(){return N(this,function(k){return[2,new Promise(function(x,c){return setTimeout(c,50)})]})})},R.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},R.prototype.enableAudio=function(){return F(this,void 0,void 0,function(){return N(this,function(k){if(!this._enabled)this._enabled=!0,this._status=m.AVAILABLE,this.reportToListeners();return[2]})})},R.prototype.testAudio=function(){return F(this,void 0,void 0,function(){var k;return N(this,function(x){switch(x.label){case 0:if(!(this._status===m.UNAVAILABLE&&this._audioContext!==null))return[3,4];x.label=1;case 1:return x.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return x.sent(),this.enableAudio(),[3,4];case 3:return k=x.sent(),[3,4];case 4:return[2]}})})},R.prototype._establishAudio=function(){return F(this,void 0,void 0,function(){return N(this,function(k){switch(k.label){case 0:if(this._started)return[3,5];if(this._started=!0,typeof window!="undefined")return[3,1];return this.enableAudio(),[3,5];case 1:this._audioContext=new AudioContext,this.listenForUserAction(),k.label=2;case 2:if(this._status!==m.UNAVAILABLE)return[3,5];return[4,this.testAudio()];case 3:return k.sent(),[4,this.delay(1000)];case 4:return k.sent(),[3,2];case 5:return[2]}})})},R.prototype.listenForUserAction=function(){var k=this,x=function(){return F(k,void 0,void 0,function(){return N(this,function(c){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",x,{once:!0})},R.prototype.establishAudio=function(){return F(this,void 0,void 0,function(){return N(this,function(k){return this._establishAudio(),[2]})})},Object.defineProperty(R.prototype,"systemVolume",{get:function(){if(this._status===m.UNAVAILABLE)return this.testAudio(),0;return 1},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),R}(u),H0=new l,N0=function(){function C(){}return C.prototype.observe=function(){},C.prototype.unobserve=function(){},C.prototype.disconnect=function(){},C}(),Q0=globalThis.ResizeObserver||N0,Z0=function(){function C(){var R=this;this._elementsMap=new Map,this._onObservedEntry=function(k){var x=R._elementsMap.get(k.target);if(x!==null)x.onResize(k.target.clientWidth==0||k.target.clientHeight==0);else R._resizeObserver.unobserve(k.target)},this._onObserved=function(k){k.forEach(R._onObservedEntry)},this._resizeObserver=new Q0(this._onObserved)}return C.prototype.add=function(R,k){var x={onResize:k,element:R};return this._elementsMap.set(R,x),this._resizeObserver.observe(R),x},C.prototype.remove=function(R){this._resizeObserver.unobserve(R.element),this._elementsMap.delete(R.element)},C}(),D0=new Z0,b=function(){function C(R){if(this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.src=R.src,this.buffer=R.buffer,R.assetLoader)this.assetLoader=R.assetLoader;if(this.enableRiveAssetCDN=typeof R.enableRiveAssetCDN=="boolean"?R.enableRiveAssetCDN:!0,this.eventManager=new u,R.onLoad)this.on(y.Load,R.onLoad);if(R.onLoadError)this.on(y.LoadError,R.onLoadError)}return C.prototype.releaseFile=function(){var R;if(this.selfUnref)(R=this.file)===null||R===void 0||R.unref();this.file=null},C.prototype.initData=function(){return F(this,void 0,void 0,function(){var R,k,x,c,s;return N(this,function(K0){switch(K0.label){case 0:if(!this.src)return[3,2];return R=this,[4,K9(this.src)];case 1:R.buffer=K0.sent(),K0.label=2;case 2:if(this.destroyed)return[2];if(this.assetLoader)x=new U.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),k=x.assetLoader;return c=this,[4,this.runtime.load(new Uint8Array(this.buffer),k,this.enableRiveAssetCDN)];case 3:if(c.file=K0.sent(),s=new U.FileFinalizer(this.file),U.finalizationRegistry.register(this,s),this.destroyed)return this.releaseFile(),[2];if(this.file!==null)this.eventManager.fire({type:y.Load,data:this});else this.fireLoadError(C.fileLoadErrorMessage);return[2]}})})},C.prototype.init=function(){return F(this,void 0,void 0,function(){var R,k;return N(this,function(x){switch(x.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(C.missingErrorMessage),[2];x.label=1;case 1:return x.trys.push([1,4,,5]),R=this,[4,I.awaitInstance()];case 2:if(R.runtime=x.sent(),this.destroyed)return[2];return[4,this.initData()];case 3:return x.sent(),[3,5];case 4:return k=x.sent(),this.fireLoadError(k instanceof Error?k.message:C.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},C.prototype.fireLoadError=function(R){throw this.eventManager.fire({type:y.LoadError,data:R}),new Error(R)},C.prototype.on=function(R,k){this.eventManager.add({type:R,callback:k})},C.prototype.off=function(R,k){this.eventManager.remove({type:R,callback:k})},C.prototype.cleanup=function(){if(this.referenceCount-=1,this.referenceCount<=0)this.removeAllRiveEventListeners(),this.releaseFile(),this.destroyed=!0},C.prototype.removeAllRiveEventListeners=function(R){this.eventManager.removeAll(R)},C.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},C.prototype.destroyIfUnused=function(){if(this.referenceCount<=0)this.cleanup()},C.prototype.getArtboard=function(R){var k=this.file.artboardByName(R);if(k!=null)return new w(k);return null},C.missingErrorMessage="Rive source file or data buffer required",C.fileLoadErrorMessage="The file failed to load",C}(),Y0=function(){function C(R){var k=this,x;if(this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(c){var s=k._hasZeroSize!==c;if(k._hasZeroSize=c,!c){if(s)k.resizeDrawingSurfaceToCanvas()}else if(!k._layout.maxX||!k._layout.maxY)k.resizeToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=R.canvas,R.canvas.constructor===HTMLCanvasElement)this._observed=D0.add(this.canvas,this.onCanvasResize);if(this.src=R.src,this.buffer=R.buffer,this.riveFile=R.riveFile,this.layout=(x=R.layout)!==null&&x!==void 0?x:new A,this.shouldDisableRiveListeners=!!R.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!R.isTouchScrollEnabled,this.automaticallyHandleEvents=!!R.automaticallyHandleEvents,this.enableRiveAssetCDN=R.enableRiveAssetCDN===void 0?!0:R.enableRiveAssetCDN,this.eventManager=new u,R.onLoad)this.on(y.Load,R.onLoad);if(R.onLoadError)this.on(y.LoadError,R.onLoadError);if(R.onPlay)this.on(y.Play,R.onPlay);if(R.onPause)this.on(y.Pause,R.onPause);if(R.onStop)this.on(y.Stop,R.onStop);if(R.onLoop)this.on(y.Loop,R.onLoop);if(R.onStateChange)this.on(y.StateChange,R.onStateChange);if(R.onAdvance)this.on(y.Advance,R.onAdvance);if(R.onload&&!R.onLoad)this.on(y.Load,R.onload);if(R.onloaderror&&!R.onLoadError)this.on(y.LoadError,R.onloaderror);if(R.onplay&&!R.onPlay)this.on(y.Play,R.onplay);if(R.onpause&&!R.onPause)this.on(y.Pause,R.onpause);if(R.onstop&&!R.onStop)this.on(y.Stop,R.onstop);if(R.onloop&&!R.onLoop)this.on(y.Loop,R.onloop);if(R.onstatechange&&!R.onStateChange)this.on(y.StateChange,R.onstatechange);if(R.assetLoader)this.assetLoader=R.assetLoader;this.taskQueue=new v(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:R.autoplay,autoBind:R.autoBind,animations:R.animations,stateMachines:R.stateMachines,artboard:R.artboard,useOffscreenRenderer:R.useOffscreenRenderer})}return Object.defineProperty(C.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),C.new=function(R){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new C(R)},C.prototype.onSystemAudioChanged=function(){this.volume=this._volume},C.prototype.init=function(R){var k=this,x=R.src,c=R.buffer,s=R.riveFile,K0=R.animations,j0=R.stateMachines,_0=R.artboard,I0=R.autoplay,T0=I0===void 0?!1:I0,c0=R.useOffscreenRenderer,M9=c0===void 0?!1:c0,W9=R.autoBind,b9=W9===void 0?!1:W9;if(this.destroyed)return;if(this.src=x,this.buffer=c,this.riveFile=s,!this.src&&!this.buffer&&!this.riveFile)throw new Y(C.missingErrorMessage);var l9=o(K0),E9=o(j0);this.loaded=!1,this.readyForPlaying=!1,I.awaitInstance().then(function(S0){if(k.destroyed)return;if(k.runtime=S0,k.removeRiveListeners(),k.deleteRiveRenderer(),k.renderer=k.runtime.makeRenderer(k.canvas,M9),!(k.canvas.width||k.canvas.height))k.resizeDrawingSurfaceToCanvas();k.initData(_0,l9,E9,T0,b9).then(function(y9){if(y9)return k.setupRiveListeners()}).catch(function(y9){console.error(y9)})}).catch(function(S0){console.error(S0)})},C.prototype.setupRiveListeners=function(R){var k=this;if(this.eventCleanup)this.eventCleanup();if(!this.shouldDisableRiveListeners){var x=(this.animator.stateMachines||[]).filter(function(s){return s.playing&&k.runtime.hasListeners(s.instance)}).map(function(s){return s.instance}),c=this.isTouchScrollEnabled;if(R&&"isTouchScrollEnabled"in R)c=R.isTouchScrollEnabled;this.eventCleanup=U.registerTouchInteractions({canvas:this.canvas,artboard:this.artboard,stateMachines:x,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:c,layoutScaleFactor:this._layout.layoutScaleFactor})}},C.prototype.removeRiveListeners=function(){if(this.eventCleanup)this.eventCleanup(),this.eventCleanup=null},C.prototype.initializeAudio=function(){var R=this,k;if(H0.status==m.UNAVAILABLE){if(((k=this.artboard)===null||k===void 0?void 0:k.hasAudio)&&this._audioEventListener===null)this._audioEventListener={type:y.AudioStatusChange,callback:function(){return R.onSystemAudioChanged()}},H0.add(this._audioEventListener),H0.establishAudio()}},C.prototype.initArtboardSize=function(){if(!this.artboard)return;this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height},C.prototype.initData=function(R,k,x,c,s){return F(this,void 0,void 0,function(){var K0,j0,_0,I0;return N(this,function(T0){switch(T0.label){case 0:if(T0.trys.push([0,3,,4]),this.riveFile!=null)return[3,2];return K0=new b({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=K0,[4,K0.init()];case 1:if(T0.sent(),this.destroyed)return K0.destroyIfUnused(),[2,!1];T0.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(R,k,x,c,s),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:y.Load,data:(I0=this.src)!==null&&I0!==void 0?I0:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return j0=T0.sent(),_0=B(j0),console.warn(_0),this.eventManager.fire({type:y.LoadError,data:_0}),[2,Promise.reject(_0)];case 4:return[2]}})})},C.prototype.initArtboard=function(R,k,x,c,s){if(!this.file)return;var K0=R?this.file.artboardByName(R):this.file.defaultArtboard();if(!K0){var j0="Invalid artboard name or no default artboard";console.warn(j0),this.eventManager.fire({type:y.LoadError,data:j0});return}this.artboard=K0,K0.volume=this._volume*H0.systemVolume,this.animator=new S(this.runtime,this.artboard,this.eventManager);var _0;if(k.length>0||x.length>0)_0=k.concat(x),this.animator.initLinearAnimations(k,c),this.animator.initStateMachines(x,c);else _0=[this.animator.atLeastOne(c,!1)];if(this.taskQueue.add({event:{type:c?y.Play:y.Pause,data:_0}}),s){var I0=this.file.defaultArtboardViewModel(K0);if(I0!==null){var T0=I0.defaultInstance();if(T0!==null){var c0=new i0(T0,null);this.bindViewModelInstance(c0)}}}},C.prototype.drawFrame=function(){var R,k;if((R=document===null||document===void 0?void 0:document.timeline)===null||R===void 0?void 0:R.currentTime){if(this.loaded&&this.artboard&&!this.frameRequestId)this._boundDraw(document.timeline.currentTime),(k=this.runtime)===null||k===void 0||k.resolveAnimationFrame()}else this.startRendering()},C.prototype.draw=function(R,k){var x;this.frameRequestId=null;var c=performance.now();if(!this.lastRenderTime)this.lastRenderTime=R;if(this.renderSecondTimer+=R-this.lastRenderTime,this.renderSecondTimer>5000)this.renderSecondTimer=0,k===null||k===void 0||k();var s=(R-this.lastRenderTime)/1000;this.lastRenderTime=R;var K0=this.animator.animations.filter(function(d){return d.playing||d.needsScrub}).sort(function(d){return d.needsScrub?-1:1});for(var j0=0,_0=K0;j0<_0.length;j0++){var I0=_0[j0];if(I0.advance(s),I0.instance.didLoop)I0.loopCount+=1;I0.apply(1)}var T0=this.animator.stateMachines.filter(function(d){return d.playing});for(var c0=0,M9=T0;c00)this.animator.stateMachines.forEach(function(x){return x.bindViewModelInstance(R)});else this.artboard.bindViewModelInstance(R.runtimeInstance)}},Object.defineProperty(C.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),C.prototype.viewModelByIndex=function(R){var k=this.file.viewModelByIndex(R);if(k!==null)return new V0(k);return null},C.prototype.viewModelByName=function(R){var k=this.file.viewModelByName(R);if(k!==null)return new V0(k);return null},C.prototype.enums=function(){if(this._dataEnums===null){var R=this.file.enums();this._dataEnums=R.map(function(k){return new f0(k)})}return this._dataEnums},C.prototype.defaultViewModel=function(){if(this.artboard){var R=this.file.defaultArtboardViewModel(this.artboard);if(R)return new V0(R)}return null},C.prototype.getArtboard=function(R){var k,x;return(x=(k=this.riveFile)===null||k===void 0?void 0:k.getArtboard(R))!==null&&x!==void 0?x:null},C.missingErrorMessage="Rive source file or data buffer required",C.cleanupErrorMessage="Attempt to use file after calling cleanup.",C}(),V0=function(){function C(R){this._viewModel=R}return Object.defineProperty(C.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),C.prototype.instanceByIndex=function(R){var k=this._viewModel.instanceByIndex(R);if(k!==null)return new i0(k,null);return null},C.prototype.instanceByName=function(R){var k=this._viewModel.instanceByName(R);if(k!==null)return new i0(k,null);return null},C.prototype.defaultInstance=function(){var R=this._viewModel.defaultInstance();if(R!==null)return new i0(R,null);return null},C.prototype.instance=function(){var R=this._viewModel.instance();if(R!==null)return new i0(R,null);return null},Object.defineProperty(C.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),C}(),f0=function(){function C(R){this._dataEnum=R}return Object.defineProperty(C.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),C}(),z0;(function(C){C.Number="number",C.String="string",C.Boolean="boolean",C.Color="color",C.Trigger="trigger",C.Enum="enum",C.List="list",C.Image="image",C.Artboard="artboard"})(z0||(z0={}));var i0=function(){function C(R,k){if(this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this._runtimeInstance=R,k!==null)this._parents.push(k)}return Object.defineProperty(C.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),C.prototype.handleCallbacks=function(){if(this._propertiesWithCallbacks.length!==0)this._propertiesWithCallbacks.forEach(function(R){R.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(R){R.clearChanges()});this._children.forEach(function(R){return R.handleCallbacks()})},C.prototype.addParent=function(R){if(!this._parents.includes(R)){if(this._parents.push(R),this._propertiesWithCallbacks.length>0||this._children.length>0)R.addToViewModelCallbacks(this)}},C.prototype.removeParent=function(R){var k=this._parents.indexOf(R);if(k!==-1){var x=this._parents[k];x.removeFromViewModelCallbacks(this),this._parents.splice(k,1)}},C.prototype.addToPropertyCallbacks=function(R){var k=this;if(!this._propertiesWithCallbacks.includes(R)){if(this._propertiesWithCallbacks.push(R),this._propertiesWithCallbacks.length>0)this._parents.forEach(function(x){x.addToViewModelCallbacks(k)})}},C.prototype.removeFromPropertyCallbacks=function(R){var k=this;if(this._propertiesWithCallbacks.includes(R)){if(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(x){return x!==R}),this._children.length===0&&this._propertiesWithCallbacks.length===0)this._parents.forEach(function(x){x.removeFromViewModelCallbacks(k)})}},C.prototype.addToViewModelCallbacks=function(R){var k=this;if(!this._children.includes(R))this._children.push(R),this._parents.forEach(function(x){x.addToViewModelCallbacks(k)})},C.prototype.removeFromViewModelCallbacks=function(R){var k=this;if(this._children.includes(R)){if(this._children=this._children.filter(function(x){return x!==R}),this._children.length===0&&this._propertiesWithCallbacks.length===0)this._parents.forEach(function(x){x.removeFromViewModelCallbacks(k)})}},C.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(R){R.clearCallbacks()})},C.prototype.propertyFromPath=function(R,k){var x=R.split("/");return this.propertyFromPathSegments(x,0,k)},C.prototype.viewModelFromPathSegments=function(R,k){var x=this.internalViewModelInstance(R[k]);if(x!==null)if(k==R.length-1)return x;else return x.viewModelFromPathSegments(R,k++);return null},C.prototype.propertyFromPathSegments=function(R,k,x){var c,s,K0,j0,_0,I0,T0,c0,M9,W9,b9,l9,E9,S0,y9,L9,v9,g9;if(k1?this.viewModelFromPathSegments(k.slice(0,k.length-1),0):this;if(x!=null)return x.internalViewModelInstance(k[k.length-1]);return null},C.prototype.internalReplaceViewModel=function(R,k){var x;if(k.runtimeInstance!==null){var c=((x=this._runtimeInstance)===null||x===void 0?void 0:x.replaceViewModel(R,k.runtimeInstance))||!1;if(c){k.internalIncrementReferenceCount();var s=this.internalViewModelInstance(R);if(s!==null){if(s.removeParent(this),this._children.includes(s))this._children=this._children.filter(function(K0){return K0!==s});s.cleanup()}this._viewModelInstances.set(R,k),k.addParent(this)}return c}return!1},C.prototype.replaceViewModel=function(R,k){var x,c=R.split("/"),s=c.length>1?this.viewModelFromPathSegments(c.slice(0,c.length-1),0):this;return(x=s===null||s===void 0?void 0:s.internalReplaceViewModel(c[c.length-1],k))!==null&&x!==void 0?x:!1},C.prototype.incrementReferenceCount=function(){var R;this._referenceCount++,(R=this._runtimeInstance)===null||R===void 0||R.incrementReferenceCount()},C.prototype.decrementReferenceCount=function(){var R;this._referenceCount--,(R=this._runtimeInstance)===null||R===void 0||R.decrementReferenceCount()},Object.defineProperty(C.prototype,"properties",{get:function(){var R;return((R=this._runtimeInstance)===null||R===void 0?void 0:R.getProperties().map(function(k){return X({},k)}))||[]},enumerable:!1,configurable:!0}),C.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},C.prototype.cleanup=function(){var R=this;if(this._referenceCount--,this._referenceCount<=0){this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(c){c.cleanup()}),this._viewModelInstances.clear();var k=L([],this._children,!0);this._children.length=0;var x=L([],this._parents,!0);this._parents.length=0,k.forEach(function(c){c.removeParent(R)}),x.forEach(function(c){c.removeFromViewModelCallbacks(R)})}},C}(),x0=function(){function C(R,k){this.callbacks=[],this._viewModelInstanceValue=R,this._parentViewModel=k}return C.prototype.on=function(R){if(this.callbacks.length===0)this._viewModelInstanceValue.clearChanges();if(!this.callbacks.includes(R))this.callbacks.push(R),this._parentViewModel.addToPropertyCallbacks(this)},C.prototype.off=function(R){if(!R)this.callbacks.length=0;else this.callbacks=this.callbacks.filter(function(k){return k!==R});if(this.callbacks.length===0)this._parentViewModel.removeFromPropertyCallbacks(this)},C.prototype.internalHandleCallback=function(R){},C.prototype.handleCallbacks=function(){var R=this;if(this._viewModelInstanceValue.hasChanged)this.callbacks.forEach(function(k){R.internalHandleCallback(k)})},C.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},C.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(C.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),C}(),o0=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(k){this._viewModelInstanceValue.value=k},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k(this.value)},R}(x0),m0=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(k){this._viewModelInstanceValue.value=k},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k(this.value)},R}(x0),D9=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(k){this._viewModelInstanceValue.value=k},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k(this.value)},R}(x0),N9=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return R.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},R.prototype.internalHandleCallback=function(k){k()},R}(x0),J9=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(k){this._viewModelInstanceValue.value=k},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(k){this._viewModelInstanceValue.valueIndex=k},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k(this.value)},R}(x0),Z9=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),R.prototype.addInstance=function(k){if(k.runtimeInstance!=null)this._viewModelInstanceValue.addInstance(k.runtimeInstance),k.addParent(this._parentViewModel)},R.prototype.addInstanceAt=function(k,x){if(k.runtimeInstance!=null){if(this._viewModelInstanceValue.addInstanceAt(k.runtimeInstance,x))return k.addParent(this._parentViewModel),!0}return!1},R.prototype.removeInstance=function(k){if(k.runtimeInstance!=null)this._viewModelInstanceValue.removeInstance(k.runtimeInstance),k.removeParent(this._parentViewModel)},R.prototype.removeInstanceAt=function(k){this._viewModelInstanceValue.removeInstanceAt(k)},R.prototype.instanceAt=function(k){var x=this._viewModelInstanceValue.instanceAt(k);if(x!=null){var c=new i0(x,this._parentViewModel);return c}return null},R.prototype.swap=function(k,x){this._viewModelInstanceValue.swap(k,x)},R.prototype.internalHandleCallback=function(k){k()},R}(x0),g0=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(k){this._viewModelInstanceValue.value=k},enumerable:!1,configurable:!0}),R.prototype.rgb=function(k,x,c){this._viewModelInstanceValue.rgb(k,x,c)},R.prototype.rgba=function(k,x,c,s){this._viewModelInstanceValue.argb(s,k,x,c)},R.prototype.argb=function(k,x,c,s){this._viewModelInstanceValue.argb(k,x,c,s)},R.prototype.alpha=function(k){this._viewModelInstanceValue.alpha(k)},R.prototype.opacity=function(k){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,k))*255))},R.prototype.internalHandleCallback=function(k){k(this.value)},R}(x0),$0=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{set:function(k){var x;this._viewModelInstanceValue.value((x=k===null||k===void 0?void 0:k.nativeImage)!==null&&x!==void 0?x:null)},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k()},R}(x0),M0=function(C){q(R,C);function R(k,x){return C.call(this,k,x)||this}return Object.defineProperty(R.prototype,"value",{set:function(k){var x;this._viewModelInstanceValue.value((x=k===null||k===void 0?void 0:k.nativeArtboard)!==null&&x!==void 0?x:null)},enumerable:!1,configurable:!0}),R.prototype.internalHandleCallback=function(k){k()},R}(x0),K9=function(C){return F(void 0,void 0,void 0,function(){var R,k,x;return N(this,function(c){switch(c.label){case 0:return R=new Request(C),[4,fetch(R)];case 1:return k=c.sent(),[4,k.arrayBuffer()];case 2:return x=c.sent(),[2,x]}})})},o=function(C){if(typeof C==="string")return[C];else if(C instanceof Array)return C;return[]},A9={EventManager:u,TaskQueueManager:v},PJ=function(C){return F(void 0,void 0,void 0,function(){var R,k,x;return N(this,function(c){switch(c.label){case 0:return R=new Promise(function(s){return I.getInstance(function(K0){K0.decodeAudio(C,s)})}),[4,R];case 1:return k=c.sent(),x=new U.AudioWrapper(k),U.finalizationRegistry.register(x,k),[2,x]}})})},vJ=function(C){return F(void 0,void 0,void 0,function(){var R,k,x;return N(this,function(c){switch(c.label){case 0:return R=new Promise(function(s){return I.getInstance(function(K0){K0.decodeImage(C,s)})}),[4,R];case 1:return k=c.sent(),x=new U.ImageWrapper(k),U.finalizationRegistry.register(x,k),[2,x]}})})},O9=function(C){return F(void 0,void 0,void 0,function(){var R,k,x;return N(this,function(c){switch(c.label){case 0:return R=new Promise(function(s){return I.getInstance(function(K0){K0.decodeFont(C,s)})}),[4,R];case 1:return k=c.sent(),x=new U.FontWrapper(k),U.finalizationRegistry.register(x,k),[2,x]}})})}})(),Z})()})});var IX={};UJ(IX,{default:()=>bB});function u7(J){if(J===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return J}function L1(J,Q){J.prototype=Object.create(Q.prototype),J.prototype.constructor=J,J.__proto__=Q}/*! * GSAP 3.13.0 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var D8={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},v$={duration:0.5,overwrite:!1,delay:0},kU,yJ,c9,d8=1e8,j9=1/d8,XU=Math.PI*2,NM=XU/4,OM=0,R1=Math.sqrt,FM=Math.cos,DM=Math.sin,VJ=function J(Q){return typeof Q==="string"},t9=function J(Q){return typeof Q==="function"},m7=function J(Q){return typeof Q==="number"},oK=function J(Q){return typeof Q==="undefined"},V7=function J(Q){return typeof Q==="object"},F8=function J(Q){return Q!==!1},VU=function J(){return typeof window!=="undefined"},vK=function J(Q){return t9(Q)||VJ(Q)},B1=typeof ArrayBuffer==="function"&&ArrayBuffer.isView||function(){},dJ=Array.isArray,YU=/(?:-?\.?\d|\.)+/gi,AU=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,tQ=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ZU=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,IU=/[+-]=-?[.\d]+/,M1=/[^,'"\[\]\s]+/gi,LM=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,o9,z7,NU,EU,j8={},mK={},z1,k1=function J(Q){return(mK=g$(Q,j8))&&mJ},sK=function J(Q,$){return console.warn("Invalid property",Q,"set to",$,"Missing plugin? gsap.registerPlugin()")},QZ=function J(Q,$){return!$&&console.warn(Q)},V1=function J(Q,$){return Q&&(j8[Q]=$)&&mK&&(mK[Q]=$)||j8},$Z=function J(){return 0},RM={suppressEvents:!0,isStart:!0,kill:!1},gK={suppressEvents:!0,kill:!1},BM={suppressEvents:!0},CU={},FQ=[],OU={},A1,N8={},KU={},G1=30,uK=[],PU="",jU=function J(Q){var $=Q[0],Z,K;if(V7($)||t9($)||(Q=[Q]),!(Z=($._gsap||{}).harness)){K=uK.length;while(K--&&!uK[K].targetTest($));Z=uK[K]}K=Q.length;while(K--)Q[K]&&(Q[K]._gsap||(Q[K]._gsap=new yU(Q[K],Z)))||Q.splice(K,1);return Q},DQ=function J(Q){return Q._gsap||jU(m8(Q))[0]._gsap},TU=function J(Q,$,Z){return(Z=Q[$])&&t9(Z)?Q[$]():oK(Z)&&Q.getAttribute&&Q.getAttribute($)||Z},tJ=function J(Q,$){return(Q=Q.split(",")).forEach($)||Q},e9=function J(Q){return Math.round(Q*1e5)/1e5||0},LJ=function J(Q){return Math.round(Q*1e7)/1e7||0},eQ=function J(Q,$){var Z=$.charAt(0),K=parseFloat($.substr(2));return Q=parseFloat(Q),Z==="+"?Q+K:Z==="-"?Q-K:Z==="*"?Q*K:Q/K},MM=function J(Q,$){var Z=$.length,K=0;for(;Q.indexOf($[K])<0&&++KU)H=H._prev}if(H)$._next=H._next,H._next=$;else $._next=Q[Z],Q[Z]=$;if($._next)$._next._prev=$;else Q[K]=$;return $._prev=H,$.parent=$._dp=Q,$},WZ=function J(Q,$,Z,K){if(Z===void 0)Z="_first";if(K===void 0)K="_last";var{_prev:W,_next:H}=$;if(W)W._next=H;else if(Q[Z]===$)Q[Z]=H;if(H)H._prev=W;else if(Q[K]===$)Q[K]=W;$._next=$._prev=$.parent=null},LQ=function J(Q,$){Q.parent&&(!$||Q.parent.autoRemoveChildren)&&Q.parent.remove&&Q.parent.remove(Q),Q._act=0},iQ=function J(Q,$){if(Q&&(!$||$._end>Q._dur||$._start<0)){var Z=Q;while(Z)Z._dirty=1,Z=Z.parent}return Q},VM=function J(Q){var $=Q.parent;while($&&$.parent)$._dirty=1,$.totalDuration(),$=$.parent;return Q},FU=function J(Q,$,Z,K){return Q._startAt&&(yJ?Q._startAt.revert(gK):Q.vars.immediateRender&&!Q.vars.autoRevert||Q._startAt.render($,!0,K))},AM=function J(Q){return!Q||Q._ts&&J(Q.parent)},Y1=function J(Q){return Q._repeat?u$(Q._tTime,Q=Q.duration()+Q._rDelay)*Q:0},u$=function J(Q,$){var Z=Math.floor(Q=LJ(Q/$));return Q&&Z===Q?Z-1:Z},lK=function J(Q,$){return(Q-$._start)*$._ts+($._ts>=0?0:$._dirty?$.totalDuration():$._tDur)},iK=function J(Q){return Q._end=LJ(Q._start+(Q._tDur/Math.abs(Q._ts||Q._rts||j9)||0))},rK=function J(Q,$){var Z=Q._dp;if(Z&&Z.smoothChildTiming&&Q._ts)Q._start=LJ(Z._time-(Q._ts>0?$/Q._ts:((Q._dirty?Q.totalDuration():Q._tDur)-$)/-Q._ts)),iK(Q),Z._dirty||iQ(Z,Q);return Q},j1=function J(Q,$){var Z;if($._time||!$._dur&&$._initted||$._startj9)$.render(Z,!0)}if(iQ(Q,$)._dp&&Q._initted&&Q._time>=Q._dur&&Q._ts){if(Q._dur=0&&Z.totalTime(Z._tTime),Z=Z._dp}Q._zTime=-j9}},k7=function J(Q,$,Z,K){return $.parent&&LQ($),$._start=LJ((m7(Z)?Z:Z||Q!==o9?u8(Q,Z,$):Q._time)+$._delay),$._end=LJ($._start+($.totalDuration()/Math.abs($.timeScale())||0)),P1(Q,$,"_first","_last",Q._sort?"_start":0),DU($)||(Q._recent=$),K||j1(Q,$),Q._ts<0&&rK(Q,Q._tTime),Q},T1=function J(Q,$){return(j8.ScrollTrigger||sK("scrollTrigger",$))&&j8.ScrollTrigger.create($,Q)},S1=function J(Q,$,Z,K,W){if(xU(Q,$,W),!Q._initted)return 1;if(!Z&&Q._pt&&!yJ&&(Q._dur&&Q.vars.lazy!==!1||!Q._dur&&Q.vars.lazy)&&A1!==O8.frame)return FQ.push(Q),Q._lazy=[W,K],1},IM=function J(Q){var $=Q.parent;return $&&$._ts&&$._initted&&!$._lock&&($.rawTime()<0||J($))},DU=function J(Q){var $=Q.data;return $==="isFromStart"||$==="isStart"},EM=function J(Q,$,Z,K){var W=Q.ratio,H=$<0||!$&&(!Q._start&&IM(Q)&&!(!Q._initted&&DU(Q))||(Q._ts<0||Q._dp._ts<0)&&!DU(Q))?0:1,U=Q._rDelay,q=0,X,F,N;if(U&&Q._repeat){if(q=HZ(0,Q._tDur,$),F=u$(q,U),Q._yoyo&&F&1&&(H=1-H),F!==u$(Q._tTime,U))W=1-H,Q.vars.repeatRefresh&&Q._initted&&Q.invalidate()}if(H!==W||yJ||K||Q._zTime===j9||!$&&Q._zTime){if(!Q._initted&&S1(Q,$,K,Z,q))return;N=Q._zTime,Q._zTime=$||(Z?j9:0),Z||(Z=$&&!N),Q.ratio=H,Q._from&&(H=1-H),Q._time=0,Q._tTime=q,X=Q._pt;while(X)X.r(H,X.d),X=X._next;if($<0&&FU(Q,$,Z,!0),Q._onUpdate&&!Z&&P8(Q,"onUpdate"),q&&Q._repeat&&!Z&&Q.parent&&P8(Q,"onRepeat"),($>=Q._tDur||$<0)&&Q.ratio===H){if(H&&LQ(Q,1),!Z&&!yJ)P8(Q,H?"onComplete":"onReverseComplete",!0),Q._prom&&Q._prom()}}else if(!Q._zTime)Q._zTime=$},CM=function J(Q,$,Z){var K;if(Z>$){K=Q._first;while(K&&K._start<=Z){if(K.data==="isPause"&&K._start>$)return K;K=K._next}}else{K=Q._last;while(K&&K._start>=Z){if(K.data==="isPause"&&K._start<$)return K;K=K._prev}}},d$=function J(Q,$,Z,K){var W=Q._repeat,H=LJ($)||0,U=Q._tTime/Q._tDur;return U&&!K&&(Q._time*=H/Q._dur),Q._dur=H,Q._tDur=!W?H:W<0?10000000000:LJ(H*(W+1)+Q._rDelay*W),U>0&&!K&&rK(Q,Q._tTime=Q._tDur*U),Q.parent&&iK(Q),Z||iQ(Q.parent,Q),Q},N1=function J(Q){return Q instanceof _J?iQ(Q):d$(Q,Q._dur)},PM={_start:0,endTime:$Z,totalDuration:$Z},u8=function J(Q,$,Z){var K=Q.labels,W=Q._recent||PM,H=Q.duration()>=d8?W.endTime(!1):Q._dur,U,q,X;if(VJ($)&&(isNaN($)||($ in K))){if(q=$.charAt(0),X=$.substr(-1)==="%",U=$.indexOf("="),q==="<"||q===">")return U>=0&&($=$.replace(/=/,"")),(q==="<"?W._start:W.endTime(W._repeat>=0))+(parseFloat($.substr(1))||0)*(X?(U<0?W:Z).totalDuration()/100:1);if(U<0)return $ in K||(K[$]=H),K[$];if(q=parseFloat($.charAt(U-1)+$.substr(U+1)),X&&Z)q=q/100*(dJ(Z)?Z[0]:Z).totalDuration();return U>1?J(Q,$.substr(0,U-1),Z)+q:H+q}return $==null?H:+$},e6=function J(Q,$,Z){var K=m7($[1]),W=(K?2:1)+(Q<2?0:1),H=$[W],U,q;if(K&&(H.duration=$[1]),H.parent=Z,Q){U=H,q=Z;while(q&&!("immediateRender"in U))U=q.vars.defaults||{},q=F8(q.vars.inherit)&&q.parent;H.immediateRender=F8(U.immediateRender),Q<2?H.runBackwards=1:H.startAt=$[W-1]}return new qJ($[0],H,$[W+1])},RQ=function J(Q,$){return Q||Q===0?$(Q):$},HZ=function J(Q,$,Z){return Z$?$:Z},wJ=function J(Q,$){return!VJ(Q)||!($=LM.exec(Q))?"":$[1]},jM=function J(Q,$,Z){return RQ(Z,function(K){return HZ(Q,$,K)})},LU=[].slice,_1=function J(Q,$){return Q&&V7(Q)&&"length"in Q&&(!$&&!Q.length||(Q.length-1 in Q)&&V7(Q[0]))&&!Q.nodeType&&Q!==z7},TM=function J(Q,$,Z){if(Z===void 0)Z=[];return Q.forEach(function(K){var W;return VJ(K)&&!$||_1(K,1)?(W=Z).push.apply(W,m8(K)):Z.push(K)})||Z},m8=function J(Q,$,Z){return c9&&!$&&c9.selector?c9.selector(Q):VJ(Q)&&!Z&&(NU||!m$())?LU.call(($||EU).querySelectorAll(Q),0):dJ(Q)?TM(Q,Z):_1(Q)?LU.call(Q,0):Q?[Q]:[]},RU=function J(Q){return Q=m8(Q)[0]||QZ("Invalid scope")||{},function($){var Z=Q.current||Q.nativeElement||Q;return m8($,Z.querySelectorAll?Z:Z===Q?QZ("Invalid scope")||EU.createElement("div"):Q)}},y1=function J(Q){return Q.sort(function(){return 0.5-Math.random()})},w1=function J(Q){if(t9(Q))return Q;var $=V7(Q)?Q:{each:Q},Z=rQ($.ease),K=$.from||0,W=parseFloat($.base)||0,H={},U=K>0&&K<1,q=isNaN(K)||U,X=$.axis,F=K,N=K;if(VJ(K))F=N={center:0.5,edges:0.5,end:1}[K]||0;else if(!U&&q)F=K[0],N=K[1];return function(L,Y,B){var M=(B||$).length,V=H[M],A,I,P,j,T,w,_,S,y;if(!V){if(y=$.grid==="auto"?0:($.grid||[1,d8])[1],!y){_=-d8;while(_<(_=B[y++].getBoundingClientRect().left)&&y_&&(_=T),TM?M-1:!X?Math.max(y,M/y):X==="y"?M/y:y)||0)*(K==="edges"?-1:1),V.b=M<0?W-M:W,V.u=wJ($.amount||$.each)||0,Z=Z&&M<0?m1(Z):Z}return M=(V[L]-V.min)/V.max||0,LJ(V.b+(Z?Z(M):M)*V.v)+V.u}},BU=function J(Q){var $=Math.pow(10,((Q+"").split(".")[1]||"").length);return function(Z){var K=LJ(Math.round(parseFloat(Z)/Q)*Q*$);return(K-K%1)/$+(m7(Z)?0:wJ(Z))}},h1=function J(Q,$){var Z=dJ(Q),K,W;if(!Z&&V7(Q))if(K=Z=Q.radius||d8,Q.values){if(Q=m8(Q.values),W=!m7(Q[0]))K*=K}else Q=BU(Q.increment);return RQ($,!Z?BU(Q):t9(Q)?function(H){return W=Q(H),Math.abs(W-H)<=K?W:H}:function(H){var U=parseFloat(W?H.x:H),q=parseFloat(W?H.y:0),X=d8,F=0,N=Q.length,L,Y;while(N--){if(W)L=Q[N].x-U,Y=Q[N].y-q,L=L*L+Y*Y;else L=Math.abs(Q[N]-U);if(LK?W-H:H)})},c$=function J(Q){var $=0,Z="",K,W,H,U;while(~(K=Q.indexOf("random(",$)))H=Q.indexOf(")",K),U=Q.charAt(K+7)==="[",W=Q.substr(K+7,H-K-7).match(U?M1:YU),Z+=Q.substr($,K-$)+x1(U?W:+W[0],U?0:+W[1],+W[2]||0.00001),$=H+1;return Z+Q.substr($,Q.length-$)},b1=function J(Q,$,Z,K,W){var H=$-Q,U=K-Z;return RQ(W,function(q){return Z+((q-Q)/H*U||0)})},xM=function J(Q,$,Z,K){var W=isNaN(Q+$)?0:function(Y){return(1-Y)*Q+Y*$};if(!W){var H=VJ(Q),U={},q,X,F,N,L;if(Z===!0&&(K=1)&&(Z=null),H)Q={p:Q},$={p:$};else if(dJ(Q)&&!dJ($)){F=[],N=Q.length,L=N-2;for(X=1;X(U=Math.abs(U)))q=H,W=U;return q},P8=function J(Q,$,Z){var K=Q.vars,W=K[$],H=c9,U=Q._ctx,q,X,F;if(!W)return;return q=K[$+"Params"],X=K.callbackScope||Q,Z&&FQ.length&&cK(),U&&(c9=U),F=q?W.apply(X,q):W.call(X),c9=H,F},r6=function J(Q){return LQ(Q),Q.scrollTrigger&&Q.scrollTrigger.kill(!!yJ),Q.progress()<1&&P8(Q,"onInterrupt"),Q},b$,v1=[],g1=function J(Q){if(!Q)return;if(Q=!Q.name&&Q.default||Q,VU()||Q.headless){var $=Q.name,Z=t9(Q),K=$&&!Z&&Q.init?function(){this._props=[]}:Q,W={init:$Z,render:vU,add:wU,kill:aM,modifier:rM,rawVars:0},H={targetTest:0,get:0,getSetter:aK,aliases:{},register:0};if(m$(),Q!==K){if(N8[$])return;if(L8(K,L8(pK(Q,W),H)),g$(K.prototype,g$(W,pK(Q,H))),N8[K.prop=$]=K,Q.targetTest)uK.push(K),CU[$]=1;$=($==="css"?"CSS":$.charAt(0).toUpperCase()+$.substr(1))+"Plugin"}V1($,K),Q.register&&Q.register(mJ,K,eJ)}else v1.push(Q)},P9=255,a6={aqua:[0,P9,P9],lime:[0,P9,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,P9],navy:[0,0,128],white:[P9,P9,P9],olive:[128,128,0],yellow:[P9,P9,0],orange:[P9,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[P9,0,0],pink:[P9,192,203],cyan:[0,P9,P9],transparent:[P9,P9,P9,0]},WU=function J(Q,$,Z){return Q+=Q<0?1:Q>1?-1:0,(Q*6<1?$+(Z-$)*Q*6:Q<0.5?Z:Q*3<2?$+(Z-$)*(0.6666666666666666-Q)*6:$)*P9+0.5|0},u1=function J(Q,$,Z){var K=!Q?a6.black:m7(Q)?[Q>>16,Q>>8&P9,Q&P9]:0,W,H,U,q,X,F,N,L,Y,B;if(!K){if(Q.substr(-1)===",")Q=Q.substr(0,Q.length-1);if(a6[Q])K=a6[Q];else if(Q.charAt(0)==="#"){if(Q.length<6)W=Q.charAt(1),H=Q.charAt(2),U=Q.charAt(3),Q="#"+W+W+H+H+U+U+(Q.length===5?Q.charAt(4)+Q.charAt(4):"");if(Q.length===9)return K=parseInt(Q.substr(1,6),16),[K>>16,K>>8&P9,K&P9,parseInt(Q.substr(7),16)/255];Q=parseInt(Q.substr(1),16),K=[Q>>16,Q>>8&P9,Q&P9]}else if(Q.substr(0,3)==="hsl"){if(K=B=Q.match(YU),!$)q=+K[0]%360/360,X=+K[1]/100,F=+K[2]/100,H=F<=0.5?F*(X+1):F+X-F*X,W=F*2-H,K.length>3&&(K[3]*=1),K[0]=WU(q+0.3333333333333333,W,H),K[1]=WU(q,W,H),K[2]=WU(q-0.3333333333333333,W,H);else if(~Q.indexOf("="))return K=Q.match(AU),Z&&K.length<4&&(K[3]=1),K}else K=Q.match(YU)||a6.transparent;K=K.map(Number)}if($&&!B){if(W=K[0]/P9,H=K[1]/P9,U=K[2]/P9,N=Math.max(W,H,U),L=Math.min(W,H,U),F=(N+L)/2,N===L)q=X=0;else Y=N-L,X=F>0.5?Y/(2-N-L):Y/(N+L),q=N===W?(H-U)/Y+(HQ||A<0)&&(Z+=A-$),K+=A,T=K-Z,P=T-H,P>0||I)w=++N.frame,L=T-N.time*1000,N.time=T=T/1000,H+=P+(P>=W?4:W-P),j=1;if(I||(q=X(M)),j)for(Y=0;Y=A&&Y--},_listeners:U},N}(),m$=function J(){return!ZZ&&O8.wake()},G9={},bM=/^[\d.\-M][\d.\-,\s]/,vM=/["']/g,gM=function J(Q){var $={},Z=Q.substr(1,Q.length-3).split(":"),K=Z[0],W=1,H=Z.length,U,q,X;for(;W1&&Z.config?Z.config.apply(null,~Q.indexOf("{")?[gM($[1])]:uM(Q).split(",").map(E1)):G9._CE&&bM.test(Q)?G9._CE("",Q):Z},m1=function J(Q){return function($){return 1-Q(1-$)}},c1=function J(Q,$){var Z=Q._first,K;while(Z){if(Z instanceof _J)J(Z,$);else if(Z.vars.yoyoEase&&(!Z._yoyo||!Z._repeat)&&Z._yoyo!==$)if(Z.timeline)J(Z.timeline,$);else K=Z._ease,Z._ease=Z._yEase,Z._yEase=K,Z._yoyo=$;Z=Z._next}},rQ=function J(Q,$){return!Q?$:(t9(Q)?Q:G9[Q]||dM(Q))||$},J$=function J(Q,$,Z,K){if(Z===void 0)Z=function U(q){return 1-$(1-q)};if(K===void 0)K=function U(q){return q<0.5?$(q*2)/2:1-$((1-q)*2)/2};var W={easeIn:$,easeOut:Z,easeInOut:K},H;return tJ(Q,function(U){G9[U]=j8[U]=W,G9[H=U.toLowerCase()]=Z;for(var q in W)G9[H+(q==="easeIn"?".in":q==="easeOut"?".out":".inOut")]=G9[U+"."+q]=W[q]}),W},p1=function J(Q){return function($){return $<0.5?(1-Q(1-$*2))/2:0.5+Q(($-0.5)*2)/2}},HU=function J(Q,$,Z){var K=$>=1?$:1,W=(Z||(Q?0.3:0.45))/($<1?$:1),H=W/XU*(Math.asin(1/K)||0),U=function X(F){return F===1?1:K*Math.pow(2,-10*F)*DM((F-H)*W)+1},q=Q==="out"?U:Q==="in"?function(X){return 1-U(1-X)}:p1(U);return W=XU/W,q.config=function(X,F){return J(Q,X,F)},q},UU=function J(Q,$){if($===void 0)$=1.70158;var Z=function W(H){return H?--H*H*(($+1)*H+$)+1:0},K=Q==="out"?Z:Q==="in"?function(W){return 1-Z(1-W)}:p1(Z);return K.config=function(W){return J(Q,W)},K};tJ("Linear,Quad,Cubic,Quart,Quint,Strong",function(J,Q){var $=Q<5?Q+1:Q;J$(J+",Power"+($-1),Q?function(Z){return Math.pow(Z,$)}:function(Z){return Z},function(Z){return 1-Math.pow(1-Z,$)},function(Z){return Z<0.5?Math.pow(Z*2,$)/2:1-Math.pow((1-Z)*2,$)/2})});G9.Linear.easeNone=G9.none=G9.Linear.easeIn;J$("Elastic",HU("in"),HU("out"),HU());(function(J,Q){var $=1/Q,Z=2*$,K=2.5*$,W=function H(U){return U<$?J*U*U:U0?Z+(Z+this._rDelay)*this._repeat:Z):this.totalDuration()&&this._dur},Q.totalDuration=function $(Z){if(!arguments.length)return this._tDur;return this._dirty=0,d$(this,this._repeat<0?Z:(Z-this._repeat*this._rDelay)/(this._repeat+1))},Q.totalTime=function $(Z,K){if(m$(),!arguments.length)return this._tTime;var W=this._dp;if(W&&W.smoothChildTiming&&this._ts){rK(this,Z),!W._dp||W.parent||j1(W,this);while(W&&W.parent){if(W.parent._time!==W._start+(W._ts>=0?W._tTime/W._ts:(W.totalDuration()-W._tTime)/-W._ts))W.totalTime(W._tTime,!0);W=W.parent}if(!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&Z0||!this._tDur&&!Z))k7(this._dp,this,this._start-this._delay)}if(this._tTime!==Z||!this._dur&&!K||this._initted&&Math.abs(this._zTime)===j9||!Z&&!this._initted&&(this.add||this._ptLookup))this._ts||(this._pTime=Z),I1(this,Z,K);return this},Q.time=function $(Z,K){return arguments.length?this.totalTime(Math.min(this.totalDuration(),Z+Y1(this))%(this._dur+this._rDelay)||(Z?this._dur:0),K):this._time},Q.totalProgress=function $(Z,K){return arguments.length?this.totalTime(this.totalDuration()*Z,K):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},Q.progress=function $(Z,K){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-Z:Z)+Y1(this),K):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},Q.iteration=function $(Z,K){var W=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(Z-1)*W,K):this._repeat?u$(this._tTime,W)+1:1},Q.timeScale=function $(Z,K){if(!arguments.length)return this._rts===-j9?0:this._rts;if(this._rts===Z)return this;var W=this.parent&&this._ts?lK(this.parent._time,this):this._tTime;return this._rts=+Z||0,this._ts=this._ps||Z===-j9?0:this._rts,this.totalTime(HZ(-Math.abs(this._delay),this.totalDuration(),W),K!==!1),iK(this),VM(this)},Q.paused=function $(Z){if(!arguments.length)return this._ps;if(this._ps!==Z)if(this._ps=Z,Z)this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0;else m$(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==j9&&(this._tTime-=j9));return this},Q.startTime=function $(Z){if(arguments.length){this._start=Z;var K=this.parent||this._dp;return K&&(K._sort||!this.parent)&&k7(K,this,Z-this._delay),this}return this._start},Q.endTime=function $(Z){return this._start+(F8(Z)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Q.rawTime=function $(Z){var K=this.parent||this._dp;return!K?this._tTime:Z&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):!this._ts?this._tTime:lK(K.rawTime(Z),this)},Q.revert=function $(Z){if(Z===void 0)Z=BM;var K=yJ;if(yJ=Z,SU(this))this.timeline&&this.timeline.revert(Z),this.totalTime(-0.01,Z.suppressEvents);return this.data!=="nested"&&Z.kill!==!1&&this.kill(),yJ=K,this},Q.globalTime=function $(Z){var K=this,W=arguments.length?Z:K.rawTime();while(K)W=K._start+W/(Math.abs(K._ts)||1),K=K._dp;return!this.parent&&this._sat?this._sat.globalTime(Z):W},Q.repeat=function $(Z){if(arguments.length)return this._repeat=Z===1/0?-2:Z,N1(this);return this._repeat===-2?1/0:this._repeat},Q.repeatDelay=function $(Z){if(arguments.length){var K=this._time;return this._rDelay=Z,N1(this),K?this.time(K):this}return this._rDelay},Q.yoyo=function $(Z){if(arguments.length)return this._yoyo=Z,this;return this._yoyo},Q.seek=function $(Z,K){return this.totalTime(u8(this,Z),F8(K))},Q.restart=function $(Z,K){return this.play().totalTime(Z?-this._delay:0,F8(K)),this._dur||(this._zTime=-j9),this},Q.play=function $(Z,K){return Z!=null&&this.seek(Z,K),this.reversed(!1).paused(!1)},Q.reverse=function $(Z,K){return Z!=null&&this.seek(Z||this.totalDuration(),K),this.reversed(!0).paused(!1)},Q.pause=function $(Z,K){return Z!=null&&this.seek(Z,K),this.paused(!0)},Q.resume=function $(){return this.paused(!1)},Q.reversed=function $(Z){if(arguments.length)return!!Z!==this.reversed()&&this.timeScale(-this._rts||(Z?-j9:0)),this;return this._rts<0},Q.invalidate=function $(){return this._initted=this._act=0,this._zTime=-j9,this},Q.isActive=function $(){var Z=this.parent||this._dp,K=this._start,W;return!!(!Z||this._ts&&this._initted&&Z.isActive()&&(W=Z.rawTime(!0))>=K&&W1){if(!K)delete H[Z];else H[Z]=K,W&&(H[Z+"Params"]=W),Z==="onUpdate"&&(this._onUpdate=K);return this}return H[Z]},Q.then=function $(Z){var K=this;return new Promise(function(W){var H=t9(Z)?Z:C1,U=function q(){var X=K.then;K.then=null,t9(H)&&(H=H(K))&&(H.then||H===K)&&(K.then=X),W(H),K.then=X};if(K._initted&&K.totalProgress()===1&&K._ts>=0||!K._tTime&&K._ts<0)U();else K._prom=U})},Q.kill=function $(){r6(this)},J}();L8(KZ.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-j9,_prom:0,_ps:!1,_rts:1});var _J=function(J){L1(Q,J);function Q(Z,K){var W;if(Z===void 0)Z={};return W=J.call(this,Z)||this,W.labels={},W.smoothChildTiming=!!Z.smoothChildTiming,W.autoRemoveChildren=!!Z.autoRemoveChildren,W._sort=F8(Z.sortChildren),o9&&k7(Z.parent||o9,u7(W),K),Z.reversed&&W.reverse(),Z.paused&&W.paused(!0),Z.scrollTrigger&&T1(u7(W),Z.scrollTrigger),W}var $=Q.prototype;return $.to=function Z(K,W,H){return e6(0,arguments,this),this},$.from=function Z(K,W,H){return e6(1,arguments,this),this},$.fromTo=function Z(K,W,H,U){return e6(2,arguments,this),this},$.set=function Z(K,W,H){return W.duration=0,W.parent=this,t6(W).repeatDelay||(W.repeat=0),W.immediateRender=!!W.immediateRender,new qJ(K,W,u8(this,H),1),this},$.call=function Z(K,W,H){return k7(this,qJ.delayedCall(0,K,W),H)},$.staggerTo=function Z(K,W,H,U,q,X,F){return H.duration=W,H.stagger=H.stagger||U,H.onComplete=X,H.onCompleteParams=F,H.parent=this,new qJ(K,H,u8(this,q)),this},$.staggerFrom=function Z(K,W,H,U,q,X,F){return H.runBackwards=1,t6(H).immediateRender=F8(H.immediateRender),this.staggerTo(K,W,H,U,q,X,F)},$.staggerFromTo=function Z(K,W,H,U,q,X,F,N){return U.startAt=H,t6(U).immediateRender=F8(U.immediateRender),this.staggerTo(K,W,U,q,X,F,N)},$.render=function Z(K,W,H){var U=this._time,q=this._dirty?this.totalDuration():this._tDur,X=this._dur,F=K<=0?0:LJ(K),N=this._zTime<0!==K<0&&(this._initted||!X),L,Y,B,M,V,A,I,P,j,T,w,_;if(this!==o9&&F>q&&K>=0&&(F=q),F!==this._tTime||H||N){if(U!==this._time&&X)F+=this._time-U,K+=this._time-U;if(L=F,j=this._start,P=this._ts,A=!P,N)X||(U=this._zTime),(K||!W)&&(this._zTime=K);if(this._repeat){if(w=this._yoyo,V=X+this._rDelay,this._repeat<-1&&K<0)return this.totalTime(V*100+K,W,H);if(L=LJ(F%V),F===q)M=this._repeat,L=X;else{if(T=LJ(F/V),M=~~T,M&&M===T)L=X,M--;L>X&&(L=X)}if(T=u$(this._tTime,V),!U&&this._tTime&&T!==M&&this._tTime-T*V-this._dur<=0&&(T=M),w&&M&1)L=X-L,_=1;if(M!==T&&!this._lock){var S=w&&T&1,y=S===(w&&M&1);if(M=U&&K>=0){Y=this._first;while(Y){if(B=Y._next,(Y._act||L>=Y._start)&&Y._ts&&I!==Y){if(Y.parent!==this)return this.render(K,W,H);if(Y.render(Y._ts>0?(L-Y._start)*Y._ts:(Y._dirty?Y.totalDuration():Y._tDur)+(L-Y._start)*Y._ts,W,H),L!==this._time||!this._ts&&!A){I=0,B&&(F+=this._zTime=-j9);break}}Y=B}}else{Y=this._last;var f=K<0?K:L;while(Y){if(B=Y._prev,(Y._act||f<=Y._end)&&Y._ts&&I!==Y){if(Y.parent!==this)return this.render(K,W,H);if(Y.render(Y._ts>0?(f-Y._start)*Y._ts:(Y._dirty?Y.totalDuration():Y._tDur)+(f-Y._start)*Y._ts,W,H||yJ&&SU(Y)),L!==this._time||!this._ts&&!A){I=0,B&&(F+=this._zTime=f?-j9:j9);break}}Y=B}}if(I&&!W){if(this.pause(),I.render(L>=U?0:-j9)._zTime=L>=U?1:-1,this._ts)return this._start=j,iK(this),this.render(K,W,H)}if(this._onUpdate&&!W&&P8(this,"onUpdate",!0),F===q&&this._tTime>=this.totalDuration()||!F&&U){if(j===this._start||Math.abs(P)!==Math.abs(this._ts)){if(!this._lock){if((K||!X)&&(F===q&&this._ts>0||!F&&this._ts<0)&&LQ(this,1),!W&&!(K<0&&!U)&&(F||U||!q))P8(this,F===q&&K>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(F0)&&this._prom()}}}}return this},$.add=function Z(K,W){var H=this;if(m7(W)||(W=u8(this,W,K)),!(K instanceof KZ)){if(dJ(K))return K.forEach(function(U){return H.add(U,W)}),this;if(VJ(K))return this.addLabel(K,W);if(t9(K))K=qJ.delayedCall(0,K);else return this}return this!==K?k7(this,K,W):this},$.getChildren=function Z(K,W,H,U){if(K===void 0)K=!0;if(W===void 0)W=!0;if(H===void 0)H=!0;if(U===void 0)U=-d8;var q=[],X=this._first;while(X){if(X._start>=U)if(X instanceof qJ)W&&q.push(X);else H&&q.push(X),K&&q.push.apply(q,X.getChildren(!0,W,H));X=X._next}return q},$.getById=function Z(K){var W=this.getChildren(1,1,1),H=W.length;while(H--)if(W[H].vars.id===K)return W[H]},$.remove=function Z(K){if(VJ(K))return this.removeLabel(K);if(t9(K))return this.killTweensOf(K);if(K.parent===this&&WZ(this,K),K===this._recent)this._recent=this._last;return iQ(this)},$.totalTime=function Z(K,W){if(!arguments.length)return this._tTime;if(this._forcing=1,!this._dp&&this._ts)this._start=LJ(O8.time-(this._ts>0?K/this._ts:(this.totalDuration()-K)/-this._ts));return J.prototype.totalTime.call(this,K,W),this._forcing=0,this},$.addLabel=function Z(K,W){return this.labels[K]=u8(this,W),this},$.removeLabel=function Z(K){return delete this.labels[K],this},$.addPause=function Z(K,W,H){var U=qJ.delayedCall(0,W||$Z,H);return U.data="isPause",this._hasPause=1,k7(this,U,u8(this,K))},$.removePause=function Z(K){var W=this._first;K=u8(this,K);while(W){if(W._start===K&&W.data==="isPause")LQ(W);W=W._next}},$.killTweensOf=function Z(K,W,H){var U=this.getTweensOf(K,H),q=U.length;while(q--)OQ!==U[q]&&U[q].kill(K,W);return this},$.getTweensOf=function Z(K,W){var H=[],U=m8(K),q=this._first,X=m7(W),F;while(q){if(q instanceof qJ){if(MM(q._targets,U)&&(X?(!OQ||q._initted&&q._ts)&&q.globalTime(0)<=W&&q.globalTime(q.totalDuration())>W:!W||q.isActive()))H.push(q)}else if((F=q.getTweensOf(U,W)).length)H.push.apply(H,F);q=q._next}return H},$.tweenTo=function Z(K,W){W=W||{};var H=this,U=u8(H,K),q=W,X=q.startAt,F=q.onStart,N=q.onStartParams,L=q.immediateRender,Y,B=qJ.to(H,L8({ease:W.ease||"none",lazy:!1,immediateRender:!1,time:U,overwrite:"auto",duration:W.duration||Math.abs((U-(X&&"time"in X?X.time:H._time))/H.timeScale())||j9,onStart:function M(){if(H.pause(),!Y){var V=W.duration||Math.abs((U-(X&&"time"in X?X.time:H._time))/H.timeScale());B._dur!==V&&d$(B,V,0,1).render(B._time,!0,!0),Y=1}F&&F.apply(B,N||[])}},W));return L?B.render(0):B},$.tweenFromTo=function Z(K,W,H){return this.tweenTo(W,L8({startAt:{time:u8(this,K)}},H))},$.recent=function Z(){return this._recent},$.nextLabel=function Z(K){if(K===void 0)K=this._time;return O1(this,u8(this,K))},$.previousLabel=function Z(K){if(K===void 0)K=this._time;return O1(this,u8(this,K),1)},$.currentLabel=function Z(K){return arguments.length?this.seek(K,!0):this.previousLabel(this._time+j9)},$.shiftChildren=function Z(K,W,H){if(H===void 0)H=0;var U=this._first,q=this.labels,X;while(U){if(U._start>=H)U._start+=K,U._end+=K;U=U._next}if(W){for(X in q)if(q[X]>=H)q[X]+=K}return iQ(this)},$.invalidate=function Z(K){var W=this._first;this._lock=0;while(W)W.invalidate(K),W=W._next;return J.prototype.invalidate.call(this,K)},$.clear=function Z(K){if(K===void 0)K=!0;var W=this._first,H;while(W)H=W._next,this.remove(W),W=H;return this._dp&&(this._time=this._tTime=this._pTime=0),K&&(this.labels={}),iQ(this)},$.totalDuration=function Z(K){var W=0,H=this,U=H._last,q=d8,X,F,N;if(arguments.length)return H.timeScale((H._repeat<0?H.duration():H.totalDuration())/(H.reversed()?-K:K));if(H._dirty){N=H.parent;while(U){if(X=U._prev,U._dirty&&U.totalDuration(),F=U._start,F>q&&H._sort&&U._ts&&!H._lock)H._lock=1,k7(H,U,F-U._delay,1)._lock=0;else q=F;if(F<0&&U._ts){if(W-=F,!N&&!H._dp||N&&N.smoothChildTiming)H._start+=F/H._ts,H._time-=F,H._tTime-=F;H.shiftChildren(-F,!1,-1/0),q=0}U._end>W&&U._ts&&(W=U._end),U=X}d$(H,H===o9&&H._time>W?H._time:W,1,1),H._dirty=0}return H._tDur},Q.updateRoot=function Z(K){if(o9._ts)I1(o9,lK(K,o9)),A1=O8.frame;if(O8.frame>=G1){G1+=D8.autoSleep||120;var W=o9._first;if(!W||!W._ts){if(D8.autoSleep&&O8._listeners.length<2){while(W&&!W._ts)W=W._next;W||O8.sleep()}}}},Q}(KZ);L8(_J.prototype,{_lock:0,_hasPause:0,_forcing:0});var mM=function J(Q,$,Z,K,W,H,U){var q=new eJ(this._pt,Q,$,0,1,bU,null,W),X=0,F=0,N,L,Y,B,M,V,A,I;if(q.b=Z,q.e=K,Z+="",K+="",A=~K.indexOf("random("))K=c$(K);if(H)I=[Z,K],H(I,Q,$),Z=I[0],K=I[1];L=Z.match(ZU)||[];while(N=ZU.exec(K)){if(B=N[0],M=K.substring(X,N.index),Y)Y=(Y+1)%5;else if(M.substr(-5)==="rgba(")Y=1;if(B!==L[F++])V=parseFloat(L[F-1])||0,q._pt={_next:q._pt,p:M||F===1?M:",",s:V,c:B.charAt(1)==="="?eQ(V,B)-V:parseFloat(B)-V,m:Y&&Y<4?Math.round:0},X=ZU.lastIndex}if(q.c=X")}),j.duration();else{w={};for(S in B)S==="ease"||S==="easeEach"||nM(S,B[S],w,B.easeEach);for(S in w){m=w[S].sort(function(N0,Q0){return N0.t-Q0.t}),v=0;for(T=0;Tq-j9&&!F?q:KX)L=X;if(A=this._yoyo&&B&1,A)j=this._yEase,L=X-L;if(V=u$(this._tTime,M),L===U&&!H&&this._initted&&B===V)return this._tTime=N,this;if(B!==V){if(P&&this._yEase&&c1(P,A),this.vars.repeatRefresh&&!A&&!this._lock&&L!==M&&this._initted)this._lock=H=1,this.render(LJ(M*B),!0).invalidate()._lock=0}}if(!this._initted){if(S1(this,F?K:L,H,W,N))return this._tTime=0,this;if(U!==this._time&&!(H&&this.vars.repeatRefresh&&B!==V))return this;if(X!==this._dur)return this.render(K,W,H)}if(this._tTime=N,this._time=L,!this._act&&this._ts)this._act=1,this._lazy=0;if(this.ratio=I=(j||this._ease)(L/X),this._from)this.ratio=I=1-I;if(!U&&N&&!W&&!V){if(P8(this,"onStart"),this._tTime!==N)return this}Y=this._pt;while(Y)Y.r(I,Y.d),Y=Y._next;if(P&&P.render(K<0?K:P._dur*P._ease(L/this._dur),W,H)||this._startAt&&(this._zTime=K),this._onUpdate&&!W)F&&FU(this,K,W,H),P8(this,"onUpdate");if(this._repeat&&B!==V&&this.vars.onRepeat&&!W&&this.parent&&P8(this,"onRepeat"),(N===this._tDur||!N)&&this._tTime===N){if(F&&!this._onUpdate&&FU(this,K,!0,!0),(K||!X)&&(N===this._tDur&&this._ts>0||!N&&this._ts<0)&&LQ(this,1),!W&&!(F&&!U)&&(N||U||A))P8(this,N===q?"onComplete":"onReverseComplete",!0),this._prom&&!(N0)&&this._prom()}}return this},$.targets=function Z(){return this._targets},$.invalidate=function Z(K){return(!K||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(K),J.prototype.invalidate.call(this,K)},$.resetTo=function Z(K,W,H,U,q){ZZ||O8.wake(),this._ts||this.play();var X=Math.min(this._dur,(this._dp._time-this._start)*this._ts),F;if(this._initted||xU(this,X),F=this._ease(X/this._dur),pM(this,K,W,H,U,F,X,q))return this.resetTo(K,W,H,U,1);return rK(this,0),this.parent||P1(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0)},$.kill=function Z(K,W){if(W===void 0)W="all";if(!K&&(!W||W==="all"))return this._lazy=this._pt=0,this.parent?r6(this):this.scrollTrigger&&this.scrollTrigger.kill(!!yJ),this;if(this.timeline){var H=this.timeline.totalDuration();return this.timeline.killTweensOf(K,W,OQ&&OQ.vars.overwrite!==!0)._first||r6(this),this.parent&&H!==this.timeline.totalDuration()&&d$(this,this._dur*this.timeline._tDur/H,0,1),this}var U=this._targets,q=K?m8(K):U,X=this._ptLookup,F=this._pt,N,L,Y,B,M,V,A;if((!W||W==="all")&&kM(U,q))return W==="all"&&(this._pt=0),r6(this);if(N=this._op=this._op||[],W!=="all"){if(VJ(W))M={},tJ(W,function(I){return M[I]=1}),W=M;W=lM(U,W)}A=U.length;while(A--)if(~q.indexOf(U[A])){if(L=X[A],W==="all")N[A]=W,B=L,Y={};else Y=N[A]=N[A]||{},B=W;for(M in B){if(V=L&&L[M],V){if(!("kill"in V.d)||V.d.kill(M)===!0)WZ(this,V,"_pt");delete L[M]}if(Y!=="all")Y[M]=1}}return this._initted&&!this._pt&&F&&r6(this),this},Q.to=function Z(K,W){return new Q(K,W,arguments[2])},Q.from=function Z(K,W){return e6(1,arguments)},Q.delayedCall=function Z(K,W,H,U){return new Q(W,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:K,onComplete:W,onReverseComplete:W,onCompleteParams:H,onReverseCompleteParams:H,callbackScope:U})},Q.fromTo=function Z(K,W,H){return e6(2,arguments)},Q.set=function Z(K,W){return W.duration=0,W.repeatDelay||(W.repeat=0),new Q(K,W)},Q.killTweensOf=function Z(K,W,H){return o9.killTweensOf(K,W,H)},Q}(KZ);L8(qJ.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});tJ("staggerTo,staggerFrom,staggerFromTo",function(J){qJ[J]=function(){var Q=new _J,$=LU.call(arguments,0);return $.splice(J==="staggerFromTo"?5:4,0,0),Q[J].apply(Q,$)}});var fU=function J(Q,$,Z){return Q[$]=Z},o1=function J(Q,$,Z){return Q[$](Z)},oM=function J(Q,$,Z,K){return Q[$](K.fp,Z)},sM=function J(Q,$,Z){return Q.setAttribute($,Z)},aK=function J(Q,$){return t9(Q[$])?o1:oK(Q[$])&&Q.setAttribute?sM:fU},s1=function J(Q,$){return $.set($.t,$.p,Math.round(($.s+$.c*Q)*1e6)/1e6,$)},iM=function J(Q,$){return $.set($.t,$.p,!!($.s+$.c*Q),$)},bU=function J(Q,$){var Z=$._pt,K="";if(!Q&&$.b)K=$.b;else if(Q===1&&$.e)K=$.e;else{while(Z)K=Z.p+(Z.m?Z.m(Z.s+Z.c*Q):Math.round((Z.s+Z.c*Q)*1e4)/1e4)+K,Z=Z._next;K+=$.c}$.set($.t,$.p,K,$)},vU=function J(Q,$){var Z=$._pt;while(Z)Z.r(Q,Z.d),Z=Z._next},rM=function J(Q,$,Z,K){var W=this._pt,H;while(W)H=W._next,W.p===K&&W.modifier(Q,$,Z),W=H},aM=function J(Q){var $=this._pt,Z,K;while($){if(K=$._next,$.p===Q&&!$.op||$.op===Q)WZ(this,$,"_pt");else if(!$.dep)Z=1;$=K}return!Z},tM=function J(Q,$,Z,K){K.mSet(Q,$,K.m.call(K.tween,Z,K.mt),K)},gU=function J(Q){var $=Q._pt,Z,K,W,H;while($){Z=$._next,K=W;while(K&&K.pr>$.pr)K=K._next;if($._prev=K?K._prev:H)$._prev._next=$;else W=$;if($._next=K)K._prev=$;else H=$;$=Z}Q._pt=W},eJ=function(){function J($,Z,K,W,H,U,q,X,F){if(this.t=Z,this.s=W,this.c=H,this.p=K,this.r=U||s1,this.d=q||this,this.set=X||fU,this.pr=F||0,this._next=$,$)$._prev=this}var Q=J.prototype;return Q.modifier=function $(Z,K,W){this.mSet=this.mSet||this.set,this.set=tM,this.m=Z,this.mt=W,this.tween=K},J}();tJ(PU+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(J){return CU[J]=1});j8.TweenMax=j8.TweenLite=qJ;j8.TimelineLite=j8.TimelineMax=_J;o9=new _J({sortChildren:!1,defaults:v$,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});D8.stringFilter=_U;var aQ=[],dK={},eM=[],D1=0,Jz=0,qU=function J(Q){return(dK[Q]||eM).map(function($){return $()})},zU=function J(){var Q=Date.now(),$=[];if(Q-D1>2)qU("matchMediaInit"),aQ.forEach(function(Z){var{queries:K,conditions:W}=Z,H,U,q,X;for(U in K)if(H=z7.matchMedia(K[U]).matches,H&&(q=1),H!==W[U])W[U]=H,X=1;if(X)Z.revert(),q&&$.push(Z)}),qU("matchMediaRevert"),$.forEach(function(Z){return Z.onMatch(Z,function(K){return Z.add(null,K)})}),D1=Q,qU("matchMedia")},i1=function(){function J($,Z){this.selector=Z&&RU(Z),this.data=[],this._r=[],this.isReverted=!1,this.id=Jz++,$&&this.add($)}var Q=J.prototype;return Q.add=function $(Z,K,W){if(t9(Z))W=K,K=Z,Z=t9;var H=this,U=function q(){var X=c9,F=H.selector,N;return X&&X!==H&&X.data.push(H),W&&(H.selector=RU(W)),c9=H,N=K.apply(H,arguments),t9(N)&&H._r.push(N),c9=X,H.selector=F,H.isReverted=!1,N};return H.last=U,Z===t9?U(H,function(q){return H.add(null,q)}):Z?H[Z]=U:U},Q.ignore=function $(Z){var K=c9;c9=null,Z(this),c9=K},Q.getTweens=function $(){var Z=[];return this.data.forEach(function(K){return K instanceof J?Z.push.apply(Z,K.getTweens()):K instanceof qJ&&!(K.parent&&K.parent.data==="nested")&&Z.push(K)}),Z},Q.clear=function $(){this._r.length=this.data.length=0},Q.kill=function $(Z,K){var W=this;if(Z)(function(){var U=W.getTweens(),q=W.data.length,X;while(q--)if(X=W.data[q],X.data==="isFlip")X.revert(),X.getChildren(!0,!0,!1).forEach(function(F){return U.splice(U.indexOf(F),1)});U.map(function(F){return{g:F._dur||F._delay||F._sat&&!F._sat.vars.immediateRender?F.globalTime(0):-1/0,t:F}}).sort(function(F,N){return N.g-F.g||-1/0}).forEach(function(F){return F.t.revert(Z)}),q=W.data.length;while(q--)if(X=W.data[q],X instanceof _J){if(X.data!=="nested")X.scrollTrigger&&X.scrollTrigger.revert(),X.kill()}else!(X instanceof qJ)&&X.revert&&X.revert(Z);W._r.forEach(function(F){return F(Z,W)}),W.isReverted=!0})();else this.data.forEach(function(U){return U.kill&&U.kill()});if(this.clear(),K){var H=aQ.length;while(H--)aQ[H].id===this.id&&aQ.splice(H,1)}},Q.revert=function $(Z){this.kill(Z||{})},J}(),Qz=function(){function J($){this.contexts=[],this.scope=$,c9&&c9.data.push(this)}var Q=J.prototype;return Q.add=function $(Z,K,W){V7(Z)||(Z={matches:Z});var H=new i1(0,W||this.scope),U=H.conditions={},q,X,F;c9&&!H.selector&&(H.selector=c9.selector),this.contexts.push(H),K=H.add("onMatch",K),H.queries=Z;for(X in Z)if(X==="all")F=1;else if(q=z7.matchMedia(Z[X]),q)aQ.indexOf(H)<0&&aQ.push(H),(U[X]=q.matches)&&(F=1),q.addListener?q.addListener(zU):q.addEventListener("change",zU);return F&&K(H,function(N){return H.add(null,N)}),this},Q.revert=function $(Z){this.kill(Z||{})},Q.kill=function $(Z){this.contexts.forEach(function(K){return K.kill(Z,!0)})},J}(),nK={registerPlugin:function J(){for(var Q=arguments.length,$=new Array(Q),Z=0;Z1){var K=Q.map(function(F){return mJ.quickSetter(F,$,Z)}),W=K.length;return function(F){var N=W;while(N--)K[N](F)}}Q=Q[0]||{};var H=N8[$],U=DQ(Q),q=U.harness&&(U.harness.aliases||{})[$]||$,X=H?function(F){var N=new H;b$._pt=0,N.init(Q,Z?F+Z:F,b$,0,[Q]),N.render(1,N),b$._pt&&vU(1,b$)}:U.set(Q,q);return H?X:function(F){return X(Q,q,Z?F+Z:F,U,1)}},quickTo:function J(Q,$,Z){var K,W=mJ.to(Q,L8((K={},K[$]="+=0.1",K.paused=!0,K.stagger=0,K),Z||{})),H=function U(q,X,F){return W.resetTo($,q,X,F)};return H.tween=W,H},isTweening:function J(Q){return o9.getTweensOf(Q,!0).length>0},defaults:function J(Q){return Q&&Q.ease&&(Q.ease=rQ(Q.ease,v$.ease)),X1(v$,Q||{})},config:function J(Q){return X1(D8,Q||{})},registerEffect:function J(Q){var{name:$,effect:Z,plugins:K,defaults:W,extendTimeline:H}=Q;if((K||"").split(",").forEach(function(U){return U&&!N8[U]&&!j8[U]&&QZ($+" effect requires "+U+" plugin.")}),KU[$]=function(U,q,X){return Z(m8(U),L8(q||{},W),X)},H)_J.prototype[$]=function(U,q,X){return this.add(KU[$](U,V7(q)?q:(X=q)&&{},this),X)}},registerEase:function J(Q,$){G9[Q]=rQ($)},parseEase:function J(Q,$){return arguments.length?rQ(Q,$):G9},getById:function J(Q){return o9.getById(Q)},exportRoot:function J(Q,$){if(Q===void 0)Q={};var Z=new _J(Q),K,W;Z.smoothChildTiming=F8(Q.smoothChildTiming),o9.remove(Z),Z._dp=0,Z._time=Z._tTime=o9._time,K=o9._first;while(K){if(W=K._next,$||!(!K._dur&&K instanceof qJ&&K.vars.onComplete===K._targets[0]))k7(Z,K,K._start-K._delay);K=W}return k7(o9,Z,0),Z},context:function J(Q,$){return Q?new i1(Q,$):c9},matchMedia:function J(Q){return new Qz(Q)},matchMediaRefresh:function J(){return aQ.forEach(function(Q){var $=Q.conditions,Z,K;for(K in $)if($[K])$[K]=!1,Z=1;Z&&Q.revert()})||zU()},addEventListener:function J(Q,$){var Z=dK[Q]||(dK[Q]=[]);~Z.indexOf($)||Z.push($)},removeEventListener:function J(Q,$){var Z=dK[Q],K=Z&&Z.indexOf($);K>=0&&Z.splice(K,1)},utils:{wrap:wM,wrapYoyo:hM,distribute:w1,random:x1,snap:h1,normalize:yM,getUnit:wJ,clamp:jM,splitColor:u1,toArray:m8,selector:RU,mapRange:b1,pipe:SM,unitize:_M,interpolate:xM,shuffle:y1},install:k1,effects:KU,ticker:O8,updateRoot:_J.updateRoot,plugins:N8,globalTimeline:o9,core:{PropTween:eJ,globals:V1,Tween:qJ,Timeline:_J,Animation:KZ,getCache:DQ,_removeLinkedListItem:WZ,reverting:function J(){return yJ},context:function J(Q){if(Q&&c9)c9.data.push(Q),Q._ctx=c9;return c9},suppressOverwrites:function J(Q){return kU=Q}}};tJ("to,from,fromTo,delayedCall,set,killTweensOf",function(J){return nK[J]=qJ[J]});O8.add(_J.updateRoot);b$=nK.to({},{duration:0});var $z=function J(Q,$){var Z=Q._pt;while(Z&&Z.p!==$&&Z.op!==$&&Z.fp!==$)Z=Z._next;return Z},Zz=function J(Q,$){var Z=Q._targets,K,W,H;for(K in $){W=Z.length;while(W--)if(H=Q._ptLookup[W][K],H&&(H=H.d)){if(H._pt)H=$z(H,K);H&&H.modifier&&H.modifier($[K],Q,Z[W],K)}}},GU=function J(Q,$){return{name:Q,headless:1,rawVars:1,init:function Z(K,W,H){H._onInit=function(U){var q,X;if(VJ(W))q={},tJ(W,function(F){return q[F]=1}),W=q;if($){q={};for(X in W)q[X]=$(W[X]);W=q}Zz(U,W)}}}},mJ=nK.registerPlugin({name:"attr",init:function J(Q,$,Z,K,W){var H,U,q;this.tween=Z;for(H in $)q=Q.getAttribute(H)||"",U=this.add(Q,"setAttribute",(q||0)+"",$[H],K,W,0,0,H),U.op=H,U.b=q,this._props.push(H)},render:function J(Q,$){var Z=$._pt;while(Z)yJ?Z.set(Z.t,Z.p,Z.b,Z):Z.r(Q,Z.d),Z=Z._next}},{name:"endArray",headless:1,init:function J(Q,$){var Z=$.length;while(Z--)this.add(Q,Z,Q[Z]||0,$[Z],0,0,0,0,0,1)}},GU("roundProps",BU),GU("modifiers"),GU("snap",h1))||nK;qJ.version=_J.version=mJ.version="3.13.0";z1=1;VU()&&m$();var{Power0:Kz,Power1:Wz,Power2:Hz,Power3:Uz,Power4:qz,Linear:Gz,Quad:Xz,Cubic:Yz,Quart:Nz,Quint:Oz,Strong:Fz,Elastic:Dz,Back:Lz,SteppedEase:Rz,Bounce:Bz,Sine:Mz,Expo:zz,Circ:kz}=G9;/*! * CSSPlugin 3.13.0 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var r1,BQ,l$,lU,K$,Vz,a1,nU,Az=function J(){return typeof window!=="undefined"},p7={},Z$=180/Math.PI,n$=Math.PI/180,p$=Math.atan2,t1=1e8,oU=/([A-Z])/g,Iz=/(left|right|width|margin|padding|x)/i,Ez=/[\s,\(]\S/,A7={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},dU=function J(Q,$){return $.set($.t,$.p,Math.round(($.s+$.c*Q)*1e4)/1e4+$.u,$)},Cz=function J(Q,$){return $.set($.t,$.p,Q===1?$.e:Math.round(($.s+$.c*Q)*1e4)/1e4+$.u,$)},Pz=function J(Q,$){return $.set($.t,$.p,Q?Math.round(($.s+$.c*Q)*1e4)/1e4+$.u:$.b,$)},jz=function J(Q,$){var Z=$.s+$.c*Q;$.set($.t,$.p,~~(Z+(Z<0?-0.5:0.5))+$.u,$)},HY=function J(Q,$){return $.set($.t,$.p,Q?$.e:$.b,$)},UY=function J(Q,$){return $.set($.t,$.p,Q!==1?$.b:$.e,$)},Tz=function J(Q,$,Z){return Q.style[$]=Z},Sz=function J(Q,$,Z){return Q.style.setProperty($,Z)},_z=function J(Q,$,Z){return Q._gsap[$]=Z},yz=function J(Q,$,Z){return Q._gsap.scaleX=Q._gsap.scaleY=Z},wz=function J(Q,$,Z,K,W){var H=Q._gsap;H.scaleX=H.scaleY=Z,H.renderTransform(W,H)},hz=function J(Q,$,Z,K,W){var H=Q._gsap;H[$]=Z,H.renderTransform(W,H)},s9="transform",R8=s9+"Origin",xz=function J(Q,$){var Z=this,K=this.target,W=K.style,H=K._gsap;if(Q in p7&&W){if(this.tfm=this.tfm||{},Q!=="transform")Q=A7[Q]||Q,~Q.indexOf(",")?Q.split(",").forEach(function(U){return Z.tfm[U]=c7(K,U)}):this.tfm[Q]=H.x?H[Q]:c7(K,Q),Q===R8&&(this.tfm.zOrigin=H.zOrigin);else return A7.transform.split(",").forEach(function(U){return J.call(Z,U,$)});if(this.props.indexOf(s9)>=0)return;if(H.svg)this.svgo=K.getAttribute("data-svg-origin"),this.props.push(R8,$,"");Q=s9}(W||$)&&this.props.push(Q,$,W[Q])},qY=function J(Q){if(Q.translate)Q.removeProperty("translate"),Q.removeProperty("scale"),Q.removeProperty("rotate")},fz=function J(){var Q=this.props,$=this.target,Z=$.style,K=$._gsap,W,H;for(W=0;W=0?e1[H]:"")+Q},cU=function J(){if(Az()&&window.document)r1=window,BQ=r1.document,l$=BQ.documentElement,K$=mU("div")||{style:{}},Vz=mU("div"),s9=o$(s9),R8=s9+"Origin",K$.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",XY=!!o$("perspective"),nU=mJ.core.reverting,lU=1},JY=function J(Q){var $=Q.ownerSVGElement,Z=mU("svg",$&&$.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),K=Q.cloneNode(!0),W;K.style.display="block",Z.appendChild(K),l$.appendChild(Z);try{W=K.getBBox()}catch(H){}return Z.removeChild(K),l$.removeChild(Z),W},QY=function J(Q,$){var Z=$.length;while(Z--)if(Q.hasAttribute($[Z]))return Q.getAttribute($[Z])},YY=function J(Q){var $,Z;try{$=Q.getBBox()}catch(K){$=JY(Q),Z=1}return $&&($.width||$.height)||Z||($=JY(Q)),$&&!$.width&&!$.x&&!$.y?{x:+QY(Q,["x","cx","x1"])||0,y:+QY(Q,["y","cy","y1"])||0,width:0,height:0}:$},NY=function J(Q){return!!(Q.getCTM&&(!Q.parentNode||Q.ownerSVGElement)&&YY(Q))},W$=function J(Q,$){if($){var Z=Q.style,K;if($ in p7&&$!==R8)$=s9;if(Z.removeProperty){if(K=$.substr(0,2),K==="ms"||$.substr(0,6)==="webkit")$="-"+$;Z.removeProperty(K==="--"?$:$.replace(oU,"-$1").toLowerCase())}else Z.removeAttribute($)}},MQ=function J(Q,$,Z,K,W,H){var U=new eJ(Q._pt,$,Z,0,1,H?UY:HY);return Q._pt=U,U.b=K,U.e=W,Q._props.push(Z),U},$Y={deg:1,rad:1,turn:1},bz={grid:1,flex:1},zQ=function J(Q,$,Z,K){var W=parseFloat(Z)||0,H=(Z+"").trim().substr((W+"").length)||"px",U=K$.style,q=Iz.test($),X=Q.tagName.toLowerCase()==="svg",F=(X?"client":"offset")+(q?"Width":"Height"),N=100,L=K==="px",Y=K==="%",B,M,V,A;if(K===H||!W||$Y[K]||$Y[H])return W;if(H!=="px"&&!L&&(W=J(Q,$,Z,"px")),A=Q.getCTM&&NY(Q),(Y||H==="%")&&(p7[$]||~$.indexOf("adius")))return B=A?Q.getBBox()[q?"width":"height"]:Q[F],e9(Y?W/B*N:W/100*B);if(U[q?"width":"height"]=N+(L?H:K),M=K!=="rem"&&~$.indexOf("adius")||K==="em"&&Q.appendChild&&!X?Q:Q.parentNode,A)M=(Q.ownerSVGElement||{}).parentNode;if(!M||M===BQ||!M.appendChild)M=BQ.body;if(V=M._gsap,V&&Y&&V.width&&q&&V.time===O8.time&&!V.uncache)return e9(W/V.width*N);else{if(Y&&($==="height"||$==="width")){var I=Q.style[$];Q.style[$]=N+K,B=Q[F],I?Q.style[$]=I:W$(Q,$)}else(Y||H==="%")&&!bz[c8(M,"display")]&&(U.position=c8(Q,"position")),M===Q&&(U.position="static"),M.appendChild(K$),B=K$[F],M.removeChild(K$),U.position="absolute";if(q&&Y)V=DQ(M),V.time=O8.time,V.width=M[F]}return e9(L?B*W/N:B&&W?N/B*W:0)},c7=function J(Q,$,Z,K){var W;if(lU||cU(),$ in A7&&$!=="transform"){if($=A7[$],~$.indexOf(","))$=$.split(",")[0]}if(p7[$]&&$!=="transform")W=GZ(Q,K),W=$!=="transformOrigin"?W[$]:W.svg?W.origin:eK(c8(Q,R8))+" "+W.zOrigin+"px";else if(W=Q.style[$],!W||W==="auto"||K||~(W+"").indexOf("calc("))W=tK[$]&&tK[$](Q,$,Z)||c8(Q,$)||TU(Q,$)||($==="opacity"?1:0);return Z&&!~(W+"").trim().indexOf(" ")?zQ(Q,$,W,Z)+Z:W},vz=function J(Q,$,Z,K){if(!Z||Z==="none"){var W=o$($,Q,1),H=W&&c8(Q,W,1);if(H&&H!==Z)$=W,Z=H;else if($==="borderColor")Z=c8(Q,"borderTopColor")}var U=new eJ(this._pt,Q.style,$,0,1,bU),q=0,X=0,F,N,L,Y,B,M,V,A,I,P,j,T;if(U.b=Z,U.e=K,Z+="",K+="",K.substring(0,6)==="var(--")K=c8(Q,K.substring(4,K.indexOf(")")));if(K==="auto")M=Q.style[$],Q.style[$]=K,K=c8(Q,$)||K,M?Q.style[$]=M:W$(Q,$);if(F=[Z,K],_U(F),Z=F[0],K=F[1],L=Z.match(tQ)||[],T=K.match(tQ)||[],T.length){while(N=tQ.exec(K)){if(V=N[0],I=K.substring(q,N.index),B)B=(B+1)%5;else if(I.substr(-5)==="rgba("||I.substr(-5)==="hsla(")B=1;if(V!==(M=L[X++]||"")){if(Y=parseFloat(M)||0,j=M.substr((Y+"").length),V.charAt(1)==="="&&(V=eQ(Y,V)+j),A=parseFloat(V),P=V.substr((A+"").length),q=tQ.lastIndex-P.length,!P){if(P=P||D8.units[$]||j,q===K.length)K+=P,U.e+=P}if(j!==P)Y=zQ(Q,$,M,P)||0;U._pt={_next:U._pt,p:I||X===1?I:",",s:Y,c:A-Y,m:B&&B<4||$==="zIndex"?Math.round:0}}}U.c=q-1){if(U=W[X],p7[U])q=1,U=U==="transformOrigin"?R8:s9;W$(Z,U)}}if(q){if(W$(Z,s9),H)H.svg&&Z.removeAttribute("transform"),K.scale=K.rotate=K.translate="none",GZ(Z,1),H.uncache=1,qY(K)}}},tK={clearProps:function J(Q,$,Z,K,W){if(W.data!=="isFromStart"){var H=Q._pt=new eJ(Q._pt,$,Z,0,0,uz);return H.u=K,H.pr=-10,H.tween=W,Q._props.push(Z),1}}},qZ=[1,0,0,1,0,0],OY={},FY=function J(Q){return Q==="matrix(1, 0, 0, 1, 0, 0)"||Q==="none"||!Q},KY=function J(Q){var $=c8(Q,s9);return FY($)?qZ:$.substr(7).match(AU).map(e9)},sU=function J(Q,$){var Z=Q._gsap||DQ(Q),K=Q.style,W=KY(Q),H,U,q,X;if(Z.svg&&Q.getAttribute("transform"))return q=Q.transform.baseVal.consolidate().matrix,W=[q.a,q.b,q.c,q.d,q.e,q.f],W.join(",")==="1,0,0,1,0,0"?qZ:W;else if(W===qZ&&!Q.offsetParent&&Q!==l$&&!Z.svg){if(q=K.display,K.display="block",H=Q.parentNode,!H||!Q.offsetParent&&!Q.getBoundingClientRect().width)X=1,U=Q.nextElementSibling,l$.appendChild(Q);if(W=KY(Q),q?K.display=q:W$(Q,"display"),X)U?H.insertBefore(Q,U):H?H.appendChild(Q):l$.removeChild(Q)}return $&&W.length>6?[W[0],W[1],W[4],W[5],W[12],W[13]]:W},pU=function J(Q,$,Z,K,W,H){var U=Q._gsap,q=W||sU(Q,!0),X=U.xOrigin||0,F=U.yOrigin||0,N=U.xOffset||0,L=U.yOffset||0,Y=q[0],B=q[1],M=q[2],V=q[3],A=q[4],I=q[5],P=$.split(" "),j=parseFloat(P[0])||0,T=parseFloat(P[1])||0,w,_,S,y;if(!Z)w=YY(Q),j=w.x+(~P[0].indexOf("%")?j/100*w.width:j),T=w.y+(~(P[1]||P[0]).indexOf("%")?T/100*w.height:T);else if(q!==qZ&&(_=Y*V-B*M))S=j*(V/_)+T*(-M/_)+(M*I-V*A)/_,y=j*(-B/_)+T*(Y/_)-(Y*I-B*A)/_,j=S,T=y;if(K||K!==!1&&U.smooth)A=j-X,I=T-F,U.xOffset=N+(A*Y+I*M)-A,U.yOffset=L+(A*B+I*V)-I;else U.xOffset=U.yOffset=0;if(U.xOrigin=j,U.yOrigin=T,U.smooth=!!K,U.origin=$,U.originIsAbsolute=!!Z,Q.style[R8]="0px 0px",H)MQ(H,U,"xOrigin",X,j),MQ(H,U,"yOrigin",F,T),MQ(H,U,"xOffset",N,U.xOffset),MQ(H,U,"yOffset",L,U.yOffset);Q.setAttribute("data-svg-origin",j+" "+T)},GZ=function J(Q,$){var Z=Q._gsap||new yU(Q);if("x"in Z&&!$&&!Z.uncache)return Z;var K=Q.style,W=Z.scaleX<0,H="px",U="deg",q=getComputedStyle(Q),X=c8(Q,R8)||"0",F,N,L,Y,B,M,V,A,I,P,j,T,w,_,S,y,f,u,v,m,l,H0,N0,Q0,Z0,D0,b,Y0,V0,f0,z0,i0;if(F=N=L=M=V=A=I=P=j=0,Y=B=1,Z.svg=!!(Q.getCTM&&NY(Q)),q.translate){if(q.translate!=="none"||q.scale!=="none"||q.rotate!=="none")K[s9]=(q.translate!=="none"?"translate3d("+(q.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(q.rotate!=="none"?"rotate("+q.rotate+") ":"")+(q.scale!=="none"?"scale("+q.scale.split(" ").join(",")+") ":"")+(q[s9]!=="none"?q[s9]:"");K.scale=K.rotate=K.translate="none"}if(_=sU(Q,Z.svg),Z.svg){if(Z.uncache)Z0=Q.getBBox(),X=Z.xOrigin-Z0.x+"px "+(Z.yOrigin-Z0.y)+"px",Q0="";else Q0=!$&&Q.getAttribute("data-svg-origin");pU(Q,Q0||X,!!Q0||Z.originIsAbsolute,Z.smooth!==!1,_)}if(T=Z.xOrigin||0,w=Z.yOrigin||0,_!==qZ){if(u=_[0],v=_[1],m=_[2],l=_[3],F=H0=_[4],N=N0=_[5],_.length===6){if(Y=Math.sqrt(u*u+v*v),B=Math.sqrt(l*l+m*m),M=u||v?p$(v,u)*Z$:0,I=m||l?p$(m,l)*Z$+M:0,I&&(B*=Math.abs(Math.cos(I*n$))),Z.svg)F-=T-(T*u+w*m),N-=w-(T*v+w*l)}else{if(i0=_[6],f0=_[7],b=_[8],Y0=_[9],V0=_[10],z0=_[11],F=_[12],N=_[13],L=_[14],S=p$(i0,V0),V=S*Z$,S)y=Math.cos(-S),f=Math.sin(-S),Q0=H0*y+b*f,Z0=N0*y+Y0*f,D0=i0*y+V0*f,b=H0*-f+b*y,Y0=N0*-f+Y0*y,V0=i0*-f+V0*y,z0=f0*-f+z0*y,H0=Q0,N0=Z0,i0=D0;if(S=p$(-m,V0),A=S*Z$,S)y=Math.cos(-S),f=Math.sin(-S),Q0=u*y-b*f,Z0=v*y-Y0*f,D0=m*y-V0*f,z0=l*f+z0*y,u=Q0,v=Z0,m=D0;if(S=p$(v,u),M=S*Z$,S)y=Math.cos(S),f=Math.sin(S),Q0=u*y+v*f,Z0=H0*y+N0*f,v=v*y-u*f,N0=N0*y-H0*f,u=Q0,H0=Z0;if(V&&Math.abs(V)+Math.abs(M)>359.9)V=M=0,A=180-A;Y=e9(Math.sqrt(u*u+v*v+m*m)),B=e9(Math.sqrt(N0*N0+i0*i0)),S=p$(H0,N0),I=Math.abs(S)>0.0002?S*Z$:0,j=z0?1/(z0<0?-z0:z0):0}if(Z.svg)Q0=Q.getAttribute("transform"),Z.forceCSS=Q.setAttribute("transform","")||!FY(c8(Q,s9)),Q0&&Q.setAttribute("transform",Q0)}if(Math.abs(I)>90&&Math.abs(I)<270)if(W)Y*=-1,I+=M<=0?180:-180,M+=M<=0?180:-180;else B*=-1,I+=I<=0?180:-180;if($=$||Z.uncache,Z.x=F-((Z.xPercent=F&&(!$&&Z.xPercent||(Math.round(Q.offsetWidth/2)===Math.round(-F)?-50:0)))?Q.offsetWidth*Z.xPercent/100:0)+H,Z.y=N-((Z.yPercent=N&&(!$&&Z.yPercent||(Math.round(Q.offsetHeight/2)===Math.round(-N)?-50:0)))?Q.offsetHeight*Z.yPercent/100:0)+H,Z.z=L+H,Z.scaleX=e9(Y),Z.scaleY=e9(B),Z.rotation=e9(M)+U,Z.rotationX=e9(V)+U,Z.rotationY=e9(A)+U,Z.skewX=I+U,Z.skewY=P+U,Z.transformPerspective=j+H,Z.zOrigin=parseFloat(X.split(" ")[2])||!$&&Z.zOrigin||0)K[R8]=eK(X);return Z.xOffset=Z.yOffset=0,Z.force3D=D8.force3D,Z.renderTransform=Z.svg?mz:XY?DY:dz,Z.uncache=0,Z},eK=function J(Q){return(Q=Q.split(" "))[0]+" "+Q[1]},uU=function J(Q,$,Z){var K=wJ($);return e9(parseFloat($)+parseFloat(zQ(Q,"x",Z+"px",K)))+K},dz=function J(Q,$){$.z="0px",$.rotationY=$.rotationX="0deg",$.force3D=0,DY(Q,$)},Q$="0deg",UZ="0px",$$=") ",DY=function J(Q,$){var Z=$||this,K=Z.xPercent,W=Z.yPercent,H=Z.x,U=Z.y,q=Z.z,X=Z.rotation,F=Z.rotationY,N=Z.rotationX,L=Z.skewX,Y=Z.skewY,B=Z.scaleX,M=Z.scaleY,V=Z.transformPerspective,A=Z.force3D,I=Z.target,P=Z.zOrigin,j="",T=A==="auto"&&Q&&Q!==1||A===!0;if(P&&(N!==Q$||F!==Q$)){var w=parseFloat(F)*n$,_=Math.sin(w),S=Math.cos(w),y;w=parseFloat(N)*n$,y=Math.cos(w),H=uU(I,H,_*y*-P),U=uU(I,U,-Math.sin(w)*-P),q=uU(I,q,S*y*-P+P)}if(V!==UZ)j+="perspective("+V+$$;if(K||W)j+="translate("+K+"%, "+W+"%) ";if(T||H!==UZ||U!==UZ||q!==UZ)j+=q!==UZ||T?"translate3d("+H+", "+U+", "+q+") ":"translate("+H+", "+U+$$;if(X!==Q$)j+="rotate("+X+$$;if(F!==Q$)j+="rotateY("+F+$$;if(N!==Q$)j+="rotateX("+N+$$;if(L!==Q$||Y!==Q$)j+="skew("+L+", "+Y+$$;if(B!==1||M!==1)j+="scale("+B+", "+M+$$;I.style[s9]=j||"translate(0, 0)"},mz=function J(Q,$){var Z=$||this,K=Z.xPercent,W=Z.yPercent,H=Z.x,U=Z.y,q=Z.rotation,X=Z.skewX,F=Z.skewY,N=Z.scaleX,L=Z.scaleY,Y=Z.target,B=Z.xOrigin,M=Z.yOrigin,V=Z.xOffset,A=Z.yOffset,I=Z.forceCSS,P=parseFloat(H),j=parseFloat(U),T,w,_,S,y;if(q=parseFloat(q),X=parseFloat(X),F=parseFloat(F),F)F=parseFloat(F),X+=F,q+=F;if(q||X){if(q*=n$,X*=n$,T=Math.cos(q)*N,w=Math.sin(q)*N,_=Math.sin(q-X)*-L,S=Math.cos(q-X)*L,X){if(F*=n$,y=Math.tan(X-F),y=Math.sqrt(1+y*y),_*=y,S*=y,F)y=Math.tan(F),y=Math.sqrt(1+y*y),T*=y,w*=y}T=e9(T),w=e9(w),_=e9(_),S=e9(S)}else T=N,S=L,w=_=0;if(P&&!~(H+"").indexOf("px")||j&&!~(U+"").indexOf("px"))P=zQ(Y,"x",H,"px"),j=zQ(Y,"y",U,"px");if(B||M||V||A)P=e9(P+B-(B*T+M*_)+V),j=e9(j+M-(B*w+M*S)+A);if(K||W)y=Y.getBBox(),P=e9(P+K/100*y.width),j=e9(j+W/100*y.height);y="matrix("+T+","+w+","+_+","+S+","+P+","+j+")",Y.setAttribute("transform",y),I&&(Y.style[s9]=y)},cz=function J(Q,$,Z,K,W){var H=360,U=VJ(W),q=parseFloat(W)*(U&&~W.indexOf("rad")?Z$:1),X=q-K,F=K+X+"deg",N,L;if(U){if(N=W.split("_")[1],N==="short"){if(X%=H,X!==X%(H/2))X+=X<0?H:-H}if(N==="cw"&&X<0)X=(X+H*t1)%H-~~(X/H)*H;else if(N==="ccw"&&X>0)X=(X-H*t1)%H-~~(X/H)*H}return Q._pt=L=new eJ(Q._pt,$,Z,K,X,Cz),L.e=F,L.u="deg",Q._props.push(Z),L},WY=function J(Q,$){for(var Z in $)Q[Z]=$[Z];return Q},pz=function J(Q,$,Z){var K=WY({},Z._gsap),W="perspective,force3D,transformOrigin,svgOrigin",H=Z.style,U,q,X,F,N,L,Y,B;if(K.svg)X=Z.getAttribute("transform"),Z.setAttribute("transform",""),H[s9]=$,U=GZ(Z,1),W$(Z,s9),Z.setAttribute("transform",X);else X=getComputedStyle(Z)[s9],H[s9]=$,U=GZ(Z,1),H[s9]=X;for(q in p7)if(X=K[q],F=U[q],X!==F&&W.indexOf(q)<0)Y=wJ(X),B=wJ(F),N=Y!==B?zQ(Z,q,X,B):parseFloat(X),L=parseFloat(F),Q._pt=new eJ(Q._pt,U,q,N,L-N,dU),Q._pt.u=B||0,Q._props.push(q);WY(U,K)};tJ("padding,margin,Width,Radius",function(J,Q){var $="Top",Z="Right",K="Bottom",W="Left",H=(Q<3?[$,Z,K,W]:[$+W,$+Z,K+Z,K+W]).map(function(U){return Q<2?J+U:"border"+U+J});tK[Q>1?"border"+J:J]=function(U,q,X,F,N){var L,Y;if(arguments.length<4)return L=H.map(function(B){return c7(U,B,X)}),Y=L.join(" "),Y.split(L[0]).length===5?L[0]:Y;L=(F+"").split(" "),Y={},H.forEach(function(B,M){return Y[B]=L[M]=L[M]||L[(M-1)/2|0]}),U.init(q,Y,N)}});var iU={name:"css",register:cU,targetTest:function J(Q){return Q.style&&Q.nodeType},init:function J(Q,$,Z,K,W){var H=this._props,U=Q.style,q=Z.vars.startAt,X,F,N,L,Y,B,M,V,A,I,P,j,T,w,_,S;lU||cU(),this.styles=this.styles||GY(Q),S=this.styles.props,this.tween=Z;for(M in $){if(M==="autoRound")continue;if(F=$[M],N8[M]&&hU(M,$,Z,K,Q,W))continue;if(Y=typeof F,B=tK[M],Y==="function")F=F.call(Z,K,Q,W),Y=typeof F;if(Y==="string"&&~F.indexOf("random("))F=c$(F);if(B)B(this,Q,M,F,Z)&&(_=1);else if(M.substr(0,2)==="--"){if(X=(getComputedStyle(Q).getPropertyValue(M)+"").trim(),F+="",d7.lastIndex=0,!d7.test(X))V=wJ(X),A=wJ(F);A?V!==A&&(X=zQ(Q,M,X,A)+A):V&&(F+=V),this.add(U,"setProperty",X,F,K,W,0,0,M),H.push(M),S.push(M,0,U[M])}else if(Y!=="undefined"){if(q&&M in q)X=typeof q[M]==="function"?q[M].call(Z,K,Q,W):q[M],VJ(X)&&~X.indexOf("random(")&&(X=c$(X)),wJ(X+"")||X==="auto"||(X+=D8.units[M]||wJ(c7(Q,M))||""),(X+"").charAt(1)==="="&&(X=c7(Q,M));else X=c7(Q,M);if(L=parseFloat(X),I=Y==="string"&&F.charAt(1)==="="&&F.substr(0,2),I&&(F=F.substr(2)),N=parseFloat(F),M in A7){if(M==="autoAlpha"){if(L===1&&c7(Q,"visibility")==="hidden"&&N)L=0;S.push("visibility",0,U.visibility),MQ(this,U,"visibility",L?"inherit":"hidden",N?"inherit":"hidden",!N)}if(M!=="scale"&&M!=="transform")M=A7[M],~M.indexOf(",")&&(M=M.split(",")[0])}if(P=M in p7,P){if(this.styles.save(M),Y==="string"&&F.substring(0,6)==="var(--")F=c8(Q,F.substring(4,F.indexOf(")"))),N=parseFloat(F);if(!j)T=Q._gsap,T.renderTransform&&!$.parseTransform||GZ(Q,$.parseTransform),w=$.smoothOrigin!==!1&&T.smooth,j=this._pt=new eJ(this._pt,U,s9,0,1,T.renderTransform,T,0,-1),j.dep=1;if(M==="scale")this._pt=new eJ(this._pt,T,"scaleY",T.scaleY,(I?eQ(T.scaleY,I+N):N)-T.scaleY||0,dU),this._pt.u=0,H.push("scaleY",M),M+="X";else if(M==="transformOrigin"){if(S.push(R8,0,U[R8]),F=gz(F),T.svg)pU(Q,F,0,w,0,this);else A=parseFloat(F.split(" ")[2])||0,A!==T.zOrigin&&MQ(this,T,"zOrigin",T.zOrigin,A),MQ(this,U,M,eK(X),eK(F));continue}else if(M==="svgOrigin"){pU(Q,F,1,w,0,this);continue}else if(M in OY){cz(this,T,M,L,I?eQ(L,I+F):F);continue}else if(M==="smoothOrigin"){MQ(this,T,"smooth",T.smooth,F);continue}else if(M==="force3D"){T[M]=F;continue}else if(M==="transform"){pz(this,F,Q);continue}}else if(!(M in U))M=o$(M)||M;if(P||(N||N===0)&&(L||L===0)&&!Ez.test(F)&&M in U){if(V=(X+"").substr((L+"").length),N||(N=0),A=wJ(F)||(M in D8.units?D8.units[M]:V),V!==A&&(L=zQ(Q,M,X,A)),this._pt=new eJ(this._pt,P?T:U,M,L,(I?eQ(L,I+N):N)-L,!P&&(A==="px"||M==="zIndex")&&$.autoRound!==!1?jz:dU),this._pt.u=A||0,V!==A&&A!=="%")this._pt.b=X,this._pt.r=Pz}else if(!(M in U)){if(M in Q)this.add(Q,M,X||Q[M],I?I+F:F,K,W);else if(M!=="parseTransform"){sK(M,F);continue}}else vz.call(this,Q,M,X,I?I+F:F);P||(M in U?S.push(M,0,U[M]):typeof Q[M]==="function"?S.push(M,2,Q[M]()):S.push(M,1,X||Q[M])),H.push(M)}}_&&gU(this)},render:function J(Q,$){if($.tween._time||!nU()){var Z=$._pt;while(Z)Z.r(Q,Z.d),Z=Z._next}else $.styles.revert()},get:c7,aliases:A7,getSetter:function J(Q,$,Z){var K=A7[$];return K&&K.indexOf(",")<0&&($=K),$ in p7&&$!==R8&&(Q._gsap.x||c7(Q,"x"))?Z&&a1===Z?$==="scale"?yz:_z:(a1=Z||{})&&($==="scale"?wz:hz):Q.style&&!oK(Q.style[$])?Tz:~$.indexOf("-")?Sz:aK(Q,$)},core:{_removeProperty:W$,_getMatrix:sU}};mJ.utils.checkPrefix=o$;mJ.core.getStyleSaver=GY;(function(J,Q,$,Z){var K=tJ(J+","+Q+","+$,function(W){p7[W]=1});tJ(Q,function(W){D8.units[W]="deg",OY[W]=1}),A7[K[13]]=J+","+Q,tJ(Z,function(W){var H=W.split(":");A7[H[1]]=K[H[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");tJ("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(J){D8.units[J]="px"});mJ.registerPlugin(iU);var T8=mJ.registerPlugin(iU)||mJ,I3=T8.core.Tween;function LY(J,Q){for(var $=0;$q)W=K,K=B,U=H,H=V;else if(Z)K+=B;else K=W+(B-W)/(V-U)*(H-U)},N=function Y(){W=K=Z?0:K,U=H=0},L=function Y(B){var M=U,V=W,A=NZ();return(B||B===0)&&B!==K&&F(B),H===U||A-U>X?0:(K+(Z?V:-V))/((Z?A:H)-M)*1000};return{update:F,reset:N,getVelocity:L}},XZ=function J(Q,$){return $&&!Q._gsapAllow&&Q.preventDefault(),Q.changedTouches?Q.changedTouches[0]:Q},RY=function J(Q){var $=Math.max.apply(Math,Q),Z=Math.min.apply(Math,Q);return Math.abs($)>=Math.abs(Z)?$:Z},AY=function J(){YZ=hJ.core.globals().ScrollTrigger,YZ&&YZ.core&&oz()},IY=function J(Q){if(hJ=Q||kY(),!$W&&hJ&&typeof document!=="undefined"&&document.body)S8=window,kQ=document,VQ=kQ.documentElement,i$=kQ.body,MY=[S8,kQ,VQ,i$],nz=hJ.utils.clamp,zY=hJ.core.context||function(){},H$="onpointerenter"in i$?"pointer":"mouse",BY=JJ.isTouch=S8.matchMedia&&S8.matchMedia("(hover: none), (pointer: coarse)").matches?1:("ontouchstart"in S8)||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,W7=JJ.eventTypes=("ontouchstart"in VQ?"touchstart,touchmove,touchcancel,touchend":!("onpointerdown"in VQ)?"mousedown,mousemove,mouseup,mouseup":"pointerdown,pointermove,pointercancel,pointerup").split(","),setTimeout(function(){return VY=0},500),AY(),$W=1;return $W};cJ.op=RJ;a0.cache=0;var JJ=function(){function J($){this.init($)}var Q=J.prototype;return Q.init=function $(Z){$W||IY(hJ)||console.warn("Please gsap.registerPlugin(Observer)"),YZ||AY();var{tolerance:K,dragMinimum:W,type:H,target:U,lineHeight:q,debounce:X,preventDefault:F,onStop:N,onStopDelay:L,ignore:Y,wheelSpeed:B,event:M,onDragStart:V,onDragEnd:A,onDrag:I,onPress:P,onRelease:j,onRight:T,onLeft:w,onUp:_,onDown:S,onChangeX:y,onChangeY:f,onChange:u,onToggleX:v,onToggleY:m,onHover:l,onHoverEnd:H0,onMove:N0,ignoreCheck:Q0,isNormalizer:Z0,onGestureStart:D0,onGestureEnd:b,onWheel:Y0,onEnable:V0,onDisable:f0,onClick:z0,scrollSpeed:i0,capture:x0,allowClicks:o0,lockAxis:m0,onLockAxis:D9}=Z;this.target=U=$8(U)||VQ,this.vars=Z,Y&&(Y=hJ.utils.toArray(Y)),K=K||0.000000001,W=W||0,B=B||1,i0=i0||1,H=H||"wheel,touch,pointer",X=X!==!1,q||(q=parseFloat(S8.getComputedStyle(i$).lineHeight)||22);var N9,J9,Z9,g0,$0,M0,K9,o=this,A9=0,PJ=0,vJ=Z.passive||!F&&Z.passive!==!1,O9=n7(U,cJ),C=n7(U,RJ),R=O9(),k=C(),x=~H.indexOf("touch")&&!~H.indexOf("pointer")&&W7[0]==="pointerdown",c=OZ(U),s=U.ownerDocument||kQ,K0=[0,0,0],j0=[0,0,0],_0=0,I0=function p(){return _0=NZ()},T0=function p(e,U0){return(o.event=e)&&Y&&sz(e.target,Y)||U0&&x&&e.pointerType!=="touch"||Q0&&Q0(e,U0)},c0=function p(){o._vx.reset(),o._vy.reset(),J9.pause(),N&&N(o)},M9=function p(){var e=o.deltaX=RY(K0),U0=o.deltaY=RY(j0),t=Math.abs(e)>=K,a=Math.abs(U0)>=K;if(u&&(t||a)&&u(o,e,U0,K0,j0),t)T&&o.deltaX>0&&T(o),w&&o.deltaX<0&&w(o),y&&y(o),v&&o.deltaX<0!==A9<0&&v(o),A9=o.deltaX,K0[0]=K0[1]=K0[2]=0;if(a)S&&o.deltaY>0&&S(o),_&&o.deltaY<0&&_(o),f&&f(o),m&&o.deltaY<0!==PJ<0&&m(o),PJ=o.deltaY,j0[0]=j0[1]=j0[2]=0;if(g0||Z9){if(N0&&N0(o),Z9)V&&Z9===1&&V(o),I&&I(o),Z9=0;g0=!1}if(M0&&!(M0=!1)&&D9&&D9(o),$0)Y0(o),$0=!1;N9=0},W9=function p(e,U0,t){K0[t]+=e,j0[t]+=U0,o._vx.update(e),o._vy.update(U0),X?N9||(N9=requestAnimationFrame(M9)):M9()},b9=function p(e,U0){if(m0&&!K9)o.axis=K9=Math.abs(e)>Math.abs(U0)?"x":"y",M0=!0;if(K9!=="y")K0[2]+=e,o._vx.update(e,!0);if(K9!=="x")j0[2]+=U0,o._vy.update(U0,!0);X?N9||(N9=requestAnimationFrame(M9)):M9()},l9=function p(e){if(T0(e,1))return;e=XZ(e,F);var{clientX:U0,clientY:t}=e,a=U0-o.x,W0=t-o.y,R0=o.isDragging;if(o.x=U0,o.y=t,R0||(a||W0)&&(Math.abs(o.startX-U0)>=W||Math.abs(o.startY-t)>=W))Z9=R0?2:1,R0||(o.isDragging=!0),b9(a,W0)},E9=o.onPress=function(p){if(T0(p,1)||p&&p.button)return;o.axis=K9=null,J9.pause(),o.isPressed=!0,p=XZ(p),A9=PJ=0,o.startX=o.x=p.clientX,o.startY=o.y=p.clientY,o._vx.reset(),o._vy.reset(),Q8(Z0?U:s,W7[1],l9,vJ,!0),o.deltaX=o.deltaY=0,P&&P(o)},S0=o.onRelease=function(p){if(T0(p,1))return;J8(Z0?U:s,W7[1],l9,!0);var e=!isNaN(o.y-o.startY),U0=o.isDragging,t=U0&&(Math.abs(o.x-o.startX)>3||Math.abs(o.y-o.startY)>3),a=XZ(p);if(!t&&e){if(o._vx.reset(),o._vy.reset(),F&&o0)hJ.delayedCall(0.08,function(){if(NZ()-_0>300&&!p.defaultPrevented){if(p.target.click)p.target.click();else if(s.createEvent){var W0=s.createEvent("MouseEvents");W0.initMouseEvent("click",!0,!0,S8,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),p.target.dispatchEvent(W0)}}})}o.isDragging=o.isGesturing=o.isPressed=!1,N&&U0&&!Z0&&J9.restart(!0),Z9&&M9(),A&&U0&&A(o),j&&j(o,t)},y9=function p(e){return e.touches&&e.touches.length>1&&(o.isGesturing=!0)&&D0(e,o.isDragging)},L9=function p(){return(o.isGesturing=!1)||b(o)},v9=function p(e){if(T0(e))return;var U0=O9(),t=C();W9((U0-R)*i0,(t-k)*i0,1),R=U0,k=t,N&&J9.restart(!0)},g9=function p(e){if(T0(e))return;e=XZ(e,F),Y0&&($0=!0);var U0=(e.deltaMode===1?q:e.deltaMode===2?S8.innerHeight:1)*B;W9(e.deltaX*U0,e.deltaY*U0,0),N&&!Z0&&J9.restart(!0)},y0=function p(e){if(T0(e))return;var{clientX:U0,clientY:t}=e,a=U0-o.x,W0=t-o.y;o.x=U0,o.y=t,g0=!0,N&&J9.restart(!0),(a||W0)&&b9(a,W0)},O0=function p(e){o.event=e,l(o)},d=function p(e){o.event=e,H0(o)},X0=function p(e){return T0(e)||XZ(e,F)&&z0(o)};J9=o._dc=hJ.delayedCall(L||0.25,c0).pause(),o.deltaX=o.deltaY=0,o._vx=KW(0,50,!0),o._vy=KW(0,50,!0),o.scrollX=O9,o.scrollY=C,o.isDragging=o.isGesturing=o.isPressed=!1,zY(this),o.enable=function(p){if(!o.isEnabled){if(Q8(c?s:U,"scroll",aU),H.indexOf("scroll")>=0&&Q8(c?s:U,"scroll",v9,vJ,x0),H.indexOf("wheel")>=0&&Q8(U,"wheel",g9,vJ,x0),H.indexOf("touch")>=0&&BY||H.indexOf("pointer")>=0)Q8(U,W7[0],E9,vJ,x0),Q8(s,W7[2],S0),Q8(s,W7[3],S0),o0&&Q8(U,"click",I0,!0,!0),z0&&Q8(U,"click",X0),D0&&Q8(s,"gesturestart",y9),b&&Q8(s,"gestureend",L9),l&&Q8(U,H$+"enter",O0),H0&&Q8(U,H$+"leave",d),N0&&Q8(U,H$+"move",y0);o.isEnabled=!0,o.isDragging=o.isGesturing=o.isPressed=g0=Z9=!1,o._vx.reset(),o._vy.reset(),R=O9(),k=C(),p&&p.type&&E9(p),V0&&V0(o)}return o},o.disable=function(){if(o.isEnabled){if(s$.filter(function(p){return p!==o&&OZ(p.target)}).length||J8(c?s:U,"scroll",aU),o.isPressed)o._vx.reset(),o._vy.reset(),J8(Z0?U:s,W7[1],l9,!0);J8(c?s:U,"scroll",v9,x0),J8(U,"wheel",g9,x0),J8(U,W7[0],E9,x0),J8(s,W7[2],S0),J8(s,W7[3],S0),J8(U,"click",I0,!0),J8(U,"click",X0),J8(s,"gesturestart",y9),J8(s,"gestureend",L9),J8(U,H$+"enter",O0),J8(U,H$+"leave",d),J8(U,H$+"move",y0),o.isEnabled=o.isPressed=o.isDragging=!1,f0&&f0(o)}},o.kill=o.revert=function(){o.disable();var p=s$.indexOf(o);p>=0&&s$.splice(p,1),l7===o&&(l7=0)},s$.push(o),Z0&&OZ(U)&&(l7=o),o.enable(M)},lz(J,[{key:"velocityX",get:function $(){return this._vx.getVelocity()}},{key:"velocityY",get:function $(){return this._vy.getVelocity()}}]),J}();JJ.version="3.13.0";JJ.create=function(J){return new JJ(J)};JJ.register=IY;JJ.getAll=function(){return s$.slice()};JJ.getById=function(J){return s$.filter(function(Q){return Q.vars.id===J})[0]};kY()&&hJ.registerPlugin(JJ);/*! * ScrollTrigger 3.13.0 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var P0,t$,Q9,h9,w8,k9,Nq,zW,CZ,zZ,DZ,WW,pJ,IW,Wq,K8,EY,CY,e$,mY,tU,cY,Z8,Hq,pY,lY,AQ,Uq,Oq,J6,Fq,kW,qq,eU,HW=1,lJ=Date.now,Jq=lJ(),n8=0,LZ=0,PY=function J(Q,$,Z){var K=y8(Q)&&(Q.substr(0,6)==="clamp("||Q.indexOf("max")>-1);return Z["_"+$+"Clamp"]=K,K?Q.substr(6,Q.length-7):Q},jY=function J(Q,$){return $&&(!y8(Q)||Q.substr(0,6)!=="clamp(")?"clamp("+Q+")":Q},iz=function J(){return LZ&&requestAnimationFrame(J)},TY=function J(){return IW=1},SY=function J(){return IW=0},I7=function J(Q){return Q},RZ=function J(Q){return Math.round(Q*1e5)/1e5||0},nY=function J(){return typeof window!=="undefined"},oY=function J(){return P0||nY()&&(P0=window.gsap)&&P0.registerPlugin&&P0},N$=function J(Q){return!!~Nq.indexOf(Q)},sY=function J(Q){return(Q==="Height"?Fq:Q9["inner"+Q])||w8["client"+Q]||k9["client"+Q]},iY=function J(Q){return o7(Q,"getBoundingClientRect")||(N$(Q)?function(){return MW.width=Q9.innerWidth,MW.height=Fq,MW}:function(){return s7(Q)})},rz=function J(Q,$,Z){var{d:K,d2:W,a:H}=Z;return(H=o7(Q,"getBoundingClientRect"))?function(){return H()[K]}:function(){return($?sY(W):Q["client"+W])||0}},az=function J(Q,$){return!$||~H7.indexOf(Q)?iY(Q):function(){return MW}},E7=function J(Q,$){var{s:Z,d2:K,d:W,a:H}=$;return Math.max(0,(Z="scroll"+K)&&(H=o7(Q,Z))?H()-iY(Q)()[W]:N$(Q)?(w8[Z]||k9[Z])-sY(K):Q[Z]-Q["offset"+K])},UW=function J(Q,$){for(var Z=0;Z0){K-=H;for(U=0;U=K)return Z[U];return Z[U-1]}else{U=Z.length,K+=H;while(U--)if(Z[U]<=K)return Z[U]}return Z[0]}:function(K,W,H){if(H===void 0)H=0.001;var U=$(K);return!W||Math.abs(U-K)Z&&(K*=$/100),Q=Q.substr(0,Z-1);Q=K+(Q in AW?AW[Q]*$:~Q.indexOf("%")?parseFloat(Q)*$/100:parseFloat(Q)||0)}return Q},YW=function J(Q,$,Z,K,W,H,U,q){var{startColor:X,endColor:F,fontSize:N,indent:L,fontWeight:Y}=W,B=h9.createElement("div"),M=N$(Z)||o7(Z,"pinType")==="fixed",V=Q.indexOf("scroller")!==-1,A=M?k9:Z,I=Q.indexOf("start")!==-1,P=I?X:F,j="border-color:"+P+";font-size:"+N+";color:"+P+";font-weight:"+Y+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return j+="position:"+((V||q)&&M?"fixed;":"absolute;"),(V||q||!M)&&(j+=(K===RJ?Dq:Lq)+":"+(H+parseFloat(L))+"px;"),U&&(j+="box-sizing:border-box;text-align:left;width:"+U.offsetWidth+"px;"),B._isStart=I,B.setAttribute("class","gsap-marker-"+Q+($?" marker-"+$:"")),B.style.cssText=j,B.innerText=$||$===0?Q+"-"+$:Q,A.children[0]?A.insertBefore(B,A.children[0]):A.appendChild(B),B._offset=B["offset"+K.op.d2],LW(B,0,K,I),B},LW=function J(Q,$,Z,K){var W={display:"block"},H=Z[K?"os2":"p2"],U=Z[K?"p2":"os2"];Q._isFlipped=K,W[Z.a+"Percent"]=K?-100:0,W[Z.a]=K?"1px":0,W["border"+H+$6]=1,W["border"+U+$6]=0,W[Z.p]=$+"px",P0.set(Q,W)},t0=[],Gq={},PZ,wY=function J(){return lJ()-n8>34&&(PZ||(PZ=requestAnimationFrame(i7)))},a$=function J(){if(!Z8||!Z8.isPressed||Z8.startX>k9.clientWidth){if(a0.cache++,Z8)PZ||(PZ=requestAnimationFrame(i7));else i7();n8||F$("scrollStart"),n8=lJ()}},$q=function J(){lY=Q9.innerWidth,pY=Q9.innerHeight},MZ=function J(Q){a0.cache++,(Q===!0||!pJ&&!cY&&!h9.fullscreenElement&&!h9.webkitFullscreenElement&&(!Hq||lY!==Q9.innerWidth||Math.abs(Q9.innerHeight-pY)>Q9.innerHeight*0.25))&&zW.restart(!0)},O$={},Q4=[],eY=function J(){return TJ(s0,"scrollEnd",J)||q$(!0)},F$=function J(Q){return O$[Q]&&O$[Q].map(function($){return $()})||Q4},_8=[],JN=function J(Q){for(var $=0;$<_8.length;$+=5)if(!Q||_8[$+4]&&_8[$+4].query===Q)_8[$].style.cssText=_8[$+1],_8[$].getBBox&&_8[$].setAttribute("transform",_8[$+2]||""),_8[$+3].uncache=1},Mq=function J(Q,$){var Z;for(K8=0;K8W,U=K._startClamp&&K.start>=W;(H||U)&&K.setPositions(U?W-1:K.start,H?Math.max(U?W:K.start+1,W):K.end,!0)}),xY(!1),qq=0,Z.forEach(function(K){return K&&K.render&&K.render(-1)}),a0.forEach(function(K){if(nJ(K))K.smooth&&requestAnimationFrame(function(){return K.target.style.scrollBehavior="smooth"}),K.rec&&K(K.rec)}),QN(Oq,1),zW.pause(),Y$++,W8=2,i7(2),t0.forEach(function(K){return nJ(K.vars.onRefresh)&&K.vars.onRefresh(K)}),W8=s0.isRefreshing=!1,F$("refresh")},Xq=0,RW=1,EZ,i7=function J(Q){if(Q===2||!W8&&!kW){s0.isUpdating=!0,EZ&&EZ.update(0);var $=t0.length,Z=lJ(),K=Z-Jq>=50,W=$&&t0[0].scroll();if(RW=Xq>W?-1:1,W8||(Xq=W),K){if(n8&&!IW&&Z-n8>200)n8=0,F$("scrollEnd");DZ=Jq,Jq=Z}if(RW<0){K8=$;while(K8-- >0)t0[K8]&&t0[K8].update(0,K);RW=1}else for(K8=0;K8<$;K8++)t0[K8]&&t0[K8].update(0,K);s0.isUpdating=!1}PZ=0},Yq=[rY,aY,Lq,Dq,p8+IZ,p8+kZ,p8+AZ,p8+VZ,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],BW=Yq.concat([G$,X$,"boxSizing","max"+$6,"max"+Rq,"position",p8,BJ,BJ+AZ,BJ+kZ,BJ+IZ,BJ+VZ]),Z4=function J(Q,$,Z){Q6(Z);var K=Q._gsap;if(K.spacerIsNative)Q6(K.spacerState);else if(Q._gsap.swappedIn){var W=$.parentNode;if(W)W.insertBefore(Q,$),W.removeChild($)}Q._gsap.swappedIn=!1},Zq=function J(Q,$,Z,K){if(!Q._gsap.swappedIn){var W=Yq.length,H=$.style,U=Q.style,q;while(W--)q=Yq[W],H[q]=Z[q];if(H.position=Z.position==="absolute"?"absolute":"relative",Z.display==="inline"&&(H.display="inline-block"),U[Lq]=U[Dq]="auto",H.flexBasis=Z.flexBasis||"auto",H.overflow="visible",H.boxSizing="border-box",H[G$]=VW(Q,cJ)+AJ,H[X$]=VW(Q,RJ)+AJ,H[BJ]=U[p8]=U[aY]=U[rY]="0",Q6(K),U[G$]=U["max"+$6]=Z[G$],U[X$]=U["max"+Rq]=Z[X$],U[BJ]=Z[BJ],Q.parentNode!==$)Q.parentNode.insertBefore($,Q),$.appendChild(Q);Q._gsap.swappedIn=!0}},K4=/([A-Z])/g,Q6=function J(Q){if(Q){var $=Q.t.style,Z=Q.length,K=0,W,H;(Q.t._gsap||P0.core.getCache(Q.t)).uncache=1;for(;K20),Z-=Z-w}else Y&&(Q=P0.utils.mapRange(Y.scrollTrigger.start,Y.scrollTrigger.end,0,L,Q)),U&&LW(U,Z,K,!0);if(B)q[B]=Q||-0.001,Q<0&&(Q=0);if(H){var S=Q+Z,y=H._isStart;if(V="scroll"+K.d2,LW(H,S,K,y&&S>20||!y&&(N?Math.max(k9[V],w8[V]):H.parentNode[V])<=S+1),N)X=s7(U),N&&(H.style[K.op.p]=X[K.op.p]-K.op.m-H._offset+AJ)}if(Y&&I)V=s7(I),Y.seek(L),A=s7(I),Y._caScrollDist=V[K.p]-A[K.p],Q=Q/Y._caScrollDist*L;return Y&&Y.seek(M),Y?Q:Math.round(Q)},H4=/(webkit|moz|length|cssText|inset)/i,bY=function J(Q,$,Z,K){if(Q.parentNode!==$){var W=Q.style,H,U;if($===k9){Q._stOrig=W.cssText,U=l8(Q);for(H in U)if(!+H&&!H4.test(H)&&U[H]&&typeof W[H]==="string"&&H!=="0")W[H]=U[H];W.top=Z,W.left=K}else W.cssText=Q._stOrig;P0.core.getCache(Q).uncache=1,$.appendChild(Q)}},ZN=function J(Q,$,Z){var K=$,W=K;return function(H){var U=Math.round(Q());if(U!==K&&U!==W&&Math.abs(U-K)>3&&Math.abs(U-W)>3)H=U,Z&&Z();return W=K,K=Math.round(H),K}},OW=function J(Q,$,Z){var K={};K[$.p]="+="+Z,P0.set(Q,K)},vY=function J(Q,$){var Z=n7(Q,$),K="_scroll"+$.p2,W=function H(U,q,X,F,N){var L=H.tween,Y=q.onComplete,B={};X=X||Z();var M=ZN(Z,X,function(){L.kill(),H.tween=0});return N=F&&N||0,F=F||U-X,L&&L.kill(),q[K]=U,q.inherit=!1,q.modifiers=B,B[K]=function(){return M(X+F*L.ratio+N*L.ratio*L.ratio)},q.onUpdate=function(){a0.cache++,H.tween&&i7()},q.onComplete=function(){H.tween=0,Y&&Y.call(L)},L=H.tween=P0.to(Q,q),L};return Q[K]=Z,Z.wheelHandler=function(){return W.tween&&W.tween.kill()&&(W.tween=0)},SJ(Q,"wheel",Z.wheelHandler),s0.isTouch&&SJ(Q,"touchmove",Z.wheelHandler),W},s0=function(){function J($,Z){t$||J.register(P0)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),Uq(this),this.init($,Z)}var Q=J.prototype;return Q.init=function $(Z,K){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!LZ){this.update=this.refresh=this.kill=I7;return}Z=_Y(y8(Z)||BZ(Z)||Z.nodeType?{trigger:Z}:Z,XW);var W=Z,H=W.onUpdate,U=W.toggleClass,q=W.id,X=W.onToggle,F=W.onRefresh,N=W.scrub,L=W.trigger,Y=W.pin,B=W.pinSpacing,M=W.invalidateOnRefresh,V=W.anticipatePin,A=W.onScrubComplete,I=W.onSnapComplete,P=W.once,j=W.snap,T=W.pinReparent,w=W.pinSpacer,_=W.containerAnimation,S=W.fastScrollEnd,y=W.preventOverlaps,f=Z.horizontal||Z.containerAnimation&&Z.horizontal!==!1?cJ:RJ,u=!N&&N!==0,v=$8(Z.scroller||Q9),m=P0.core.getCache(v),l=N$(v),H0=("pinType"in Z?Z.pinType:o7(v,"pinType")||l&&"fixed")==="fixed",N0=[Z.onEnter,Z.onLeave,Z.onEnterBack,Z.onLeaveBack],Q0=u&&Z.toggleActions.split(" "),Z0="markers"in Z?Z.markers:XW.markers,D0=l?0:parseFloat(l8(v)["border"+f.p2+$6])||0,b=this,Y0=Z.onRefreshInit&&function(){return Z.onRefreshInit(b)},V0=rz(v,l,f),f0=az(v,l),z0=0,i0=0,x0=0,o0=n7(v,f),m0,D9,N9,J9,Z9,g0,$0,M0,K9,o,A9,PJ,vJ,O9,C,R,k,x,c,s,K0,j0,_0,I0,T0,c0,M9,W9,b9,l9,E9,S0,y9,L9,v9,g9,y0,O0,d;if(b._startClamp=b._endClamp=!1,b._dir=f,V*=45,b.scroller=v,b.scroll=_?_.time.bind(_):o0,J9=o0(),b.vars=Z,K=K||Z.animation,"refreshPriority"in Z)mY=1,Z.refreshPriority===-9999&&(EZ=b);if(m.tweenScroll=m.tweenScroll||{top:vY(v,RJ),left:vY(v,cJ)},b.tweenTo=m0=m.tweenScroll[f.p],b.scrubDuration=function(t){if(y9=BZ(t)&&t,!y9)S0&&S0.progress(1).kill(),S0=0;else S0?S0.duration(t):S0=P0.to(K,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:y9,paused:!0,onComplete:function a(){return A&&A(b)}})},K)K.vars.lazy=!1,K._initted&&!b.isReverted||K.vars.immediateRender!==!1&&Z.immediateRender!==!1&&K.duration()&&K.render(0,!0,!0),b.animation=K.pause(),K.scrollTrigger=b,b.scrubDuration(N),l9=0,q||(q=K.vars.id);if(j){if(!U$(j)||j.push)j={snapTo:j};"scrollBehavior"in k9.style&&P0.set(l?[k9,w8]:v,{scrollBehavior:"auto"}),a0.forEach(function(t){return nJ(t)&&t.target===(l?h9.scrollingElement||w8:v)&&(t.smooth=!1)}),N9=nJ(j.snapTo)?j.snapTo:j.snapTo==="labels"?ez(K):j.snapTo==="labelsDirectional"?J4(K):j.directional!==!1?function(t,a){return Bq(j.snapTo)(t,lJ()-i0<500?0:a.direction)}:P0.utils.snap(j.snapTo),L9=j.duration||{min:0.1,max:2},L9=U$(L9)?zZ(L9.min,L9.max):zZ(L9,L9),v9=P0.delayedCall(j.delay||y9/2||0.1,function(){var t=o0(),a=lJ()-i0<500,W0=m0.tween;if((a||Math.abs(b.getVelocity())<10)&&!W0&&!IW&&z0!==t){var R0=(t-g0)/O9,w0=K&&!u?K.totalProgress():R0,E0=a?0:(w0-E9)/(lJ()-DZ)*1000||0,u0=P0.utils.clamp(-R0,1-R0,r$(E0/2)*E0/0.185),H9=R0+(j.inertia===!1?0:u0),q9,l0,r0=j,z9=r0.onStart,b0=r0.onInterrupt,FJ=r0.onComplete;if(q9=N9(H9,b),BZ(q9)||(q9=H9),l0=Math.max(0,Math.round(g0+q9*O9)),t<=$0&&t>=g0&&l0!==t){if(W0&&!W0._initted&&W0.data<=r$(l0-t))return;if(j.inertia===!1)u0=q9-R0;m0(l0,{duration:L9(r$(Math.max(r$(H9-w0),r$(q9-w0))*0.185/E0/0.05||0)),ease:j.ease||"power3",data:r$(l0-t),onInterrupt:function u9(){return v9.restart(!0)&&b0&&b0(b)},onComplete:function u9(){if(b.update(),z0=o0(),K&&!u)S0?S0.resetTo("totalProgress",q9,K._tTime/K._tDur):K.progress(q9);l9=E9=K&&!u?K.totalProgress():b.progress,I&&I(b),FJ&&FJ(b)}},t,u0*O9,l0-t-u0*O9),z9&&z9(b,m0.tween)}}else if(b.isActive&&z0!==t)v9.restart(!0)}).pause()}if(q&&(Gq[q]=b),L=b.trigger=$8(L||Y!==!0&&Y),d=L&&L._gsap&&L._gsap.stRevert,d&&(d=d(b)),Y=Y===!0?L:$8(Y),y8(U)&&(U={targets:L,className:U}),Y){if(B===!1||B===p8||(B=!B&&Y.parentNode&&Y.parentNode.style&&l8(Y.parentNode).display==="flex"?!1:BJ),b.pin=Y,D9=P0.core.getCache(Y),!D9.spacer){if(w)w=$8(w),w&&!w.nodeType&&(w=w.current||w.nativeElement),D9.spacerIsNative=!!w,w&&(D9.spacerState=NW(w));D9.spacer=x=w||h9.createElement("div"),x.classList.add("pin-spacer"),q&&x.classList.add("pin-spacer-"+q),D9.pinState=C=NW(Y)}else C=D9.pinState;Z.force3D!==!1&&P0.set(Y,{force3D:!0}),b.spacer=x=D9.spacer,b9=l8(Y),I0=b9[B+f.os2],s=P0.getProperty(Y),K0=P0.quickSetter(Y,f.a,AJ),Zq(Y,x,b9),k=NW(Y)}if(Z0){PJ=U$(Z0)?_Y(Z0,yY):yY,o=YW("scroller-start",q,v,f,PJ,0),A9=YW("scroller-end",q,v,f,PJ,0,o),c=o["offset"+f.op.d2];var X0=$8(o7(v,"content")||v);if(M0=this.markerStart=YW("start",q,X0,f,PJ,c,0,_),K9=this.markerEnd=YW("end",q,X0,f,PJ,c,0,_),_&&(O0=P0.quickSetter([M0,K9],f.a,AJ)),!H0&&!(H7.length&&o7(v,"fixedMarkers")===!0))tz(l?k9:v),P0.set([o,A9],{force3D:!0}),c0=P0.quickSetter(o,f.a,AJ),W9=P0.quickSetter(A9,f.a,AJ)}if(_){var p=_.vars.onUpdate,e=_.vars.onUpdateParams;_.eventCallback("onUpdate",function(){b.update(0,0,1),p&&p.apply(_,e||[])})}if(b.previous=function(){return t0[t0.indexOf(b)-1]},b.next=function(){return t0[t0.indexOf(b)+1]},b.revert=function(t,a){if(!a)return b.kill(!0);var W0=t!==!1||!b.enabled,R0=pJ;if(W0!==b.isReverted){if(W0)g9=Math.max(o0(),b.scroll.rec||0),x0=b.progress,y0=K&&K.progress();if(M0&&[M0,K9,o,A9].forEach(function(w0){return w0.style.display=W0?"none":"block"}),W0)pJ=b,b.update(W0);if(Y&&(!T||!b.isActive))if(W0)Z4(Y,x,C);else Zq(Y,x,l8(Y),T0);W0||b.update(W0),pJ=R0,b.isReverted=W0}},b.refresh=function(t,a,W0,R0){if((pJ||!b.enabled)&&!a)return;if(Y&&t&&n8){SJ(J,"scrollEnd",eY);return}if(!W8&&Y0&&Y0(b),pJ=b,m0.tween&&!W0)m0.tween.kill(),m0.tween=0;if(S0&&S0.pause(),M&&K)K.revert({kill:!1}).invalidate(),K.getChildren&&K.getChildren(!0,!0,!1).forEach(function(E8){return E8.vars.immediateRender&&E8.render(0,!0,!0)});b.isReverted||b.revert(!0,!0),b._subPinOffset=!1;var w0=V0(),E0=f0(),u0=_?_.duration():E7(v,f),H9=O9<=0.01||!O9,q9=0,l0=R0||0,r0=U$(W0)?W0.end:Z.end,z9=Z.endTrigger||L,b0=U$(W0)?W0.start:Z.start||(Z.start===0||!L?0:Y?"0 0":"0 100%"),FJ=b.pinnedContainer=Z.pinnedContainer&&$8(Z.pinnedContainer,b),u9=L&&Math.max(0,t0.indexOf(b))||0,WJ=u9,DJ,C9,v8,YQ,jJ,d9,A8,y$,g6,$7,Y8,I8,L7;if(Z0&&U$(W0))I8=P0.getProperty(o,f.p),L7=P0.getProperty(A9,f.p);while(WJ-- >0){if(d9=t0[WJ],d9.end||d9.refresh(0,1)||(pJ=b),A8=d9.pin,A8&&(A8===L||A8===Y||A8===FJ)&&!d9.isReverted)$7||($7=[]),$7.unshift(d9),d9.revert(!0,!0);if(d9!==t0[WJ])u9--,WJ--}if(nJ(b0)&&(b0=b0(b)),b0=PY(b0,"start",b),g0=fY(b0,L,w0,f,o0(),M0,o,b,E0,D0,H0,u0,_,b._startClamp&&"_startClamp")||(Y?-0.001:0),nJ(r0)&&(r0=r0(b)),y8(r0)&&!r0.indexOf("+="))if(~r0.indexOf(" "))r0=(y8(b0)?b0.split(" ")[0]:"")+r0;else q9=DW(r0.substr(2),w0),r0=y8(b0)?b0:(_?P0.utils.mapRange(0,_.duration(),_.scrollTrigger.start,_.scrollTrigger.end,g0):g0)+q9,z9=L;r0=PY(r0,"end",b),$0=Math.max(g0,fY(r0||(z9?"100% 0":u0),z9,w0,f,o0()+q9,K9,A9,b,E0,D0,H0,u0,_,b._endClamp&&"_endClamp"))||-0.001,q9=0,WJ=u9;while(WJ--)if(d9=t0[WJ],A8=d9.pin,A8&&d9.start-d9._pinPush<=g0&&!_&&d9.end>0){if(DJ=d9.end-(b._startClamp?Math.max(0,d9.start):d9.start),(A8===L&&d9.start-d9._pinPush=E7(v,f))){if(DJ=l8(Y),YQ=f===RJ,v8=o0(),j0=parseFloat(s(f.a))+l0,!u0&&$0>1){if(Y8=(l?h9.scrollingElement||w8:v).style,Y8={style:Y8,value:Y8["overflow"+f.a.toUpperCase()]},l&&l8(k9)["overflow"+f.a.toUpperCase()]!=="scroll")Y8.style["overflow"+f.a.toUpperCase()]="scroll"}if(Zq(Y,x,DJ),k=NW(Y),C9=s7(Y,!0),y$=H0&&n7(v,YQ?cJ:RJ)(),B){if(T0=[B+f.os2,O9+l0+AJ],T0.t=x,WJ=B===BJ?VW(Y,f)+O9+l0:0,WJ)T0.push(f.d,WJ+AJ),x.style.flexBasis!=="auto"&&(x.style.flexBasis=WJ+AJ);if(Q6(T0),FJ)t0.forEach(function(E8){if(E8.pin===FJ&&E8.vars.pinSpacing!==!1)E8._subPinOffset=!0});H0&&o0(g9)}else WJ=VW(Y,f),WJ&&x.style.flexBasis!=="auto"&&(x.style.flexBasis=WJ+AJ);if(H0)jJ={top:C9.top+(YQ?v8-g0:y$)+AJ,left:C9.left+(YQ?y$:v8-g0)+AJ,boxSizing:"border-box",position:"fixed"},jJ[G$]=jJ["max"+$6]=Math.ceil(C9.width)+AJ,jJ[X$]=jJ["max"+Rq]=Math.ceil(C9.height)+AJ,jJ[p8]=jJ[p8+AZ]=jJ[p8+kZ]=jJ[p8+IZ]=jJ[p8+VZ]="0",jJ[BJ]=DJ[BJ],jJ[BJ+AZ]=DJ[BJ+AZ],jJ[BJ+kZ]=DJ[BJ+kZ],jJ[BJ+IZ]=DJ[BJ+IZ],jJ[BJ+VZ]=DJ[BJ+VZ],R=W4(C,jJ,T),W8&&o0(0);if(K)g6=K._initted,tU(1),K.render(K.duration(),!0,!0),_0=s(f.a)-j0+O9+l0,M9=Math.abs(O9-_0)>1,H0&&M9&&R.splice(R.length-2,2),K.render(0,!0,!0),g6||K.invalidate(!0),K.parent||K.totalTime(K.totalTime()),tU(0);else _0=O9;Y8&&(Y8.value?Y8.style["overflow"+f.a.toUpperCase()]=Y8.value:Y8.style.removeProperty("overflow-"+f.a))}else if(L&&o0()&&!_){C9=L.parentNode;while(C9&&C9!==k9){if(C9._pinOffset)g0-=C9._pinOffset,$0-=C9._pinOffset;C9=C9.parentNode}}if($7&&$7.forEach(function(E8){return E8.revert(!1,!0)}),b.start=g0,b.end=$0,J9=Z9=W8?g9:o0(),!_&&!W8)J90?t0.slice(0,a).reverse():t0.slice(a+1);return(y8(t)?W0.filter(function(R0){return R0.vars.preventOverlaps===t}):W0).filter(function(R0){return b.direction>0?R0.end<=g0:R0.start>=$0})},b.update=function(t,a,W0){if(_&&!W0&&!t)return;var R0=W8===!0?g9:b.scroll(),w0=t?0:(R0-g0)/O9,E0=w0<0?0:w0>1?1:w0||0,u0=b.progress,H9,q9,l0,r0,z9,b0,FJ,u9;if(a){if(Z9=J9,J9=_?o0():R0,j)E9=l9,l9=K&&!u?K.totalProgress():E0}if(V&&Y&&!pJ&&!HW&&n8){if(!E0&&g0R0+(R0-Z9)/(lJ()-DZ)*V)E0=0.9999}if(E0!==u0&&b.enabled){if(H9=b.isActive=!!E0&&E0<1,q9=!!u0&&u0<1,b0=H9!==q9,z9=b0||!!E0!==!!u0,b.direction=E0>u0?1:-1,b.progress=E0,z9&&!pJ){if(l0=E0&&!u0?0:E0===1?1:u0===1?2:3,u)r0=!b0&&Q0[l0+1]!=="none"&&Q0[l0+1]||Q0[l0],u9=K&&(r0==="complete"||r0==="reset"||(r0 in K))}if(y&&(b0||u9)&&(u9||N||!K)&&(nJ(y)?y(b):b.getTrailing(y).forEach(function(v8){return v8.endAnimation()})),!u){if(S0&&!pJ&&!HW)if(S0._dp._time-S0._start!==S0._time&&S0.render(S0._dp._time-S0._start),S0.resetTo)S0.resetTo("totalProgress",E0,K._tTime/K._tDur);else S0.vars.totalProgress=E0,S0.invalidate().restart();else if(K)K.totalProgress(E0,!!(pJ&&(i0||t)))}if(Y){if(t&&B&&(x.style[B+f.os2]=I0),!H0)K0(RZ(j0+_0*E0));else if(z9){if(FJ=!t&&E0>u0&&$0+1>R0&&R0+1>=E7(v,f),T)if(!t&&(H9||FJ)){var WJ=s7(Y,!0),DJ=R0-g0;bY(Y,k9,WJ.top+(f===RJ?DJ:0)+AJ,WJ.left+(f===RJ?0:DJ)+AJ)}else bY(Y,x);Q6(H9||FJ?R:k),M9&&E0<1&&H9||K0(j0+(E0===1&&!FJ?_0:0))}}if(j&&!m0.tween&&!pJ&&!HW&&v9.restart(!0),U&&(b0||P&&E0&&(E0<1||!eU))&&CZ(U.targets).forEach(function(v8){return v8.classList[H9||P?"add":"remove"](U.className)}),H&&!u&&!t&&H(b),z9&&!pJ){if(u){if(u9)if(r0==="complete")K.pause().totalProgress(1);else if(r0==="reset")K.restart(!0).pause();else if(r0==="restart")K.restart(!0);else K[r0]();H&&H(b)}if(b0||!eU){if(X&&b0&&Qq(b,X),N0[l0]&&Qq(b,N0[l0]),P&&(E0===1?b.kill(!1,1):N0[l0]=0),!b0)l0=E0===1?1:3,N0[l0]&&Qq(b,N0[l0])}if(S&&!H9&&Math.abs(b.getVelocity())>(BZ(S)?S:2500))FZ(b.callbackAnimation),S0?S0.progress(1):FZ(K,r0==="reverse"?1:!E0,1)}else if(u&&H&&!pJ)H(b)}if(W9){var C9=_?R0/_.duration()*(_._caScrollDist||0):R0;c0(C9+(o._isFlipped?1:0)),W9(C9)}O0&&O0(-R0/_.duration()*(_._caScrollDist||0))},b.enable=function(t,a){if(!b.enabled){if(b.enabled=!0,SJ(v,"resize",MZ),l||SJ(v,"scroll",a$),Y0&&SJ(J,"refreshInit",Y0),t!==!1)b.progress=x0=0,J9=Z9=z0=o0();a!==!1&&b.refresh()}},b.getTween=function(t){return t&&m0?m0.tween:S0},b.setPositions=function(t,a,W0,R0){if(_){var w0=_.scrollTrigger,E0=_.duration(),u0=w0.end-w0.start;t=w0.start+u0*t/E0,a=w0.start+u0*a/E0}b.refresh(!1,!1,{start:jY(t,W0&&!!b._startClamp),end:jY(a,W0&&!!b._endClamp)},R0),b.update()},b.adjustPinSpacing=function(t){if(T0&&t){var a=T0.indexOf(f.d)+1;T0[a]=parseFloat(T0[a])+t+AJ,T0[1]=parseFloat(T0[1])+t+AJ,Q6(T0)}},b.disable=function(t,a){if(b.enabled){if(t!==!1&&b.revert(!0,!0),b.enabled=b.isActive=!1,a||S0&&S0.pause(),g9=0,D9&&(D9.uncache=1),Y0&&TJ(J,"refreshInit",Y0),v9)v9.pause(),m0.tween&&m0.tween.kill()&&(m0.tween=0);if(!l){var W0=t0.length;while(W0--)if(t0[W0].scroller===v&&t0[W0]!==b)return;TJ(v,"resize",MZ),l||TJ(v,"scroll",a$)}}},b.kill=function(t,a){b.disable(t,a),S0&&!a&&S0.kill(),q&&delete Gq[q];var W0=t0.indexOf(b);if(W0>=0&&t0.splice(W0,1),W0===K8&&RW>0&&K8--,W0=0,t0.forEach(function(R0){return R0.scroller===b.scroller&&(W0=1)}),W0||W8||(b.scroll.rec=0),K)K.scrollTrigger=null,t&&K.revert({kill:!1}),a||K.kill();if(M0&&[M0,K9,o,A9].forEach(function(R0){return R0.parentNode&&R0.parentNode.removeChild(R0)}),EZ===b&&(EZ=0),Y)D9&&(D9.uncache=1),W0=0,t0.forEach(function(R0){return R0.pin===Y&&W0++}),W0||(D9.spacer=0);Z.onKill&&Z.onKill(b)},t0.push(b),b.enable(!1,!1),d&&d(b),K&&K.add&&!O9){var U0=b.update;b.update=function(){b.update=U0,a0.cache++,g0||$0||b.refresh()},P0.delayedCall(0.01,b.update),O9=0.01,g0=$0=0}else b.refresh();Y&&$4()},J.register=function $(Z){if(!t$)P0=Z||oY(),nY()&&window.document&&J.enable(),t$=LZ;return t$},J.defaults=function $(Z){if(Z)for(var K in Z)XW[K]=Z[K];return XW},J.disable=function $(Z,K){LZ=0,t0.forEach(function(H){return H[K?"kill":"disable"](Z)}),TJ(Q9,"wheel",a$),TJ(h9,"scroll",a$),clearInterval(WW),TJ(h9,"touchcancel",I7),TJ(k9,"touchstart",I7),qW(TJ,h9,"pointerdown,touchstart,mousedown",TY),qW(TJ,h9,"pointerup,touchend,mouseup",SY),zW.kill(),UW(TJ);for(var W=0;W0&&H.left+U0&&H.top+U=0&&_8.splice($,5),_8.push(Q,Q.style.cssText,Q.getBBox&&Q.getAttribute("transform"),P0.core.getCache(Q),Uq())}}):_8};s0.revert=function(J,Q){return Mq(!J,Q)};s0.create=function(J,Q){return new s0(J,Q)};s0.refresh=function(J){return J?MZ(!0):(t$||s0.register())&&q$(!0)};s0.update=function(J){return++a0.cache&&i7(J===!0?2:0)};s0.clearScrollMemory=QN;s0.maxScroll=function(J,Q){return E7(J,Q?cJ:RJ)};s0.getScrollFunc=function(J,Q){return n7($8(J),Q?cJ:RJ)};s0.getById=function(J){return Gq[J]};s0.getAll=function(){return t0.filter(function(J){return J.vars.id!=="ScrollSmoother"})};s0.isScrolling=function(){return!!n8};s0.snapDirectional=Bq;s0.addEventListener=function(J,Q){var $=O$[J]||(O$[J]=[]);~$.indexOf(Q)||$.push(Q)};s0.removeEventListener=function(J,Q){var $=O$[J],Z=$&&$.indexOf(Q);Z>=0&&$.splice(Z,1)};s0.batch=function(J,Q){var $=[],Z={},K=Q.interval||0.016,W=Q.batchMax||1e9,H=function q(X,F){var N=[],L=[],Y=P0.delayedCall(K,function(){F(N,L),N=[],L=[]}).pause();return function(B){N.length||Y.restart(!0),N.push(B.trigger),L.push(B),W<=N.length&&Y.progress(1)}},U;for(U in Q)Z[U]=U.substr(0,2)==="on"&&nJ(Q[U])&&U!=="onRefreshInit"?H(U,Q[U]):Q[U];if(nJ(W))W=W(),SJ(s0,"refresh",function(){return W=Q.batchMax()});return CZ(J).forEach(function(q){var X={};for(U in Z)X[U]=Z[U];X.trigger=q,$.push(s0.create(X))}),$};var gY=function J(Q,$,Z,K){return $>K?Q(K):$<0&&Q(0),Z>K?(K-$)/(Z-$):Z<0?$/($-Z):1},Kq=function J(Q,$){if($===!0)Q.style.removeProperty("touch-action");else Q.style.touchAction=$===!0?"auto":$?"pan-"+$+(JJ.isTouch?" pinch-zoom":""):"none";Q===w8&&J(k9,$)},FW={auto:1,scroll:1},U4=function J(Q){var{event:$,target:Z,axis:K}=Q,W=($.changedTouches?$.changedTouches[0]:$).target,H=W._gsap||P0.core.getCache(W),U=lJ(),q;if(!H._isScrollT||U-H._isScrollT>2000){while(W&&W!==k9&&(W.scrollHeight<=W.clientHeight&&W.scrollWidth<=W.clientWidth||!(FW[(q=l8(W)).overflowY]||FW[q.overflowX])))W=W.parentNode;H._isScroll=W&&W!==Z&&!N$(W)&&(FW[(q=l8(W)).overflowY]||FW[q.overflowX]),H._isScrollT=U}if(H._isScroll||K==="x")$.stopPropagation(),$._gsapAllow=!0},KN=function J(Q,$,Z,K){return JJ.create({target:Q,capture:!0,debounce:!1,lockAxis:!0,type:$,onWheel:K=K&&U4,onPress:K,onDrag:K,onScroll:K,onEnable:function W(){return Z&&SJ(h9,JJ.eventTypes[0],dY,!1,!0)},onDisable:function W(){return TJ(h9,JJ.eventTypes[0],dY,!0)}})},q4=/(input|label|select|textarea)/i,uY,dY=function J(Q){var $=q4.test(Q.target.tagName);if($||uY)Q._gsapAllow=!0,uY=$},G4=function J(Q){U$(Q)||(Q={}),Q.preventDefault=Q.isNormalizer=Q.allowClicks=!0,Q.type||(Q.type="wheel,touch"),Q.debounce=!!Q.debounce,Q.id=Q.id||"normalizer";var $=Q,Z=$.normalizeScrollX,K=$.momentum,W=$.allowNestedScroll,H=$.onRelease,U,q,X=$8(Q.target)||w8,F=P0.core.globals().ScrollSmoother,N=F&&F.get(),L=AQ&&(Q.content&&$8(Q.content)||N&&Q.content!==!1&&!N.smooth()&&N.content()),Y=n7(X,RJ),B=n7(X,cJ),M=1,V=(JJ.isTouch&&Q9.visualViewport?Q9.visualViewport.scale*Q9.visualViewport.width:Q9.outerWidth)/Q9.innerWidth,A=0,I=nJ(K)?function(){return K(U)}:function(){return K||2.8},P,j,T=KN(X,Q.type,!0,W),w=function Q0(){return j=!1},_=I7,S=I7,y=function Q0(){q=E7(X,RJ),S=zZ(AQ?1:0,q),Z&&(_=zZ(0,E7(X,cJ))),P=Y$},f=function Q0(){L._gsap.y=RZ(parseFloat(L._gsap.y)+Y.offset)+"px",L.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(L._gsap.y)+", 0, 1)",Y.offset=Y.cacheID=0},u=function Q0(){if(j){requestAnimationFrame(w);var Z0=RZ(U.deltaY/2),D0=S(Y.v-Z0);if(L&&D0!==Y.v+Y.offset){Y.offset=D0-Y.v;var b=RZ((parseFloat(L&&L._gsap.y)||0)-Y.offset);L.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+b+", 0, 1)",L._gsap.y=b+"px",Y.cacheID=a0.cache,i7()}return!0}Y.offset&&f(),j=!0},v,m,l,H0,N0=function Q0(){if(y(),v.isActive()&&v.vars.scrollY>q)Y()>q?v.progress(1)&&Y(q):v.resetTo("scrollY",q)};return L&&P0.set(L,{y:"+=0"}),Q.ignoreCheck=function(Q0){return AQ&&Q0.type==="touchmove"&&u(Q0)||M>1.05&&Q0.type!=="touchstart"||U.isGesturing||Q0.touches&&Q0.touches.length>1},Q.onPress=function(){j=!1;var Q0=M;M=RZ((Q9.visualViewport&&Q9.visualViewport.scale||1)/V),v.pause(),Q0!==M&&Kq(X,M>1.01?!0:Z?!1:"x"),m=B(),l=Y(),y(),P=Y$},Q.onRelease=Q.onGestureStart=function(Q0,Z0){if(Y.offset&&f(),!Z0)H0.restart(!0);else{a0.cache++;var D0=I(),b,Y0;if(Z)b=B(),Y0=b+D0*0.05*-Q0.velocityX/0.227,D0*=gY(B,b,Y0,E7(X,cJ)),v.vars.scrollX=_(Y0);if(b=Y(),Y0=b+D0*0.05*-Q0.velocityY/0.227,D0*=gY(Y,b,Y0,E7(X,RJ)),v.vars.scrollY=S(Y0),v.invalidate().duration(D0).play(0.01),AQ&&v.vars.scrollY>=q||b>=q-1)P0.to({},{onUpdate:N0,duration:D0})}H&&H(Q0)},Q.onWheel=function(){if(v._ts&&v.pause(),lJ()-A>1000)P=0,A=lJ()},Q.onChange=function(Q0,Z0,D0,b,Y0){if(Y$!==P&&y(),Z0&&Z&&B(_(b[2]===Z0?m+(Q0.startX-Q0.x):B()+Z0-b[1])),D0){Y.offset&&f();var V0=Y0[2]===D0,f0=V0?l+Q0.startY-Q0.y:Y()+D0-Y0[1],z0=S(f0);V0&&f0!==z0&&(l+=z0-f0),Y(z0)}(D0||Z0)&&i7()},Q.onEnable=function(){if(Kq(X,Z?!1:"x"),s0.addEventListener("refresh",N0),SJ(Q9,"resize",N0),Y.smooth)Y.target.style.scrollBehavior="auto",Y.smooth=B.smooth=!1;T.enable()},Q.onDisable=function(){Kq(X,!0),TJ(Q9,"resize",N0),s0.removeEventListener("refresh",N0),T.kill()},Q.lockAxis=Q.lockAxis!==!1,U=new JJ(Q),U.iOS=AQ,AQ&&!Y()&&Y(1),AQ&&P0.ticker.add(I7),H0=U._dc,v=P0.to(U,{ease:"power4",paused:!0,inherit:!1,scrollX:Z?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:ZN(Y,Y(),function(){return v.pause()})},onUpdate:i7,onComplete:H0.vars.onComplete}),U};s0.sort=function(J){if(nJ(J))return t0.sort(J);var Q=Q9.pageYOffset||0;return s0.getAll().forEach(function($){return $._sortY=$.trigger?Q+$.trigger.getBoundingClientRect().top:$.start+Q9.innerHeight}),t0.sort(J||function($,Z){return($.vars.refreshPriority||0)*-1e6+($.vars.containerAnimation?1e6:$._sortY)-((Z.vars.containerAnimation?1e6:Z._sortY)+(Z.vars.refreshPriority||0)*-1e6)})};s0.observe=function(J){return new JJ(J)};s0.normalizeScroll=function(J){if(typeof J==="undefined")return Z8;if(J===!0&&Z8)return Z8.enable();if(J===!1){Z8&&Z8.kill(),Z8=J;return}var Q=J instanceof JJ?J:G4(J);return Z8&&Z8.target===Q.target&&Z8.kill(),N$(Q.target)&&(Z8=Q),Q};s0.core={_getVelocityProp:KW,_inputObserver:KN,_scrollers:a0,_proxies:H7,bridge:{ss:function J(){n8||F$("scrollStart"),n8=lJ()},ref:function J(){return pJ}}};oY()&&P0.registerPlugin(s0);/*! * SplitText 3.13.0 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle */var jZ,Z6,kq,X4=()=>kq||CW.register(window.gsap),WN=typeof Intl!=="undefined"?new Intl.Segmenter:0,EW=(J)=>typeof J==="string"?EW(document.querySelectorAll(J)):("length"in J)?Array.from(J):[J],HN=(J)=>EW(J).filter((Q)=>Q instanceof HTMLElement),Vq=[],zq=function(){},Y4=/\s+/g,UN=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),qN={left:0,top:0,width:0,height:0},GN=(J,Q)=>{if(Q){let $=new Set(J.join("").match(Q)||Vq),Z=J.length,K,W,H,U;if($.size)while(--Z>-1){W=J[Z];for(H of $)if(H.startsWith(W)&&H.length>W.length){K=0,U=W;while(H.startsWith(U+=J[Z+ ++K])&&U.lengthwindow.getComputedStyle(J).display==="inline"&&(J.style.display="inline-block"),K6=(J,Q,$)=>Q.insertBefore(typeof J==="string"?document.createTextNode(J):J,$),Aq=(J,Q,$)=>{let Z=Q[J+"sClass"]||"",{tag:K="div",aria:W="auto",propIndex:H=!1}=Q,U=J==="line"?"block":"inline-block",q=Z.indexOf("++")>-1,X=(F)=>{let N=document.createElement(K),L=$.length+1;if(Z&&(N.className=Z+(q?" "+Z+L:"")),H&&N.style.setProperty("--"+J,L+""),W!=="none"&&N.setAttribute("aria-hidden","true"),K!=="span")N.style.position="relative",N.style.display=U;return N.textContent=F,$.push(N),N};return q&&(Z=Z.replace("++","")),X.collection=$,X},N4=(J,Q,$,Z)=>{let K=Aq("line",$,Z),W=window.getComputedStyle(J).textAlign||"left";return(H,U)=>{let q=K("");q.style.textAlign=W,J.insertBefore(q,Q[H]);for(;H{var F;let N=Array.from(J.childNodes),L=0,{wordDelimiter:Y,reduceWhiteSpace:B=!0,prepareText:M}=Q,V=J.getBoundingClientRect(),A=V,I=!B&&window.getComputedStyle(J).whiteSpace.substring(0,3)==="pre",P=0,j=$.collection,T,w,_,S,y,f,u,v,m,l,H0,N0,Q0,Z0,D0,b,Y0,V0;if(typeof Y==="object")_=Y.delimiter||Y,w=Y.replaceWith||"";else w=Y===""?"":Y||" ";T=w!==" ";for(;L-1)f=j[j.length-1],f.appendChild(document.createTextNode(Z?"":b));else f=$(Z?"":b),K6(f,J,S),P&&m===1&&!u&&f.insertBefore(P,f.firstChild);if(Z){H0=WN?GN([...WN.segment(b)].map((f0)=>f0.segment),q):b.match(U)||Vq;for(V0=0;V0A.top&&l.left<=A.left){N0=J.cloneNode(),Q0=J.childNodes[0];while(Q0&&Q0!==f)Z0=Q0,Q0=Q0.nextSibling,N0.appendChild(Z0);J.parentNode.insertBefore(N0,J),K&&XN(N0)}A=l}if(m=y.length?" ":T&&b.slice(-1)===" "?" "+w:w,J,S)}}J.removeChild(S),P=0}else if(S.nodeType===1){if(H&&H.indexOf(S)>-1)j.indexOf(S.previousSibling)>-1&&j[j.length-1].appendChild(S),P=S;else YN(S,Q,$,Z,K,W,H,U,q,!0),P=0;K&&XN(S)}},NN=class J{constructor(Q,$){this.isSplit=!1,X4(),this.elements=HN(Q),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=$,this._split=()=>this.isSplit&&this.split(this.vars);let Z=[],K,W=()=>{let H=Z.length,U;while(H--){U=Z[H];let q=U.element.offsetWidth;if(q!==U.width){U.width=q,this._split();return}}};this._data={orig:Z,obs:typeof ResizeObserver!=="undefined"&&new ResizeObserver(()=>{clearTimeout(K),K=setTimeout(W,200)})},zq(this),this.split($)}split(Q){this.isSplit&&this.revert(),this.vars=Q=Q||this.vars||{};let{type:$="chars,words,lines",aria:Z="auto",deepSlice:K=!0,smartWrap:W,onSplit:H,autoSplit:U=!1,specialChars:q,mask:X}=this.vars,F=$.indexOf("lines")>-1,N=$.indexOf("chars")>-1,L=$.indexOf("words")>-1,Y=N&&!L&&!F,B=q&&("push"in q?new RegExp("(?:"+q.join("|")+")","gu"):q),M=B?new RegExp(B.source+"|"+UN.source,"gu"):UN,V=!!Q.ignore&&HN(Q.ignore),{orig:A,animTime:I,obs:P}=this._data,j;if(N||L||F)this.elements.forEach((T,w)=>{A[w]={element:T,html:T.innerHTML,ariaL:T.getAttribute("aria-label"),ariaH:T.getAttribute("aria-hidden")},Z==="auto"?T.setAttribute("aria-label",(T.textContent||"").trim()):Z==="hidden"&&T.setAttribute("aria-hidden","true");let _=[],S=[],y=[],f=N?Aq("char",Q,_):null,u=Aq("word",Q,S),v,m,l,H0;if(YN(T,Q,u,f,Y,K&&(F||Y),V,M,B,!1),F){let N0=EW(T.childNodes),Q0=N4(T,N0,Q,y),Z0,D0=[],b=0,Y0=N0.map((f0)=>f0.nodeType===1?f0.getBoundingClientRect():qN),V0=qN;for(v=0;vV0.top&&Y0[v].left<=V0.left)Q0(b,v),b=v;V0=Y0[v]}b{var z0;return(z0=f0.parentNode)==null?void 0:z0.removeChild(f0)})}if(!L){for(v=0;v{let w=T.cloneNode();return T.replaceWith(w),w.appendChild(T),T.className&&(w.className=T.className.replace(/(\b\w+\b)/g,"$1-mask")),w.style.overflow="clip",w}));if(this.isSplit=!0,Z6&&(U?Z6.addEventListener("loadingdone",this._split):Z6.status==="loading"&&console.warn("SplitText called before fonts loaded")),(j=H&&H(this))&&j.totalTime)this._data.anim=I?j.totalTime(I):j;return F&&U&&this.elements.forEach((T,w)=>{A[w].width=T.offsetWidth,P&&P.observe(T)}),this}revert(){var Q,$;let{orig:Z,anim:K,obs:W}=this._data;if(W&&W.disconnect(),Z.forEach(({element:H,html:U,ariaL:q,ariaH:X})=>{H.innerHTML=U,q?H.setAttribute("aria-label",q):H.removeAttribute("aria-label"),X?H.setAttribute("aria-hidden",X):H.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=Z.length=this.masks.length=0,this.isSplit=!1,Z6==null||Z6.removeEventListener("loadingdone",this._split),K)this._data.animTime=K.totalTime(),K.revert();return($=(Q=this.vars).onRevert)==null||$.call(Q,this),this}static create(Q,$){return new J(Q,$)}static register(Q){if(jZ=jZ||Q||window.gsap,jZ)EW=jZ.utils.toArray,zq=jZ.core.context||zq;if(!kq&&window.innerWidth>0)Z6=document.fonts,kq=!0}};NN.version="3.13.0";var CW=NN;/*! * matrix 3.13.0 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var r7,D$,Pq,TW,TZ,PW,jW,SZ,U7="transform",Cq=U7+"Origin",ON,FN=function J(Q){var $=Q.ownerDocument||Q;if(!(U7 in Q.style)&&"msTransform"in Q.style)U7="msTransform",Cq=U7+"Origin";while($.parentNode&&($=$.parentNode));if(D$=window,jW=new IQ,$){r7=$,Pq=$.documentElement,TW=$.body,SZ=r7.createElementNS("http://www.w3.org/2000/svg","g"),SZ.style.transform="none";var Z=$.createElement("div"),K=$.createElement("div"),W=$&&($.body||$.firstElementChild);if(W&&W.appendChild)W.appendChild(Z),Z.appendChild(K),Z.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),ON=K.offsetParent!==Z,W.removeChild(Z)}return $},O4=function J(Q){var $,Z;while(Q&&Q!==TW){if(Z=Q._gsap,Z&&Z.uncache&&Z.get(Q,"x"),Z&&!Z.scaleX&&!Z.scaleY&&Z.renderTransform)Z.scaleX=Z.scaleY=0.0001,Z.renderTransform(1,Z),$?$.push(Z):$=[Z];Q=Q.parentNode}return $},DN=[],LN=[],F4=function J(){return D$.pageYOffset||r7.scrollTop||Pq.scrollTop||TW.scrollTop||0},D4=function J(){return D$.pageXOffset||r7.scrollLeft||Pq.scrollLeft||TW.scrollLeft||0},jq=function J(Q){return Q.ownerSVGElement||((Q.tagName+"").toLowerCase()==="svg"?Q:null)},L4=function J(Q){if(D$.getComputedStyle(Q).position==="fixed")return!0;if(Q=Q.parentNode,Q&&Q.nodeType===1)return J(Q)},Iq=function J(Q,$){if(Q.parentNode&&(r7||FN(Q))){var Z=jq(Q),K=Z?Z.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",W=Z?$?"rect":"g":"div",H=$!==2?0:100,U=$===3?100:0,q="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",X=r7.createElementNS?r7.createElementNS(K.replace(/^https/,"http"),W):r7.createElement(W);if($)if(!Z){if(!TZ)TZ=J(Q),TZ.style.cssText=q;X.style.cssText=q+"width:0.1px;height:0.1px;top:"+U+"px;left:"+H+"px",TZ.appendChild(X)}else PW||(PW=J(Q)),X.setAttribute("width",0.01),X.setAttribute("height",0.01),X.setAttribute("transform","translate("+H+","+U+")"),PW.appendChild(X);return X}throw"Need document and parent."},R4=function J(Q){var $=new IQ,Z=0;for(;Z1?R4(X):X.getItem(0).matrix,N=X.a*F.x+X.c*F.y,L=X.b*F.x+X.d*F.y;else X=new IQ,N=L=0;if($&&Q.tagName.toLowerCase()==="g")N=L=0;(K?Z:H).appendChild(q),q.setAttribute("transform","matrix("+X.a+","+X.b+","+X.c+","+X.d+","+(X.e+N)+","+(X.f+L)+")")}else{if(N=L=0,ON){X=Q.offsetParent,F=Q;while(F&&(F=F.parentNode)&&F!==X&&F.parentNode)if((D$.getComputedStyle(F)[U7]+"").length>4)N=F.offsetLeft,L=F.offsetTop,F=0}if(Y=D$.getComputedStyle(Q),Y.position!=="absolute"&&Y.position!=="fixed"){X=Q.offsetParent;while(H&&H!==X)N+=H.scrollLeft||0,L+=H.scrollTop||0,H=H.parentNode}F=q.style,F.top=Q.offsetTop-L+"px",F.left=Q.offsetLeft-N+"px",F[U7]=Y[U7],F[Cq]=Y[Cq],F.position=Y.position==="fixed"?"fixed":"absolute",U.appendChild(q)}return q},Eq=function J(Q,$,Z,K,W,H,U){return Q.a=$,Q.b=Z,Q.c=K,Q.d=W,Q.e=H,Q.f=U,Q},IQ=function(){function J($,Z,K,W,H,U){if($===void 0)$=1;if(Z===void 0)Z=0;if(K===void 0)K=0;if(W===void 0)W=1;if(H===void 0)H=0;if(U===void 0)U=0;Eq(this,$,Z,K,W,H,U)}var Q=J.prototype;return Q.inverse=function $(){var Z=this.a,K=this.b,W=this.c,H=this.d,U=this.e,q=this.f,X=Z*H-K*W||0.0000000001;return Eq(this,H/X,-K/X,-W/X,Z/X,(W*q-H*U)/X,-(Z*q-K*U)/X)},Q.multiply=function $(Z){var K=this.a,W=this.b,H=this.c,U=this.d,q=this.e,X=this.f,F=Z.a,N=Z.c,L=Z.b,Y=Z.d,B=Z.e,M=Z.f;return Eq(this,F*K+L*H,F*W+L*U,N*K+Y*H,N*W+Y*U,q+B*K+M*H,X+B*W+M*U)},Q.clone=function $(){return new J(this.a,this.b,this.c,this.d,this.e,this.f)},Q.equals=function $(Z){var K=this.a,W=this.b,H=this.c,U=this.d,q=this.e,X=this.f;return K===Z.a&&W===Z.b&&H===Z.c&&U===Z.d&&q===Z.e&&X===Z.f},Q.apply=function $(Z,K){if(K===void 0)K={};var{x:W,y:H}=Z,U=this.a,q=this.b,X=this.c,F=this.d,N=this.e,L=this.f;return K.x=W*U+H*X+N||0,K.y=W*q+H*F+L||0,K},J}();function EQ(J,Q,$,Z){if(!J||!J.parentNode||(r7||FN(J)).documentElement===J)return new IQ;var K=O4(J),W=jq(J),H=W?DN:LN,U=M4(J,$),q=H[0].getBoundingClientRect(),X=H[1].getBoundingClientRect(),F=H[2].getBoundingClientRect(),N=U.parentNode,L=!Z&&L4(J),Y=new IQ((X.left-q.left)/100,(X.top-q.top)/100,(F.left-q.left)/100,(F.top-q.top)/100,q.left+(L?0:D4()),q.top+(L?0:F4()));if(N.removeChild(U),K){q=K.length;while(q--)X=K[q],X.scaleX=X.scaleY=0,X.renderTransform(1,X)}return Q?Y.inverse():Y}function RN(J){if(J===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return J}function z4(J,Q){J.prototype=Object.create(Q.prototype),J.prototype.constructor=J,J.__proto__=Q}/*! * Draggable 3.13.0 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var X9,T9,h8,X7,e7,Tq,t7,hq,yZ,TQ,jN,xq,bZ,gq,wZ,q7,hZ,yW,TN,fq,hW=0,SN=function J(){return typeof window!=="undefined"},_N=function J(){return X9||SN()&&(X9=window.gsap)&&X9.registerPlugin&&X9},jQ=function J(Q){return typeof Q==="function"},xZ=function J(Q){return typeof Q==="object"},G7=function J(Q){return typeof Q==="undefined"},wW=function J(){return!1},fZ="transform",bq="transformOrigin",CQ=function J(Q){return Math.round(Q*1e4)/1e4},_Z=Array.isArray,SW=function J(Q,$){var Z=h8.createElementNS?h8.createElementNS(($||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),Q):h8.createElement(Q);return Z.style?Z:h8.createElement(Q)},BN=180/Math.PI,L$=100000000000000000000,k4=new IQ,PQ=Date.now||function(){return new Date().getTime()},B$=[],U6={},V4=0,A4=/^(?:a|input|textarea|button|select)$/i,MN=0,W6={},a7={},yN=function J(Q,$){var Z={},K;for(K in Q)Z[K]=$?Q[K]*$:Q[K];return Z},I4=function J(Q,$){for(var Z in $)if(!(Z in Q))Q[Z]=$[Z];return Q},zN=function J(Q,$){var Z=Q.length,K;while(Z--)$?Q[Z].style.touchAction=$:Q[Z].style.removeProperty("touch-action"),K=Q[Z].children,K&&K.length&&J(K,$)},wN=function J(){return B$.forEach(function(Q){return Q()})},E4=function J(Q){if(B$.push(Q),B$.length===1)X9.ticker.add(wN)},kN=function J(){return!B$.length&&X9.ticker.remove(wN)},VN=function J(Q){var $=B$.length;while($--)if(B$[$]===Q)B$.splice($,1);X9.to(kN,{overwrite:!0,delay:15,duration:0,onComplete:kN,data:"_draggable"})},C4=function J(Q,$){for(var Z in $)if(!(Z in Q))Q[Z]=$[Z];return Q},IJ=function J(Q,$,Z,K){if(Q.addEventListener){var W=bZ[$];K=K||(jN?{passive:!1}:null),Q.addEventListener(W||$,Z,K),W&&$!==W&&Q.addEventListener($,Z,K)}},MJ=function J(Q,$,Z,K){if(Q.removeEventListener){var W=bZ[$];Q.removeEventListener(W||$,Z,K),W&&$!==W&&Q.removeEventListener($,Z,K)}},o8=function J(Q){Q.preventDefault&&Q.preventDefault(),Q.preventManipulation&&Q.preventManipulation()},P4=function J(Q,$){var Z=Q.length;while(Z--)if(Q[Z].identifier===$)return!0},j4=function J(Q){gq=Q.touches&&hW2||_<-2)&&!w){if(X=Q.scrollLeft,X9.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-X),$.onKill)$.onKill();return}if(T=-T,T<0)U=T-0.5|0,T=0;else if(T>Y)U=T-Y|0,T=Y;else U=0;if(U||S){if(!this._skip)K[fZ]=P+-U+"px,"+-H+j;if(U+L>=0)K.paddingRight=U+L+"px"}Q.scrollLeft=T|0,X=Q.scrollLeft},this.top=function(T,w){if(!arguments.length)return-(Q.scrollTop+H);var _=Q.scrollTop-q,S=H;if((_>2||_<-2)&&!w){if(q=Q.scrollTop,X9.killTweensOf(this,{top:1,scrollTop:1}),this.top(-q),$.onKill)$.onKill();return}if(T=-T,T<0)H=T-0.5|0,T=0;else if(T>B)H=T-B|0,T=B;else H=0;if(H||S){if(!this._skip)K[fZ]=P+-U+"px,"+-H+j}Q.scrollTop=T|0,q=Q.scrollTop},this.maxScrollTop=function(){return B},this.maxScrollLeft=function(){return Y},this.disable=function(){W=Z.firstChild;while(W)I=W.nextSibling,Q.appendChild(W),W=I;if(Q===Z.parentNode)Q.removeChild(Z)},this.enable=function(){if(W=Q.firstChild,W===Z)return;while(W)I=W.nextSibling,Z.appendChild(W),W=I;Q.appendChild(Z),this.calibrate()},this.calibrate=function(T){var w=Q.clientWidth===M,_,S,y;if(q=Q.scrollTop,X=Q.scrollLeft,w&&Q.clientHeight===V&&Z.offsetHeight===A&&F===Q.scrollWidth&&N===Q.scrollHeight&&!T)return;if(H||U)S=this.left(),y=this.top(),this.left(-Q.scrollLeft),this.top(-Q.scrollTop);if(_=vZ(Q),!w||T){if(K.display="block",K.width="auto",K.paddingRight="0px",L=Math.max(0,Q.scrollWidth-Q.clientWidth),L)L+=parseFloat(_.paddingLeft)+(vq?parseFloat(_.paddingRight):0)}if(K.display="inline-block",K.position="relative",K.overflow="visible",K.verticalAlign="top",K.boxSizing="content-box",K.width="100%",K.paddingRight=L+"px",vq)K.paddingBottom=_.paddingBottom;if(M=Q.clientWidth,V=Q.clientHeight,F=Q.scrollWidth,N=Q.scrollHeight,Y=Q.scrollWidth-M,B=Q.scrollHeight-V,A=Z.offsetHeight,K.display="block",S||y)this.left(S),this.top(y)},this.content=Z,this.element=Q,this._skip=!1,this.enable()},wq=function J(Q){if(SN()&&document.body){var $=window&&window.navigator;T9=window,h8=document,X7=h8.documentElement,e7=h8.body,Tq=SW("div"),yW=!!window.PointerEvent,t7=SW("div"),t7.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",hZ=t7.style.cursor==="grab"?"grab":"move",wZ=$&&$.userAgent.toLowerCase().indexOf("android")!==-1,xq="ontouchstart"in X7&&"orientation"in T9||$&&($.MaxTouchPoints>0||$.msMaxTouchPoints>0),vq=function(){var Z=SW("div"),K=SW("div"),W=K.style,H=e7,U;return W.display="inline-block",W.position="relative",Z.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",Z.appendChild(K),H.appendChild(Z),U=K.offsetHeight+18>Z.scrollHeight,H.removeChild(Z),U}(),bZ=function(Z){var K=Z.split(","),W=("onpointerdown"in Tq?"pointerdown,pointermove,pointerup,pointercancel":("onmspointerdown"in Tq)?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":Z).split(","),H={},U=4;while(--U>-1)H[K[U]]=W[U],H[W[U]]=K[U];try{X7.addEventListener("test",null,Object.defineProperty({},"passive",{get:function q(){jN=1}}))}catch(q){}return H}("touchstart,touchmove,touchend,touchcancel"),IJ(h8,"touchcancel",wW),IJ(T9,"touchmove",wW),e7&&e7.addEventListener("touchstart",wW),IJ(h8,"contextmenu",function(){for(var Z in U6)if(U6[Z].isPressed)U6[Z].endDrag()}),X9=hq=_N()}if(X9)q7=X9.plugins.inertia,TN=X9.core.context||function(){},yZ=X9.utils.checkPrefix,fZ=yZ(fZ),bq=yZ(bq),TQ=X9.utils.toArray,fq=X9.core.getStyleSaver,hN=!!yZ("perspective");else if(Q)console.warn("Please gsap.registerPlugin(Draggable)")},w4=function(){function J($){this._listeners={},this.target=$||this}var Q=J.prototype;return Q.addEventListener=function $(Z,K){var W=this._listeners[Z]||(this._listeners[Z]=[]);if(!~W.indexOf(K))W.push(K)},Q.removeEventListener=function $(Z,K){var W=this._listeners[Z],H=W&&W.indexOf(K);H>=0&&W.splice(H,1)},Q.dispatchEvent=function $(Z){var K=this,W;return(this._listeners[Z]||[]).forEach(function(H){return H.call(K,{type:Z,target:K.target})===!1&&(W=!1)}),W},J}(),Y7=function(J){z4(Q,J);function Q($,Z){var K=J.call(this)||this;if(hq||wq(1),$=TQ($)[0],K.styles=fq&&fq($,"transform,left,top"),!q7)q7=X9.plugins.inertia;K.vars=Z=yN(Z||{}),K.target=$,K.x=K.y=K.rotation=0,K.dragResistance=parseFloat(Z.dragResistance)||0,K.edgeResistance=isNaN(Z.edgeResistance)?1:parseFloat(Z.edgeResistance)||0,K.lockAxis=Z.lockAxis,K.autoScroll=Z.autoScroll||0,K.lockedAxis=null,K.allowEventDefault=!!Z.allowEventDefault,X9.getProperty($,"x");var W=(Z.type||"x,y").toLowerCase(),H=~W.indexOf("x")||~W.indexOf("y"),U=W.indexOf("rotation")!==-1,q=U?"rotation":H?"x":"left",X=H?"y":"top",F=!!(~W.indexOf("x")||~W.indexOf("left")||W==="scroll"),N=!!(~W.indexOf("y")||~W.indexOf("top")||W==="scroll"),L=Z.minimumMovement||2,Y=RN(K),B=TQ(Z.trigger||Z.handle||$),M={},V=0,A=!1,I=Z.autoScrollMarginTop||40,P=Z.autoScrollMarginRight||40,j=Z.autoScrollMarginBottom||40,T=Z.autoScrollMarginLeft||40,w=Z.clickableTest||S4,_=0,S=$._gsap||X9.core.getCache($),y=_4($),f=function O0(d,X0){return parseFloat(S.get($,d,X0))},u=$.ownerDocument||h8,v,m,l,H0,N0,Q0,Z0,D0,b,Y0,V0,f0,z0,i0,x0,o0,m0,D9,N9,J9,Z9,g0,$0,M0,K9,o,A9,PJ,vJ,O9,C,R,k,x=function O0(d){return o8(d),d.stopImmediatePropagation&&d.stopImmediatePropagation(),!1},c=function O0(d){if(Y.autoScroll&&Y.isDragging&&(A||m0)){var X0=$,p=Y.autoScroll*15,e,U0,t,a,W0,R0,w0,E0;A=!1,a7.scrollTop=T9.pageYOffset!=null?T9.pageYOffset:u.documentElement.scrollTop!=null?u.documentElement.scrollTop:u.body.scrollTop,a7.scrollLeft=T9.pageXOffset!=null?T9.pageXOffset:u.documentElement.scrollLeft!=null?u.documentElement.scrollLeft:u.body.scrollLeft,a=Y.pointerX-a7.scrollLeft,W0=Y.pointerY-a7.scrollTop;while(X0&&!U0){if(U0=X6(X0.parentNode),e=U0?a7:X0.parentNode,t=U0?{bottom:Math.max(X7.clientHeight,T9.innerHeight||0),right:Math.max(X7.clientWidth,T9.innerWidth||0),left:0,top:0}:e.getBoundingClientRect(),R0=w0=0,N){if(E0=e._gsMaxScrollY-e.scrollTop,E0<0)w0=E0;else if(W0>t.bottom-j&&E0)A=!0,w0=Math.min(E0,p*(1-Math.max(0,t.bottom-W0)/j)|0);else if(W0t.right-P&&E0)A=!0,R0=Math.min(E0,p*(1-Math.max(0,t.right-a)/P)|0);else if(ap?p+(U0-p)*t:U0-1){if(R0=d[t],w0=R0-U0,w0<0)w0=-w0;if(w0=X0&&R0<=p)a=t,W0=w0}return d[a]};return isNaN(d)?function(U0){return U0}:function(){return d*e}},j0=function O0(d,X0,p,e,U0,t,a){if(t=t&&tp?p+(w0-p)*R0:w0U0?U0+(E0-U0)*R0:E0t)W0.x=w0,W0.y=E0}return W0};if(_Z(d))return function(W0){var R0=d.length,w0=0,E0=L$,u0,H9,q9,l0;while(--R0>-1)if(q9=d[R0],u0=q9.x-W0.x,H9=q9.y-W0.y,l0=u0*u0+H9*H9,l0Y0)Y.minX=Y0,Y.maxX=Y0=V0,V0=Y.minX;if(z0>f0)Y.minY=f0,Y.maxY=f0=z0,z0=Y.minY;if(U)Y.minRotation=V0,Y.maxRotation=Y0;Z0=!0}if(Z.liveSnap)if(p=Z.liveSnap===!0?Z.snap||{}:Z.liveSnap,e=_Z(p)||jQ(p),U)N9=K0(e?p:p.rotation,V0,Y0,1),J9=null;else if(p.points)Z9=j0(e?p:p.points,V0,Y0,z0,f0,p.radius,m?-1:1);else{if(F)N9=K0(e?p:p.x||p.left||p.scrollLeft,V0,Y0,m?-1:1);if(N)J9=K0(e?p:p.y||p.top||p.scrollTop,z0,f0,m?-1:1)}},I0=function O0(){Y.isThrowing=!1,GJ(Y,"throwcomplete","onThrowComplete")},T0=function O0(){Y.isThrowing=!1},c0=function O0(d,X0){var p,e,U0,t;if(d&&q7){if(d===!0)if(p=Z.snap||Z.liveSnap||{},e=_Z(p)||jQ(p),d={resistance:(Z.throwResistance||Z.resistance||1000)/(U?10:1)},U)d.rotation=yq(Y,e?p:p.rotation,Y0,V0,1,X0);else{if(F)d[q]=yq(Y,e?p:p.points||p.x||p.left,Y0,V0,m?-1:1,X0||Y.lockedAxis==="x");if(N)d[X]=yq(Y,e?p:p.points||p.y||p.top,f0,z0,m?-1:1,X0||Y.lockedAxis==="y");if(p.points||_Z(p)&&xZ(p[0]))d.linkedProps=q+","+X,d.radius=p.radius}if(Y.isThrowing=!0,t=!isNaN(Z.overshootTolerance)?Z.overshootTolerance:Z.edgeResistance===1?0:1-Y.edgeResistance+0.2,!d.duration)d.duration={max:Math.max(Z.minDuration||0,"maxDuration"in Z?Z.maxDuration:2),min:!isNaN(Z.minDuration)?Z.minDuration:t===0||xZ(d)&&d.resistance>1000?0:0.5,overshoot:t};if(Y.tween=U0=X9.to(m||$,{inertia:d,data:"_draggable",inherit:!1,onComplete:I0,onInterrupt:T0,onUpdate:Z.fastMode?GJ:s,onUpdateParams:Z.fastMode?[Y,"onthrowupdate","onThrowUpdate"]:p&&p.radius?[!1,!0]:[]}),!Z.fastMode){if(m)m._skip=!0;if(U0.render(1e9,!0,!0),s(!0,!0),Y.endX=Y.x,Y.endY=Y.y,U)Y.endRotation=Y.x;if(U0.play(0),s(!0,!0),m)m._skip=!1}}else if(Z0)Y.applyBounds()},M9=function O0(d){var X0=M0,p;if(M0=EQ($.parentNode,!0),d&&Y.isPressed&&!M0.equals(X0||new IQ))p=X0.inverse().apply({x:l,y:H0}),M0.apply(p,p),l=p.x,H0=p.y;if(M0.equals(k4))M0=null},W9=function O0(){var d=1-Y.edgeResistance,X0=y?G6(u):0,p=y?q6(u):0,e,U0,t;if(H)S.x=f(q,"px")+"px",S.y=f(X,"px")+"px",S.renderTransform();if(M9(!1),s8.x=Y.pointerX-X0,s8.y=Y.pointerY-p,M0&&M0.apply(s8,s8),l=s8.x,H0=s8.y,m0)y9(Y.pointerX,Y.pointerY),c(!0);if(R=EQ($),m)_0(),Q0=m.top(),N0=m.left();else{if(b9())s(!0,!0),_0();else Y.applyBounds();if(U)e=$.ownerSVGElement?[S.xOrigin-$.getBBox().x,S.yOrigin-$.getBBox().y]:(vZ($)[bq]||"0 0").split(" "),o0=Y.rotationOrigin=EQ($).apply({x:parseFloat(e[0])||0,y:parseFloat(e[1])||0}),s(!0,!0),U0=Y.pointerX-o0.x-X0,t=o0.y-Y.pointerY+p,N0=Y.x,Q0=Y.y=Math.atan2(t,U0)*BN;else Q0=f(X,"px"),N0=f(q,"px")}if(Z0&&d){if(N0>Y0)N0=Y0+(N0-Y0)/d;else if(N0f0)Q0=f0+(Q0-f0)/d;else if(Q02)?!1:F?"y":"x",C=!o&&!Y.allowEventDefault,C)o8(d),IJ(T9,"touchforcechange",o8);if(d.changedTouches)d=i0=d.changedTouches[0],x0=d.identifier;else if(d.pointerId)x0=d.pointerId;else i0=x0=null;if(hW++,E4(c),H0=Y.pointerY=d.pageY,l=Y.pointerX=d.pageX,GJ(Y,"pressInit","onPressInit"),o||Y.autoScroll)Sq($.parentNode);if($.parentNode&&Y.autoScroll&&!m&&!U&&$.parentNode._gsMaxScrollX&&!t7.parentNode&&!$.getBBox)t7.style.width=$.parentNode.scrollWidth+"px",$.parentNode.appendChild(t7);if(W9(),Y.tween&&Y.tween.kill(),Y.isThrowing=!1,X9.killTweensOf(m||$,M,!0),m&&X9.killTweensOf($,{scrollTo:1},!0),Y.tween=Y.lockedAxis=null,Z.zIndexBoost||!U&&!m&&Z.zIndexBoost!==!1)$.style.zIndex=Q.zIndex++;if(Y.isPressed=!0,D0=!!(Z.onDrag||Y._listeners.drag),b=!!(Z.onMove||Y._listeners.move),Z.cursor!==!1||Z.activeCursor){p=B.length;while(--p>-1)X9.set(B[p],{cursor:Z.activeCursor||Z.cursor||(hZ==="grab"?"grabbing":hZ)})}GJ(Y,"press","onPress")},S0=function O0(d){var X0=d,p,e,U0,t,a,W0;if(!v||gq||!Y.isPressed||!d){C&&d&&v&&o8(d);return}if(Y.pointerEvent=d,p=d.changedTouches,p){if(d=p[0],d!==i0&&d.identifier!==x0){t=p.length;while(--t>-1&&(d=p[t]).identifier!==x0&&d.target!==$);if(t<0)return}}else if(d.pointerId&&x0&&d.pointerId!==x0)return;if($0&&o&&!A9){if(s8.x=d.pageX-(y?G6(u):0),s8.y=d.pageY-(y?q6(u):0),M0&&M0.apply(s8,s8),e=s8.x,U0=s8.y,a=Math.abs(e-l),W0=Math.abs(U0-H0),a!==W0&&(a>L||W0>L)||wZ&&o===A9){if(A9=a>W0&&F?"x":"y",o&&A9!==o)IJ(T9,"touchforcechange",o8);if(Y.vars.lockAxisOnTouchScroll!==!1&&F&&N)Y.lockedAxis=A9==="x"?"y":"x",jQ(Y.vars.onLockAxis)&&Y.vars.onLockAxis.call(Y,X0);if(wZ&&o===A9){L9(X0);return}}}if(!Y.allowEventDefault&&(!o||A9&&o!==A9)&&X0.cancelable!==!1)o8(X0),C=!0;else if(C)C=!1;if(Y.autoScroll)A=!0;y9(d.pageX,d.pageY,b)},y9=function O0(d,X0,p){var e=1-Y.dragResistance,U0=1-Y.edgeResistance,t=Y.pointerX,a=Y.pointerY,W0=Q0,R0=Y.x,w0=Y.y,E0=Y.endX,u0=Y.endY,H9=Y.endRotation,q9=m0,l0,r0,z9,b0,FJ,u9;if(Y.pointerX=d,Y.pointerY=X0,y)d-=G6(u),X0-=q6(u);if(U){if(b0=Math.atan2(o0.y-X0,d-o0.x)*BN,FJ=Y.y-b0,FJ>180)Q0-=360,Y.y=b0;else if(FJ<-180)Q0+=360,Y.y=b0;if(Y.x!==N0||Math.max(Math.abs(l-d),Math.abs(H0-X0))>L)Y.y=b0,z9=N0+(Q0-b0)*e;else z9=N0}else{if(M0)u9=d*M0.a+X0*M0.c+M0.e,X0=d*M0.b+X0*M0.d+M0.f,d=u9;if(r0=X0-H0,l0=d-l,r0-L)r0=0;if(l0-L)l0=0;if((Y.lockAxis||Y.lockedAxis)&&(l0||r0)){if(u9=Y.lockedAxis,!u9){if(Y.lockedAxis=u9=F&&Math.abs(l0)>Math.abs(r0)?"y":N?"x":null,u9&&jQ(Y.vars.onLockAxis))Y.vars.onLockAxis.call(Y,Y.pointerEvent)}if(u9==="y")r0=0;else if(u9==="x")l0=0}z9=CQ(N0+l0*e),b0=CQ(Q0+r0*e)}if((N9||J9||Z9)&&(Y.x!==z9||Y.y!==b0&&!U)){if(Z9)W6.x=z9,W6.y=b0,u9=Z9(W6),z9=CQ(u9.x),b0=CQ(u9.y);if(N9)z9=CQ(N9(z9));if(J9)b0=CQ(J9(b0))}if(Z0){if(z9>Y0)z9=Y0+Math.round((z9-Y0)*U0);else if(z9f0)b0=Math.round(f0+(b0-f0)*U0);else if(b02),t=X9.delayedCall(0.001,l9),a,W0,R0,w0,E0;if($0)MJ($0,"touchend",O0),MJ($0,"touchmove",S0),MJ($0,"touchcancel",O0),MJ(u,"touchstart",AN);else MJ(u,"mousemove",S0);if(MJ(T9,"touchforcechange",o8),!yW||!$0)MJ(u,"mouseup",O0),d&&d.target&&MJ(d.target,"mouseup",O0);if(m0=!1,e)V=MN=PQ(),Y.isDragging=!1;if(VN(c),g0&&!U0){if(d)MJ(d.target,"change",O0),Y.pointerEvent=p;_W(B,!1),GJ(Y,"release","onRelease"),GJ(Y,"click","onClick"),g0=!1;return}W0=B.length;while(--W0>-1)_q(B[W0],"cursor",Z.cursor||(Z.cursor!==!1?hZ:null));if(hW--,d){if(a=d.changedTouches,a){if(d=a[0],d!==i0&&d.identifier!==x0){W0=a.length;while(--W0>-1&&(d=a[W0]).identifier!==x0&&d.target!==$);if(W0<0&&!X0)return}}Y.pointerEvent=p,Y.pointerX=d.pageX,Y.pointerY=d.pageY}if(U0&&p)o8(p),C=!0,GJ(Y,"release","onRelease");else if(p&&!e){if(C=!1,K9&&(Z.snap||Z.bounds))c0(Z.inertia||Z.throwProps);if(GJ(Y,"release","onRelease"),(!wZ||p.type!=="touchmove")&&p.type.indexOf("cancel")===-1){if(GJ(Y,"click","onClick"),PQ()-_<300)GJ(Y,"doubleclick","onDoubleClick");if(w0=p.target||$,_=PQ(),E0=function u0(){if(_!==vJ&&Y.enabled()&&!Y.isPressed&&!p.defaultPrevented){if(w0.click)w0.click();else if(u.createEvent)R0=u.createEvent("MouseEvents"),R0.initMouseEvent("click",!0,!0,T9,1,Y.pointerEvent.screenX,Y.pointerEvent.screenY,Y.pointerX,Y.pointerY,!1,!1,!1,!1,0,null),w0.dispatchEvent(R0)}},!wZ&&!p.defaultPrevented)X9.delayedCall(0.05,E0)}}else{if(c0(Z.inertia||Z.throwProps),!Y.allowEventDefault&&p&&(Z.dragClickables!==!1||!w.call(Y,p.target))&&e&&(!o||A9&&o===A9)&&p.cancelable!==!1)C=!0,o8(p);else C=!1;GJ(Y,"release","onRelease")}return b9()&&t.duration(Y.tween.duration()),e&&GJ(Y,"dragend","onDragEnd"),!0},v9=function O0(d){if(d&&Y.isDragging&&!m){var X0=d.target||$.parentNode,p=X0.scrollLeft-X0._gsScrollX,e=X0.scrollTop-X0._gsScrollY;if(p||e){if(M0)l-=p*M0.a+e*M0.c,H0-=e*M0.d+p*M0.b;else l-=p,H0-=e;X0._gsScrollX+=p,X0._gsScrollY+=e,y9(Y.pointerX,Y.pointerY)}}},g9=function O0(d){var X0=PQ(),p=X0-_<100,e=X0-V<50,U0=p&&vJ===_,t=Y.pointerEvent&&Y.pointerEvent.defaultPrevented,a=p&&O9===_,W0=d.isTrusted||d.isTrusted==null&&p&&U0;if((U0||e&&Y.vars.suppressClickOnDrag!==!1)&&d.stopImmediatePropagation)d.stopImmediatePropagation();if(p&&!(Y.pointerEvent&&Y.pointerEvent.defaultPrevented)&&(!U0||W0&&!a)){if(W0&&U0)O9=_;vJ=_;return}if(Y.isPressed||e||p){if(!W0||!d.detail||!p||t)o8(d)}if(!p&&!e&&!k)d&&d.target&&(Y.pointerEvent=d),GJ(Y,"click","onClick")},y0=function O0(d){return M0?{x:d.x*M0.a+d.y*M0.c+M0.e,y:d.x*M0.b+d.y*M0.d+M0.f}:{x:d.x,y:d.y}};if(D9=Q.get($),D9&&D9.kill(),K.startDrag=function(O0,d){var X0,p,e,U0;if(E9(O0||Y.pointerEvent,!0),d&&!Y.hitTest(O0||Y.pointerEvent))X0=H6(O0||Y.pointerEvent),p=H6($),e=y0({x:X0.left+X0.width/2,y:X0.top+X0.height/2}),U0=y0({x:p.left+p.width/2,y:p.top+p.height/2}),l-=e.x-U0.x,H0-=e.y-U0.y;if(!Y.isDragging)Y.isDragging=k=!0,GJ(Y,"dragstart","onDragStart")},K.drag=S0,K.endDrag=function(O0){return L9(O0||Y.pointerEvent,!0)},K.timeSinceDrag=function(){return Y.isDragging?0:(PQ()-V)/1000},K.timeSinceClick=function(){return(PQ()-_)/1000},K.hitTest=function(O0,d){return Q.hitTest(Y.target,O0,d)},K.getDirection=function(O0,d){var X0=O0==="velocity"&&q7?O0:xZ(O0)&&!U?"element":"start",p,e,U0,t,a,W0;if(X0==="element")a=H6(Y.target),W0=H6(O0);if(p=X0==="start"?Y.x-N0:X0==="velocity"?q7.getVelocity($,q):a.left+a.width/2-(W0.left+W0.width/2),U)return p<0?"counter-clockwise":"clockwise";else if(d=d||2,e=X0==="start"?Y.y-Q0:X0==="velocity"?q7.getVelocity($,X):a.top+a.height/2-(W0.top+W0.height/2),U0=Math.abs(p/e),t=U0<1/d?"":p<0?"left":"right",U0Y0)X0=Y0;else if(X0f0)p=f0;else if(pt._gsMaxScrollY)t.scrollTop=t._gsMaxScrollY;if(F&&t.scrollLeft>t._gsMaxScrollX)t.scrollLeft=t._gsMaxScrollX;U0=t}}}if(Y.isThrowing&&(e||Y.endX>Y0||Y.endXf0||Y.endY0.01||N&&Math.abs(a-Y.y)>0.01&&!U))W9();if(Y.autoScroll)Sq($.parentNode,Y.isDragging),A=Y.isDragging,c(!0),EN($,v9),IN($,v9);return Y},K.enable=function(O0){var d={lazy:!0},X0,p,e;if(Z.cursor!==!1)d.cursor=Z.cursor||hZ;if(X9.utils.checkPrefix("touchCallout"))d.touchCallout="none";if(O0!=="soft"){zN(B,F===N?"none":Z.allowNativeTouchScrolling&&$.scrollHeight===$.clientHeight===($.scrollWidth===$.clientHeight)||Z.allowEventDefault?"manipulation":F?"pan-y":"pan-x"),p=B.length;while(--p>-1){if(e=B[p],yW||IJ(e,"mousedown",E9),IJ(e,"touchstart",E9),IJ(e,"click",g9,!0),X9.set(e,d),e.getBBox&&e.ownerSVGElement&&F!==N)X9.set(e.ownerSVGElement,{touchAction:Z.allowNativeTouchScrolling||Z.allowEventDefault?"manipulation":F?"pan-y":"pan-x"});Z.allowContextMenu||IJ(e,"contextmenu",x)}_W(B,!1)}if(IN($,v9),v=!0,q7&&O0!=="soft")q7.track(m||$,H?"x,y":U?"rotation":"top,left");if($._gsDragID=X0=$._gsDragID||"d"+V4++,U6[X0]=Y,m)m.enable(),m.element._gsDragID=X0;return(Z.bounds||U)&&W9(),Z.bounds&&Y.applyBounds(),Y},K.disable=function(O0){var d=Y.isDragging,X0=B.length,p;while(--X0>-1)_q(B[X0],"cursor",null);if(O0!=="soft"){zN(B,null),X0=B.length;while(--X0>-1)p=B[X0],_q(p,"touchCallout",null),MJ(p,"mousedown",E9),MJ(p,"touchstart",E9),MJ(p,"click",g9,!0),MJ(p,"contextmenu",x);if(_W(B,!0),$0)MJ($0,"touchcancel",L9),MJ($0,"touchend",L9),MJ($0,"touchmove",S0);MJ(u,"mouseup",L9),MJ(u,"mousemove",S0)}if(EN($,v9),v=!1,q7&&O0!=="soft")q7.untrack(m||$,H?"x,y":U?"rotation":"top,left"),Y.tween&&Y.tween.kill();return m&&m.disable(),VN(c),Y.isDragging=Y.isPressed=g0=!1,d&&GJ(Y,"dragend","onDragEnd"),Y},K.enabled=function(O0,d){return arguments.length?O0?Y.enable(d):Y.disable(d):v},K.kill=function(){return Y.isThrowing=!1,Y.tween&&Y.tween.kill(),Y.disable(),X9.set(B,{clearProps:"userSelect"}),delete U6[$._gsDragID],Y},K.revert=function(){this.kill(),this.styles&&this.styles.revert()},~W.indexOf("scroll"))m=K.scrollProxy=new y4($,I4({onKill:function O0(){Y.isPressed&&L9(null)}},Z)),$.style.overflowY=N&&!xq?"auto":"hidden",$.style.overflowX=F&&!xq?"auto":"hidden",$=m.content;if(U)M.rotation=1;else{if(F)M[q]=1;if(N)M[X]=1}return S.force3D="force3D"in Z?Z.force3D:!0,TN(RN(K)),K.enable(),K}return Q.register=function $(Z){X9=Z,wq()},Q.create=function $(Z,K){return hq||wq(!0),TQ(Z).map(function(W){return new Q(W,K)})},Q.get=function $(Z){return U6[(TQ(Z)[0]||{})._gsDragID]},Q.timeSinceDrag=function $(){return(PQ()-MN)/1000},Q.hitTest=function $(Z,K,W){if(Z===K)return!1;var H=H6(Z),U=H6(K),q=H.top,X=H.left,F=H.right,N=H.bottom,L=H.width,Y=H.height,B=U.left>F||U.rightN||U.bottom=L*Y*W||V>=U.width*U.height*W;return M.width>W&&M.height>W},Q}(w4);C4(Y7.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1});Y7.zIndex=1000;Y7.version="3.13.0";_N()&&X9.registerPlugin(Y7);var xN=()=>{return window.matchMedia("(prefers-reduced-motion: reduce)").matches};T8.registerPlugin(s0,Y7);var h4={ease:"expo.out",duration:1.2};T8.defaults(h4);var g3=xN(),S9=T8;class uq{#J=[];add(J,Q=0,$=Symbol()){let Z=this.#J.findIndex((K)=>K.priority>Q);if(Z===-1)this.#J.push({fn:J,priority:Q,id:$});else this.#J.splice(Z,0,{fn:J,priority:Q,id:$});return()=>this.remove($)}remove(J){this.#J=this.#J.filter((Q)=>Q.id!==J)}notify(J){if(this.#J.length<1)return;this.#J.forEach((Q)=>Q.fn(J))}}class fN extends uq{constructor(){super();S9.ticker.add(this.update.bind(this))}update(J,Q){this.notify({deltaTime:J,time:Q*0.01})}}class bN extends uq{width=window.innerWidth;height=window.innerHeight;timeoutId=null;debounceDelay=100;constructor(){super();window.addEventListener("resize",this.update.bind(this))}update(){if(this.timeoutId)window.clearTimeout(this.timeoutId);this.timeoutId=window.setTimeout(()=>{let{innerWidth:J,innerHeight:Q}=window;if(J!==this.width||Q!==this.height)this.width=J,this.height=Q,this.notify({width:this.width,height:this.height});this.timeoutId=null},this.debounceDelay)}}var x4=new fN,C7=new bN;var f4=[],dq=[];function XJ(J){dq.push(J)}function YJ(J){f4.push(J)}function n3(){dq.forEach((J)=>J()),dq.length=0}var vN=[],mq=[];function xW(J,{element:Q}={}){if(Q)vN.push(async()=>{let $=Q.getBoundingClientRect();return $.top0?await J():Promise.resolve()});else vN.push(J)}function fW(J){mq.push(J)}async function o3(){await Promise.allSettled(mq.map((J)=>J())),mq.length=0}function P7(J,{root:Q,rootMargin:$,threshold:Z,autoStart:K,once:W,callback:H}){let U=new gZ(J,{root:Q,rootMargin:$,threshold:Z,autoStart:K,once:W,callback:H});return YJ(()=>{U.destroy()}),U}var cq={};UJ(cq,{default:()=>uN});function uN(J,Q){let $=J,Z=$.querySelector(".aeo-hero-form-w"),K=gsap.utils.toArray(".aeo-grid-el",$);gsap.timeline({defaults:{ease:"power1.out",duration:1}}).from(Z,{autoAlpha:0,scale:1.2}).from(K,{autoAlpha:0,scale:1.05,yPercent:100,stagger:{from:"random",each:0.05}},"> -0.4")}var pq={};UJ(pq,{default:()=>dN});function dN(J,Q){let $=J,Z=gsap.utils.toArray(".aeo-window-card.is-fill",J);gsap.timeline({scrollTrigger:{trigger:J,start:"top bottom",scrub:!1,markers:!1},defaults:{duration:0.8,ease:"power2.out"}}).from(J,{autoAlpha:0,y:30}).from(Z,{autoAlpha:0,duration:0.15,stagger:{each:0.1,start:"center"}},"<0.25")}var U5={};UJ(U5,{default:()=>qO});function mN(J){return J!==null&&typeof J==="object"&&"constructor"in J&&J.constructor===Object}function lq(J={},Q={}){let $=["__proto__","constructor","prototype"];Object.keys(Q).filter((Z)=>$.indexOf(Z)<0).forEach((Z)=>{if(typeof J[Z]==="undefined")J[Z]=Q[Z];else if(mN(Q[Z])&&mN(J[Z])&&Object.keys(Q[Z]).length>0)lq(J[Z],Q[Z])})}var cN={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function oJ(){let J=typeof document!=="undefined"?document:{};return lq(J,cN),J}var b4={document:cN,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function J(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(J){if(typeof setTimeout==="undefined")return J(),null;return setTimeout(J,0)},cancelAnimationFrame(J){if(typeof setTimeout==="undefined")return;clearTimeout(J)}};function QJ(){let J=typeof window!=="undefined"?window:{};return lq(J,b4),J}function pN(J=""){return J.trim().split(" ").filter((Q)=>!!Q.trim())}function lN(J){let Q=J;Object.keys(Q).forEach(($)=>{try{Q[$]=null}catch(Z){}try{delete Q[$]}catch(Z){}})}function Y6(J,Q=0){return setTimeout(J,Q)}function M$(){return Date.now()}function v4(J){let Q=QJ(),$;if(Q.getComputedStyle)$=Q.getComputedStyle(J,null);if(!$&&J.currentStyle)$=J.currentStyle;if(!$)$=J.style;return $}function nq(J,Q="x"){let $=QJ(),Z,K,W,H=v4(J);if($.WebKitCSSMatrix){if(K=H.transform||H.webkitTransform,K.split(",").length>6)K=K.split(", ").map((U)=>U.replace(",",".")).join(", ");W=new $.WebKitCSSMatrix(K==="none"?"":K)}else W=H.MozTransform||H.OTransform||H.MsTransform||H.msTransform||H.transform||H.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),Z=W.toString().split(",");if(Q==="x")if($.WebKitCSSMatrix)K=W.m41;else if(Z.length===16)K=parseFloat(Z[12]);else K=parseFloat(Z[4]);if(Q==="y")if($.WebKitCSSMatrix)K=W.m42;else if(Z.length===16)K=parseFloat(Z[13]);else K=parseFloat(Z[5]);return K||0}function uZ(J){return typeof J==="object"&&J!==null&&J.constructor&&Object.prototype.toString.call(J).slice(8,-1)==="Object"}function g4(J){if(typeof window!=="undefined"&&typeof window.HTMLElement!=="undefined")return J instanceof HTMLElement;return J&&(J.nodeType===1||J.nodeType===11)}function B8(...J){let Q=Object(J[0]),$=["__proto__","constructor","prototype"];for(let Z=1;Z$.indexOf(H)<0);for(let H=0,U=W.length;HK?"next":"prev",X=(N,L)=>{return q==="next"&&N>=L||q==="prev"&&N<=L},F=()=>{if(H=new Date().getTime(),W===null)W=H;let N=Math.max(Math.min((H-W)/U,1),0),L=0.5-Math.cos(N*Math.PI)/2,Y=K+L*(Q-K);if(X(Y,Q))Y=Q;if(J.wrapperEl.scrollTo({[$]:Y}),X(Y,Q)){J.wrapperEl.style.overflow="hidden",J.wrapperEl.style.scrollSnapType="",setTimeout(()=>{J.wrapperEl.style.overflow="",J.wrapperEl.scrollTo({[$]:Y})}),Z.cancelAnimationFrame(J.cssModeFrameID);return}J.cssModeFrameID=Z.requestAnimationFrame(F)};F()}function xJ(J,Q=""){let $=QJ(),Z=[...J.children];if($.HTMLSlotElement&&J instanceof HTMLSlotElement)Z.push(...J.assignedElements());if(!Q)return Z;return Z.filter((K)=>K.matches(Q))}function u4(J,Q){let $=[Q];while($.length>0){let Z=$.shift();if(J===Z)return!0;$.push(...Z.children,...Z.shadowRoot?Z.shadowRoot.children:[],...Z.assignedElements?Z.assignedElements():[])}}function nN(J,Q){let $=QJ(),Z=Q.contains(J);if(!Z&&$.HTMLSlotElement&&Q instanceof HTMLSlotElement){if(Z=[...Q.assignedElements()].includes(J),!Z)Z=u4(J,Q)}return Z}function dZ(J){try{console.warn(J);return}catch(Q){}}function N7(J,Q=[]){let $=document.createElement(J);return $.classList.add(...Array.isArray(Q)?Q:pN(Q)),$}function oN(J,Q){let $=[];while(J.previousElementSibling){let Z=J.previousElementSibling;if(Q){if(Z.matches(Q))$.push(Z)}else $.push(Z);J=Z}return $}function sN(J,Q){let $=[];while(J.nextElementSibling){let Z=J.nextElementSibling;if(Q){if(Z.matches(Q))$.push(Z)}else $.push(Z);J=Z}return $}function JQ(J,Q){return QJ().getComputedStyle(J,null).getPropertyValue(Q)}function z$(J){let Q=J,$;if(Q){$=0;while((Q=Q.previousSibling)!==null)if(Q.nodeType===1)$+=1;return $}return}function O6(J,Q){let $=[],Z=J.parentElement;while(Z){if(Q){if(Z.matches(Q))$.push(Z)}else $.push(Z);Z=Z.parentElement}return $}function mZ(J,Q,$){let Z=QJ();if($)return J[Q==="width"?"offsetWidth":"offsetHeight"]+parseFloat(Z.getComputedStyle(J,null).getPropertyValue(Q==="width"?"margin-right":"margin-top"))+parseFloat(Z.getComputedStyle(J,null).getPropertyValue(Q==="width"?"margin-left":"margin-bottom"));return J.offsetWidth}function $J(J){return(Array.isArray(J)?J:[J]).filter((Q)=>!!Q)}function SQ(J,Q=""){if(typeof trustedTypes!=="undefined")J.innerHTML=trustedTypes.createPolicy("html",{createHTML:($)=>$}).createHTML(Q);else J.innerHTML=Q}var sq;function d4(){let J=QJ(),Q=oJ();return{smoothScroll:Q.documentElement&&Q.documentElement.style&&"scrollBehavior"in Q.documentElement.style,touch:!!(("ontouchstart"in J)||J.DocumentTouch&&Q instanceof J.DocumentTouch)}}function JO(){if(!sq)sq=d4();return sq}var iq;function m4({userAgent:J}={}){let Q=JO(),$=QJ(),Z=$.navigator.platform,K=J||$.navigator.userAgent,W={ios:!1,android:!1},H=$.screen.width,U=$.screen.height,q=K.match(/(Android);?[\s\/]+([\d.]+)?/),X=K.match(/(iPad)(?!\1).*OS\s([\d_]+)/),F=K.match(/(iPod)(.*OS\s([\d_]+))?/),N=!X&&K.match(/(iPhone\sOS|iOS)\s([\d_]+)/),L=Z==="Win32",Y=Z==="MacIntel",B=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];if(!X&&Y&&Q.touch&&B.indexOf(`${H}x${U}`)>=0){if(X=K.match(/(Version)\/([\d.]+)/),!X)X=[0,1,"13_0_0"];Y=!1}if(q&&!L)W.os="android",W.android=!0;if(X||N||F)W.os="ios",W.ios=!0;return W}function QO(J={}){if(!iq)iq=m4(J);return iq}var rq;function c4(){let J=QJ(),Q=QO(),$=!1;function Z(){let U=J.navigator.userAgent.toLowerCase();return U.indexOf("safari")>=0&&U.indexOf("chrome")<0&&U.indexOf("android")<0}if(Z()){let U=String(J.navigator.userAgent);if(U.includes("Version/")){let[q,X]=U.split("Version/")[1].split(" ")[0].split(".").map((F)=>Number(F));$=q<16||q===16&&X<2}}let K=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(J.navigator.userAgent),W=Z(),H=W||K&&Q.ios;return{isSafari:$||W,needPerspectiveFix:$,need3dFix:H,isWebView:K}}function $O(){if(!rq)rq=c4();return rq}function p4({swiper:J,on:Q,emit:$}){let Z=QJ(),K=null,W=null,H=()=>{if(!J||J.destroyed||!J.initialized)return;$("beforeResize"),$("resize")},U=()=>{if(!J||J.destroyed||!J.initialized)return;K=new ResizeObserver((F)=>{W=Z.requestAnimationFrame(()=>{let{width:N,height:L}=J,Y=N,B=L;if(F.forEach(({contentBoxSize:M,contentRect:V,target:A})=>{if(A&&A!==J.el)return;Y=V?V.width:(M[0]||M).inlineSize,B=V?V.height:(M[0]||M).blockSize}),Y!==N||B!==L)H()})}),K.observe(J.el)},q=()=>{if(W)Z.cancelAnimationFrame(W);if(K&&K.unobserve&&J.el)K.unobserve(J.el),K=null},X=()=>{if(!J||J.destroyed||!J.initialized)return;$("orientationchange")};Q("init",()=>{if(J.params.resizeObserver&&typeof Z.ResizeObserver!=="undefined"){U();return}Z.addEventListener("resize",H),Z.addEventListener("orientationchange",X)}),Q("destroy",()=>{q(),Z.removeEventListener("resize",H),Z.removeEventListener("orientationchange",X)})}function l4({swiper:J,extendParams:Q,on:$,emit:Z}){let K=[],W=QJ(),H=(X,F={})=>{let L=new(W.MutationObserver||W.WebkitMutationObserver)((Y)=>{if(J.__preventObserver__)return;if(Y.length===1){Z("observerUpdate",Y[0]);return}let B=function M(){Z("observerUpdate",Y[0])};if(W.requestAnimationFrame)W.requestAnimationFrame(B);else W.setTimeout(B,0)});L.observe(X,{attributes:typeof F.attributes==="undefined"?!0:F.attributes,childList:J.isElement||(typeof F.childList==="undefined"?!0:F).childList,characterData:typeof F.characterData==="undefined"?!0:F.characterData}),K.push(L)},U=()=>{if(!J.params.observer)return;if(J.params.observeParents){let X=O6(J.hostEl);for(let F=0;F{K.forEach((X)=>{X.disconnect()}),K.splice(0,K.length)};Q({observer:!1,observeParents:!1,observeSlideChildren:!1}),$("init",U),$("destroy",q)}var n4={on(J,Q,$){let Z=this;if(!Z.eventsListeners||Z.destroyed)return Z;if(typeof Q!=="function")return Z;let K=$?"unshift":"push";return J.split(" ").forEach((W)=>{if(!Z.eventsListeners[W])Z.eventsListeners[W]=[];Z.eventsListeners[W][K](Q)}),Z},once(J,Q,$){let Z=this;if(!Z.eventsListeners||Z.destroyed)return Z;if(typeof Q!=="function")return Z;function K(...W){if(Z.off(J,K),K.__emitterProxy)delete K.__emitterProxy;Q.apply(Z,W)}return K.__emitterProxy=Q,Z.on(J,K,$)},onAny(J,Q){let $=this;if(!$.eventsListeners||$.destroyed)return $;if(typeof J!=="function")return $;let Z=Q?"unshift":"push";if($.eventsAnyListeners.indexOf(J)<0)$.eventsAnyListeners[Z](J);return $},offAny(J){let Q=this;if(!Q.eventsListeners||Q.destroyed)return Q;if(!Q.eventsAnyListeners)return Q;let $=Q.eventsAnyListeners.indexOf(J);if($>=0)Q.eventsAnyListeners.splice($,1);return Q},off(J,Q){let $=this;if(!$.eventsListeners||$.destroyed)return $;if(!$.eventsListeners)return $;return J.split(" ").forEach((Z)=>{if(typeof Q==="undefined")$.eventsListeners[Z]=[];else if($.eventsListeners[Z])$.eventsListeners[Z].forEach((K,W)=>{if(K===Q||K.__emitterProxy&&K.__emitterProxy===Q)$.eventsListeners[Z].splice(W,1)})}),$},emit(...J){let Q=this;if(!Q.eventsListeners||Q.destroyed)return Q;if(!Q.eventsListeners)return Q;let $,Z,K;if(typeof J[0]==="string"||Array.isArray(J[0]))$=J[0],Z=J.slice(1,J.length),K=Q;else $=J[0].events,Z=J[0].data,K=J[0].context||Q;return Z.unshift(K),(Array.isArray($)?$:$.split(" ")).forEach((H)=>{if(Q.eventsAnyListeners&&Q.eventsAnyListeners.length)Q.eventsAnyListeners.forEach((U)=>{U.apply(K,[H,...Z])});if(Q.eventsListeners&&Q.eventsListeners[H])Q.eventsListeners[H].forEach((U)=>{U.apply(K,Z)})}),Q}};function o4(){let J=this,Q,$,Z=J.el;if(typeof J.params.width!=="undefined"&&J.params.width!==null)Q=J.params.width;else Q=Z.clientWidth;if(typeof J.params.height!=="undefined"&&J.params.height!==null)$=J.params.height;else $=Z.clientHeight;if(Q===0&&J.isHorizontal()||$===0&&J.isVertical())return;if(Q=Q-parseInt(JQ(Z,"padding-left")||0,10)-parseInt(JQ(Z,"padding-right")||0,10),$=$-parseInt(JQ(Z,"padding-top")||0,10)-parseInt(JQ(Z,"padding-bottom")||0,10),Number.isNaN(Q))Q=0;if(Number.isNaN($))$=0;Object.assign(J,{width:Q,height:$,size:J.isHorizontal()?Q:$})}function s4(){let J=this;function Q(f,u){return parseFloat(f.getPropertyValue(J.getDirectionLabel(u))||0)}let $=J.params,{wrapperEl:Z,slidesEl:K,rtlTranslate:W,wrongRTL:H}=J,U=J.virtual&&$.virtual.enabled,q=U?J.virtual.slides.length:J.slides.length,X=xJ(K,`.${J.params.slideClass}, swiper-slide`),F=U?J.virtual.slides.length:X.length,N=[],L=[],Y=[],B=$.slidesOffsetBefore;if(typeof B==="function")B=$.slidesOffsetBefore.call(J);let M=$.slidesOffsetAfter;if(typeof M==="function")M=$.slidesOffsetAfter.call(J);let V=J.snapGrid.length,A=J.slidesGrid.length,I=J.size-B-M,P=$.spaceBetween,j=-B,T=0,w=0;if(typeof I==="undefined")return;if(typeof P==="string"&&P.indexOf("%")>=0)P=parseFloat(P.replace("%",""))/100*I;else if(typeof P==="string")P=parseFloat(P);if(J.virtualSize=-P-B-M,X.forEach((f)=>{if(W)f.style.marginLeft="";else f.style.marginRight="";f.style.marginBottom="",f.style.marginTop=""}),$.centeredSlides&&$.cssMode)N6(Z,"--swiper-centered-offset-before",""),N6(Z,"--swiper-centered-offset-after","");let _=$.grid&&$.grid.rows>1&&J.grid;if(_)J.grid.initSlides(X);else if(J.grid)J.grid.unsetSlides();let S,y=$.slidesPerView==="auto"&&$.breakpoints&&Object.keys($.breakpoints).filter((f)=>{return typeof $.breakpoints[f].slidesPerView!=="undefined"}).length>0;for(let f=0;f1)N.push(J.virtualSize-I)}if(U&&$.loop){let f=Y[0]+P;if($.slidesPerGroup>1){let u=Math.ceil((J.virtual.slidesBefore+J.virtual.slidesAfter)/$.slidesPerGroup),v=f*$.slidesPerGroup;for(let m=0;m{if(!$.cssMode||$.loop)return!0;if(v===X.length-1)return!1;return!0}).forEach((u)=>{u.style[f]=`${P}px`})}if($.centeredSlides&&$.centeredSlidesBounds){let f=0;Y.forEach((v)=>{f+=v+(P||0)}),f-=P;let u=f>I?f-I:0;N=N.map((v)=>{if(v<=0)return-B;if(v>u)return u+M;return v})}if($.centerInsufficientSlides){let f=0;Y.forEach((v)=>{f+=v+(P||0)}),f-=P;let u=(B||0)+(M||0);if(f+u{N[l]=m-v}),L.forEach((m,l)=>{L[l]=m+v})}}if(Object.assign(J,{slides:X,snapGrid:N,slidesGrid:L,slidesSizesGrid:Y}),$.centeredSlides&&$.cssMode&&!$.centeredSlidesBounds){N6(Z,"--swiper-centered-offset-before",`${-N[0]}px`),N6(Z,"--swiper-centered-offset-after",`${J.size/2-Y[Y.length-1]/2}px`);let f=-J.snapGrid[0],u=-J.slidesGrid[0];J.snapGrid=J.snapGrid.map((v)=>v+f),J.slidesGrid=J.slidesGrid.map((v)=>v+u)}if(F!==q)J.emit("slidesLengthChange");if(N.length!==V){if(J.params.watchOverflow)J.checkOverflow();J.emit("snapGridLengthChange")}if(L.length!==A)J.emit("slidesGridLengthChange");if($.watchSlidesProgress)J.updateSlidesOffset();if(J.emit("slidesUpdated"),!U&&!$.cssMode&&($.effect==="slide"||$.effect==="fade")){let f=`${$.containerModifierClass}backface-hidden`,u=J.el.classList.contains(f);if(F<=$.maxBackfaceHiddenSlides){if(!u)J.el.classList.add(f)}else if(u)J.el.classList.remove(f)}}function i4(J){let Q=this,$=[],Z=Q.virtual&&Q.params.virtual.enabled,K=0,W;if(typeof J==="number")Q.setTransition(J);else if(J===!0)Q.setTransition(Q.params.speed);let H=(U)=>{if(Z)return Q.slides[Q.getSlideIndexByData(U)];return Q.slides[U]};if(Q.params.slidesPerView!=="auto"&&Q.params.slidesPerView>1)if(Q.params.centeredSlides)(Q.visibleSlides||[]).forEach((U)=>{$.push(U)});else for(W=0;WQ.slides.length&&!Z)break;$.push(H(U))}else $.push(H(Q.activeIndex));for(W=0;W<$.length;W+=1)if(typeof $[W]!=="undefined"){let U=$[W].offsetHeight;K=U>K?U:K}if(K||K===0)Q.wrapperEl.style.height=`${K}px`}function r4(){let J=this,Q=J.slides,$=J.isElement?J.isHorizontal()?J.wrapperEl.offsetLeft:J.wrapperEl.offsetTop:0;for(let Z=0;Z{if(Q&&!J.classList.contains($))J.classList.add($);else if(!Q&&J.classList.contains($))J.classList.remove($)};function a4(J=this&&this.translate||0){let Q=this,$=Q.params,{slides:Z,rtlTranslate:K,snapGrid:W}=Q;if(Z.length===0)return;if(typeof Z[0].swiperSlideOffset==="undefined")Q.updateSlidesOffset();let H=-J;if(K)H=J;Q.visibleSlidesIndexes=[],Q.visibleSlides=[];let U=$.spaceBetween;if(typeof U==="string"&&U.indexOf("%")>=0)U=parseFloat(U.replace("%",""))/100*Q.size;else if(typeof U==="string")U=parseFloat(U);for(let q=0;q=0&&Y<=Q.size-Q.slidesSizesGrid[q],V=Y>=0&&Y1&&B<=Q.size||Y<=0&&B>=Q.size;if(V)Q.visibleSlides.push(X),Q.visibleSlidesIndexes.push(q);iN(X,V,$.slideVisibleClass),iN(X,M,$.slideFullyVisibleClass),X.progress=K?-N:N,X.originalProgress=K?-L:L}}function t4(J){let Q=this;if(typeof J==="undefined"){let F=Q.rtlTranslate?-1:1;J=Q&&Q.translate&&Q.translate*F||0}let $=Q.params,Z=Q.maxTranslate()-Q.minTranslate(),{progress:K,isBeginning:W,isEnd:H,progressLoop:U}=Q,q=W,X=H;if(Z===0)K=0,W=!0,H=!0;else{K=(J-Q.minTranslate())/Z;let F=Math.abs(J-Q.minTranslate())<1,N=Math.abs(J-Q.maxTranslate())<1;if(W=F||K<=0,H=N||K>=1,F)K=0;if(N)K=1}if($.loop){let F=Q.getSlideIndexByData(0),N=Q.getSlideIndexByData(Q.slides.length-1),L=Q.slidesGrid[F],Y=Q.slidesGrid[N],B=Q.slidesGrid[Q.slidesGrid.length-1],M=Math.abs(J);if(M>=L)U=(M-L)/B;else U=(M+B-Y)/B;if(U>1)U-=1}if(Object.assign(Q,{progress:K,progressLoop:U,isBeginning:W,isEnd:H}),$.watchSlidesProgress||$.centeredSlides&&$.autoHeight)Q.updateSlidesProgress(J);if(W&&!q)Q.emit("reachBeginning toEdge");if(H&&!X)Q.emit("reachEnd toEdge");if(q&&!W||X&&!H)Q.emit("fromEdge");Q.emit("progress",K)}var aq=(J,Q,$)=>{if(Q&&!J.classList.contains($))J.classList.add($);else if(!Q&&J.classList.contains($))J.classList.remove($)};function e4(){let J=this,{slides:Q,params:$,slidesEl:Z,activeIndex:K}=J,W=J.virtual&&$.virtual.enabled,H=J.grid&&$.grid&&$.grid.rows>1,U=(N)=>{return xJ(Z,`.${$.slideClass}${N}, swiper-slide${N}`)[0]},q,X,F;if(W)if($.loop){let N=K-J.virtual.slidesBefore;if(N<0)N=J.virtual.slides.length+N;if(N>=J.virtual.slides.length)N-=J.virtual.slides.length;q=U(`[data-swiper-slide-index="${N}"]`)}else q=U(`[data-swiper-slide-index="${K}"]`);else if(H)q=Q.find((N)=>N.column===K),F=Q.find((N)=>N.column===K+1),X=Q.find((N)=>N.column===K-1);else q=Q[K];if(q){if(!H){if(F=sN(q,`.${$.slideClass}, swiper-slide`)[0],$.loop&&!F)F=Q[0];if(X=oN(q,`.${$.slideClass}, swiper-slide`)[0],$.loop&&!X===0)X=Q[Q.length-1]}}Q.forEach((N)=>{aq(N,N===q,$.slideActiveClass),aq(N,N===F,$.slideNextClass),aq(N,N===X,$.slidePrevClass)}),J.emitSlidesClasses()}var bW=(J,Q)=>{if(!J||J.destroyed||!J.params)return;let $=()=>J.isElement?"swiper-slide":`.${J.params.slideClass}`,Z=Q.closest($());if(Z){let K=Z.querySelector(`.${J.params.lazyPreloaderClass}`);if(!K&&J.isElement)if(Z.shadowRoot)K=Z.shadowRoot.querySelector(`.${J.params.lazyPreloaderClass}`);else requestAnimationFrame(()=>{if(Z.shadowRoot){if(K=Z.shadowRoot.querySelector(`.${J.params.lazyPreloaderClass}`),K)K.remove()}});if(K)K.remove()}},tq=(J,Q)=>{if(!J.slides[Q])return;let $=J.slides[Q].querySelector('[loading="lazy"]');if($)$.removeAttribute("loading")},Q5=(J)=>{if(!J||J.destroyed||!J.params)return;let Q=J.params.lazyPreloadPrevNext,$=J.slides.length;if(!$||!Q||Q<0)return;Q=Math.min(Q,$);let Z=J.params.slidesPerView==="auto"?J.slidesPerViewDynamic():Math.ceil(J.params.slidesPerView),K=J.activeIndex;if(J.params.grid&&J.params.grid.rows>1){let H=K,U=[H-Q];U.push(...Array.from({length:Q}).map((q,X)=>{return H+Z+X})),J.slides.forEach((q,X)=>{if(U.includes(q.column))tq(J,X)});return}let W=K+Z-1;if(J.params.rewind||J.params.loop)for(let H=K-Q;H<=W+Q;H+=1){let U=(H%$+$)%$;if(UW)tq(J,U)}else for(let H=Math.max(K-Q,0);H<=Math.min(W+Q,$-1);H+=1)if(H!==K&&(H>W||H=Q[W]&&Z=Q[W]&&Z=Q[W])K=W;if($.normalizeSlideIndex){if(K<0||typeof K==="undefined")K=0}return K}function Qk(J){let Q=this,$=Q.rtlTranslate?Q.translate:-Q.translate,{snapGrid:Z,params:K,activeIndex:W,realIndex:H,snapIndex:U}=Q,q=J,X,F=(Y)=>{let B=Y-Q.virtual.slidesBefore;if(B<0)B=Q.virtual.slides.length+B;if(B>=Q.virtual.slides.length)B-=Q.virtual.slides.length;return B};if(typeof q==="undefined")q=Jk(Q);if(Z.indexOf($)>=0)X=Z.indexOf($);else{let Y=Math.min(K.slidesPerGroupSkip,q);X=Y+Math.floor((q-Y)/K.slidesPerGroup)}if(X>=Z.length)X=Z.length-1;if(q===W&&!Q.params.loop){if(X!==U)Q.snapIndex=X,Q.emit("snapIndexChange");return}if(q===W&&Q.params.loop&&Q.virtual&&Q.params.virtual.enabled){Q.realIndex=F(q);return}let N=Q.grid&&K.grid&&K.grid.rows>1,L;if(Q.virtual&&K.virtual.enabled&&K.loop)L=F(q);else if(N){let Y=Q.slides.find((M)=>M.column===q),B=parseInt(Y.getAttribute("data-swiper-slide-index"),10);if(Number.isNaN(B))B=Math.max(Q.slides.indexOf(Y),0);L=Math.floor(B/K.grid.rows)}else if(Q.slides[q]){let Y=Q.slides[q].getAttribute("data-swiper-slide-index");if(Y)L=parseInt(Y,10);else L=q}else L=q;if(Object.assign(Q,{previousSnapIndex:U,snapIndex:X,previousRealIndex:H,realIndex:L,previousIndex:W,activeIndex:q}),Q.initialized)Q5(Q);if(Q.emit("activeIndexChange"),Q.emit("snapIndexChange"),Q.initialized||Q.params.runCallbacksOnInit){if(H!==L)Q.emit("realIndexChange");Q.emit("slideChange")}}function $k(J,Q){let $=this,Z=$.params,K=J.closest(`.${Z.slideClass}, swiper-slide`);if(!K&&$.isElement&&Q&&Q.length>1&&Q.includes(J))[...Q.slice(Q.indexOf(J)+1,Q.length)].forEach((U)=>{if(!K&&U.matches&&U.matches(`.${Z.slideClass}, swiper-slide`))K=U});let W=!1,H;if(K){for(let U=0;U<$.slides.length;U+=1)if($.slides[U]===K){W=!0,H=U;break}}if(K&&W)if($.clickedSlide=K,$.virtual&&$.params.virtual.enabled)$.clickedIndex=parseInt(K.getAttribute("data-swiper-slide-index"),10);else $.clickedIndex=H;else{$.clickedSlide=void 0,$.clickedIndex=void 0;return}if(Z.slideToClickedSlide&&$.clickedIndex!==void 0&&$.clickedIndex!==$.activeIndex)$.slideToClickedSlide()}var Zk={updateSize:o4,updateSlides:s4,updateAutoHeight:i4,updateSlidesOffset:r4,updateSlidesProgress:a4,updateProgress:t4,updateSlidesClasses:e4,updateActiveIndex:Qk,updateClickedSlide:$k};function Kk(J=this.isHorizontal()?"x":"y"){let Q=this,{params:$,rtlTranslate:Z,translate:K,wrapperEl:W}=Q;if($.virtualTranslate)return Z?-K:K;if($.cssMode)return K;let H=nq(W,J);if(H+=Q.cssOverflowAdjustment(),Z)H=-H;return H||0}function Wk(J,Q){let $=this,{rtlTranslate:Z,params:K,wrapperEl:W,progress:H}=$,U=0,q=0,X=0;if($.isHorizontal())U=Z?-J:J;else q=J;if(K.roundLengths)U=Math.floor(U),q=Math.floor(q);if($.previousTranslate=$.translate,$.translate=$.isHorizontal()?U:q,K.cssMode)W[$.isHorizontal()?"scrollLeft":"scrollTop"]=$.isHorizontal()?-U:-q;else if(!K.virtualTranslate){if($.isHorizontal())U-=$.cssOverflowAdjustment();else q-=$.cssOverflowAdjustment();W.style.transform=`translate3d(${U}px, ${q}px, ${X}px)`}let F,N=$.maxTranslate()-$.minTranslate();if(N===0)F=0;else F=(J-$.minTranslate())/N;if(F!==H)$.updateProgress(J);$.emit("setTranslate",$.translate,Q)}function Hk(){return-this.snapGrid[0]}function Uk(){return-this.snapGrid[this.snapGrid.length-1]}function qk(J=0,Q=this.params.speed,$=!0,Z=!0,K){let W=this,{params:H,wrapperEl:U}=W;if(W.animating&&H.preventInteractionOnTransition)return!1;let q=W.minTranslate(),X=W.maxTranslate(),F;if(Z&&J>q)F=q;else if(Z&&JW)H="next";else if(K=q.length)V=q.length-1;let A=-q[V];if(U.normalizeSlideIndex)for(let _=0;_=y&&S=y&&S=y)H=_}if(W.initialized&&H!==N){if(!W.allowSlideNext&&(L?A>W.translate&&A>W.minTranslate():AW.translate&&A>W.maxTranslate()){if((N||0)!==H)return!1}}if(H!==(F||0)&&$)W.emit("beforeSlideChangeStart");W.updateProgress(A);let I;if(H>N)I="next";else if(H0)W._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{Y[_?"scrollLeft":"scrollTop"]=S});else Y[_?"scrollLeft":"scrollTop"]=S;if(P)requestAnimationFrame(()=>{W.wrapperEl.style.scrollSnapType="",W._immediateVirtual=!1})}else{if(!W.support.smoothScroll)return oq({swiper:W,targetPosition:S,side:_?"left":"top"}),!0;Y.scrollTo({[_?"left":"top"]:S,behavior:"smooth"})}return!0}let w=$O().isSafari;if(P&&!K&&w&&W.isElement)W.virtual.update(!1,!1,H);if(W.setTransition(Q),W.setTranslate(A),W.updateActiveIndex(H),W.updateSlidesClasses(),W.emit("beforeTransitionStart",Q,Z),W.transitionStart($,I),Q===0)W.transitionEnd($,I);else if(!W.animating){if(W.animating=!0,!W.onSlideToWrapperTransitionEnd)W.onSlideToWrapperTransitionEnd=function _(S){if(!W||W.destroyed)return;if(S.target!==this)return;W.wrapperEl.removeEventListener("transitionend",W.onSlideToWrapperTransitionEnd),W.onSlideToWrapperTransitionEnd=null,delete W.onSlideToWrapperTransitionEnd,W.transitionEnd($,I)};W.wrapperEl.addEventListener("transitionend",W.onSlideToWrapperTransitionEnd)}return!0}function Dk(J=0,Q,$=!0,Z){if(typeof J==="string")J=parseInt(J,10);let K=this;if(K.destroyed)return;if(typeof Q==="undefined")Q=K.params.speed;let W=K.grid&&K.params.grid&&K.params.grid.rows>1,H=J;if(K.params.loop)if(K.virtual&&K.params.virtual.enabled)H=H+K.virtual.slidesBefore;else{let U;if(W){let M=H*K.params.grid.rows;U=K.slides.find((V)=>V.getAttribute("data-swiper-slide-index")*1===M).column}else U=K.getSlideIndexByData(H);let q=W?Math.ceil(K.slides.length/K.params.grid.rows):K.slides.length,{centeredSlides:X,slidesOffsetBefore:F,slidesOffsetAfter:N}=K.params,L=X||!!F||!!N,Y=K.params.slidesPerView;if(Y==="auto")Y=K.slidesPerViewDynamic();else if(Y=Math.ceil(parseFloat(K.params.slidesPerView,10)),L&&Y%2===0)Y=Y+1;let B=q-UV.getAttribute("data-swiper-slide-index")*1===M).column}else H=K.getSlideIndexByData(H)}return requestAnimationFrame(()=>{K.slideTo(H,Q,$,Z)}),K}function Lk(J,Q=!0,$){let Z=this,{enabled:K,params:W,animating:H}=Z;if(!K||Z.destroyed)return Z;if(typeof J==="undefined")J=Z.params.speed;let U=W.slidesPerGroup;if(W.slidesPerView==="auto"&&W.slidesPerGroup===1&&W.slidesPerGroupAuto)U=Math.max(Z.slidesPerViewDynamic("current",!0),1);let q=Z.activeIndex{Z.slideTo(Z.activeIndex+q,J,Q,$)}),!0}if(W.rewind&&Z.isEnd)return Z.slideTo(0,J,Q,$);return Z.slideTo(Z.activeIndex+q,J,Q,$)}function Rk(J,Q=!0,$){let Z=this,{params:K,snapGrid:W,slidesGrid:H,rtlTranslate:U,enabled:q,animating:X}=Z;if(!q||Z.destroyed)return Z;if(typeof J==="undefined")J=Z.params.speed;let F=Z.virtual&&K.virtual.enabled;if(K.loop){if(X&&!F&&K.loopPreventsSliding)return!1;Z.loopFix({direction:"prev"}),Z._clientLeft=Z.wrapperEl.clientLeft}let N=U?Z.translate:-Z.translate;function L(I){if(I<0)return-Math.floor(Math.abs(I));return Math.floor(I)}let Y=L(N),B=W.map((I)=>L(I)),M=K.freeMode&&K.freeMode.enabled,V=W[B.indexOf(Y)-1];if(typeof V==="undefined"&&(K.cssMode||M)){let I;if(W.forEach((P,j)=>{if(Y>=P)I=j}),typeof I!=="undefined")V=M?W[I]:W[I>0?I-1:I]}let A=0;if(typeof V!=="undefined"){if(A=H.indexOf(V),A<0)A=Z.activeIndex-1;if(K.slidesPerView==="auto"&&K.slidesPerGroup===1&&K.slidesPerGroupAuto)A=A-Z.slidesPerViewDynamic("previous",!0)+1,A=Math.max(A,0)}if(K.rewind&&Z.isBeginning){let I=Z.params.virtual&&Z.params.virtual.enabled&&Z.virtual?Z.virtual.slides.length-1:Z.slides.length-1;return Z.slideTo(I,J,Q,$)}else if(K.loop&&Z.activeIndex===0&&K.cssMode)return requestAnimationFrame(()=>{Z.slideTo(A,J,Q,$)}),!0;return Z.slideTo(A,J,Q,$)}function Bk(J,Q=!0,$){let Z=this;if(Z.destroyed)return;if(typeof J==="undefined")J=Z.params.speed;return Z.slideTo(Z.activeIndex,J,Q,$)}function Mk(J,Q=!0,$,Z=0.5){let K=this;if(K.destroyed)return;if(typeof J==="undefined")J=K.params.speed;let W=K.activeIndex,H=Math.min(K.params.slidesPerGroupSkip,W),U=H+Math.floor((W-H)/K.params.slidesPerGroup),q=K.rtlTranslate?K.translate:-K.translate;if(q>=K.snapGrid[U]){let X=K.snapGrid[U],F=K.snapGrid[U+1];if(q-X>(F-X)*Z)W+=K.params.slidesPerGroup}else{let X=K.snapGrid[U-1],F=K.snapGrid[U];if(q-X<=(F-X)*Z)W-=K.params.slidesPerGroup}return W=Math.max(W,0),W=Math.min(W,K.slidesGrid.length-1),K.slideTo(W,J,Q,$)}function zk(){let J=this;if(J.destroyed)return;let{params:Q,slidesEl:$}=J,Z=Q.slidesPerView==="auto"?J.slidesPerViewDynamic():Q.slidesPerView,K=J.getSlideIndexWhenGrid(J.clickedIndex),W,H=J.isElement?"swiper-slide":`.${Q.slideClass}`,U=J.grid&&J.params.grid&&J.params.grid.rows>1;if(Q.loop){if(J.animating)return;if(W=parseInt(J.clickedSlide.getAttribute("data-swiper-slide-index"),10),Q.centeredSlides)J.slideToLoop(W);else if(K>(U?(J.slides.length-Z)/2-(J.params.grid.rows-1):J.slides.length-Z))J.loopFix(),K=J.getSlideIndex(xJ($,`${H}[data-swiper-slide-index="${W}"]`)[0]),Y6(()=>{J.slideTo(K)});else J.slideTo(K)}else J.slideTo(K)}var kk={slideTo:Fk,slideToLoop:Dk,slideNext:Lk,slidePrev:Rk,slideReset:Bk,slideToClosest:Mk,slideToClickedSlide:zk};function Vk(J,Q){let $=this,{params:Z,slidesEl:K}=$;if(!Z.loop||$.virtual&&$.params.virtual.enabled)return;let W=()=>{xJ(K,`.${Z.slideClass}, swiper-slide`).forEach((B,M)=>{B.setAttribute("data-swiper-slide-index",M)})},H=()=>{let Y=xJ(K,`.${Z.slideBlankClass}`);if(Y.forEach((B)=>{B.remove()}),Y.length>0)$.recalcSlides(),$.updateSlides()},U=$.grid&&Z.grid&&Z.grid.rows>1;if(Z.loopAddBlankSlides&&(Z.slidesPerGroup>1||U))H();let q=Z.slidesPerGroup*(U?Z.grid.rows:1),X=$.slides.length%q!==0,F=U&&$.slides.length%Z.grid.rows!==0,N=(Y)=>{for(let B=0;B1;if(X.lengthZ0.classList.contains(Y.slideActiveClass)));else u=K;let v=$==="next"||!$,m=$==="prev"||!$,l=0,H0=0,Q0=(w?X[K].column:K)+(I&&typeof Z==="undefined"?-P/2+0.5:0);if(Q0=0;Y0-=1)if(X[Y0].column===b)_.push(Y0)}else _.push(y-D0-1)}}else if(Q0+P>y-T){if(H0=Math.max(Q0-(y-T*2),j),f)H0=Math.max(H0,P-y+A+1);for(let Z0=0;Z0{if(b.column===D0)S.push(Y0)});else S.push(D0)}}if(q.__preventObserver__=!0,requestAnimationFrame(()=>{q.__preventObserver__=!1}),q.params.effect==="cards"&&X.length{X[Z0].swiperLoopMoveDOM=!0,L.prepend(X[Z0]),X[Z0].swiperLoopMoveDOM=!1});if(v)S.forEach((Z0)=>{X[Z0].swiperLoopMoveDOM=!0,L.append(X[Z0]),X[Z0].swiperLoopMoveDOM=!1});if(q.recalcSlides(),Y.slidesPerView==="auto")q.updateSlides();else if(w&&(_.length>0&&m||S.length>0&&v))q.slides.forEach((Z0,D0)=>{q.grid.updateSlide(D0,Z0,q.slides)});if(Y.watchSlidesProgress)q.updateSlidesOffset();if(Q){if(_.length>0&&m){if(typeof J==="undefined"){let Z0=q.slidesGrid[u],b=q.slidesGrid[u+l]-Z0;if(U)q.setTranslate(q.translate-b);else if(q.slideTo(u+Math.ceil(l),0,!1,!0),Z)q.touchEventsData.startTranslate=q.touchEventsData.startTranslate-b,q.touchEventsData.currentTranslate=q.touchEventsData.currentTranslate-b}else if(Z){let Z0=w?_.length/Y.grid.rows:_.length;q.slideTo(q.activeIndex+Z0,0,!1,!0),q.touchEventsData.currentTranslate=q.translate}}else if(S.length>0&&v)if(typeof J==="undefined"){let Z0=q.slidesGrid[u],b=q.slidesGrid[u-H0]-Z0;if(U)q.setTranslate(q.translate-b);else if(q.slideTo(u-H0,0,!1,!0),Z)q.touchEventsData.startTranslate=q.touchEventsData.startTranslate-b,q.touchEventsData.currentTranslate=q.touchEventsData.currentTranslate-b}else{let Z0=w?S.length/Y.grid.rows:S.length;q.slideTo(q.activeIndex-Z0,0,!1,!0)}}if(q.allowSlidePrev=F,q.allowSlideNext=N,q.controller&&q.controller.control&&!H){let Z0={slideRealIndex:J,direction:$,setTranslate:Z,activeSlideIndex:K,byController:!0};if(Array.isArray(q.controller.control))q.controller.control.forEach((D0)=>{if(!D0.destroyed&&D0.params.loop)D0.loopFix({...Z0,slideTo:D0.params.slidesPerView===Y.slidesPerView?Q:!1})});else if(q.controller.control instanceof q.constructor&&q.controller.control.params.loop)q.controller.control.loopFix({...Z0,slideTo:q.controller.control.params.slidesPerView===Y.slidesPerView?Q:!1})}q.emit("loopFix")}function Ik(){let J=this,{params:Q,slidesEl:$}=J;if(!Q.loop||!$||J.virtual&&J.params.virtual.enabled)return;J.recalcSlides();let Z=[];J.slides.forEach((K)=>{let W=typeof K.swiperSlideIndex==="undefined"?K.getAttribute("data-swiper-slide-index")*1:K.swiperSlideIndex;Z[W]=K}),J.slides.forEach((K)=>{K.removeAttribute("data-swiper-slide-index")}),Z.forEach((K)=>{$.append(K)}),J.recalcSlides(),J.slideTo(J.realIndex,0)}var Ek={loopCreate:Vk,loopFix:Ak,loopDestroy:Ik};function Ck(J){let Q=this;if(!Q.params.simulateTouch||Q.params.watchOverflow&&Q.isLocked||Q.params.cssMode)return;let $=Q.params.touchEventsTarget==="container"?Q.el:Q.wrapperEl;if(Q.isElement)Q.__preventObserver__=!0;if($.style.cursor="move",$.style.cursor=J?"grabbing":"grab",Q.isElement)requestAnimationFrame(()=>{Q.__preventObserver__=!1})}function Pk(){let J=this;if(J.params.watchOverflow&&J.isLocked||J.params.cssMode)return;if(J.isElement)J.__preventObserver__=!0;if(J[J.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",J.isElement)requestAnimationFrame(()=>{J.__preventObserver__=!1})}var jk={setGrabCursor:Ck,unsetGrabCursor:Pk};function Tk(J,Q=this){function $(Z){if(!Z||Z===oJ()||Z===QJ())return null;if(Z.assignedSlot)Z=Z.assignedSlot;let K=Z.closest(J);if(!K&&!Z.getRootNode)return null;return K||$(Z.getRootNode().host)}return $(Q)}function rN(J,Q,$){let Z=QJ(),{params:K}=J,W=K.edgeSwipeDetection,H=K.edgeSwipeThreshold;if(W&&($<=H||$>=Z.innerWidth-H)){if(W==="prevent")return Q.preventDefault(),!0;return!1}return!0}function Sk(J){let Q=this,$=oJ(),Z=J;if(Z.originalEvent)Z=Z.originalEvent;let K=Q.touchEventsData;if(Z.type==="pointerdown"){if(K.pointerId!==null&&K.pointerId!==Z.pointerId)return;K.pointerId=Z.pointerId}else if(Z.type==="touchstart"&&Z.targetTouches.length===1)K.touchId=Z.targetTouches[0].identifier;if(Z.type==="touchstart"){rN(Q,Z,Z.targetTouches[0].pageX);return}let{params:W,touches:H,enabled:U}=Q;if(!U)return;if(!W.simulateTouch&&Z.pointerType==="mouse")return;if(Q.animating&&W.preventInteractionOnTransition)return;if(!Q.animating&&W.cssMode&&W.loop)Q.loopFix();let q=Z.target;if(W.touchEventsTarget==="wrapper"){if(!nN(q,Q.wrapperEl))return}if("which"in Z&&Z.which===3)return;if("button"in Z&&Z.button>0)return;if(K.isTouched&&K.isMoved)return;let X=!!W.noSwipingClass&&W.noSwipingClass!=="",F=Z.composedPath?Z.composedPath():Z.path;if(X&&Z.target&&Z.target.shadowRoot&&F)q=F[0];let N=W.noSwipingSelector?W.noSwipingSelector:`.${W.noSwipingClass}`,L=!!(Z.target&&Z.target.shadowRoot);if(W.noSwiping&&(L?Tk(N,q):q.closest(N))){Q.allowClick=!0;return}if(W.swipeHandler){if(!q.closest(W.swipeHandler))return}H.currentX=Z.pageX,H.currentY=Z.pageY;let{currentX:Y,currentY:B}=H;if(!rN(Q,Z,Y))return;if(Object.assign(K,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),H.startX=Y,H.startY=B,K.touchStartTime=M$(),Q.allowClick=!0,Q.updateSize(),Q.swipeDirection=void 0,W.threshold>0)K.allowThresholdMove=!1;let M=!0;if(q.matches(K.focusableElements)){if(M=!1,q.nodeName==="SELECT")K.isTouched=!1}if($.activeElement&&$.activeElement.matches(K.focusableElements)&&$.activeElement!==q&&(Z.pointerType==="mouse"||Z.pointerType!=="mouse"&&!q.matches(K.focusableElements)))$.activeElement.blur();let V=M&&Q.allowTouchMove&&W.touchStartPreventDefault;if((W.touchStartForcePreventDefault||V)&&!q.isContentEditable)Z.preventDefault();if(W.freeMode&&W.freeMode.enabled&&Q.freeMode&&Q.animating&&!W.cssMode)Q.freeMode.onTouchStart();Q.emit("touchStart",Z)}function _k(J){let Q=oJ(),$=this,Z=$.touchEventsData,{params:K,touches:W,rtlTranslate:H,enabled:U}=$;if(!U)return;if(!K.simulateTouch&&J.pointerType==="mouse")return;let q=J;if(q.originalEvent)q=q.originalEvent;if(q.type==="pointermove"){if(Z.touchId!==null)return;if(q.pointerId!==Z.pointerId)return}let X;if(q.type==="touchmove"){if(X=[...q.changedTouches].find((w)=>w.identifier===Z.touchId),!X||X.identifier!==Z.touchId)return}else X=q;if(!Z.isTouched){if(Z.startMoving&&Z.isScrolling)$.emit("touchMoveOpposite",q);return}let{pageX:F,pageY:N}=X;if(q.preventedByNestedSwiper){W.startX=F,W.startY=N;return}if(!$.allowTouchMove){if(!q.target.matches(Z.focusableElements))$.allowClick=!1;if(Z.isTouched)Object.assign(W,{startX:F,startY:N,currentX:F,currentY:N}),Z.touchStartTime=M$();return}if(K.touchReleaseOnEdges&&!K.loop){if($.isVertical()){if(NW.startY&&$.translate>=$.minTranslate()){Z.isTouched=!1,Z.isMoved=!1;return}}else if(H&&(F>W.startX&&-$.translate<=$.maxTranslate()||F=$.minTranslate()))return;else if(!H&&(FW.startX&&$.translate>=$.minTranslate()))return}if(Q.activeElement&&Q.activeElement.matches(Z.focusableElements)&&Q.activeElement!==q.target&&q.pointerType!=="mouse")Q.activeElement.blur();if(Q.activeElement){if(q.target===Q.activeElement&&q.target.matches(Z.focusableElements)){Z.isMoved=!0,$.allowClick=!1;return}}if(Z.allowTouchCallbacks)$.emit("touchMove",q);W.previousX=W.currentX,W.previousY=W.currentY,W.currentX=F,W.currentY=N;let L=W.currentX-W.startX,Y=W.currentY-W.startY;if($.params.threshold&&Math.sqrt(L**2+Y**2)<$.params.threshold)return;if(typeof Z.isScrolling==="undefined"){let w;if($.isHorizontal()&&W.currentY===W.startY||$.isVertical()&&W.currentX===W.startX)Z.isScrolling=!1;else if(L*L+Y*Y>=25)w=Math.atan2(Math.abs(Y),Math.abs(L))*180/Math.PI,Z.isScrolling=$.isHorizontal()?w>K.touchAngle:90-w>K.touchAngle}if(Z.isScrolling)$.emit("touchMoveOpposite",q);if(typeof Z.startMoving==="undefined"){if(W.currentX!==W.startX||W.currentY!==W.startY)Z.startMoving=!0}if(Z.isScrolling||q.type==="touchmove"&&Z.preventTouchMoveFromPointerMove){Z.isTouched=!1;return}if(!Z.startMoving)return;if($.allowClick=!1,!K.cssMode&&q.cancelable)q.preventDefault();if(K.touchMoveStopPropagation&&!K.nested)q.stopPropagation();let B=$.isHorizontal()?L:Y,M=$.isHorizontal()?W.currentX-W.previousX:W.currentY-W.previousY;if(K.oneWayMovement)B=Math.abs(B)*(H?1:-1),M=Math.abs(M)*(H?1:-1);if(W.diff=B,B*=K.touchRatio,H)B=-B,M=-M;let V=$.touchesDirection;$.swipeDirection=B>0?"prev":"next",$.touchesDirection=M>0?"prev":"next";let A=$.params.loop&&!K.cssMode,I=$.touchesDirection==="next"&&$.allowSlideNext||$.touchesDirection==="prev"&&$.allowSlidePrev;if(!Z.isMoved){if(A&&I)$.loopFix({direction:$.swipeDirection});if(Z.startTranslate=$.getTranslate(),$.setTransition(0),$.animating){let w=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});$.wrapperEl.dispatchEvent(w)}if(Z.allowMomentumBounce=!1,K.grabCursor&&($.allowSlideNext===!0||$.allowSlidePrev===!0))$.setGrabCursor(!0);$.emit("sliderFirstMove",q)}let P;if(new Date().getTime(),K._loopSwapReset!==!1&&Z.isMoved&&Z.allowThresholdMove&&V!==$.touchesDirection&&A&&I&&Math.abs(B)>=1){Object.assign(W,{startX:F,startY:N,currentX:F,currentY:N,startTranslate:Z.currentTranslate}),Z.loopSwapReset=!0,Z.startTranslate=Z.currentTranslate;return}$.emit("sliderMove",q),Z.isMoved=!0,Z.currentTranslate=B+Z.startTranslate;let j=!0,T=K.resistanceRatio;if(K.touchReleaseOnEdges)T=0;if(B>0){if(A&&I&&!P&&Z.allowThresholdMove&&Z.currentTranslate>(K.centeredSlides?$.minTranslate()-$.slidesSizesGrid[$.activeIndex+1]-(K.slidesPerView!=="auto"&&$.slides.length-K.slidesPerView>=2?$.slidesSizesGrid[$.activeIndex+1]+$.params.spaceBetween:0)-$.params.spaceBetween:$.minTranslate()))$.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0});if(Z.currentTranslate>$.minTranslate()){if(j=!1,K.resistance)Z.currentTranslate=$.minTranslate()-1+(-$.minTranslate()+Z.startTranslate+B)**T}}else if(B<0){if(A&&I&&!P&&Z.allowThresholdMove&&Z.currentTranslate<(K.centeredSlides?$.maxTranslate()+$.slidesSizesGrid[$.slidesSizesGrid.length-1]+$.params.spaceBetween+(K.slidesPerView!=="auto"&&$.slides.length-K.slidesPerView>=2?$.slidesSizesGrid[$.slidesSizesGrid.length-1]+$.params.spaceBetween:0):$.maxTranslate()))$.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:$.slides.length-(K.slidesPerView==="auto"?$.slidesPerViewDynamic():Math.ceil(parseFloat(K.slidesPerView,10)))});if(Z.currentTranslate<$.maxTranslate()){if(j=!1,K.resistance)Z.currentTranslate=$.maxTranslate()+1-($.maxTranslate()-Z.startTranslate-B)**T}}if(j)q.preventedByNestedSwiper=!0;if(!$.allowSlideNext&&$.swipeDirection==="next"&&Z.currentTranslateZ.startTranslate)Z.currentTranslate=Z.startTranslate;if(!$.allowSlidePrev&&!$.allowSlideNext)Z.currentTranslate=Z.startTranslate;if(K.threshold>0)if(Math.abs(B)>K.threshold||Z.allowThresholdMove){if(!Z.allowThresholdMove){Z.allowThresholdMove=!0,W.startX=W.currentX,W.startY=W.currentY,Z.currentTranslate=Z.startTranslate,W.diff=$.isHorizontal()?W.currentX-W.startX:W.currentY-W.startY;return}}else{Z.currentTranslate=Z.startTranslate;return}if(!K.followFinger||K.cssMode)return;if(K.freeMode&&K.freeMode.enabled&&$.freeMode||K.watchSlidesProgress)$.updateActiveIndex(),$.updateSlidesClasses();if(K.freeMode&&K.freeMode.enabled&&$.freeMode)$.freeMode.onTouchMove();$.updateProgress(Z.currentTranslate),$.setTranslate(Z.currentTranslate)}function yk(J){let Q=this,$=Q.touchEventsData,Z=J;if(Z.originalEvent)Z=Z.originalEvent;let K;if(!(Z.type==="touchend"||Z.type==="touchcancel")){if($.touchId!==null)return;if(Z.pointerId!==$.pointerId)return;K=Z}else if(K=[...Z.changedTouches].find((T)=>T.identifier===$.touchId),!K||K.identifier!==$.touchId)return;if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(Z.type)){if(!(["pointercancel","contextmenu"].includes(Z.type)&&(Q.browser.isSafari||Q.browser.isWebView)))return}$.pointerId=null,$.touchId=null;let{params:H,touches:U,rtlTranslate:q,slidesGrid:X,enabled:F}=Q;if(!F)return;if(!H.simulateTouch&&Z.pointerType==="mouse")return;if($.allowTouchCallbacks)Q.emit("touchEnd",Z);if($.allowTouchCallbacks=!1,!$.isTouched){if($.isMoved&&H.grabCursor)Q.setGrabCursor(!1);$.isMoved=!1,$.startMoving=!1;return}if(H.grabCursor&&$.isMoved&&$.isTouched&&(Q.allowSlideNext===!0||Q.allowSlidePrev===!0))Q.setGrabCursor(!1);let N=M$(),L=N-$.touchStartTime;if(Q.allowClick){let T=Z.path||Z.composedPath&&Z.composedPath();if(Q.updateClickedSlide(T&&T[0]||Z.target,T),Q.emit("tap click",Z),L<300&&N-$.lastClickTime<300)Q.emit("doubleTap doubleClick",Z)}if($.lastClickTime=M$(),Y6(()=>{if(!Q.destroyed)Q.allowClick=!0}),!$.isTouched||!$.isMoved||!Q.swipeDirection||U.diff===0&&!$.loopSwapReset||$.currentTranslate===$.startTranslate&&!$.loopSwapReset){$.isTouched=!1,$.isMoved=!1,$.startMoving=!1;return}$.isTouched=!1,$.isMoved=!1,$.startMoving=!1;let Y;if(H.followFinger)Y=q?Q.translate:-Q.translate;else Y=-$.currentTranslate;if(H.cssMode)return;if(H.freeMode&&H.freeMode.enabled){Q.freeMode.onTouchEnd({currentPos:Y});return}let B=Y>=-Q.maxTranslate()&&!Q.params.loop,M=0,V=Q.slidesSizesGrid[0];for(let T=0;T=X[T]&&Y=X[T])M=T,V=X[X.length-1]-X[X.length-2]}let A=null,I=null;if(H.rewind){if(Q.isBeginning)I=H.virtual&&H.virtual.enabled&&Q.virtual?Q.virtual.slides.length-1:Q.slides.length-1;else if(Q.isEnd)A=0}let P=(Y-X[M])/V,j=MH.longSwipesMs){if(!H.longSwipes){Q.slideTo(Q.activeIndex);return}if(Q.swipeDirection==="next")if(P>=H.longSwipesRatio)Q.slideTo(H.rewind&&Q.isEnd?A:M+j);else Q.slideTo(M);if(Q.swipeDirection==="prev")if(P>1-H.longSwipesRatio)Q.slideTo(M+j);else if(I!==null&&P<0&&Math.abs(P)>H.longSwipesRatio)Q.slideTo(I);else Q.slideTo(M)}else{if(!H.shortSwipes){Q.slideTo(Q.activeIndex);return}if(!(Q.navigation&&(Z.target===Q.navigation.nextEl||Z.target===Q.navigation.prevEl))){if(Q.swipeDirection==="next")Q.slideTo(A!==null?A:M+j);if(Q.swipeDirection==="prev")Q.slideTo(I!==null?I:M)}else if(Z.target===Q.navigation.nextEl)Q.slideTo(M+j);else Q.slideTo(M)}}function aN(){let J=this,{params:Q,el:$}=J;if($&&$.offsetWidth===0)return;if(Q.breakpoints)J.setBreakpoint();let{allowSlideNext:Z,allowSlidePrev:K,snapGrid:W}=J,H=J.virtual&&J.params.virtual.enabled;J.allowSlideNext=!0,J.allowSlidePrev=!0,J.updateSize(),J.updateSlides(),J.updateSlidesClasses();let U=H&&Q.loop;if((Q.slidesPerView==="auto"||Q.slidesPerView>1)&&J.isEnd&&!J.isBeginning&&!J.params.centeredSlides&&!U)J.slideTo(J.slides.length-1,0,!1,!0);else if(J.params.loop&&!H)J.slideToLoop(J.realIndex,0,!1,!0);else J.slideTo(J.activeIndex,0,!1,!0);if(J.autoplay&&J.autoplay.running&&J.autoplay.paused)clearTimeout(J.autoplay.resizeTimeout),J.autoplay.resizeTimeout=setTimeout(()=>{if(J.autoplay&&J.autoplay.running&&J.autoplay.paused)J.autoplay.resume()},500);if(J.allowSlidePrev=K,J.allowSlideNext=Z,J.params.watchOverflow&&W!==J.snapGrid)J.checkOverflow()}function wk(J){let Q=this;if(!Q.enabled)return;if(!Q.allowClick){if(Q.params.preventClicks)J.preventDefault();if(Q.params.preventClicksPropagation&&Q.animating)J.stopPropagation(),J.stopImmediatePropagation()}}function hk(){let J=this,{wrapperEl:Q,rtlTranslate:$,enabled:Z}=J;if(!Z)return;if(J.previousTranslate=J.translate,J.isHorizontal())J.translate=-Q.scrollLeft;else J.translate=-Q.scrollTop;if(J.translate===0)J.translate=0;J.updateActiveIndex(),J.updateSlidesClasses();let K,W=J.maxTranslate()-J.minTranslate();if(W===0)K=0;else K=(J.translate-J.minTranslate())/W;if(K!==J.progress)J.updateProgress($?-J.translate:J.translate);J.emit("setTranslate",J.translate,!1)}function xk(J){let Q=this;if(bW(Q,J.target),Q.params.cssMode||Q.params.slidesPerView!=="auto"&&!Q.params.autoHeight)return;Q.update()}function fk(){let J=this;if(J.documentTouchHandlerProceeded)return;if(J.documentTouchHandlerProceeded=!0,J.params.touchReleaseOnEdges)J.el.style.touchAction="auto"}var KO=(J,Q)=>{let $=oJ(),{params:Z,el:K,wrapperEl:W,device:H}=J,U=!!Z.nested,q=Q==="on"?"addEventListener":"removeEventListener",X=Q;if(!K||typeof K==="string")return;if($[q]("touchstart",J.onDocumentTouchStart,{passive:!1,capture:U}),K[q]("touchstart",J.onTouchStart,{passive:!1}),K[q]("pointerdown",J.onTouchStart,{passive:!1}),$[q]("touchmove",J.onTouchMove,{passive:!1,capture:U}),$[q]("pointermove",J.onTouchMove,{passive:!1,capture:U}),$[q]("touchend",J.onTouchEnd,{passive:!0}),$[q]("pointerup",J.onTouchEnd,{passive:!0}),$[q]("pointercancel",J.onTouchEnd,{passive:!0}),$[q]("touchcancel",J.onTouchEnd,{passive:!0}),$[q]("pointerout",J.onTouchEnd,{passive:!0}),$[q]("pointerleave",J.onTouchEnd,{passive:!0}),$[q]("contextmenu",J.onTouchEnd,{passive:!0}),Z.preventClicks||Z.preventClicksPropagation)K[q]("click",J.onClick,!0);if(Z.cssMode)W[q]("scroll",J.onScroll);if(Z.updateOnWindowResize)J[X](H.ios||H.android?"resize orientationchange observerUpdate":"resize observerUpdate",aN,!0);else J[X]("observerUpdate",aN,!0);K[q]("load",J.onLoad,{capture:!0})};function bk(){let J=this,{params:Q}=J;if(J.onTouchStart=Sk.bind(J),J.onTouchMove=_k.bind(J),J.onTouchEnd=yk.bind(J),J.onDocumentTouchStart=fk.bind(J),Q.cssMode)J.onScroll=hk.bind(J);J.onClick=wk.bind(J),J.onLoad=xk.bind(J),KO(J,"on")}function vk(){KO(this,"off")}var gk={attachEvents:bk,detachEvents:vk},tN=(J,Q)=>{return J.grid&&Q.grid&&Q.grid.rows>1};function uk(){let J=this,{realIndex:Q,initialized:$,params:Z,el:K}=J,W=Z.breakpoints;if(!W||W&&Object.keys(W).length===0)return;let H=oJ(),U=Z.breakpointsBase==="window"||!Z.breakpointsBase?Z.breakpointsBase:"container",q=["window","container"].includes(Z.breakpointsBase)||!Z.breakpointsBase?J.el:H.querySelector(Z.breakpointsBase),X=J.getBreakpoint(W,U,q);if(!X||J.currentBreakpoint===X)return;let N=(X in W?W[X]:void 0)||J.originalParams,L=tN(J,Z),Y=tN(J,N),B=J.params.grabCursor,M=N.grabCursor,V=Z.enabled;if(L&&!Y)K.classList.remove(`${Z.containerModifierClass}grid`,`${Z.containerModifierClass}grid-column`),J.emitContainerClasses();else if(!L&&Y){if(K.classList.add(`${Z.containerModifierClass}grid`),N.grid.fill&&N.grid.fill==="column"||!N.grid.fill&&Z.grid.fill==="column")K.classList.add(`${Z.containerModifierClass}grid-column`);J.emitContainerClasses()}if(B&&!M)J.unsetGrabCursor();else if(!B&&M)J.setGrabCursor();["navigation","pagination","scrollbar"].forEach((w)=>{if(typeof N[w]==="undefined")return;let _=Z[w]&&Z[w].enabled,S=N[w]&&N[w].enabled;if(_&&!S)J[w].disable();if(!_&&S)J[w].enable()});let A=N.direction&&N.direction!==Z.direction,I=Z.loop&&(N.slidesPerView!==Z.slidesPerView||A),P=Z.loop;if(A&&$)J.changeDirection();B8(J.params,N);let j=J.params.enabled,T=J.params.loop;if(Object.assign(J,{allowTouchMove:J.params.allowTouchMove,allowSlideNext:J.params.allowSlideNext,allowSlidePrev:J.params.allowSlidePrev}),V&&!j)J.disable();else if(!V&&j)J.enable();if(J.currentBreakpoint=X,J.emit("_beforeBreakpoint",N),$){if(I)J.loopDestroy(),J.loopCreate(Q),J.updateSlides();else if(!P&&T)J.loopCreate(Q),J.updateSlides();else if(P&&!T)J.loopDestroy()}J.emit("breakpoint",N)}function dk(J,Q="window",$){if(!J||Q==="container"&&!$)return;let Z=!1,K=QJ(),W=Q==="window"?K.innerHeight:$.clientHeight,H=Object.keys(J).map((U)=>{if(typeof U==="string"&&U.indexOf("@")===0){let q=parseFloat(U.substr(1));return{value:W*q,point:U}}return{value:U,point:U}});H.sort((U,q)=>parseInt(U.value,10)-parseInt(q.value,10));for(let U=0;U{if(typeof Z==="object")Object.keys(Z).forEach((K)=>{if(Z[K])$.push(Q+K)});else if(typeof Z==="string")$.push(Q+Z)}),$}function pk(){let J=this,{classNames:Q,params:$,rtl:Z,el:K,device:W}=J,H=ck(["initialized",$.direction,{"free-mode":J.params.freeMode&&$.freeMode.enabled},{autoheight:$.autoHeight},{rtl:Z},{grid:$.grid&&$.grid.rows>1},{"grid-column":$.grid&&$.grid.rows>1&&$.grid.fill==="column"},{android:W.android},{ios:W.ios},{"css-mode":$.cssMode},{centered:$.cssMode&&$.centeredSlides},{"watch-progress":$.watchSlidesProgress}],$.containerModifierClass);Q.push(...H),K.classList.add(...Q),J.emitContainerClasses()}function lk(){let J=this,{el:Q,classNames:$}=J;if(!Q||typeof Q==="string")return;Q.classList.remove(...$),J.emitContainerClasses()}var nk={addClasses:pk,removeClasses:lk};function ok(){let J=this,{isLocked:Q,params:$}=J,{slidesOffsetBefore:Z}=$;if(Z){let K=J.slides.length-1,W=J.slidesGrid[K]+J.slidesSizesGrid[K]+Z*2;J.isLocked=J.size>W}else J.isLocked=J.snapGrid.length===1;if($.allowSlideNext===!0)J.allowSlideNext=!J.isLocked;if($.allowSlidePrev===!0)J.allowSlidePrev=!J.isLocked;if(Q&&Q!==J.isLocked)J.isEnd=!1;if(Q!==J.isLocked)J.emit(J.isLocked?"lock":"unlock")}var sk={checkOverflow:ok},eN={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:0.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:0.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function ik(J,Q){return function $(Z={}){let K=Object.keys(Z)[0],W=Z[K];if(typeof W!=="object"||W===null){B8(Q,Z);return}if(J[K]===!0)J[K]={enabled:!0};if(K==="navigation"&&J[K]&&J[K].enabled&&!J[K].prevEl&&!J[K].nextEl)J[K].auto=!0;if(["pagination","scrollbar"].indexOf(K)>=0&&J[K]&&J[K].enabled&&!J[K].el)J[K].auto=!0;if(!((K in J)&&("enabled"in W))){B8(Q,Z);return}if(typeof J[K]==="object"&&!("enabled"in J[K]))J[K].enabled=!0;if(!J[K])J[K]={enabled:!1};B8(Q,Z)}}var eq={eventsEmitter:n4,update:Zk,translate:Gk,transition:Ok,slide:kk,loop:Ek,grabCursor:jk,events:gk,breakpoints:mk,checkOverflow:sk,classes:nk},J5={};class H8{constructor(...J){let Q,$;if(J.length===1&&J[0].constructor&&Object.prototype.toString.call(J[0]).slice(8,-1)==="Object")$=J[0];else[Q,$]=J;if(!$)$={};if($=B8({},$),Q&&!$.el)$.el=Q;let Z=oJ();if($.el&&typeof $.el==="string"&&Z.querySelectorAll($.el).length>1){let U=[];return Z.querySelectorAll($.el).forEach((q)=>{let X=B8({},$,{el:q});U.push(new H8(X))}),U}let K=this;if(K.__swiper__=!0,K.support=JO(),K.device=QO({userAgent:$.userAgent}),K.browser=$O(),K.eventsListeners={},K.eventsAnyListeners=[],K.modules=[...K.__modules__],$.modules&&Array.isArray($.modules))K.modules.push(...$.modules);let W={};K.modules.forEach((U)=>{U({params:$,swiper:K,extendParams:ik($,W),on:K.on.bind(K),once:K.once.bind(K),off:K.off.bind(K),emit:K.emit.bind(K)})});let H=B8({},eN,W);if(K.params=B8({},H,J5,$),K.originalParams=B8({},K.params),K.passedParams=B8({},$),K.params&&K.params.on)Object.keys(K.params.on).forEach((U)=>{K.on(U,K.params.on[U])});if(K.params&&K.params.onAny)K.onAny(K.params.onAny);if(Object.assign(K,{enabled:K.params.enabled,el:Q,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return K.params.direction==="horizontal"},isVertical(){return K.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/8388608)*8388608},allowSlideNext:K.params.allowSlideNext,allowSlidePrev:K.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:K.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:K.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),K.emit("_swiper"),K.params.init)K.init();return K}getDirectionLabel(J){if(this.isHorizontal())return J;return{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[J]}getSlideIndex(J){let{slidesEl:Q,params:$}=this,Z=xJ(Q,`.${$.slideClass}, swiper-slide`),K=z$(Z[0]);return z$(J)-K}getSlideIndexByData(J){return this.getSlideIndex(this.slides.find((Q)=>Q.getAttribute("data-swiper-slide-index")*1===J))}getSlideIndexWhenGrid(J){if(this.grid&&this.params.grid&&this.params.grid.rows>1){if(this.params.grid.fill==="column")J=Math.floor(J/this.params.grid.rows);else if(this.params.grid.fill==="row")J=J%Math.ceil(this.slides.length/this.params.grid.rows)}return J}recalcSlides(){let J=this,{slidesEl:Q,params:$}=J;J.slides=xJ(Q,`.${$.slideClass}, swiper-slide`)}enable(){let J=this;if(J.enabled)return;if(J.enabled=!0,J.params.grabCursor)J.setGrabCursor();J.emit("enable")}disable(){let J=this;if(!J.enabled)return;if(J.enabled=!1,J.params.grabCursor)J.unsetGrabCursor();J.emit("disable")}setProgress(J,Q){let $=this;J=Math.min(Math.max(J,0),1);let Z=$.minTranslate(),W=($.maxTranslate()-Z)*J+Z;$.translateTo(W,typeof Q==="undefined"?0:Q),$.updateActiveIndex(),$.updateSlidesClasses()}emitContainerClasses(){let J=this;if(!J.params._emitClasses||!J.el)return;let Q=J.el.className.split(" ").filter(($)=>{return $.indexOf("swiper")===0||$.indexOf(J.params.containerModifierClass)===0});J.emit("_containerClasses",Q.join(" "))}getSlideClasses(J){let Q=this;if(Q.destroyed)return"";return J.className.split(" ").filter(($)=>{return $.indexOf("swiper-slide")===0||$.indexOf(Q.params.slideClass)===0}).join(" ")}emitSlidesClasses(){let J=this;if(!J.params._emitClasses||!J.el)return;let Q=[];J.slides.forEach(($)=>{let Z=J.getSlideClasses($);Q.push({slideEl:$,classNames:Z}),J.emit("_slideClass",$,Z)}),J.emit("_slideClasses",Q)}slidesPerViewDynamic(J="current",Q=!1){let $=this,{params:Z,slides:K,slidesGrid:W,slidesSizesGrid:H,size:U,activeIndex:q}=$,X=1;if(typeof Z.slidesPerView==="number")return Z.slidesPerView;if(Z.centeredSlides){let F=K[q]?Math.ceil(K[q].swiperSlideSize):0,N;for(let L=q+1;LU)N=!0}for(let L=q-1;L>=0;L-=1)if(K[L]&&!N){if(F+=K[L].swiperSlideSize,X+=1,F>U)N=!0}}else if(J==="current"){for(let F=q+1;F=0;F-=1)if(W[q]-W[F]{if(W.complete)bW(J,W)}),J.updateSize(),J.updateSlides(),J.updateProgress(),J.updateSlidesClasses();function Z(){let W=J.rtlTranslate?J.translate*-1:J.translate,H=Math.min(Math.max(W,J.maxTranslate()),J.minTranslate());J.setTranslate(H),J.updateActiveIndex(),J.updateSlidesClasses()}let K;if($.freeMode&&$.freeMode.enabled&&!$.cssMode){if(Z(),$.autoHeight)J.updateAutoHeight()}else{if(($.slidesPerView==="auto"||$.slidesPerView>1)&&J.isEnd&&!$.centeredSlides){let W=J.virtual&&$.virtual.enabled?J.virtual.slides:J.slides;K=J.slideTo(W.length-1,0,!1,!0)}else K=J.slideTo(J.activeIndex,0,!1,!0);if(!K)Z()}if($.watchOverflow&&Q!==J.snapGrid)J.checkOverflow();J.emit("update")}changeDirection(J,Q=!0){let $=this,Z=$.params.direction;if(!J)J=Z==="horizontal"?"vertical":"horizontal";if(J===Z||J!=="horizontal"&&J!=="vertical")return $;if($.el.classList.remove(`${$.params.containerModifierClass}${Z}`),$.el.classList.add(`${$.params.containerModifierClass}${J}`),$.emitContainerClasses(),$.params.direction=J,$.slides.forEach((K)=>{if(J==="vertical")K.style.width="";else K.style.height=""}),$.emit("changeDirection"),Q)$.update();return $}changeLanguageDirection(J){let Q=this;if(Q.rtl&&J==="rtl"||!Q.rtl&&J==="ltr")return;if(Q.rtl=J==="rtl",Q.rtlTranslate=Q.params.direction==="horizontal"&&Q.rtl,Q.rtl)Q.el.classList.add(`${Q.params.containerModifierClass}rtl`),Q.el.dir="rtl";else Q.el.classList.remove(`${Q.params.containerModifierClass}rtl`),Q.el.dir="ltr";Q.update()}mount(J){let Q=this;if(Q.mounted)return!0;let $=J||Q.params.el;if(typeof $==="string")$=document.querySelector($);if(!$)return!1;if($.swiper=Q,$.parentNode&&$.parentNode.host&&$.parentNode.host.nodeName===Q.params.swiperElementNodeName.toUpperCase())Q.isElement=!0;let Z=()=>{return`.${(Q.params.wrapperClass||"").trim().split(" ").join(".")}`},W=(()=>{if($&&$.shadowRoot&&$.shadowRoot.querySelector)return $.shadowRoot.querySelector(Z());return xJ($,Z())[0]})();if(!W&&Q.params.createElements)W=N7("div",Q.params.wrapperClass),$.append(W),xJ($,`.${Q.params.slideClass}`).forEach((H)=>{W.append(H)});return Object.assign(Q,{el:$,wrapperEl:W,slidesEl:Q.isElement&&!$.parentNode.host.slideSlots?$.parentNode.host:W,hostEl:Q.isElement?$.parentNode.host:$,mounted:!0,rtl:$.dir.toLowerCase()==="rtl"||JQ($,"direction")==="rtl",rtlTranslate:Q.params.direction==="horizontal"&&($.dir.toLowerCase()==="rtl"||JQ($,"direction")==="rtl"),wrongRTL:JQ(W,"display")==="-webkit-box"}),!0}init(J){let Q=this;if(Q.initialized)return Q;if(Q.mount(J)===!1)return Q;if(Q.emit("beforeInit"),Q.params.breakpoints)Q.setBreakpoint();if(Q.addClasses(),Q.updateSize(),Q.updateSlides(),Q.params.watchOverflow)Q.checkOverflow();if(Q.params.grabCursor&&Q.enabled)Q.setGrabCursor();if(Q.params.loop&&Q.virtual&&Q.params.virtual.enabled)Q.slideTo(Q.params.initialSlide+Q.virtual.slidesBefore,0,Q.params.runCallbacksOnInit,!1,!0);else Q.slideTo(Q.params.initialSlide,0,Q.params.runCallbacksOnInit,!1,!0);if(Q.params.loop)Q.loopCreate(void 0,!0);Q.attachEvents();let Z=[...Q.el.querySelectorAll('[loading="lazy"]')];if(Q.isElement)Z.push(...Q.hostEl.querySelectorAll('[loading="lazy"]'));return Z.forEach((K)=>{if(K.complete)bW(Q,K);else K.addEventListener("load",(W)=>{bW(Q,W.target)})}),Q5(Q),Q.initialized=!0,Q5(Q),Q.emit("init"),Q.emit("afterInit"),Q}destroy(J=!0,Q=!0){let $=this,{params:Z,el:K,wrapperEl:W,slides:H}=$;if(typeof $.params==="undefined"||$.destroyed)return null;if($.emit("beforeDestroy"),$.initialized=!1,$.detachEvents(),Z.loop)$.loopDestroy();if(Q){if($.removeClasses(),K&&typeof K!=="string")K.removeAttribute("style");if(W)W.removeAttribute("style");if(H&&H.length)H.forEach((U)=>{U.classList.remove(Z.slideVisibleClass,Z.slideFullyVisibleClass,Z.slideActiveClass,Z.slideNextClass,Z.slidePrevClass),U.removeAttribute("style"),U.removeAttribute("data-swiper-slide-index")})}if($.emit("destroy"),Object.keys($.eventsListeners).forEach((U)=>{$.off(U)}),J!==!1){if($.el&&typeof $.el!=="string")$.el.swiper=null;lN($)}return $.destroyed=!0,null}static extendDefaults(J){B8(J5,J)}static get extendedDefaults(){return J5}static get defaults(){return eN}static installModule(J){if(!H8.prototype.__modules__)H8.prototype.__modules__=[];let Q=H8.prototype.__modules__;if(typeof J==="function"&&Q.indexOf(J)<0)Q.push(J)}static use(J){if(Array.isArray(J))return J.forEach((Q)=>H8.installModule(Q)),H8;return H8.installModule(J),H8}}Object.keys(eq).forEach((J)=>{Object.keys(eq[J]).forEach((Q)=>{H8.prototype[Q]=eq[J][Q]})});H8.use([p4,l4]);function cZ(J,Q,$,Z){if(J.params.createElements)Object.keys(Z).forEach((K)=>{if(!$[K]&&$.auto===!0){let W=xJ(J.el,`.${Z[K]}`)[0];if(!W)W=N7("div",Z[K]),W.className=Z[K],J.el.append(W);$[K]=W,Q[K]=W}});return $}var HO='';function $5({swiper:J,extendParams:Q,on:$,emit:Z}){Q({navigation:{nextEl:null,prevEl:null,addIcons:!0,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),J.navigation={nextEl:null,prevEl:null,arrowSvg:HO};function K(Y){let B;if(Y&&typeof Y==="string"&&J.isElement){if(B=J.el.querySelector(Y)||J.hostEl.querySelector(Y),B)return B}if(Y){if(typeof Y==="string")B=[...document.querySelectorAll(Y)];if(J.params.uniqueNavElements&&typeof Y==="string"&&B&&B.length>1&&J.el.querySelectorAll(Y).length===1)B=J.el.querySelector(Y);else if(B&&B.length===1)B=B[0]}if(Y&&!B)return Y;return B}function W(Y,B){let M=J.params.navigation;Y=$J(Y),Y.forEach((V)=>{if(V){if(V.classList[B?"add":"remove"](...M.disabledClass.split(" ")),V.tagName==="BUTTON")V.disabled=B;if(J.params.watchOverflow&&J.enabled)V.classList[J.isLocked?"add":"remove"](M.lockClass)}})}function H(){let{nextEl:Y,prevEl:B}=J.navigation;if(J.params.loop){W(B,!1),W(Y,!1);return}W(B,J.isBeginning&&!J.params.rewind),W(Y,J.isEnd&&!J.params.rewind)}function U(Y){if(Y.preventDefault(),J.isBeginning&&!J.params.loop&&!J.params.rewind)return;J.slidePrev(),Z("navigationPrev")}function q(Y){if(Y.preventDefault(),J.isEnd&&!J.params.loop&&!J.params.rewind)return;J.slideNext(),Z("navigationNext")}function X(){let Y=J.params.navigation;if(J.params.navigation=cZ(J,J.originalParams.navigation,J.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(Y.nextEl||Y.prevEl))return;let B=K(Y.nextEl),M=K(Y.prevEl);Object.assign(J.navigation,{nextEl:B,prevEl:M}),B=$J(B),M=$J(M);let V=(A,I)=>{if(A){if(Y.addIcons&&A.matches(".swiper-button-next,.swiper-button-prev")&&!A.querySelector("svg")){let P=document.createElement("div");SQ(P,HO),A.appendChild(P.querySelector("svg")),P.remove()}A.addEventListener("click",I==="next"?q:U)}if(!J.enabled&&A)A.classList.add(...Y.lockClass.split(" "))};B.forEach((A)=>V(A,"next")),M.forEach((A)=>V(A,"prev"))}function F(){let{nextEl:Y,prevEl:B}=J.navigation;Y=$J(Y),B=$J(B);let M=(V,A)=>{V.removeEventListener("click",A==="next"?q:U),V.classList.remove(...J.params.navigation.disabledClass.split(" "))};Y.forEach((V)=>M(V,"next")),B.forEach((V)=>M(V,"prev"))}$("init",()=>{if(J.params.navigation.enabled===!1)L();else X(),H()}),$("toEdge fromEdge lock unlock",()=>{H()}),$("destroy",()=>{F()}),$("enable disable",()=>{let{nextEl:Y,prevEl:B}=J.navigation;if(Y=$J(Y),B=$J(B),J.enabled){H();return}[...Y,...B].filter((M)=>!!M).forEach((M)=>M.classList.add(J.params.navigation.lockClass))}),$("click",(Y,B)=>{let{nextEl:M,prevEl:V}=J.navigation;M=$J(M),V=$J(V);let A=B.target,I=V.includes(A)||M.includes(A);if(J.isElement&&!I){let P=B.path||B.composedPath&&B.composedPath();if(P)I=P.find((j)=>M.includes(j)||V.includes(j))}if(J.params.navigation.hideOnClick&&!I){if(J.pagination&&J.params.pagination&&J.params.pagination.clickable&&(J.pagination.el===A||J.pagination.el.contains(A)))return;let P;if(M.length)P=M[0].classList.contains(J.params.navigation.hiddenClass);else if(V.length)P=V[0].classList.contains(J.params.navigation.hiddenClass);if(P===!0)Z("navigationShow");else Z("navigationHide");[...M,...V].filter((j)=>!!j).forEach((j)=>j.classList.toggle(J.params.navigation.hiddenClass))}});let N=()=>{J.el.classList.remove(...J.params.navigation.navigationDisabledClass.split(" ")),X(),H()},L=()=>{J.el.classList.add(...J.params.navigation.navigationDisabledClass.split(" ")),F()};Object.assign(J.navigation,{enable:N,disable:L,update:H,init:X,destroy:F})}function _Q(J=""){return`.${J.trim().replace(/([\.:!+\/()[\]])/g,"\\$1").replace(/ /g,".")}`}function Z5({swiper:J,extendParams:Q,on:$,emit:Z}){Q({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:(A)=>A,formatFractionTotal:(A)=>A,bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",modifierClass:"swiper-pagination-",currentClass:"swiper-pagination-current",totalClass:"swiper-pagination-total",hiddenClass:"swiper-pagination-hidden",progressbarFillClass:"swiper-pagination-progressbar-fill",progressbarOppositeClass:"swiper-pagination-progressbar-opposite",clickableClass:"swiper-pagination-clickable",lockClass:"swiper-pagination-lock",horizontalClass:"swiper-pagination-horizontal",verticalClass:"swiper-pagination-vertical",paginationDisabledClass:"swiper-pagination-disabled"}}),J.pagination={el:null,bullets:[]};let W,H=0;function U(){return!J.params.pagination.el||!J.pagination.el||Array.isArray(J.pagination.el)&&J.pagination.el.length===0}function q(A,I){let{bulletActiveClass:P}=J.params.pagination;if(!A)return;if(A=A[`${I==="prev"?"previous":"next"}ElementSibling`],A){if(A.classList.add(`${P}-${I}`),A=A[`${I==="prev"?"previous":"next"}ElementSibling`],A)A.classList.add(`${P}-${I}-${I}`)}}function X(A,I,P){if(A=A%P,I=I%P,I===A+1)return"next";else if(I===A-1)return"previous";return}function F(A){let I=A.target.closest(_Q(J.params.pagination.bulletClass));if(!I)return;A.preventDefault();let P=z$(I)*J.params.slidesPerGroup;if(J.params.loop){if(J.realIndex===P)return;let j=X(J.realIndex,P,J.slides.length);if(j==="next")J.slideNext();else if(j==="previous")J.slidePrev();else J.slideToLoop(P)}else J.slideTo(P)}function N(){let A=J.rtl,I=J.params.pagination;if(U())return;let P=J.pagination.el;P=$J(P);let j,T,w=J.virtual&&J.params.virtual.enabled?J.virtual.slides.length:J.slides.length,_=J.params.loop?Math.ceil(w/J.params.slidesPerGroup):J.snapGrid.length;if(J.params.loop)T=J.previousRealIndex||0,j=J.params.slidesPerGroup>1?Math.floor(J.realIndex/J.params.slidesPerGroup):J.realIndex;else if(typeof J.snapIndex!=="undefined")j=J.snapIndex,T=J.previousSnapIndex;else T=J.previousIndex||0,j=J.activeIndex||0;if(I.type==="bullets"&&J.pagination.bullets&&J.pagination.bullets.length>0){let S=J.pagination.bullets,y,f,u;if(I.dynamicBullets){if(W=mZ(S[0],J.isHorizontal()?"width":"height",!0),P.forEach((v)=>{v.style[J.isHorizontal()?"width":"height"]=`${W*(I.dynamicMainBullets+4)}px`}),I.dynamicMainBullets>1&&T!==void 0){if(H+=j-(T||0),H>I.dynamicMainBullets-1)H=I.dynamicMainBullets-1;else if(H<0)H=0}y=Math.max(j-H,0),f=y+(Math.min(S.length,I.dynamicMainBullets)-1),u=(f+y)/2}if(S.forEach((v)=>{let m=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((l)=>`${I.bulletActiveClass}${l}`)].map((l)=>typeof l==="string"&&l.includes(" ")?l.split(" "):l).flat();v.classList.remove(...m)}),P.length>1)S.forEach((v)=>{let m=z$(v);if(m===j)v.classList.add(...I.bulletActiveClass.split(" "));else if(J.isElement)v.setAttribute("part","bullet");if(I.dynamicBullets){if(m>=y&&m<=f)v.classList.add(...`${I.bulletActiveClass}-main`.split(" "));if(m===y)q(v,"prev");if(m===f)q(v,"next")}});else{let v=S[j];if(v)v.classList.add(...I.bulletActiveClass.split(" "));if(J.isElement)S.forEach((m,l)=>{m.setAttribute("part",l===j?"bullet-active":"bullet")});if(I.dynamicBullets){let m=S[y],l=S[f];for(let H0=y;H0<=f;H0+=1)if(S[H0])S[H0].classList.add(...`${I.bulletActiveClass}-main`.split(" "));q(m,"prev"),q(l,"next")}}if(I.dynamicBullets){let v=Math.min(S.length,I.dynamicMainBullets+4),m=(W*v-W)/2-u*W,l=A?"right":"left";S.forEach((H0)=>{H0.style[J.isHorizontal()?l:"top"]=`${m}px`})}}P.forEach((S,y)=>{if(I.type==="fraction")S.querySelectorAll(_Q(I.currentClass)).forEach((f)=>{f.textContent=I.formatFractionCurrent(j+1)}),S.querySelectorAll(_Q(I.totalClass)).forEach((f)=>{f.textContent=I.formatFractionTotal(_)});if(I.type==="progressbar"){let f;if(I.progressbarOpposite)f=J.isHorizontal()?"vertical":"horizontal";else f=J.isHorizontal()?"horizontal":"vertical";let u=(j+1)/_,v=1,m=1;if(f==="horizontal")v=u;else m=u;S.querySelectorAll(_Q(I.progressbarFillClass)).forEach((l)=>{l.style.transform=`translate3d(0,0,0) scaleX(${v}) scaleY(${m})`,l.style.transitionDuration=`${J.params.speed}ms`})}if(I.type==="custom"&&I.renderCustom){if(SQ(S,I.renderCustom(J,j+1,_)),y===0)Z("paginationRender",S)}else{if(y===0)Z("paginationRender",S);Z("paginationUpdate",S)}if(J.params.watchOverflow&&J.enabled)S.classList[J.isLocked?"add":"remove"](I.lockClass)})}function L(){let A=J.params.pagination;if(U())return;let I=J.virtual&&J.params.virtual.enabled?J.virtual.slides.length:J.grid&&J.params.grid.rows>1?J.slides.length/Math.ceil(J.params.grid.rows):J.slides.length,P=J.pagination.el;P=$J(P);let j="";if(A.type==="bullets"){let T=J.params.loop?Math.ceil(I/J.params.slidesPerGroup):J.snapGrid.length;if(J.params.freeMode&&J.params.freeMode.enabled&&T>I)T=I;for(let w=0;w`}if(A.type==="fraction")if(A.renderFraction)j=A.renderFraction.call(J,A.currentClass,A.totalClass);else j=` / `;if(A.type==="progressbar")if(A.renderProgressbar)j=A.renderProgressbar.call(J,A.progressbarFillClass);else j=``;if(J.pagination.bullets=[],P.forEach((T)=>{if(A.type!=="custom")SQ(T,j||"");if(A.type==="bullets")J.pagination.bullets.push(...T.querySelectorAll(_Q(A.bulletClass)))}),A.type!=="custom")Z("paginationRender",P[0])}function Y(){J.params.pagination=cZ(J,J.originalParams.pagination,J.params.pagination,{el:"swiper-pagination"});let A=J.params.pagination;if(!A.el)return;let I;if(typeof A.el==="string"&&J.isElement)I=J.el.querySelector(A.el);if(!I&&typeof A.el==="string")I=[...document.querySelectorAll(A.el)];if(!I)I=A.el;if(!I||I.length===0)return;if(J.params.uniqueNavElements&&typeof A.el==="string"&&Array.isArray(I)&&I.length>1){if(I=[...J.el.querySelectorAll(A.el)],I.length>1)I=I.find((P)=>{if(O6(P,".swiper")[0]!==J.el)return!1;return!0})}if(Array.isArray(I)&&I.length===1)I=I[0];Object.assign(J.pagination,{el:I}),I=$J(I),I.forEach((P)=>{if(A.type==="bullets"&&A.clickable)P.classList.add(...(A.clickableClass||"").split(" "));if(P.classList.add(A.modifierClass+A.type),P.classList.add(J.isHorizontal()?A.horizontalClass:A.verticalClass),A.type==="bullets"&&A.dynamicBullets){if(P.classList.add(`${A.modifierClass}${A.type}-dynamic`),H=0,A.dynamicMainBullets<1)A.dynamicMainBullets=1}if(A.type==="progressbar"&&A.progressbarOpposite)P.classList.add(A.progressbarOppositeClass);if(A.clickable)P.addEventListener("click",F);if(!J.enabled)P.classList.add(A.lockClass)})}function B(){let A=J.params.pagination;if(U())return;let I=J.pagination.el;if(I)I=$J(I),I.forEach((P)=>{if(P.classList.remove(A.hiddenClass),P.classList.remove(A.modifierClass+A.type),P.classList.remove(J.isHorizontal()?A.horizontalClass:A.verticalClass),A.clickable)P.classList.remove(...(A.clickableClass||"").split(" ")),P.removeEventListener("click",F)});if(J.pagination.bullets)J.pagination.bullets.forEach((P)=>P.classList.remove(...A.bulletActiveClass.split(" ")))}$("changeDirection",()=>{if(!J.pagination||!J.pagination.el)return;let A=J.params.pagination,{el:I}=J.pagination;I=$J(I),I.forEach((P)=>{P.classList.remove(A.horizontalClass,A.verticalClass),P.classList.add(J.isHorizontal()?A.horizontalClass:A.verticalClass)})}),$("init",()=>{if(J.params.pagination.enabled===!1)V();else Y(),L(),N()}),$("activeIndexChange",()=>{if(typeof J.snapIndex==="undefined")N()}),$("snapIndexChange",()=>{N()}),$("snapGridLengthChange",()=>{L(),N()}),$("destroy",()=>{B()}),$("enable disable",()=>{let{el:A}=J.pagination;if(A)A=$J(A),A.forEach((I)=>I.classList[J.enabled?"remove":"add"](J.params.pagination.lockClass))}),$("lock unlock",()=>{N()}),$("click",(A,I)=>{let P=I.target,j=$J(J.pagination.el);if(J.params.pagination.el&&J.params.pagination.hideOnClick&&j&&j.length>0&&!P.classList.contains(J.params.pagination.bulletClass)){if(J.navigation&&(J.navigation.nextEl&&P===J.navigation.nextEl||J.navigation.prevEl&&P===J.navigation.prevEl))return;if(j[0].classList.contains(J.params.pagination.hiddenClass)===!0)Z("paginationShow");else Z("paginationHide");j.forEach((w)=>w.classList.toggle(J.params.pagination.hiddenClass))}});let M=()=>{J.el.classList.remove(J.params.pagination.paginationDisabledClass);let{el:A}=J.pagination;if(A)A=$J(A),A.forEach((I)=>I.classList.remove(J.params.pagination.paginationDisabledClass));Y(),L(),N()},V=()=>{J.el.classList.add(J.params.pagination.paginationDisabledClass);let{el:A}=J.pagination;if(A)A=$J(A),A.forEach((I)=>I.classList.add(J.params.pagination.paginationDisabledClass));B()};Object.assign(J.pagination,{enable:M,disable:V,render:L,update:N,init:Y,destroy:B})}function qO(J,Q){console.log("Bar graph module initializing...");let $=J.querySelector(".swiper"),K=$.querySelector(".swiper-wrapper.sotw-bars").querySelectorAll(".swiper-slide"),W=J.querySelector("[data-slider='next']"),H=J.querySelector("[data-slider='previous']"),U=window.matchMedia("(prefers-reduced-motion: reduce)"),q=U.matches;U.addEventListener("change",(L)=>{q=L.matches});let X=q?0:750,F=(L)=>{let Y=T8.utils.toArray(".c-bar-row_track",L),B=L.querySelector(".c-bar-row"),M=T8.utils.toArray(".c-bar-row_label",L),V=T8.utils.toArray(".c-bar-row_value",L);if(Y.length===0)return;let A=T8.timeline();if(B)A.from(B,{backgroundColor:"#FFF",duration:0.5,ease:"none",delay:1});if(A.fromTo(Y,{scaleX:0,transformOrigin:"0% 50%"},{scaleX:1,duration:1,ease:"power2.out",stagger:0.05,onStart:()=>{Y.forEach((I)=>{let j=I.querySelector(".c-bar-row_value").querySelector("h4"),T=parseFloat(j.textContent),w={value:0};T8.to(w,{value:T,duration:2,ease:"power2.out",onUpdate:function(){j.textContent=Math.round(w.value)+"%"}})})}},"0"),M.length>0)A.from(M,{opacity:0,duration:0.6,ease:"power2.out",stagger:0.05},"<0.5");if(V.length>0)A.from(V,{opacity:0,duration:0.6,ease:"power2.out",stagger:0.05},"<")},N=new H8($,{modules:[$5,Z5],slidesPerView:"auto",centeredSlides:!1,autoHeight:!1,speed:X,mousewheel:{enabled:!1,forceToAxis:!0},keyboard:{enabled:!0,onlyInViewport:!0},navigation:{nextEl:W,prevEl:H},slideActiveClass:"is-active",on:{init:function(){let L=this.slides[this.activeIndex];P7(J,{autoStart:!0,callback:({isIn:Y})=>{if(Y)F(L)}})},slideChange:function(){let L=this.slides[this.activeIndex];F(L)}}});YJ(()=>{U.removeEventListener("change",()=>{}),N.destroy(!0,!0)})}var q5={};UJ(q5,{default:()=>GO});function GO(J,Q){let $=document.cookie.includes("goose=true"),Z=new URLSearchParams(window.location.search).has("directaccess");if(console.log("chaptersection Has Cookie",$),console.log("chaptersection Has Direct Access",Z),$||Z)J.dataset.chapters="unlocked"}var XO={};var G5={};UJ(G5,{default:()=>NO});class YO{events;constructor(){this.events={}}on(J,Q){if(!this.events[J])this.events[J]=[];this.events[J].push(Q)}once(J,Q){let $=(Z)=>{Q(Z),this.off(J,$)};this.on(J,$)}off(J,Q){if(!this.events[J])return;this.events[J]=this.events[J].filter(($)=>$!==Q)}emit(J,Q){if(!this.events[J])return;this.events[J].forEach(($)=>$(Q))}}class j7{static emitter=new YO;static state={};static createProxy(J){return new Proxy(J,{set:function(Q,$,Z,K){return j7.emitter.emit($.toString(),Z),Reflect.set(Q,$,Z,K)}})}static proxy=new Proxy(j7.state,{set:function(J,Q,$,Z){if(typeof $==="object"&&$!==null)$=j7.createProxy($);return j7.emitter.emit(Q.toString(),$),Reflect.set(J,Q,$,Z)}});static on(J,Q){this.emitter.on(J,Q)}static once(J,Q){this.emitter.once(J,Q)}static off(J,Q){this.emitter.off(J,Q)}}var rk={get(J,Q){if(typeof Q==="string"&&Q in j7)return j7[Q].bind(j7);return J[Q]},set(J,Q,$,Z){return Reflect.set(j7.proxy,Q,$,Z)}},U8=new Proxy(j7.proxy,rk);function NO(J,Q){U8.on("SOMETHING",($)=>{console.log("something",$)}),fW(async()=>{await S9.to(J,{duration:0.2,backgroundColor:"green"})}),xW(async()=>{await S9.to(J,{duration:1,backgroundColor:"blue"}),await S9.to(J,{duration:1,autoAlpha:0})},{element:J}),XJ(()=>{}),YJ(()=>{})}var X5={};UJ(X5,{default:()=>OO});function OO(J,Q){let $=[],Z=()=>{let W=window.matchMedia("(pointer: coarse)").matches,H=window.matchMedia("(prefers-reduced-motion: reduce)").matches,U=window.matchMedia("(max-width: 991px)").matches;return W||H||U},K=()=>{if(Z())return;let W;if(J.hasAttribute("data-target")&&J.dataset.target==="draggable-container")W=[J];else W=Array.from(J.querySelectorAll('[data-target="draggable-container"]'));if(!W.length){console.warn("No draggable containers found");return}W.forEach((H,U)=>{let q=Array.from(H.querySelectorAll('[data-target="draggable-element"]'));if(!q.length){console.warn(`No draggable elements found in container ${U}`);return}let X=q.reduce((N,L)=>Math.max(N,parseInt(getComputedStyle(L).zIndex,10)||0),0),F=Y7.create(q,{type:"x,y",bounds:H,inertia:!1,zIndexBoost:!1,onPress:function(){this.target.style.zIndex=String(++X),this.target.classList.add("is-dragging")},onRelease:function(){this.target.classList.remove("is-dragging")}});$.push(...F)})};XJ(()=>{K()}),YJ(()=>{$.forEach((W)=>{if(W&&W.kill)W.kill()}),$=[]})}var Y5={};UJ(Y5,{default:()=>DO});function FO(){let J=window.Webflow||[];if(J.length>0)J.forEach((Q)=>{Q.destroy(),Q.ready()});console.log(J)}function DO(J,Q){console.log("form",J),XJ(()=>{FO()})}var N5={};UJ(N5,{default:()=>LO});function LO(J,Q){setTimeout(()=>{let $=J.querySelectorAll("input, textarea, select"),Z=()=>{if(Array.from($).filter((H)=>{let U=H,q=window.getComputedStyle(U);return q.display!=="none"&&q.visibility!=="hidden"&&U.offsetParent!==null}).every((H)=>{return H.value.trim()!==""}))document.cookie="goose=true; path=/; max-age=31536000",console.log("Cookie 'goose' has been set!")};$.forEach((K)=>{K.addEventListener("input",Z),K.addEventListener("change",Z)}),Z()},1000)}var O5={};UJ(O5,{default:()=>RO});function RO(J,Q){console.log("Highlighted text initializing");let $=()=>{if(typeof gsap==="undefined"||typeof SplitText==="undefined"||typeof ScrollTrigger==="undefined")return;gsap.registerPlugin(ScrollTrigger,SplitText),J.querySelectorAll(".h3").forEach((K)=>{let W=K.getAttribute("data-highlight-scroll-start")||"top 90%",H=K.getAttribute("data-highlight-scroll-end")||"center 40%",U=parseFloat(K.getAttribute("data-highlight-fade"))||0.2,q=parseFloat(K.getAttribute("data-highlight-stagger"))||0.1;new SplitText(K,{type:"words, chars",autoSplit:!0,onSplit(X){return gsap.context(()=>{gsap.timeline({scrollTrigger:{scrub:!0,trigger:K,start:W,end:H}}).from(X.chars,{autoAlpha:U,stagger:q,ease:"linear"})},K)}})})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{$()})})}var F5={};UJ(F5,{default:()=>BO});function BO(J,Q){console.log("Bar graph module initializing...");let $=()=>{let Z=gsap.utils.toArray(".c-bar-row_track",J),K=J,W=gsap.utils.toArray(".c-bar-row_label",J),H=gsap.utils.toArray(".c-bar-row_value",J);if(console.log(Z),Z.length===0)return;let U=gsap.timeline();if(K)U.from(K,{backgroundColor:"#FFF",duration:0.5,ease:"none",delay:1});if(U.fromTo(Z,{scaleX:0,transformOrigin:"0% 50%"},{scaleX:1,duration:1,ease:"power2.out",stagger:0.05,onStart:()=>{Z.forEach((q)=>{let F=q.querySelector(".c-bar-row_value").querySelector("h4, h3, h2, .h4"),N=parseFloat(F.textContent),L={value:0};gsap.to(L,{value:N,duration:2,ease:"power2.out",onUpdate:function(){F.textContent=Math.round(L.value)+"%"}})})}},"0"),W.length>0)U.from(W,{opacity:0,duration:0.6,ease:"power2.out",stagger:0.05},"<0.5");if(H.length>0)U.from(H,{opacity:0,duration:0.6,ease:"power2.out",stagger:0.05},"<")};P7(J,{autoStart:!0,callback:({isIn:Z})=>{if(Z)$()}})}var D5={};UJ(D5,{default:()=>MO});function MO(J,Q){console.log("ilya",J,Q),XJ(()=>{console.log("ilya mounted")}),YJ(()=>{console.log("ilya destroyed")}),fW(()=>{console.log("ilya page in")}),xW(()=>{console.log("ilya page out")})}var L5={};UJ(L5,{default:()=>zO});S9.registerPlugin(Y7);function zO(J,Q){let $=J.querySelector(".cc-recycle-bin"),Z=document.querySelector(".sotw-recycle_window");if(!$||!Z){console.warn("Required elements not found",{icon:$,modal:Z});return}let K=!1,W=null,H=0,U=0,q=()=>{let B=$.getBoundingClientRect();return{x:B.left+B.width/2,y:B.top+B.height/2}},X=()=>{if(K)return;K=!0;let B=q(),M=window.innerWidth/2,V=window.innerHeight/2,A=B.x-M,I=B.y-V;S9.set(Z,{opacity:0,width:0,height:0,left:"50%",top:"50%",xPercent:-50,yPercent:-50,x:A,y:I,display:"block",zIndex:1000}),S9.to(Z,{opacity:1,width:600,height:400,x:0,y:0,duration:0.6,ease:"back.out(1.2)",onComplete:()=>{if(W)W.kill();W=Y7.create(Z,{type:"x,y",bounds:window,edgeResistance:0.65,onDrag:function(){H=this.deltaX,U=this.deltaY},onDragEnd:function(){let j=this.x+H*10,T=this.y+U*10;S9.to(Z,{x:j,y:T,duration:0.8,ease:"power2.out",overwrite:"auto"})}})[0],setTimeout(()=>{document.addEventListener("click",Y)},100)}}),console.log("Modal opened")},F=()=>{if(!K)return;if(K=!1,document.removeEventListener("click",Y),W)W.disable();let B=q(),M=window.innerWidth/2,V=window.innerHeight/2,A=B.x-M,I=B.y-V;S9.to(Z,{opacity:0,width:0,height:0,x:A,y:I,duration:0.5,ease:"back.in(1.2)",onComplete:()=>{if(S9.set(Z,{display:"none"}),W)W.kill(),W=null}}),console.log("Modal closed")},N=(B)=>{if(console.log("Icon clicked!",{isOpen:K}),B.preventDefault(),B.stopPropagation(),K)F();else X()},L=(B)=>{let M=Z.querySelector(".sotw-ui-controls"),V=B.target.closest(".cc-close");if(V&&M?.contains(V)){console.log("Minimize button clicked via delegation!"),B.preventDefault(),B.stopPropagation(),F();return}B.stopPropagation()},Y=(B)=>{if(!Z.contains(B.target)&&!$.contains(B.target))F()};XJ(()=>{console.log("key-data-points mounted"),S9.set(Z,{display:"none",opacity:0}),console.log("Adding click listener to icon:",$),$.addEventListener("click",N),Z.addEventListener("click",L),console.log("Event listeners attached")}),YJ(()=>{if(console.log("key-data-points destroyed"),$.removeEventListener("click",N),Z.removeEventListener("click",L),document.removeEventListener("click",Y),W)W.kill(),W=null;S9.set(Z,{clearProps:"all"})})}var R5={};UJ(R5,{default:()=>kO});function kO(J,Q){U8.on("PAGE",($)=>{console.log("page changed")})}var M5={};UJ(M5,{default:()=>AO});var i9=XM(VO());function AO(J,Q){let $=J.tagName==="CANVAS"?J:J.querySelector("canvas");if(!$){console.warn("[rive] No found");return}let Z=Q.rive||"ani-1",K=Q.riveSrc||"https://cdn.prod.website-files.com/686294e263eb7e215bd232f7/68f10995c151c9f81b2ef353_fff6f54180720a23efe54c719128b791_webflow_sotw.riv",W=Q.riveSm||Q.riveStateMachine||"State Machine 1",H=Q.riveAutoplay!=="false",U=Q.rivePlayOnce==="true",q=parseFloat(Q.riveThreshold)||0.2,X={"top-left":i9.Alignment.TopLeft,"top-center":i9.Alignment.TopCenter,"top-right":i9.Alignment.TopRight,"center-left":i9.Alignment.CenterLeft,center:i9.Alignment.Center,"center-right":i9.Alignment.CenterRight,"bottom-left":i9.Alignment.BottomLeft,"bottom-center":i9.Alignment.BottomCenter,"bottom-right":i9.Alignment.BottomRight},F={cover:i9.Fit.Cover,contain:i9.Fit.Contain,fill:i9.Fit.Fill,"fit-width":i9.Fit.FitWidth,"fit-height":i9.Fit.FitHeight,none:i9.Fit.None},N=X[(Q.riveAlignment||"").toLowerCase()]||i9.Alignment.BottomCenter,L=F[(Q.riveFit||"").toLowerCase()]||i9.Fit.Contain;$.style.width=$.style.width||"100%",$.style.height=$.style.height||"100%",$.style.display="block",$.removeAttribute("width"),$.removeAttribute("height");let Y=null,B=null,M=null,V=null,A=!1,I=!1,P=()=>{let v=window.devicePixelRatio||1,m=$.getBoundingClientRect(),l=Math.max(1,Math.round(m.width*v)),H0=Math.max(1,Math.round(m.height*v));if($.width!==l)$.width=l;if($.height!==H0)$.height=H0},j=()=>{clearTimeout(M),M=setTimeout(()=>{P(),Y?.resizeDrawingSurfaceToCanvas()},80)},T=()=>{if(!Y)return;if(document.hidden)Y.pause();else if(H&&I)Y.play()},w=()=>{V=new IntersectionObserver((v)=>{v.forEach((m)=>{if(I=m.isIntersecting,m.isIntersecting){if(!Y)_();else if(H&&!A)Y.play(),Y.stateMachineInputs(W)?.find((N0)=>N0.name==="start")?.fire();if(U)A=!0}else if(Y&&H&&!U)Y.pause()})},{threshold:q,rootMargin:"0px"}),V.observe(J)},_=()=>{try{Y=new i9.Rive({src:K,canvas:$,artboard:Z,stateMachines:W,autoplay:H,layout:new i9.Layout({fit:L,alignment:N}),onLoad:()=>{P(),Y.resizeDrawingSurfaceToCanvas();let m=Y.stateMachineInputs(W)?.find((l)=>l.name==="start");if(m&&H)m.fire()},onLoadError:(v)=>{console.error("[rive] Load error:",v)}})}catch(v){console.error("[rive] Init error:",v)}},S=()=>{if(!Y)return;Y.play(),Y.stateMachineInputs(W)?.find((l)=>l.name==="start")?.fire()},y=()=>Y?.pause(),f=()=>Y?.reset(),u=(v)=>{if(!Y)return;Y.stateMachineInputs(W)?.find((H0)=>H0.name===v)?.fire()};J.riveControls={play:S,pause:y,reset:f,trigger:u,getInstance:()=>Y},XJ(()=>{w(),window.addEventListener("resize",j,{passive:!0}),document.addEventListener("visibilitychange",T)}),YJ(()=>{if(clearTimeout(M),window.removeEventListener("resize",j),document.removeEventListener("visibilitychange",T),V)V.disconnect(),V=null;if(B)cancelAnimationFrame(B);Y?.cleanup(),Y=null,delete J.riveControls})}var z5={};UJ(z5,{default:()=>IO});function ak(J){J.setAttribute("aria-hidden","true"),J.style.position="absolute",J.style.left="-9999px",J.style.top="-9999px",J.style.width="1px"}var tk=(J)=>{let Q=J.textContent;J.textContent="";let $=document.createElement("span");$.textContent=Q,J.appendChild($),ak($);let Z=document.createElement("span");return Z.setAttribute("data-css","overflow-clip"),Z.textContent=Q,Z.setAttribute("aria-hidden","true"),J.appendChild(Z),new CW(Z,{type:"chars"})};function IO(J){let Q=tk(J);P7(J,{autoStart:!0,callback:({isIn:$})=>{if($)S9.to(Q.chars,{yPercent:0,stagger:0.02});else S9.killTweensOf(Q.chars),S9.set(Q.chars,{yPercent:100})}})}var k5={};UJ(k5,{default:()=>EO});function EO(J,Q){}var V5={};UJ(V5,{default:()=>CO});function CO(J,Q){let $=J.querySelector(".slot > div"),Z=parseFloat($.textContent),K={value:0};P7(J,{autoStart:!0,callback:({isIn:W})=>{if(W)gsap.to(K,{value:Z,duration:1,ease:"power2.out",onUpdate:function(){$.textContent=Math.round(K.value)+"%"}})}})}var A5={};UJ(A5,{default:()=>PO});function PO(J,Q){let $=J.querySelectorAll('[data-bars-vertical="item"]');$.forEach((Z)=>{let K=Z.querySelector('[data-bars-vertical="head"]'),W=K.querySelectorAll(":scope > *"),H=()=>{gsap.timeline().fromTo($,{transformOrigin:"100% 100%",scaleY:0},{scaleY:1,stagger:0.1,duration:1,ease:"power2.out"}).fromTo(K,{transformOrigin:"100% 100%",scaleY:0},{scaleY:1,stagger:0.1,duration:1,ease:"power2.out"},"<0.5").fromTo(W,{opacity:0.5},{opacity:1,duration:0.5,ease:"none"},"<0.1")};P7(J,{autoStart:!0,callback:({isIn:U})=>{H()}})})}var VX={};UJ(VX,{default:()=>CB});var kX={};UJ(kX,{getWebglValues:()=>LK,default:()=>EB});class jO{static isWebGL2Available(){try{let J=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&J.getContext("webgl2"))}catch(J){return!1}}static isColorSpaceAvailable(J){try{let Q=document.createElement("canvas"),$=window.WebGL2RenderingContext&&Q.getContext("webgl2");return $.drawingBufferColorSpace=J,$.drawingBufferColorSpace===J}catch(Q){return!1}}static getWebGL2ErrorMessage(){return this._getErrorMessage(2)}static _getErrorMessage(J){let Q={1:"WebGL",2:"WebGL 2"},$={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},Z='Your $0 does not seem to support $1',K=document.createElement("div");if(K.id="webglmessage",K.style.fontFamily="monospace",K.style.fontSize="13px",K.style.fontWeight="normal",K.style.textAlign="center",K.style.background="#fff",K.style.color="#000",K.style.padding="1.5em",K.style.width="400px",K.style.margin="5em auto 0",$[J])Z=Z.replace("$0","graphics card");else Z=Z.replace("$0","browser");return Z=Z.replace("$1",Q[J]),K.innerHTML=Z,K}}var I5=jO;function k$(J){let Q=J[0],$=J[1],Z=J[2];return Math.sqrt(Q*Q+$*$+Z*Z)}function gW(J,Q){return J[0]=Q[0],J[1]=Q[1],J[2]=Q[2],J}function TO(J,Q,$,Z){return J[0]=Q,J[1]=$,J[2]=Z,J}function E5(J,Q,$){return J[0]=Q[0]+$[0],J[1]=Q[1]+$[1],J[2]=Q[2]+$[2],J}function C5(J,Q,$){return J[0]=Q[0]-$[0],J[1]=Q[1]-$[1],J[2]=Q[2]-$[2],J}function SO(J,Q,$){return J[0]=Q[0]*$[0],J[1]=Q[1]*$[1],J[2]=Q[2]*$[2],J}function _O(J,Q,$){return J[0]=Q[0]/$[0],J[1]=Q[1]/$[1],J[2]=Q[2]/$[2],J}function dW(J,Q,$){return J[0]=Q[0]*$,J[1]=Q[1]*$,J[2]=Q[2]*$,J}function yO(J,Q){let $=Q[0]-J[0],Z=Q[1]-J[1],K=Q[2]-J[2];return Math.sqrt($*$+Z*Z+K*K)}function wO(J,Q){let $=Q[0]-J[0],Z=Q[1]-J[1],K=Q[2]-J[2];return $*$+Z*Z+K*K}function P5(J){let Q=J[0],$=J[1],Z=J[2];return Q*Q+$*$+Z*Z}function hO(J,Q){return J[0]=-Q[0],J[1]=-Q[1],J[2]=-Q[2],J}function xO(J,Q){return J[0]=1/Q[0],J[1]=1/Q[1],J[2]=1/Q[2],J}function uW(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=$*$+Z*Z+K*K;if(W>0)W=1/Math.sqrt(W);return J[0]=Q[0]*W,J[1]=Q[1]*W,J[2]=Q[2]*W,J}function j5(J,Q){return J[0]*Q[0]+J[1]*Q[1]+J[2]*Q[2]}function T5(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=$[0],U=$[1],q=$[2];return J[0]=K*q-W*U,J[1]=W*H-Z*q,J[2]=Z*U-K*H,J}function fO(J,Q,$,Z){let K=Q[0],W=Q[1],H=Q[2];return J[0]=K+Z*($[0]-K),J[1]=W+Z*($[1]-W),J[2]=H+Z*($[2]-H),J}function bO(J,Q,$,Z,K){let W=Math.exp(-Z*K),H=Q[0],U=Q[1],q=Q[2];return J[0]=$[0]+(H-$[0])*W,J[1]=$[1]+(U-$[1])*W,J[2]=$[2]+(q-$[2])*W,J}function vO(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=$[3]*Z+$[7]*K+$[11]*W+$[15];return H=H||1,J[0]=($[0]*Z+$[4]*K+$[8]*W+$[12])/H,J[1]=($[1]*Z+$[5]*K+$[9]*W+$[13])/H,J[2]=($[2]*Z+$[6]*K+$[10]*W+$[14])/H,J}function gO(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=$[3]*Z+$[7]*K+$[11]*W+$[15];return H=H||1,J[0]=($[0]*Z+$[4]*K+$[8]*W)/H,J[1]=($[1]*Z+$[5]*K+$[9]*W)/H,J[2]=($[2]*Z+$[6]*K+$[10]*W)/H,J}function uO(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2];return J[0]=Z*$[0]+K*$[3]+W*$[6],J[1]=Z*$[1]+K*$[4]+W*$[7],J[2]=Z*$[2]+K*$[5]+W*$[8],J}function dO(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=$[0],U=$[1],q=$[2],X=$[3],F=U*W-q*K,N=q*Z-H*W,L=H*K-U*Z,Y=U*L-q*N,B=q*F-H*L,M=H*N-U*F,V=X*2;return F*=V,N*=V,L*=V,Y*=2,B*=2,M*=2,J[0]=Z+F+Y,J[1]=K+N+B,J[2]=W+L+M,J}var mO=function(){let J=[0,0,0],Q=[0,0,0];return function($,Z){gW(J,$),gW(Q,Z),uW(J,J),uW(Q,Q);let K=j5(J,Q);if(K>1)return 0;else if(K<-1)return Math.PI;else return Math.acos(K)}}();function cO(J,Q){return J[0]===Q[0]&&J[1]===Q[1]&&J[2]===Q[2]}class k0 extends Array{constructor(J=0,Q=J,$=J){super(J,Q,$);return this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(J){this[0]=J}set y(J){this[1]=J}set z(J){this[2]=J}set(J,Q=J,$=J){if(J.length)return this.copy(J);return TO(this,J,Q,$),this}copy(J){return gW(this,J),this}add(J,Q){if(Q)E5(this,J,Q);else E5(this,this,J);return this}sub(J,Q){if(Q)C5(this,J,Q);else C5(this,this,J);return this}multiply(J){if(J.length)SO(this,this,J);else dW(this,this,J);return this}divide(J){if(J.length)_O(this,this,J);else dW(this,this,1/J);return this}inverse(J=this){return xO(this,J),this}len(){return k$(this)}distance(J){if(J)return yO(this,J);else return k$(this)}squaredLen(){return P5(this)}squaredDistance(J){if(J)return wO(this,J);else return P5(this)}negate(J=this){return hO(this,J),this}cross(J,Q){if(Q)T5(this,J,Q);else T5(this,this,J);return this}scale(J){return dW(this,this,J),this}normalize(){return uW(this,this),this}dot(J){return j5(this,J)}equals(J){return cO(this,J)}applyMatrix3(J){return uO(this,this,J),this}applyMatrix4(J){return vO(this,this,J),this}scaleRotateMatrix4(J){return gO(this,this,J),this}applyQuaternion(J){return dO(this,this,J),this}angle(J){return mO(this,J)}lerp(J,Q){return fO(this,this,J,Q),this}smoothLerp(J,Q,$){return bO(this,this,J,Q,$),this}clone(){return new k0(this[0],this[1],this[2])}fromArray(J,Q=0){return this[0]=J[Q],this[1]=J[Q+1],this[2]=J[Q+2],this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J[Q+2]=this[2],J}transformDirection(J){let Q=this[0],$=this[1],Z=this[2];return this[0]=J[0]*Q+J[4]*$+J[8]*Z,this[1]=J[1]*Q+J[5]*$+J[9]*Z,this[2]=J[2]*Q+J[6]*$+J[10]*Z,this.normalize()}}var lO=new k0,ek=1,JV=1,nO=!1;class nZ{constructor(J,Q={}){if(!J.canvas)console.error("gl not passed as first argument to Geometry");this.gl=J,this.attributes=Q,this.id=ek++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let $ in Q)this.addAttribute($,Q[$])}addAttribute(J,Q){if(this.attributes[J]=Q,Q.id=JV++,Q.size=Q.size||1,Q.type=Q.type||(Q.data.constructor===Float32Array?this.gl.FLOAT:Q.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),Q.target=J==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,Q.normalized=Q.normalized||!1,Q.stride=Q.stride||0,Q.offset=Q.offset||0,Q.count=Q.count||(Q.stride?Q.data.byteLength/Q.stride:Q.data.length/Q.size),Q.divisor=Q.instanced||0,Q.needsUpdate=!1,Q.usage=Q.usage||this.gl.STATIC_DRAW,!Q.buffer)this.updateAttribute(Q);if(Q.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==Q.count*Q.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,Q.count*Q.divisor);this.instancedCount=Q.count*Q.divisor}else if(J==="index")this.drawRange.count=Q.count;else if(!this.attributes.index)this.drawRange.count=Math.max(this.drawRange.count,Q.count)}updateAttribute(J){let Q=!J.buffer;if(Q)J.buffer=this.gl.createBuffer();if(this.glState.boundBuffer!==J.buffer)this.gl.bindBuffer(J.target,J.buffer),this.glState.boundBuffer=J.buffer;if(Q)this.gl.bufferData(J.target,J.data,J.usage);else this.gl.bufferSubData(J.target,0,J.data);J.needsUpdate=!1}setIndex(J){this.addAttribute("index",J)}setDrawRange(J,Q){this.drawRange.start=J,this.drawRange.count=Q}setInstancedCount(J){this.instancedCount=J}createVAO(J){this.VAOs[J.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[J.attributeOrder]),this.bindAttributes(J)}bindAttributes(J){if(J.attributeLocations.forEach((Q,{name:$,type:Z})=>{if(!this.attributes[$]){console.warn(`active attribute ${$} not being supplied`);return}let K=this.attributes[$];this.gl.bindBuffer(K.target,K.buffer),this.glState.boundBuffer=K.buffer;let W=1;if(Z===35674)W=2;if(Z===35675)W=3;if(Z===35676)W=4;let H=K.size/W,U=W===1?0:W*W*4,q=W===1?0:W*4;for(let X=0;X{let W=this.attributes[K];if(W.needsUpdate)this.updateAttribute(W)});let $=2;if(this.attributes.index?.type===this.gl.UNSIGNED_INT)$=4;if(this.isInstanced)if(this.attributes.index)this.gl.renderer.drawElementsInstanced(Q,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*$,this.instancedCount);else this.gl.renderer.drawArraysInstanced(Q,this.drawRange.start,this.drawRange.count,this.instancedCount);else if(this.attributes.index)this.gl.drawElements(Q,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*$);else this.gl.drawArrays(Q,this.drawRange.start,this.drawRange.count)}getPosition(){let J=this.attributes.position;if(J.data)return J;if(nO)return;return console.warn("No position buffer data found to compute bounds"),nO=!0}computeBoundingBox(J){if(!J)J=this.getPosition();let{data:Q,size:$}=J;if(!this.bounds)this.bounds={min:new k0,max:new k0,center:new k0,scale:new k0,radius:1/0};let Z=this.bounds.min,K=this.bounds.max,W=this.bounds.center,H=this.bounds.scale;Z.set(1/0),K.set(-1/0);for(let U=0,q=Q.length;U{let W=this.uniforms[K.uniformName];for(let H of K.nameComponents){if(!W)break;if(H in W)W=W[H];else if(Array.isArray(W.value))break;else{W=void 0;break}}if(!W)return iO(`Active uniform ${K.name} has not been supplied`);if(W&&W.value===void 0)return iO(`${K.name} uniform is missing a value parameter`);if(W.value.texture)return Q=Q+1,W.value.update(Q),S5(this.gl,K.type,Z,Q);if(W.value.length&&W.value[0].texture){let H=[];return W.value.forEach((U)=>{Q=Q+1,U.update(Q),H.push(Q)}),S5(this.gl,K.type,Z,H)}S5(this.gl,K.type,Z,W.value)}),this.applyState(),J)this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function S5(J,Q,$,Z){Z=Z.length?$V(Z):Z;let K=J.renderer.state.uniformLocations.get($);if(Z.length)if(K===void 0||K.length!==Z.length)J.renderer.state.uniformLocations.set($,Z.slice(0));else{if(ZV(K,Z))return;K.set?K.set(Z):KV(K,Z),J.renderer.state.uniformLocations.set($,K)}else{if(K===Z)return;J.renderer.state.uniformLocations.set($,Z)}switch(Q){case 5126:return Z.length?J.uniform1fv($,Z):J.uniform1f($,Z);case 35664:return J.uniform2fv($,Z);case 35665:return J.uniform3fv($,Z);case 35666:return J.uniform4fv($,Z);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return Z.length?J.uniform1iv($,Z):J.uniform1i($,Z);case 35671:case 35667:return J.uniform2iv($,Z);case 35672:case 35668:return J.uniform3iv($,Z);case 35673:case 35669:return J.uniform4iv($,Z);case 35674:return J.uniformMatrix2fv($,!1,Z);case 35675:return J.uniformMatrix3fv($,!1,Z);case 35676:return J.uniformMatrix4fv($,!1,Z)}}function sO(J){let Q=J.split(` `);for(let $=0;$100)return;if(console.warn(J),_5++,_5>100)console.warn("More than 100 program warnings - stopping logs.")}var y5=new k0,WV=1;class mW{constructor({canvas:J=document.createElement("canvas"),width:Q=300,height:$=150,dpr:Z=1,alpha:K=!1,depth:W=!0,stencil:H=!1,antialias:U=!1,premultipliedAlpha:q=!1,preserveDrawingBuffer:X=!1,powerPreference:F="default",autoClear:N=!0,webgl:L=2}={}){let Y={alpha:K,depth:W,stencil:H,antialias:U,premultipliedAlpha:q,preserveDrawingBuffer:X,powerPreference:F};if(this.dpr=Z,this.alpha=K,this.color=!0,this.depth=W,this.stencil=H,this.premultipliedAlpha=q,this.autoClear=N,this.id=WV++,L===2)this.gl=J.getContext("webgl2",Y);if(this.isWebgl2=!!this.gl,!this.gl)this.gl=J.getContext("webgl",Y);if(!this.gl)console.error("unable to create webgl context");if(this.gl.renderer=this,this.setSize(Q,$),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2)this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear");else this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers");this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(J,Q){if(this.width=J,this.height=Q,this.gl.canvas.width=J*this.dpr,this.gl.canvas.height=Q*this.dpr,!this.gl.canvas.style)return;Object.assign(this.gl.canvas.style,{width:J+"px",height:Q+"px"})}setViewport(J,Q,$=0,Z=0){if(this.state.viewport.width===J&&this.state.viewport.height===Q)return;this.state.viewport.width=J,this.state.viewport.height=Q,this.state.viewport.x=$,this.state.viewport.y=Z,this.gl.viewport($,Z,J,Q)}setScissor(J,Q,$=0,Z=0){this.gl.scissor($,Z,J,Q)}enable(J){if(this.state[J]===!0)return;this.gl.enable(J),this.state[J]=!0}disable(J){if(this.state[J]===!1)return;this.gl.disable(J),this.state[J]=!1}setBlendFunc(J,Q,$,Z){if(this.state.blendFunc.src===J&&this.state.blendFunc.dst===Q&&this.state.blendFunc.srcAlpha===$&&this.state.blendFunc.dstAlpha===Z)return;if(this.state.blendFunc.src=J,this.state.blendFunc.dst=Q,this.state.blendFunc.srcAlpha=$,this.state.blendFunc.dstAlpha=Z,$!==void 0)this.gl.blendFuncSeparate(J,Q,$,Z);else this.gl.blendFunc(J,Q)}setBlendEquation(J,Q){if(J=J||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===J&&this.state.blendEquation.modeAlpha===Q)return;if(this.state.blendEquation.modeRGB=J,this.state.blendEquation.modeAlpha=Q,Q!==void 0)this.gl.blendEquationSeparate(J,Q);else this.gl.blendEquation(J)}setCullFace(J){if(this.state.cullFace===J)return;this.state.cullFace=J,this.gl.cullFace(J)}setFrontFace(J){if(this.state.frontFace===J)return;this.state.frontFace=J,this.gl.frontFace(J)}setDepthMask(J){if(this.state.depthMask===J)return;this.state.depthMask=J,this.gl.depthMask(J)}setDepthFunc(J){if(this.state.depthFunc===J)return;this.state.depthFunc=J,this.gl.depthFunc(J)}setStencilMask(J){if(this.state.stencilMask===J)return;this.state.stencilMask=J,this.gl.stencilMask(J)}setStencilFunc(J,Q,$){if(this.state.stencilFunc===J&&this.state.stencilRef===Q&&this.state.stencilFuncMask===$)return;this.state.stencilFunc=J||this.gl.ALWAYS,this.state.stencilRef=Q||0,this.state.stencilFuncMask=$||0,this.gl.stencilFunc(J||this.gl.ALWAYS,Q||0,$||0)}setStencilOp(J,Q,$){if(this.state.stencilFail===J&&this.state.stencilDepthFail===Q&&this.state.stencilDepthPass===$)return;this.state.stencilFail=J,this.state.stencilDepthFail=Q,this.state.stencilDepthPass=$,this.gl.stencilOp(J,Q,$)}activeTexture(J){if(this.state.activeTextureUnit===J)return;this.state.activeTextureUnit=J,this.gl.activeTexture(this.gl.TEXTURE0+J)}bindFramebuffer({target:J=this.gl.FRAMEBUFFER,buffer:Q=null}={}){if(this.state.framebuffer===Q)return;this.state.framebuffer=Q,this.gl.bindFramebuffer(J,Q)}getExtension(J,Q,$){if(Q&&this.gl[Q])return this.gl[Q].bind(this.gl);if(!this.extensions[J])this.extensions[J]=this.gl.getExtension(J);if(!Q)return this.extensions[J];if(!this.extensions[J])return null;return this.extensions[J][$].bind(this.extensions[J])}sortOpaque(J,Q){if(J.renderOrder!==Q.renderOrder)return J.renderOrder-Q.renderOrder;else if(J.program.id!==Q.program.id)return J.program.id-Q.program.id;else if(J.zDepth!==Q.zDepth)return J.zDepth-Q.zDepth;else return Q.id-J.id}sortTransparent(J,Q){if(J.renderOrder!==Q.renderOrder)return J.renderOrder-Q.renderOrder;if(J.zDepth!==Q.zDepth)return Q.zDepth-J.zDepth;else return Q.id-J.id}sortUI(J,Q){if(J.renderOrder!==Q.renderOrder)return J.renderOrder-Q.renderOrder;else if(J.program.id!==Q.program.id)return J.program.id-Q.program.id;else return Q.id-J.id}getRenderList({scene:J,camera:Q,frustumCull:$,sort:Z}){let K=[];if(Q&&$)Q.updateFrustum();if(J.traverse((W)=>{if(!W.visible)return!0;if(!W.draw)return;if($&&W.frustumCulled&&Q){if(!Q.frustumIntersectsMesh(W))return}K.push(W)}),Z){let W=[],H=[],U=[];K.forEach((q)=>{if(!q.program.transparent)W.push(q);else if(q.program.depthTest)H.push(q);else U.push(q);if(q.zDepth=0,q.renderOrder!==0||!q.program.depthTest||!Q)return;q.worldMatrix.getTranslation(y5),y5.applyMatrix4(Q.projectionViewMatrix),q.zDepth=y5.z}),W.sort(this.sortOpaque),H.sort(this.sortTransparent),U.sort(this.sortUI),K=W.concat(H,U)}return K}render({scene:J,camera:Q,target:$=null,update:Z=!0,sort:K=!0,frustumCull:W=!0,clear:H}){if($===null)this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr);else this.bindFramebuffer($),this.setViewport($.width,$.height);if(H||this.autoClear&&H!==!1){if(this.depth&&(!$||$.depth))this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0);if(this.stencil||(!$||$.stencil))this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255);this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))}if(Z)J.updateMatrixWorld();if(Q)Q.updateMatrixWorld();this.getRenderList({scene:J,camera:Q,frustumCull:W,sort:K}).forEach((q)=>{q.draw({camera:Q})})}}function cW(J,Q){return J[0]=Q[0],J[1]=Q[1],J[2]=Q[2],J[3]=Q[3],J}function pW(J,Q,$,Z,K){return J[0]=Q,J[1]=$,J[2]=Z,J[3]=K,J}function w5(J,Q,$){return J[0]=Q[0]*$,J[1]=Q[1]*$,J[2]=Q[2]*$,J[3]=Q[3]*$,J}function lW(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=$*$+Z*Z+K*K+W*W;if(H>0)H=1/Math.sqrt(H);return J[0]=$*H,J[1]=Z*H,J[2]=K*H,J[3]=W*H,J}function nW(J,Q){return J[0]*Q[0]+J[1]*Q[1]+J[2]*Q[2]+J[3]*Q[3]}function aO(J){return J[0]=0,J[1]=0,J[2]=0,J[3]=1,J}function tO(J,Q,$){$=$*0.5;let Z=Math.sin($);return J[0]=Z*Q[0],J[1]=Z*Q[1],J[2]=Z*Q[2],J[3]=Math.cos($),J}function h5(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=$[0],q=$[1],X=$[2],F=$[3];return J[0]=Z*F+H*U+K*X-W*q,J[1]=K*F+H*q+W*U-Z*X,J[2]=W*F+H*X+Z*q-K*U,J[3]=H*F-Z*U-K*q-W*X,J}function eO(J,Q,$){$*=0.5;let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Math.sin($),q=Math.cos($);return J[0]=Z*q+H*U,J[1]=K*q+W*U,J[2]=W*q-K*U,J[3]=H*q-Z*U,J}function JF(J,Q,$){$*=0.5;let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Math.sin($),q=Math.cos($);return J[0]=Z*q-W*U,J[1]=K*q+H*U,J[2]=W*q+Z*U,J[3]=H*q-K*U,J}function QF(J,Q,$){$*=0.5;let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Math.sin($),q=Math.cos($);return J[0]=Z*q+K*U,J[1]=K*q-Z*U,J[2]=W*q+H*U,J[3]=H*q-W*U,J}function $F(J,Q,$,Z){let K=Q[0],W=Q[1],H=Q[2],U=Q[3],q=$[0],X=$[1],F=$[2],N=$[3],L,Y,B,M,V;if(Y=K*q+W*X+H*F+U*N,Y<0)Y=-Y,q=-q,X=-X,F=-F,N=-N;if(1-Y>0.000001)L=Math.acos(Y),B=Math.sin(L),M=Math.sin((1-Z)*L)/B,V=Math.sin(Z*L)/B;else M=1-Z,V=Z;return J[0]=M*K+V*q,J[1]=M*W+V*X,J[2]=M*H+V*F,J[3]=M*U+V*N,J}function ZF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=$*$+Z*Z+K*K+W*W,U=H?1/H:0;return J[0]=-$*U,J[1]=-Z*U,J[2]=-K*U,J[3]=W*U,J}function KF(J,Q){return J[0]=-Q[0],J[1]=-Q[1],J[2]=-Q[2],J[3]=Q[3],J}function WF(J,Q){let $=Q[0]+Q[4]+Q[8],Z;if($>0)Z=Math.sqrt($+1),J[3]=0.5*Z,Z=0.5/Z,J[0]=(Q[5]-Q[7])*Z,J[1]=(Q[6]-Q[2])*Z,J[2]=(Q[1]-Q[3])*Z;else{let K=0;if(Q[4]>Q[0])K=1;if(Q[8]>Q[K*3+K])K=2;let W=(K+1)%3,H=(K+2)%3;Z=Math.sqrt(Q[K*3+K]-Q[W*3+W]-Q[H*3+H]+1),J[K]=0.5*Z,Z=0.5/Z,J[3]=(Q[W*3+H]-Q[H*3+W])*Z,J[W]=(Q[W*3+K]+Q[K*3+W])*Z,J[H]=(Q[H*3+K]+Q[K*3+H])*Z}return J}function HF(J,Q,$="YXZ"){let Z=Math.sin(Q[0]*0.5),K=Math.cos(Q[0]*0.5),W=Math.sin(Q[1]*0.5),H=Math.cos(Q[1]*0.5),U=Math.sin(Q[2]*0.5),q=Math.cos(Q[2]*0.5);if($==="XYZ")J[0]=Z*H*q+K*W*U,J[1]=K*W*q-Z*H*U,J[2]=K*H*U+Z*W*q,J[3]=K*H*q-Z*W*U;else if($==="YXZ")J[0]=Z*H*q+K*W*U,J[1]=K*W*q-Z*H*U,J[2]=K*H*U-Z*W*q,J[3]=K*H*q+Z*W*U;else if($==="ZXY")J[0]=Z*H*q-K*W*U,J[1]=K*W*q+Z*H*U,J[2]=K*H*U+Z*W*q,J[3]=K*H*q-Z*W*U;else if($==="ZYX")J[0]=Z*H*q-K*W*U,J[1]=K*W*q+Z*H*U,J[2]=K*H*U-Z*W*q,J[3]=K*H*q+Z*W*U;else if($==="YZX")J[0]=Z*H*q+K*W*U,J[1]=K*W*q+Z*H*U,J[2]=K*H*U-Z*W*q,J[3]=K*H*q-Z*W*U;else if($==="XZY")J[0]=Z*H*q-K*W*U,J[1]=K*W*q-Z*H*U,J[2]=K*H*U+Z*W*q,J[3]=K*H*q+Z*W*U;return J}var UF=cW,qF=pW;var GF=nW;var XF=lW;class yQ extends Array{constructor(J=0,Q=0,$=0,Z=1){super(J,Q,$,Z);this.onChange=()=>{},this._target=this;let K=["0","1","2","3"];return new Proxy(this,{set(W,H){let U=Reflect.set(...arguments);if(U&&K.includes(H))W.onChange();return U}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(J){this._target[0]=J,this.onChange()}set y(J){this._target[1]=J,this.onChange()}set z(J){this._target[2]=J,this.onChange()}set w(J){this._target[3]=J,this.onChange()}identity(){return aO(this._target),this.onChange(),this}set(J,Q,$,Z){if(J.length)return this.copy(J);return qF(this._target,J,Q,$,Z),this.onChange(),this}rotateX(J){return eO(this._target,this._target,J),this.onChange(),this}rotateY(J){return JF(this._target,this._target,J),this.onChange(),this}rotateZ(J){return QF(this._target,this._target,J),this.onChange(),this}inverse(J=this._target){return ZF(this._target,J),this.onChange(),this}conjugate(J=this._target){return KF(this._target,J),this.onChange(),this}copy(J){return UF(this._target,J),this.onChange(),this}normalize(J=this._target){return XF(this._target,J),this.onChange(),this}multiply(J,Q){if(Q)h5(this._target,J,Q);else h5(this._target,this._target,J);return this.onChange(),this}dot(J){return GF(this._target,J)}fromMatrix3(J){return WF(this._target,J),this.onChange(),this}fromEuler(J,Q){if(HF(this._target,J,J.order),!Q)this.onChange();return this}fromAxisAngle(J,Q){return tO(this._target,J,Q),this.onChange(),this}slerp(J,Q){return $F(this._target,this._target,J,Q),this.onChange(),this}fromArray(J,Q=0){return this._target[0]=J[Q],this._target[1]=J[Q+1],this._target[2]=J[Q+2],this._target[3]=J[Q+3],this.onChange(),this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J[Q+2]=this[2],J[Q+3]=this[3],J}}var UV=0.000001;function YF(J,Q){return J[0]=Q[0],J[1]=Q[1],J[2]=Q[2],J[3]=Q[3],J[4]=Q[4],J[5]=Q[5],J[6]=Q[6],J[7]=Q[7],J[8]=Q[8],J[9]=Q[9],J[10]=Q[10],J[11]=Q[11],J[12]=Q[12],J[13]=Q[13],J[14]=Q[14],J[15]=Q[15],J}function NF(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M,V){return J[0]=Q,J[1]=$,J[2]=Z,J[3]=K,J[4]=W,J[5]=H,J[6]=U,J[7]=q,J[8]=X,J[9]=F,J[10]=N,J[11]=L,J[12]=Y,J[13]=B,J[14]=M,J[15]=V,J}function OF(J){return J[0]=1,J[1]=0,J[2]=0,J[3]=0,J[4]=0,J[5]=1,J[6]=0,J[7]=0,J[8]=0,J[9]=0,J[10]=1,J[11]=0,J[12]=0,J[13]=0,J[14]=0,J[15]=1,J}function FF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=Q[4],U=Q[5],q=Q[6],X=Q[7],F=Q[8],N=Q[9],L=Q[10],Y=Q[11],B=Q[12],M=Q[13],V=Q[14],A=Q[15],I=$*U-Z*H,P=$*q-K*H,j=$*X-W*H,T=Z*q-K*U,w=Z*X-W*U,_=K*X-W*q,S=F*M-N*B,y=F*V-L*B,f=F*A-Y*B,u=N*V-L*M,v=N*A-Y*M,m=L*A-Y*V,l=I*m-P*v+j*u+T*f-w*y+_*S;if(!l)return null;return l=1/l,J[0]=(U*m-q*v+X*u)*l,J[1]=(K*v-Z*m-W*u)*l,J[2]=(M*_-V*w+A*T)*l,J[3]=(L*w-N*_-Y*T)*l,J[4]=(q*f-H*m-X*y)*l,J[5]=($*m-K*f+W*y)*l,J[6]=(V*j-B*_-A*P)*l,J[7]=(F*_-L*j+Y*P)*l,J[8]=(H*v-U*f+X*S)*l,J[9]=(Z*f-$*v-W*S)*l,J[10]=(B*w-M*j+A*I)*l,J[11]=(N*j-F*w-Y*I)*l,J[12]=(U*y-H*u-q*S)*l,J[13]=($*u-Z*y+K*S)*l,J[14]=(M*P-B*T-V*I)*l,J[15]=(F*T-N*P+L*I)*l,J}function x5(J){let Q=J[0],$=J[1],Z=J[2],K=J[3],W=J[4],H=J[5],U=J[6],q=J[7],X=J[8],F=J[9],N=J[10],L=J[11],Y=J[12],B=J[13],M=J[14],V=J[15],A=Q*H-$*W,I=Q*U-Z*W,P=Q*q-K*W,j=$*U-Z*H,T=$*q-K*H,w=Z*q-K*U,_=X*B-F*Y,S=X*M-N*Y,y=X*V-L*Y,f=F*M-N*B,u=F*V-L*B,v=N*V-L*M;return A*v-I*u+P*f+j*y-T*S+w*_}function f5(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Q[4],q=Q[5],X=Q[6],F=Q[7],N=Q[8],L=Q[9],Y=Q[10],B=Q[11],M=Q[12],V=Q[13],A=Q[14],I=Q[15],P=$[0],j=$[1],T=$[2],w=$[3];return J[0]=P*Z+j*U+T*N+w*M,J[1]=P*K+j*q+T*L+w*V,J[2]=P*W+j*X+T*Y+w*A,J[3]=P*H+j*F+T*B+w*I,P=$[4],j=$[5],T=$[6],w=$[7],J[4]=P*Z+j*U+T*N+w*M,J[5]=P*K+j*q+T*L+w*V,J[6]=P*W+j*X+T*Y+w*A,J[7]=P*H+j*F+T*B+w*I,P=$[8],j=$[9],T=$[10],w=$[11],J[8]=P*Z+j*U+T*N+w*M,J[9]=P*K+j*q+T*L+w*V,J[10]=P*W+j*X+T*Y+w*A,J[11]=P*H+j*F+T*B+w*I,P=$[12],j=$[13],T=$[14],w=$[15],J[12]=P*Z+j*U+T*N+w*M,J[13]=P*K+j*q+T*L+w*V,J[14]=P*W+j*X+T*Y+w*A,J[15]=P*H+j*F+T*B+w*I,J}function DF(J,Q,$){let Z=$[0],K=$[1],W=$[2],H,U,q,X,F,N,L,Y,B,M,V,A;if(Q===J)J[12]=Q[0]*Z+Q[4]*K+Q[8]*W+Q[12],J[13]=Q[1]*Z+Q[5]*K+Q[9]*W+Q[13],J[14]=Q[2]*Z+Q[6]*K+Q[10]*W+Q[14],J[15]=Q[3]*Z+Q[7]*K+Q[11]*W+Q[15];else H=Q[0],U=Q[1],q=Q[2],X=Q[3],F=Q[4],N=Q[5],L=Q[6],Y=Q[7],B=Q[8],M=Q[9],V=Q[10],A=Q[11],J[0]=H,J[1]=U,J[2]=q,J[3]=X,J[4]=F,J[5]=N,J[6]=L,J[7]=Y,J[8]=B,J[9]=M,J[10]=V,J[11]=A,J[12]=H*Z+F*K+B*W+Q[12],J[13]=U*Z+N*K+M*W+Q[13],J[14]=q*Z+L*K+V*W+Q[14],J[15]=X*Z+Y*K+A*W+Q[15];return J}function LF(J,Q,$){let Z=$[0],K=$[1],W=$[2];return J[0]=Q[0]*Z,J[1]=Q[1]*Z,J[2]=Q[2]*Z,J[3]=Q[3]*Z,J[4]=Q[4]*K,J[5]=Q[5]*K,J[6]=Q[6]*K,J[7]=Q[7]*K,J[8]=Q[8]*W,J[9]=Q[9]*W,J[10]=Q[10]*W,J[11]=Q[11]*W,J[12]=Q[12],J[13]=Q[13],J[14]=Q[14],J[15]=Q[15],J}function RF(J,Q,$,Z){let K=Z[0],W=Z[1],H=Z[2],U=Math.hypot(K,W,H),q,X,F,N,L,Y,B,M,V,A,I,P,j,T,w,_,S,y,f,u,v,m,l,H0;if(Math.abs(U)0)A=Math.sqrt(V+1)*2,Q[3]=0.25*A,Q[0]=(L-B)/A,Q[1]=(Y-X)/A,Q[2]=(q-F)/A;else if(U>N&&U>M)A=Math.sqrt(1+U-N-M)*2,Q[3]=(L-B)/A,Q[0]=0.25*A,Q[1]=(q+F)/A,Q[2]=(Y+X)/A;else if(N>M)A=Math.sqrt(1+N-U-M)*2,Q[3]=(Y-X)/A,Q[0]=(q+F)/A,Q[1]=0.25*A,Q[2]=(L+B)/A;else A=Math.sqrt(1+M-U-N)*2,Q[3]=(q-F)/A,Q[0]=(Y+X)/A,Q[1]=(L+B)/A,Q[2]=0.25*A;return Q}}();function zF(J,Q,$,Z){let K=k$([J[0],J[1],J[2]]),W=k$([J[4],J[5],J[6]]),H=k$([J[8],J[9],J[10]]);if(x5(J)<0)K=-K;$[0]=J[12],$[1]=J[13],$[2]=J[14];let q=J.slice(),X=1/K,F=1/W,N=1/H;q[0]*=X,q[1]*=X,q[2]*=X,q[4]*=F,q[5]*=F,q[6]*=F,q[8]*=N,q[9]*=N,q[10]*=N,v5(Q,q),Z[0]=K,Z[1]=W,Z[2]=H}function kF(J,Q,$,Z){let K=J,W=Q[0],H=Q[1],U=Q[2],q=Q[3],X=W+W,F=H+H,N=U+U,L=W*X,Y=W*F,B=W*N,M=H*F,V=H*N,A=U*N,I=q*X,P=q*F,j=q*N,T=Z[0],w=Z[1],_=Z[2];return K[0]=(1-(M+A))*T,K[1]=(Y+j)*T,K[2]=(B-P)*T,K[3]=0,K[4]=(Y-j)*w,K[5]=(1-(L+A))*w,K[6]=(V+I)*w,K[7]=0,K[8]=(B+P)*_,K[9]=(V-I)*_,K[10]=(1-(L+M))*_,K[11]=0,K[12]=$[0],K[13]=$[1],K[14]=$[2],K[15]=1,K}function VF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=$+$,U=Z+Z,q=K+K,X=$*H,F=Z*H,N=Z*U,L=K*H,Y=K*U,B=K*q,M=W*H,V=W*U,A=W*q;return J[0]=1-N-B,J[1]=F+A,J[2]=L-V,J[3]=0,J[4]=F-A,J[5]=1-X-B,J[6]=Y+M,J[7]=0,J[8]=L+V,J[9]=Y-M,J[10]=1-X-N,J[11]=0,J[12]=0,J[13]=0,J[14]=0,J[15]=1,J}function AF(J,Q,$,Z,K){let W=1/Math.tan(Q/2),H=1/(Z-K);return J[0]=W/$,J[1]=0,J[2]=0,J[3]=0,J[4]=0,J[5]=W,J[6]=0,J[7]=0,J[8]=0,J[9]=0,J[10]=(K+Z)*H,J[11]=-1,J[12]=0,J[13]=0,J[14]=2*K*Z*H,J[15]=0,J}function IF(J,Q,$,Z,K,W,H){let U=1/(Q-$),q=1/(Z-K),X=1/(W-H);return J[0]=-2*U,J[1]=0,J[2]=0,J[3]=0,J[4]=0,J[5]=-2*q,J[6]=0,J[7]=0,J[8]=0,J[9]=0,J[10]=2*X,J[11]=0,J[12]=(Q+$)*U,J[13]=(K+Z)*q,J[14]=(H+W)*X,J[15]=1,J}function EF(J,Q,$,Z){let K=Q[0],W=Q[1],H=Q[2],U=Z[0],q=Z[1],X=Z[2],F=K-$[0],N=W-$[1],L=H-$[2],Y=F*F+N*N+L*L;if(Y===0)L=1;else Y=1/Math.sqrt(Y),F*=Y,N*=Y,L*=Y;let B=q*L-X*N,M=X*F-U*L,V=U*N-q*F;if(Y=B*B+M*M+V*V,Y===0){if(X)U+=0.000001;else if(q)X+=0.000001;else q+=0.000001;B=q*L-X*N,M=X*F-U*L,V=U*N-q*F,Y=B*B+M*M+V*V}return Y=1/Math.sqrt(Y),B*=Y,M*=Y,V*=Y,J[0]=B,J[1]=M,J[2]=V,J[3]=0,J[4]=N*V-L*M,J[5]=L*B-F*V,J[6]=F*M-N*B,J[7]=0,J[8]=F,J[9]=N,J[10]=L,J[11]=0,J[12]=K,J[13]=W,J[14]=H,J[15]=1,J}function g5(J,Q,$){return J[0]=Q[0]+$[0],J[1]=Q[1]+$[1],J[2]=Q[2]+$[2],J[3]=Q[3]+$[3],J[4]=Q[4]+$[4],J[5]=Q[5]+$[5],J[6]=Q[6]+$[6],J[7]=Q[7]+$[7],J[8]=Q[8]+$[8],J[9]=Q[9]+$[9],J[10]=Q[10]+$[10],J[11]=Q[11]+$[11],J[12]=Q[12]+$[12],J[13]=Q[13]+$[13],J[14]=Q[14]+$[14],J[15]=Q[15]+$[15],J}function u5(J,Q,$){return J[0]=Q[0]-$[0],J[1]=Q[1]-$[1],J[2]=Q[2]-$[2],J[3]=Q[3]-$[3],J[4]=Q[4]-$[4],J[5]=Q[5]-$[5],J[6]=Q[6]-$[6],J[7]=Q[7]-$[7],J[8]=Q[8]-$[8],J[9]=Q[9]-$[9],J[10]=Q[10]-$[10],J[11]=Q[11]-$[11],J[12]=Q[12]-$[12],J[13]=Q[13]-$[13],J[14]=Q[14]-$[14],J[15]=Q[15]-$[15],J}function CF(J,Q,$){return J[0]=Q[0]*$,J[1]=Q[1]*$,J[2]=Q[2]*$,J[3]=Q[3]*$,J[4]=Q[4]*$,J[5]=Q[5]*$,J[6]=Q[6]*$,J[7]=Q[7]*$,J[8]=Q[8]*$,J[9]=Q[9]*$,J[10]=Q[10]*$,J[11]=Q[11]*$,J[12]=Q[12]*$,J[13]=Q[13]*$,J[14]=Q[14]*$,J[15]=Q[15]*$,J}class zJ extends Array{constructor(J=1,Q=0,$=0,Z=0,K=0,W=1,H=0,U=0,q=0,X=0,F=1,N=0,L=0,Y=0,B=0,M=1){super(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M);return this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(J){this[12]=J}set y(J){this[13]=J}set z(J){this[14]=J}set w(J){this[15]=J}set(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M){if(J.length)return this.copy(J);return NF(this,J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M),this}translate(J,Q=this){return DF(this,Q,J),this}rotate(J,Q,$=this){return RF(this,$,J,Q),this}scale(J,Q=this){return LF(this,Q,typeof J==="number"?[J,J,J]:J),this}add(J,Q){if(Q)g5(this,J,Q);else g5(this,this,J);return this}sub(J,Q){if(Q)u5(this,J,Q);else u5(this,this,J);return this}multiply(J,Q){if(!J.length)CF(this,this,J);else if(Q)f5(this,J,Q);else f5(this,this,J);return this}identity(){return OF(this),this}copy(J){return YF(this,J),this}fromPerspective({fov:J,aspect:Q,near:$,far:Z}={}){return AF(this,J,Q,$,Z),this}fromOrthogonal({left:J,right:Q,bottom:$,top:Z,near:K,far:W}){return IF(this,J,Q,$,Z,K,W),this}fromQuaternion(J){return VF(this,J),this}setPosition(J){return this.x=J[0],this.y=J[1],this.z=J[2],this}inverse(J=this){return FF(this,J),this}compose(J,Q,$){return kF(this,J,Q,$),this}decompose(J,Q,$){return zF(this,J,Q,$),this}getRotation(J){return v5(J,this),this}getTranslation(J){return BF(J,this),this}getScaling(J){return b5(J,this),this}getMaxScaleOnAxis(){return MF(this)}lookAt(J,Q,$){return EF(this,J,Q,$),this}determinant(){return x5(this)}fromArray(J,Q=0){return this[0]=J[Q],this[1]=J[Q+1],this[2]=J[Q+2],this[3]=J[Q+3],this[4]=J[Q+4],this[5]=J[Q+5],this[6]=J[Q+6],this[7]=J[Q+7],this[8]=J[Q+8],this[9]=J[Q+9],this[10]=J[Q+10],this[11]=J[Q+11],this[12]=J[Q+12],this[13]=J[Q+13],this[14]=J[Q+14],this[15]=J[Q+15],this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J[Q+2]=this[2],J[Q+3]=this[3],J[Q+4]=this[4],J[Q+5]=this[5],J[Q+6]=this[6],J[Q+7]=this[7],J[Q+8]=this[8],J[Q+9]=this[9],J[Q+10]=this[10],J[Q+11]=this[11],J[Q+12]=this[12],J[Q+13]=this[13],J[Q+14]=this[14],J[Q+15]=this[15],J}}function PF(J,Q,$="YXZ"){if($==="XYZ")if(J[1]=Math.asin(Math.min(Math.max(Q[8],-1),1)),Math.abs(Q[8])<0.99999)J[0]=Math.atan2(-Q[9],Q[10]),J[2]=Math.atan2(-Q[4],Q[0]);else J[0]=Math.atan2(Q[6],Q[5]),J[2]=0;else if($==="YXZ")if(J[0]=Math.asin(-Math.min(Math.max(Q[9],-1),1)),Math.abs(Q[9])<0.99999)J[1]=Math.atan2(Q[8],Q[10]),J[2]=Math.atan2(Q[1],Q[5]);else J[1]=Math.atan2(-Q[2],Q[0]),J[2]=0;else if($==="ZXY")if(J[0]=Math.asin(Math.min(Math.max(Q[6],-1),1)),Math.abs(Q[6])<0.99999)J[1]=Math.atan2(-Q[2],Q[10]),J[2]=Math.atan2(-Q[4],Q[5]);else J[1]=0,J[2]=Math.atan2(Q[1],Q[0]);else if($==="ZYX")if(J[1]=Math.asin(-Math.min(Math.max(Q[2],-1),1)),Math.abs(Q[2])<0.99999)J[0]=Math.atan2(Q[6],Q[10]),J[2]=Math.atan2(Q[1],Q[0]);else J[0]=0,J[2]=Math.atan2(-Q[4],Q[5]);else if($==="YZX")if(J[2]=Math.asin(Math.min(Math.max(Q[1],-1),1)),Math.abs(Q[1])<0.99999)J[0]=Math.atan2(-Q[9],Q[5]),J[1]=Math.atan2(-Q[2],Q[0]);else J[0]=0,J[1]=Math.atan2(Q[8],Q[10]);else if($==="XZY")if(J[2]=Math.asin(-Math.min(Math.max(Q[4],-1),1)),Math.abs(Q[4])<0.99999)J[0]=Math.atan2(Q[6],Q[5]),J[1]=Math.atan2(Q[8],Q[0]);else J[0]=Math.atan2(-Q[9],Q[10]),J[1]=0;return J}var jF=new zJ;class d5 extends Array{constructor(J=0,Q=J,$=J,Z="YXZ"){super(J,Q,$);this.order=Z,this.onChange=()=>{},this._target=this;let K=["0","1","2"];return new Proxy(this,{set(W,H){let U=Reflect.set(...arguments);if(U&&K.includes(H))W.onChange();return U}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(J){this._target[0]=J,this.onChange()}set y(J){this._target[1]=J,this.onChange()}set z(J){this._target[2]=J,this.onChange()}set(J,Q=J,$=J){if(J.length)return this.copy(J);return this._target[0]=J,this._target[1]=Q,this._target[2]=$,this.onChange(),this}copy(J){return this._target[0]=J[0],this._target[1]=J[1],this._target[2]=J[2],this.onChange(),this}reorder(J){return this._target.order=J,this.onChange(),this}fromRotationMatrix(J,Q=this.order){return PF(this._target,J,Q),this.onChange(),this}fromQuaternion(J,Q=this.order,$){if(jF.fromQuaternion(J),this._target.fromRotationMatrix(jF,Q),!$)this.onChange();return this}fromArray(J,Q=0){return this._target[0]=J[Q],this._target[1]=J[Q+1],this._target[2]=J[Q+2],this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J[Q+2]=this[2],J}}class NJ{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new zJ,this.worldMatrix=new zJ,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new k0,this.quaternion=new yQ,this.scale=new k0(1),this.rotation=new d5,this.up=new k0(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(J,Q=!0){if(this.parent&&J!==this.parent)this.parent.removeChild(this,!1);if(this.parent=J,Q&&J)J.addChild(this,!1)}addChild(J,Q=!0){if(!~this.children.indexOf(J))this.children.push(J);if(Q)J.setParent(this,!1)}removeChild(J,Q=!0){if(~this.children.indexOf(J))this.children.splice(this.children.indexOf(J),1);if(Q)J.setParent(null,!1)}updateMatrixWorld(J){if(this.matrixAutoUpdate)this.updateMatrix();if(this.worldMatrixNeedsUpdate||J){if(this.parent===null)this.worldMatrix.copy(this.matrix);else this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix);this.worldMatrixNeedsUpdate=!1,J=!0}for(let Q=0,$=this.children.length;Q<$;Q++)this.children[Q].updateMatrixWorld(J)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(J){if(J(this))return;for(let Q=0,$=this.children.length;Q<$;Q++)this.children[Q].traverse(J)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(J,Q=!1){if(Q)this.matrix.lookAt(this.position,J,this.up);else this.matrix.lookAt(J,this.position,this.up);this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}var XV=new zJ,YV=new k0,NV=new k0;class O7 extends NJ{constructor(J,{near:Q=0.1,far:$=100,fov:Z=45,aspect:K=1,left:W,right:H,bottom:U,top:q,zoom:X=1}={}){super();if(Object.assign(this,{near:Q,far:$,fov:Z,aspect:K,left:W,right:H,bottom:U,top:q,zoom:X}),this.projectionMatrix=new zJ,this.viewMatrix=new zJ,this.projectionViewMatrix=new zJ,this.worldPosition=new k0,this.type=W||H?"orthographic":"perspective",this.type==="orthographic")this.orthographic();else this.perspective()}perspective({near:J=this.near,far:Q=this.far,fov:$=this.fov,aspect:Z=this.aspect}={}){return Object.assign(this,{near:J,far:Q,fov:$,aspect:Z}),this.projectionMatrix.fromPerspective({fov:$*(Math.PI/180),aspect:Z,near:J,far:Q}),this.type="perspective",this}orthographic({near:J=this.near,far:Q=this.far,left:$=this.left||-1,right:Z=this.right||1,bottom:K=this.bottom||-1,top:W=this.top||1,zoom:H=this.zoom}={}){return Object.assign(this,{near:J,far:Q,left:$,right:Z,bottom:K,top:W,zoom:H}),$/=H,Z/=H,K/=H,W/=H,this.projectionMatrix.fromOrthogonal({left:$,right:Z,bottom:K,top:W,near:J,far:Q}),this.type="orthographic",this}updateMatrixWorld(){return super.updateMatrixWorld(),this.viewMatrix.inverse(this.worldMatrix),this.worldMatrix.getTranslation(this.worldPosition),this.projectionViewMatrix.multiply(this.projectionMatrix,this.viewMatrix),this}updateProjectionMatrix(){if(this.type==="perspective")return this.perspective();else return this.orthographic()}lookAt(J){return super.lookAt(J,!0),this}project(J){return J.applyMatrix4(this.viewMatrix),J.applyMatrix4(this.projectionMatrix),this}unproject(J){return J.applyMatrix4(XV.inverse(this.projectionMatrix)),J.applyMatrix4(this.worldMatrix),this}updateFrustum(){if(!this.frustum)this.frustum=[new k0,new k0,new k0,new k0,new k0,new k0];let J=this.projectionViewMatrix;this.frustum[0].set(J[3]-J[0],J[7]-J[4],J[11]-J[8]).constant=J[15]-J[12],this.frustum[1].set(J[3]+J[0],J[7]+J[4],J[11]+J[8]).constant=J[15]+J[12],this.frustum[2].set(J[3]+J[1],J[7]+J[5],J[11]+J[9]).constant=J[15]+J[13],this.frustum[3].set(J[3]-J[1],J[7]-J[5],J[11]-J[9]).constant=J[15]-J[13],this.frustum[4].set(J[3]-J[2],J[7]-J[6],J[11]-J[10]).constant=J[15]-J[14],this.frustum[5].set(J[3]+J[2],J[7]+J[6],J[11]+J[10]).constant=J[15]+J[14];for(let Q=0;Q<6;Q++){let $=1/this.frustum[Q].distance();this.frustum[Q].multiply($),this.frustum[Q].constant*=$}}frustumIntersectsMesh(J,Q=J.worldMatrix){if(!J.geometry.attributes.position)return!0;if(!J.geometry.bounds||J.geometry.bounds.radius===1/0)J.geometry.computeBoundingSphere();if(!J.geometry.bounds)return!0;let $=YV;$.copy(J.geometry.bounds.center),$.applyMatrix4(Q);let Z=J.geometry.bounds.radius*Q.getMaxScaleOnAxis();return this.frustumIntersectsSphere($,Z)}frustumIntersectsSphere(J,Q){let $=NV;for(let Z=0;Z<6;Z++){let K=this.frustum[Z];if($.copy(K).dot(J)+K.constant<-Q)return!1}return!0}}function TF(J,Q){return J[0]=Q[0],J[1]=Q[1],J[2]=Q[2],J[3]=Q[4],J[4]=Q[5],J[5]=Q[6],J[6]=Q[8],J[7]=Q[9],J[8]=Q[10],J}function SF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=$+$,U=Z+Z,q=K+K,X=$*H,F=Z*H,N=Z*U,L=K*H,Y=K*U,B=K*q,M=W*H,V=W*U,A=W*q;return J[0]=1-N-B,J[3]=F-A,J[6]=L+V,J[1]=F+A,J[4]=1-X-B,J[7]=Y-M,J[2]=L-V,J[5]=Y+M,J[8]=1-X-N,J}function _F(J,Q){return J[0]=Q[0],J[1]=Q[1],J[2]=Q[2],J[3]=Q[3],J[4]=Q[4],J[5]=Q[5],J[6]=Q[6],J[7]=Q[7],J[8]=Q[8],J}function yF(J,Q,$,Z,K,W,H,U,q,X){return J[0]=Q,J[1]=$,J[2]=Z,J[3]=K,J[4]=W,J[5]=H,J[6]=U,J[7]=q,J[8]=X,J}function wF(J){return J[0]=1,J[1]=0,J[2]=0,J[3]=0,J[4]=1,J[5]=0,J[6]=0,J[7]=0,J[8]=1,J}function hF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=Q[4],U=Q[5],q=Q[6],X=Q[7],F=Q[8],N=F*H-U*X,L=-F*W+U*q,Y=X*W-H*q,B=$*N+Z*L+K*Y;if(!B)return null;return B=1/B,J[0]=N*B,J[1]=(-F*Z+K*X)*B,J[2]=(U*Z-K*H)*B,J[3]=L*B,J[4]=(F*$-K*q)*B,J[5]=(-U*$+K*W)*B,J[6]=Y*B,J[7]=(-X*$+Z*q)*B,J[8]=(H*$-Z*W)*B,J}function m5(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Q[4],q=Q[5],X=Q[6],F=Q[7],N=Q[8],L=$[0],Y=$[1],B=$[2],M=$[3],V=$[4],A=$[5],I=$[6],P=$[7],j=$[8];return J[0]=L*Z+Y*H+B*X,J[1]=L*K+Y*U+B*F,J[2]=L*W+Y*q+B*N,J[3]=M*Z+V*H+A*X,J[4]=M*K+V*U+A*F,J[5]=M*W+V*q+A*N,J[6]=I*Z+P*H+j*X,J[7]=I*K+P*U+j*F,J[8]=I*W+P*q+j*N,J}function xF(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Q[4],q=Q[5],X=Q[6],F=Q[7],N=Q[8],L=$[0],Y=$[1];return J[0]=Z,J[1]=K,J[2]=W,J[3]=H,J[4]=U,J[5]=q,J[6]=L*Z+Y*H+X,J[7]=L*K+Y*U+F,J[8]=L*W+Y*q+N,J}function fF(J,Q,$){let Z=Q[0],K=Q[1],W=Q[2],H=Q[3],U=Q[4],q=Q[5],X=Q[6],F=Q[7],N=Q[8],L=Math.sin($),Y=Math.cos($);return J[0]=Y*Z+L*H,J[1]=Y*K+L*U,J[2]=Y*W+L*q,J[3]=Y*H-L*Z,J[4]=Y*U-L*K,J[5]=Y*q-L*W,J[6]=X,J[7]=F,J[8]=N,J}function bF(J,Q,$){let Z=$[0],K=$[1];return J[0]=Z*Q[0],J[1]=Z*Q[1],J[2]=Z*Q[2],J[3]=K*Q[3],J[4]=K*Q[4],J[5]=K*Q[5],J[6]=Q[6],J[7]=Q[7],J[8]=Q[8],J}function vF(J,Q){let $=Q[0],Z=Q[1],K=Q[2],W=Q[3],H=Q[4],U=Q[5],q=Q[6],X=Q[7],F=Q[8],N=Q[9],L=Q[10],Y=Q[11],B=Q[12],M=Q[13],V=Q[14],A=Q[15],I=$*U-Z*H,P=$*q-K*H,j=$*X-W*H,T=Z*q-K*U,w=Z*X-W*U,_=K*X-W*q,S=F*M-N*B,y=F*V-L*B,f=F*A-Y*B,u=N*V-L*M,v=N*A-Y*M,m=L*A-Y*V,l=I*m-P*v+j*u+T*f-w*y+_*S;if(!l)return null;return l=1/l,J[0]=(U*m-q*v+X*u)*l,J[1]=(q*f-H*m-X*y)*l,J[2]=(H*v-U*f+X*S)*l,J[3]=(K*v-Z*m-W*u)*l,J[4]=($*m-K*f+W*y)*l,J[5]=(Z*f-$*v-W*S)*l,J[6]=(M*_-V*w+A*T)*l,J[7]=(V*j-B*_-A*P)*l,J[8]=(B*w-M*j+A*I)*l,J}class c5 extends Array{constructor(J=1,Q=0,$=0,Z=0,K=1,W=0,H=0,U=0,q=1){super(J,Q,$,Z,K,W,H,U,q);return this}set(J,Q,$,Z,K,W,H,U,q){if(J.length)return this.copy(J);return yF(this,J,Q,$,Z,K,W,H,U,q),this}translate(J,Q=this){return xF(this,Q,J),this}rotate(J,Q=this){return fF(this,Q,J),this}scale(J,Q=this){return bF(this,Q,J),this}multiply(J,Q){if(Q)m5(this,J,Q);else m5(this,this,J);return this}identity(){return wF(this),this}copy(J){return _F(this,J),this}fromMatrix4(J){return TF(this,J),this}fromQuaternion(J){return SF(this,J),this}fromBasis(J,Q,$){return this.set(J[0],J[1],J[2],Q[0],Q[1],Q[2],$[0],$[1],$[2]),this}inverse(J=this){return hF(this,J),this}getNormalMatrix(J){return vF(this,J),this}}var FV=0;class EJ extends NJ{constructor(J,{geometry:Q,program:$,mode:Z=J.TRIANGLES,frustumCulled:K=!0,renderOrder:W=0}={}){super();if(!J.canvas)console.error("gl not passed as first argument to Mesh");this.gl=J,this.id=FV++,this.geometry=Q,this.program=$,this.mode=Z,this.frustumCulled=K,this.renderOrder=W,this.modelViewMatrix=new zJ,this.normalMatrix=new c5,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(J){return this.beforeRenderCallbacks.push(J),this}onAfterRender(J){return this.afterRenderCallbacks.push(J),this}draw({camera:J}={}){if(J){if(!this.program.uniforms.modelMatrix)Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}});this.program.uniforms.projectionMatrix.value=J.projectionMatrix,this.program.uniforms.cameraPosition.value=J.worldPosition,this.program.uniforms.viewMatrix.value=J.viewMatrix,this.modelViewMatrix.multiply(J.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix}this.beforeRenderCallbacks.forEach(($)=>$&&$({mesh:this,camera:J}));let Q=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:Q}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(($)=>$&&$({mesh:this,camera:J}))}}var gF=new Uint8Array(4);function uF(J){return(J&J-1)===0}var DV=1;class fJ{constructor(J,{image:Q,target:$=J.TEXTURE_2D,type:Z=J.UNSIGNED_BYTE,format:K=J.RGBA,internalFormat:W=K,wrapS:H=J.CLAMP_TO_EDGE,wrapT:U=J.CLAMP_TO_EDGE,wrapR:q=J.CLAMP_TO_EDGE,generateMipmaps:X=$===(J.TEXTURE_2D||J.TEXTURE_CUBE_MAP),minFilter:F=X?J.NEAREST_MIPMAP_LINEAR:J.LINEAR,magFilter:N=J.LINEAR,premultiplyAlpha:L=!1,unpackAlignment:Y=4,flipY:B=$==(J.TEXTURE_2D||J.TEXTURE_3D)?!0:!1,anisotropy:M=0,level:V=0,width:A,height:I=A,length:P=1}={}){this.gl=J,this.id=DV++,this.image=Q,this.target=$,this.type=Z,this.format=K,this.internalFormat=W,this.minFilter=F,this.magFilter=N,this.wrapS=H,this.wrapT=U,this.wrapR=q,this.generateMipmaps=X,this.premultiplyAlpha=L,this.unpackAlignment=Y,this.flipY=B,this.anisotropy=Math.min(M,this.gl.renderer.parameters.maxAnisotropy),this.level=V,this.width=A,this.height=I,this.length=P,this.texture=this.gl.createTexture(),this.store={image:null},this.glState=this.gl.renderer.state,this.state={},this.state.minFilter=this.gl.NEAREST_MIPMAP_LINEAR,this.state.magFilter=this.gl.LINEAR,this.state.wrapS=this.gl.REPEAT,this.state.wrapT=this.gl.REPEAT,this.state.anisotropy=0}bind(){if(this.glState.textureUnits[this.glState.activeTextureUnit]===this.id)return;this.gl.bindTexture(this.target,this.texture),this.glState.textureUnits[this.glState.activeTextureUnit]=this.id}update(J=0){let Q=!(this.image===this.store.image&&!this.needsUpdate);if(Q||this.glState.textureUnits[J]!==this.id)this.gl.renderer.activeTexture(J),this.bind();if(!Q)return;if(this.needsUpdate=!1,this.flipY!==this.glState.flipY)this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,this.flipY),this.glState.flipY=this.flipY;if(this.premultiplyAlpha!==this.glState.premultiplyAlpha)this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),this.glState.premultiplyAlpha=this.premultiplyAlpha;if(this.unpackAlignment!==this.glState.unpackAlignment)this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,this.unpackAlignment),this.glState.unpackAlignment=this.unpackAlignment;if(this.minFilter!==this.state.minFilter)this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.minFilter),this.state.minFilter=this.minFilter;if(this.magFilter!==this.state.magFilter)this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.magFilter),this.state.magFilter=this.magFilter;if(this.wrapS!==this.state.wrapS)this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.wrapS),this.state.wrapS=this.wrapS;if(this.wrapT!==this.state.wrapT)this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.wrapT),this.state.wrapT=this.wrapT;if(this.wrapR!==this.state.wrapR)this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_R,this.wrapR),this.state.wrapR=this.wrapR;if(this.anisotropy&&this.anisotropy!==this.state.anisotropy)this.gl.texParameterf(this.target,this.gl.renderer.getExtension("EXT_texture_filter_anisotropic").TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy),this.state.anisotropy=this.anisotropy;if(this.image){if(this.image.width)this.width=this.image.width,this.height=this.image.height;if(this.target===this.gl.TEXTURE_CUBE_MAP)for(let $=0;$<6;$++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+$,this.level,this.internalFormat,this.format,this.type,this.image[$]);else if(ArrayBuffer.isView(this.image)){if(this.target===this.gl.TEXTURE_2D)this.gl.texImage2D(this.target,this.level,this.internalFormat,this.width,this.height,0,this.format,this.type,this.image);else if(this.target===this.gl.TEXTURE_2D_ARRAY||this.target===this.gl.TEXTURE_3D)this.gl.texImage3D(this.target,this.level,this.internalFormat,this.width,this.height,this.length,0,this.format,this.type,this.image)}else if(this.image.isCompressedTexture)for(let $=0;$1)this.gl.renderer.drawBuffers(I);if(this.texture=this.textures[0],U&&(this.gl.renderer.isWebgl2||this.gl.renderer.getExtension("WEBGL_depth_texture")))this.depthTexture=new fJ(J,{width:Q,height:$,minFilter:this.gl.NEAREST,magFilter:this.gl.NEAREST,format:this.stencil?this.gl.DEPTH_STENCIL:this.gl.DEPTH_COMPONENT,internalFormat:J.renderer.isWebgl2?this.stencil?this.gl.DEPTH24_STENCIL8:this.gl.DEPTH_COMPONENT16:this.gl.DEPTH_COMPONENT,type:this.stencil?this.gl.UNSIGNED_INT_24_8:this.gl.UNSIGNED_INT}),this.depthTexture.update(),this.gl.framebufferTexture2D(this.target,this.stencil?this.gl.DEPTH_STENCIL_ATTACHMENT:this.gl.DEPTH_ATTACHMENT,this.gl.TEXTURE_2D,this.depthTexture.texture,0);else{if(W&&!H)this.depthBuffer=this.gl.createRenderbuffer(),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,this.depthBuffer),this.gl.renderbufferStorage(this.gl.RENDERBUFFER,this.gl.DEPTH_COMPONENT16,Q,$),this.gl.framebufferRenderbuffer(this.target,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,this.depthBuffer);if(H&&!W)this.stencilBuffer=this.gl.createRenderbuffer(),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,this.stencilBuffer),this.gl.renderbufferStorage(this.gl.RENDERBUFFER,this.gl.STENCIL_INDEX8,Q,$),this.gl.framebufferRenderbuffer(this.target,this.gl.STENCIL_ATTACHMENT,this.gl.RENDERBUFFER,this.stencilBuffer);if(W&&H)this.depthStencilBuffer=this.gl.createRenderbuffer(),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,this.depthStencilBuffer),this.gl.renderbufferStorage(this.gl.RENDERBUFFER,this.gl.DEPTH_STENCIL,Q,$),this.gl.framebufferRenderbuffer(this.target,this.gl.DEPTH_STENCIL_ATTACHMENT,this.gl.RENDERBUFFER,this.depthStencilBuffer)}this.gl.renderer.bindFramebuffer({target:this.target})}setSize(J,Q){if(this.width===J&&this.height===Q)return;this.width=J,this.height=Q,this.gl.renderer.bindFramebuffer(this);for(let $=0;$>16&255)/255,(J>>8&255)/255,(J&255)/255]}function p5(J){if(J===void 0)return[0,0,0];if(arguments.length===3)return arguments;if(!isNaN(J))return LV(J);if(J[0]==="#")return mF(J);if(dF[J.toLowerCase()])return mF(dF[J.toLowerCase()]);return console.warn("Color format not recognised"),[0,0,0]}class d0 extends Array{constructor(J){if(Array.isArray(J))return super(...J);return super(...p5(...arguments))}get r(){return this[0]}get g(){return this[1]}get b(){return this[2]}set r(J){this[0]=J}set g(J){this[1]=J}set b(J){this[2]=J}set(J){if(Array.isArray(J))return this.copy(J);return this.copy(p5(...arguments))}copy(J){return this[0]=J[0],this[1]=J[1],this[2]=J[2],this}}function cF(J,Q){return J[0]=Q[0],J[1]=Q[1],J}function pF(J,Q,$){return J[0]=Q,J[1]=$,J}function l5(J,Q,$){return J[0]=Q[0]+$[0],J[1]=Q[1]+$[1],J}function n5(J,Q,$){return J[0]=Q[0]-$[0],J[1]=Q[1]-$[1],J}function lF(J,Q,$){return J[0]=Q[0]*$[0],J[1]=Q[1]*$[1],J}function nF(J,Q,$){return J[0]=Q[0]/$[0],J[1]=Q[1]/$[1],J}function oW(J,Q,$){return J[0]=Q[0]*$,J[1]=Q[1]*$,J}function oF(J,Q){var $=Q[0]-J[0],Z=Q[1]-J[1];return Math.sqrt($*$+Z*Z)}function sF(J,Q){var $=Q[0]-J[0],Z=Q[1]-J[1];return $*$+Z*Z}function o5(J){var Q=J[0],$=J[1];return Math.sqrt(Q*Q+$*$)}function iF(J){var Q=J[0],$=J[1];return Q*Q+$*$}function rF(J,Q){return J[0]=-Q[0],J[1]=-Q[1],J}function aF(J,Q){return J[0]=1/Q[0],J[1]=1/Q[1],J}function tF(J,Q){var $=Q[0],Z=Q[1],K=$*$+Z*Z;if(K>0)K=1/Math.sqrt(K);return J[0]=Q[0]*K,J[1]=Q[1]*K,J}function eF(J,Q){return J[0]*Q[0]+J[1]*Q[1]}function s5(J,Q){return J[0]*Q[1]-J[1]*Q[0]}function JD(J,Q,$,Z){var K=Q[0],W=Q[1];return J[0]=K+Z*($[0]-K),J[1]=W+Z*($[1]-W),J}function QD(J,Q,$,Z,K){let W=Math.exp(-Z*K),H=Q[0],U=Q[1];return J[0]=$[0]+(H-$[0])*W,J[1]=$[1]+(U-$[1])*W,J}function $D(J,Q,$){var Z=Q[0],K=Q[1];return J[0]=$[0]*Z+$[3]*K+$[6],J[1]=$[1]*Z+$[4]*K+$[7],J}function ZD(J,Q,$){let Z=Q[0],K=Q[1];return J[0]=$[0]*Z+$[4]*K+$[12],J[1]=$[1]*Z+$[5]*K+$[13],J}function KD(J,Q){return J[0]===Q[0]&&J[1]===Q[1]}class Y9 extends Array{constructor(J=0,Q=J){super(J,Q);return this}get x(){return this[0]}get y(){return this[1]}set x(J){this[0]=J}set y(J){this[1]=J}set(J,Q=J){if(J.length)return this.copy(J);return pF(this,J,Q),this}copy(J){return cF(this,J),this}add(J,Q){if(Q)l5(this,J,Q);else l5(this,this,J);return this}sub(J,Q){if(Q)n5(this,J,Q);else n5(this,this,J);return this}multiply(J){if(J.length)lF(this,this,J);else oW(this,this,J);return this}divide(J){if(J.length)nF(this,this,J);else oW(this,this,1/J);return this}inverse(J=this){return aF(this,J),this}len(){return o5(this)}distance(J){if(J)return oF(this,J);else return o5(this)}squaredLen(){return this.squaredDistance()}squaredDistance(J){if(J)return sF(this,J);else return iF(this)}negate(J=this){return rF(this,J),this}cross(J,Q){if(Q)return s5(J,Q);return s5(this,J)}scale(J){return oW(this,this,J),this}normalize(){return tF(this,this),this}dot(J){return eF(this,J)}equals(J){return KD(this,J)}applyMatrix3(J){return $D(this,this,J),this}applyMatrix4(J){return ZD(this,this,J),this}lerp(J,Q){return JD(this,this,J,Q),this}smoothLerp(J,Q,$){return QD(this,this,J,Q,$),this}clone(){return new Y9(this[0],this[1])}fromArray(J,Q=0){return this[0]=J[Q],this[1]=J[Q+1],this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J}}class i5 extends Array{constructor(J=0,Q=J,$=J,Z=J){super(J,Q,$,Z);return this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(J){this[0]=J}set y(J){this[1]=J}set z(J){this[2]=J}set w(J){this[3]=J}set(J,Q=J,$=J,Z=J){if(J.length)return this.copy(J);return pW(this,J,Q,$,Z),this}copy(J){return cW(this,J),this}normalize(){return lW(this,this),this}multiply(J){return w5(this,this,J),this}dot(J){return nW(this,J)}fromArray(J,Q=0){return this[0]=J[Q],this[1]=J[Q+1],this[2]=J[Q+2],this[3]=J[Q+3],this}toArray(J=[],Q=0){return J[Q]=this[0],J[Q+1]=this[1],J[Q+2]=this[2],J[Q+3]=this[3],J}}class r8 extends nZ{constructor(J,{width:Q=1,height:$=1,widthSegments:Z=1,heightSegments:K=1,attributes:W={}}={}){let H=Z,U=K,q=(H+1)*(U+1),X=H*U*6,F=new Float32Array(q*3),N=new Float32Array(q*3),L=new Float32Array(q*2),Y=X>65536?new Uint32Array(X):new Uint16Array(X);r8.buildPlane(F,N,L,Y,Q,$,0,H,U),Object.assign(W,{position:{size:3,data:F},normal:{size:3,data:N},uv:{size:2,data:L},index:{data:Y}});super(J,W)}static buildPlane(J,Q,$,Z,K,W,H,U,q,X=0,F=1,N=2,L=1,Y=-1,B=0,M=0){let V=B,A=K/U,I=W/q;for(let P=0;P<=q;P++){let j=P*I-W/2;for(let T=0;T<=U;T++,B++){let w=T*A-K/2;if(J[B*3+X]=w*L,J[B*3+F]=j*Y,J[B*3+N]=H/2,Q[B*3+X]=0,Q[B*3+F]=0,Q[B*3+N]=H>=0?1:-1,$[B*2]=T/U,$[B*2+1]=1-P/q,P===q||T===U)continue;let _=V+T+P*(U+1),S=V+T+(P+1)*(U+1),y=V+T+(P+1)*(U+1)+1,f=V+T+P*(U+1)+1;Z[M*6]=_,Z[M*6+1]=S,Z[M*6+2]=f,Z[M*6+3]=S,Z[M*6+4]=y,Z[M*6+5]=f,M++}}}}var sJ={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,DOLLY_PAN:3},wQ=new k0,a8=new Y9,F7=new Y9;function D6(J,{element:Q=document,enabled:$=!0,target:Z=new k0,ease:K=0.25,inertia:W=0.85,enableRotate:H=!0,rotateSpeed:U=0.1,autoRotate:q=!1,autoRotateSpeed:X=1,enableZoom:F=!0,zoomSpeed:N=1,zoomStyle:L="dolly",enablePan:Y=!0,panSpeed:B=0.1,minPolarAngle:M=0,maxPolarAngle:V=Math.PI,minAzimuthAngle:A=-1/0,maxAzimuthAngle:I=1/0,minDistance:P=0,maxDistance:j=1/0}={}){this.enabled=$,this.target=Z,this.zoomStyle=L,K=K||1,W=W||0,this.minDistance=P,this.maxDistance=j;let T={radius:1,phi:0,theta:0},w={radius:1,phi:0,theta:0},_={radius:1,phi:0,theta:0},S=new k0,y=new k0;y.copy(J.position).sub(this.target),_.radius=w.radius=y.distance(),_.theta=w.theta=Math.atan2(y.x,y.z),_.phi=w.phi=Math.acos(Math.min(Math.max(y.y/w.radius,-1),1)),this.offset=y,this.update=()=>{if(q)D0();w.radius*=T.radius,w.theta+=T.theta,w.phi+=T.phi,w.theta=Math.max(A,Math.min(I,w.theta)),w.phi=Math.max(M,Math.min(V,w.phi)),w.radius=Math.max(this.minDistance,Math.min(this.maxDistance,w.radius)),_.phi+=(w.phi-_.phi)*K,_.theta+=(w.theta-_.theta)*K,_.radius+=(w.radius-_.radius)*K,this.target.add(S);let $0=_.radius*Math.sin(Math.max(0.000001,_.phi));y.x=$0*Math.sin(_.theta),y.y=_.radius*Math.cos(_.phi),y.z=$0*Math.cos(_.theta),J.position.copy(this.target).add(y),J.lookAt(this.target),T.theta*=W,T.phi*=W,S.multiply(W),T.radius=1},this.forcePosition=()=>{y.copy(J.position).sub(this.target),_.radius=w.radius=y.distance(),_.theta=w.theta=Math.atan2(y.x,y.z),_.phi=w.phi=Math.acos(Math.min(Math.max(y.y/w.radius,-1),1)),J.lookAt(this.target)};let f=new Y9,u=new Y9,v=new Y9,m=sJ.NONE;this.mouseButtons={ORBIT:0,ZOOM:1,PAN:2};function l(){return Math.pow(0.95,N)}function H0($0,M0){wQ.set(M0[0],M0[1],M0[2]),wQ.multiply(-$0),S.add(wQ)}function N0($0,M0){wQ.set(M0[4],M0[5],M0[6]),wQ.multiply($0),S.add(wQ)}let Q0=($0,M0)=>{let K9=Q===document?document.body:Q;wQ.copy(J.position).sub(this.target);let o=wQ.distance();o*=Math.tan((J.fov||45)/2*Math.PI/180),H0(2*$0*o/K9.clientHeight,J.matrix),N0(2*M0*o/K9.clientHeight,J.matrix)},Z0=($0)=>{if(this.zoomStyle==="dolly")T.radius/=$0;else if(J.fov/=$0,J.type==="orthographic")J.orthographic();else J.perspective()};function D0(){let $0=2*Math.PI/60/60*X;T.theta-=$0}function b($0,M0){a8.set($0,M0),F7.sub(a8,f).multiply(U);let K9=Q===document?document.body:Q;T.theta-=2*Math.PI*F7.x/K9.clientHeight,T.phi-=2*Math.PI*F7.y/K9.clientHeight,f.copy(a8)}function Y0($0){if(a8.set($0.clientX,$0.clientY),F7.sub(a8,v),F7.y>0)Z0(l());else if(F7.y<0)Z0(1/l());v.copy(a8)}function V0($0,M0){a8.set($0,M0),F7.sub(a8,u).multiply(B),Q0(F7.x,F7.y),u.copy(a8)}function f0($0){if(F){let M0=$0.touches[0].pageX-$0.touches[1].pageX,K9=$0.touches[0].pageY-$0.touches[1].pageY,o=Math.sqrt(M0*M0+K9*K9);v.set(0,o)}if(Y){let M0=0.5*($0.touches[0].pageX+$0.touches[1].pageX),K9=0.5*($0.touches[0].pageY+$0.touches[1].pageY);u.set(M0,K9)}}function z0($0){if(F){let M0=$0.touches[0].pageX-$0.touches[1].pageX,K9=$0.touches[0].pageY-$0.touches[1].pageY,o=Math.sqrt(M0*M0+K9*K9);a8.set(0,o),F7.set(0,Math.pow(a8.y/v.y,N)),Z0(F7.y),v.copy(a8)}if(Y){let M0=0.5*($0.touches[0].pageX+$0.touches[1].pageX),K9=0.5*($0.touches[0].pageY+$0.touches[1].pageY);V0(M0,K9)}}let i0=($0)=>{if(!this.enabled)return;switch($0.button){case this.mouseButtons.ORBIT:if(H===!1)return;f.set($0.clientX,$0.clientY),m=sJ.ROTATE;break;case this.mouseButtons.ZOOM:if(F===!1)return;v.set($0.clientX,$0.clientY),m=sJ.DOLLY;break;case this.mouseButtons.PAN:if(Y===!1)return;u.set($0.clientX,$0.clientY),m=sJ.PAN;break}if(m!==sJ.NONE)window.addEventListener("mousemove",x0,!1),window.addEventListener("mouseup",o0,!1)},x0=($0)=>{if(!this.enabled)return;switch(m){case sJ.ROTATE:if(H===!1)return;b($0.clientX,$0.clientY);break;case sJ.DOLLY:if(F===!1)return;Y0($0);break;case sJ.PAN:if(Y===!1)return;V0($0.clientX,$0.clientY);break}},o0=()=>{window.removeEventListener("mousemove",x0,!1),window.removeEventListener("mouseup",o0,!1),m=sJ.NONE},m0=($0)=>{if(!this.enabled||!F||m!==sJ.NONE&&m!==sJ.ROTATE)return;if($0.stopPropagation(),$0.preventDefault(),$0.deltaY<0)Z0(1/l());else if($0.deltaY>0)Z0(l())},D9=($0)=>{if(!this.enabled)return;switch($0.preventDefault(),$0.touches.length){case 1:if(H===!1)return;f.set($0.touches[0].pageX,$0.touches[0].pageY),m=sJ.ROTATE;break;case 2:if(F===!1&&Y===!1)return;f0($0),m=sJ.DOLLY_PAN;break;default:m=sJ.NONE}},N9=($0)=>{if(!this.enabled)return;switch($0.preventDefault(),$0.stopPropagation(),$0.touches.length){case 1:if(H===!1)return;b($0.touches[0].pageX,$0.touches[0].pageY);break;case 2:if(F===!1&&Y===!1)return;z0($0);break;default:m=sJ.NONE}},J9=()=>{if(!this.enabled)return;m=sJ.NONE},Z9=($0)=>{if(!this.enabled)return;$0.preventDefault()};function g0(){Q.addEventListener("contextmenu",Z9,!1),Q.addEventListener("mousedown",i0,!1),Q.addEventListener("wheel",m0,{passive:!1}),Q.addEventListener("touchstart",D9,{passive:!1}),Q.addEventListener("touchend",J9,!1),Q.addEventListener("touchmove",N9,{passive:!1})}this.remove=function(){Q.removeEventListener("contextmenu",Z9),Q.removeEventListener("mousedown",i0),Q.removeEventListener("wheel",m0),Q.removeEventListener("touchstart",D9),Q.removeEventListener("touchend",J9),Q.removeEventListener("touchmove",N9),window.removeEventListener("mousemove",x0),window.removeEventListener("mouseup",o0)},g0()}var MV=new Y9,zV=new Y9,kV=new Y9,r5=new k0,WD=new k0,HD=new k0,VV=new k0,AV=new k0,IV=new k0,UD=new k0,a5=new k0,qD=new k0,GD=new k0,EV=new k0,XD=new zJ;class sW{constructor(){this.origin=new k0,this.direction=new k0}castMouse(J,Q=[0,0]){if(J.type==="orthographic"){let{left:$,right:Z,bottom:K,top:W,zoom:H}=J,U=$/H+(Z-$)/H*(Q[0]*0.5+0.5),q=K/H+(W-K)/H*(Q[1]*0.5+0.5);this.origin.set(U,q,0),this.origin.applyMatrix4(J.worldMatrix),this.direction.x=-J.worldMatrix[8],this.direction.y=-J.worldMatrix[9],this.direction.z=-J.worldMatrix[10]}else J.worldMatrix.getTranslation(this.origin),this.direction.set(Q[0],Q[1],0.5),J.unproject(this.direction),this.direction.sub(this.origin).normalize()}intersectBounds(J,{maxDistance:Q,output:$=[]}={}){if(!Array.isArray(J))J=[J];let Z=XD,K=r5,W=WD,H=$;return H.length=0,J.forEach((U)=>{if(!U.geometry.bounds||U.geometry.bounds.radius===1/0)U.geometry.computeBoundingSphere();let q=U.geometry.bounds;Z.inverse(U.worldMatrix);let X;if(Q)W.copy(this.direction).scaleRotateMatrix4(Z),X=Q*W.len();if(K.copy(this.origin).applyMatrix4(Z),W.copy(this.direction).transformDirection(Z),Q){if(K.distance(q.center)-q.radius>X)return}let F=0;if(U.geometry.raycast==="sphere"){if(K.distance(q.center)>q.radius){if(F=this.intersectSphere(q,K,W),!F)return}}else if(K.xq.max.x||K.yq.max.y||K.zq.max.z){if(F=this.intersectBox(q,K,W),!F)return}if(Q&&F>X)return;if(!U.hit)U.hit={localPoint:new k0,point:new k0};U.hit.localPoint.copy(W).multiply(F).add(K),U.hit.point.copy(U.hit.localPoint).applyMatrix4(U.worldMatrix),U.hit.distance=U.hit.point.distance(this.origin),H.push(U)}),H.sort((U,q)=>U.hit.distance-q.hit.distance),H}intersectMeshes(J,{cullFace:Q=!0,maxDistance:$,includeUV:Z=!0,includeNormal:K=!0,output:W=[]}={}){let H=this.intersectBounds(J,{maxDistance:$,output:W});if(!H.length)return H;let U=XD,q=r5,X=WD,F=HD,N=VV,L=AV,Y=IV,B=UD,M=a5,V=MV,A=zV,I=kV;for(let P=H.length-1;P>=0;P--){let j=H[P];U.inverse(j.worldMatrix);let T;if($)X.copy(this.direction).scaleRotateMatrix4(U),T=$*X.len();q.copy(this.origin).applyMatrix4(U),X.copy(this.direction).transformDirection(U);let w=0,_,S,y,f=j.geometry,u=f.attributes,v=u.index,m=u.position,l=Math.max(0,f.drawRange.start),H0=Math.min(v?v.count:m.count,f.drawRange.start+f.drawRange.count),N0=m.size;for(let Q0=l;Q0T)continue;if(!w||Y0P.hit.distance-j.hit.distance),H}intersectPlane(J,Q=this.origin,$=this.direction){let Z=r5;Z.sub(J.origin,Q);let K=Z.dot(J.normal),W=$.dot(J.normal);if(W==0)return 0;let H=K/W;if(H<=0)return 0;return Q.add($.scale(H))}intersectSphere(J,Q=this.origin,$=this.direction){let Z=HD;Z.sub(J.center,Q);let K=Z.dot($),W=Z.dot(Z)-K*K,H=J.radius*J.radius;if(W>H)return 0;let U=Math.sqrt(H-W),q=K-U,X=K+U;if(q<0&&X<0)return 0;if(q<0)return X;return q}intersectBox(J,Q=this.origin,$=this.direction){let Z,K,W,H,U,q,X=1/$.x,F=1/$.y,N=1/$.z,L=J.min,Y=J.max;if(Z=((X>=0?L.x:Y.x)-Q.x)*X,K=((X>=0?Y.x:L.x)-Q.x)*X,W=((F>=0?L.y:Y.y)-Q.y)*F,H=((F>=0?Y.y:L.y)-Q.y)*F,Z>H||W>K)return 0;if(W>Z)Z=W;if(H=0?L.z:Y.z)-Q.z)*N,q=((N>=0?Y.z:L.z)-Q.z)*N,Z>q||U>K)return 0;if(U>Z)Z=U;if(q=0?Z:K}intersectTriangle(J,Q,$,Z=!0,K=this.origin,W=this.direction,H=UD){let U=a5,q=qD,X=GD;U.sub(Q,J),q.sub($,J),H.cross(U,q);let F=W.dot(H);if(!F)return 0;let N;if(F>0){if(Z)return 0;N=1}else N=-1,F=-F;X.sub(K,J);let L=N*W.dot(q.cross(X,q));if(L<0)return 0;let Y=N*W.dot(U.cross(X));if(Y<0)return 0;if(L+Y>F)return 0;let B=-N*X.dot(H);if(B<0)return 0;return B/F}getBarycoord(J,Q,$,Z,K=a5){let W=qD,H=GD,U=EV;W.sub(Z,Q),H.sub($,Q),U.sub(J,Q);let q=W.dot(W),X=W.dot(H),F=W.dot(U),N=H.dot(H),L=H.dot(U),Y=q*N-X*X;if(Y===0)return K.set(-2,-1,-1);let B=1/Y,M=(N*F-X*L)*B,V=(q*L-X*F)*B;return K.set(1-M-V,V,M)}}var CV=` precision highp float; precision highp int; attribute vec3 position; attribute vec3 normal; uniform mat3 normalMatrix; uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; varying vec3 vNormal; void main() { vNormal = normalize(normalMatrix * normal); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); } `,PV=` precision highp float; precision highp int; varying vec3 vNormal; void main() { gl_FragColor.rgb = normalize(vNormal); gl_FragColor.a = 1.0; } `;function YD(J){return new M8(J,{vertex:CV,fragment:PV,cullFace:!1})}class t5 extends fJ{constructor(J,{buffer:Q,wrapS:$=J.CLAMP_TO_EDGE,wrapT:Z=J.CLAMP_TO_EDGE,anisotropy:K=0,minFilter:W,magFilter:H}={}){super(J,{generateMipmaps:!1,wrapS:$,wrapT:Z,anisotropy:K,minFilter:W,magFilter:H});if(Q)return this.parseBuffer(Q)}parseBuffer(J){let Q=new jV(J);if(Q.mipmaps.isCompressedTexture=!0,this.image=Q.mipmaps,this.internalFormat=Q.glInternalFormat,Q.numberOfMipmapLevels>1){if(this.minFilter===this.gl.LINEAR)this.minFilter=this.gl.NEAREST_MIPMAP_LINEAR}else if(this.minFilter===this.gl.NEAREST_MIPMAP_LINEAR)this.minFilter=this.gl.LINEAR}}function jV(J){let Q=[171,75,84,88,32,49,49,187,13,10,26,10],$=new Uint8Array(J,0,12);for(let N=0;N<$.length;N++)if($[N]!==Q[N])return console.error("File missing KTX identifier");let Z=Uint32Array.BYTES_PER_ELEMENT,K=new DataView(J,12,13*Z),W=K.getUint32(0,!0)===67305985;if(K.getUint32(1*Z,W)!==0)return console.warn("only compressed formats currently supported");this.glInternalFormat=K.getUint32(4*Z,W);let U=K.getUint32(6*Z,W),q=K.getUint32(7*Z,W);this.numberOfFaces=K.getUint32(10*Z,W),this.numberOfMipmapLevels=Math.max(1,K.getUint32(11*Z,W));let X=K.getUint32(12*Z,W);this.mipmaps=[];let F=64+X;for(let N=0;N>1,q=q>>1}}var iW={},oZ=[];class rW{static load(J,{src:Q,wrapS:$=J.CLAMP_TO_EDGE,wrapT:Z=J.CLAMP_TO_EDGE,anisotropy:K=0,format:W=J.RGBA,internalFormat:H=W,generateMipmaps:U=!0,minFilter:q=U?J.NEAREST_MIPMAP_LINEAR:J.LINEAR,magFilter:X=J.LINEAR,premultiplyAlpha:F=!1,unpackAlignment:N=4,flipY:L=!0}={}){let Y=this.getSupportedExtensions(J),B="none";if(typeof Q==="string")B=Q.split(".").pop().split("?")[0].toLowerCase();if(typeof Q==="object"){for(let A in Q)if(Y.includes(A.toLowerCase())){B=A.toLowerCase(),Q=Q[A];break}}let M=Q+$+Z+K+W+H+U+q+X+F+N+L+J.renderer.id;if(iW[M])return iW[M];let V;switch(B){case"ktx":case"pvrtc":case"s3tc":case"etc":case"etc1":case"astc":V=new t5(J,{src:Q,wrapS:$,wrapT:Z,anisotropy:K,minFilter:q,magFilter:X}),V.loaded=this.loadKTX(Q,V);break;case"webp":case"jpg":case"jpeg":case"png":V=new fJ(J,{wrapS:$,wrapT:Z,anisotropy:K,format:W,internalFormat:H,generateMipmaps:U,minFilter:q,magFilter:X,premultiplyAlpha:F,unpackAlignment:N,flipY:L}),V.loaded=this.loadImage(J,Q,V,L);break;default:console.warn("No supported format supplied"),V=new fJ(J)}return V.ext=B,iW[M]=V,V}static getSupportedExtensions(J){if(oZ.length)return oZ;let Q={pvrtc:J.renderer.getExtension("WEBGL_compressed_texture_pvrtc")||J.renderer.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),s3tc:J.renderer.getExtension("WEBGL_compressed_texture_s3tc"),etc1:J.renderer.getExtension("WEBGL_compressed_texture_etc1"),astc:J.renderer.getExtension("WEBGL_compressed_texture_astc"),bc7:J.renderer.getExtension("EXT_texture_compression_bptc")};for(let $ in Q)if(Q[$])oZ.push($);return oZ.push("png","jpg","webp"),oZ}static loadKTX(J,Q){return fetch(J).then(($)=>$.arrayBuffer()).then(($)=>Q.parseBuffer($))}static loadImage(J,Q,$,Z){return TV(Q,Z).then((K)=>{if(!J.renderer.isWebgl2&&(!ND(K.width)||!ND(K.height))){if($.generateMipmaps)$.generateMipmaps=!1;if($.minFilter===J.NEAREST_MIPMAP_LINEAR)$.minFilter=J.LINEAR;if($.wrapS===J.REPEAT)$.wrapS=$.wrapT=J.CLAMP_TO_EDGE}return $.image=K,$.onUpdate=()=>{if(K.close)K.close();$.onUpdate=null},K})}static clearCache(){iW={}}}function ND(J){return Math.log2(J)%1===0}function TV(J,Q){return new Promise(($,Z)=>{if(SV())fetch(J,{mode:"cors"}).then((K)=>K.blob()).then((K)=>createImageBitmap(K,{imageOrientation:Q?"flipY":"none",premultiplyAlpha:"none"})).then($).catch((K)=>Z(K));else{let K=new Image;K.crossOrigin="",K.src=J,K.onerror=({type:W})=>Z(`${W}: Loading image`),K.onload=()=>$(K)}})}function SV(){if(!navigator.userAgent.toLowerCase().includes("chrome"))return!1;try{createImageBitmap}catch(Q){return!1}return!0}var OD=new k0,_V=new k0,yV=new k0,wV=new k0,FD=new yQ,hV=new yQ,xV=new yQ,fV=new yQ;class e5{constructor(J,Q=1){this.data=J,this.elapsed=0,this.weight=Q,this.loop=!0,this.startTime=J.reduce(($,{times:Z})=>Math.min($,Z[0]),1/0),this.endTime=J.reduce(($,{times:Z})=>Math.max($,Z[Z.length-1]),0),this.duration=this.endTime-this.startTime}update(J=1,Q){let $=Q?1:this.weight/J,Z=!this.duration?0:(this.loop?this.elapsed%this.duration:Math.min(this.elapsed,this.duration-0.001))+this.startTime;this.data.forEach(({node:K,transform:W,interpolation:H,times:U,values:q})=>{if(!this.duration){let A=OD,I=3;if(W==="quaternion")A=FD,I=4;if(A.fromArray(q,0),I===4)K[W].slerp(A,$);else K[W].lerp(A,$);return}let X=Math.max(1,U.findIndex((A)=>A>Z))-1,F=X+1,N=(Z-U[X])/(U[F]-U[X]);if(H==="STEP")N=0;let L=OD,Y=_V,B=yV,M=wV,V=3;if(W==="quaternion")L=FD,Y=hV,B=xV,M=fV,V=4;if(H==="CUBICSPLINE"){if(L.fromArray(q,X*V*3+V*1),Y.fromArray(q,X*V*3+V*2),B.fromArray(q,F*V*3+V*0),M.fromArray(q,F*V*3+V*1),L=this.cubicSplineInterpolate(N,L,Y,B,M),V===4)L.normalize()}else if(L.fromArray(q,X*V),M.fromArray(q,F*V),V===4)L.slerp(M,N);else L.lerp(M,N);if(V===4)K[W].slerp(L,$);else K[W].lerp(L,$)})}cubicSplineInterpolate(J,Q,$,Z,K){let W=J*J,H=W*J,U=3*W-2*H,q=H-W,X=1-U,F=q-W+J;for(let N=0;N{DD.multiply(J.worldMatrix,J.bindInverse),this.boneMatrices.set(DD,Q*16)}),this.boneTexture.needsUpdate=!0,this.program.uniforms.boneTexture.value=this.boneTexture,this.program.uniforms.boneTextureSize.value=this.boneTextureSize}draw({camera:J}={}){if(!this.program.uniforms.boneTexture)Object.assign(this.program.uniforms,{boneTexture:{value:this.boneTexture},boneTextureSize:{value:this.boneTextureSize}});this.updateUniforms();let Q=this.worldMatrix;this.worldMatrix=bV,super.draw({camera:J}),this.worldMatrix=Q}}class JG extends EJ{constructor(...J){super(...J);this.frustumCulled=!1,this.isInstancedMesh=!0}addFrustumCull(){if(this.instanceTransforms=null,this.instanceLightmapScaleOffset=null,this.totalInstanceCount=0,this.frustumCullFunction=null,this.instanceRenderList=null,!this.geometry.attributes.instanceMatrix)console.error(`mesh ${this.name?`"${this.name}" `:""}missing instanceMatrix attribute; unable to frustum cull`);let J=this.geometry.attributes.instanceMatrix.data;this.instanceTransforms=[];for(let Q=0,$=0;Q{this.instanceRenderList=[],this.instanceTransforms.forEach(($)=>{if(!Q.frustumIntersectsMesh(this,$.worldMatrix))return;this.instanceRenderList.push($)}),this.instanceRenderList.forEach(($,Z)=>{if($.matrix.toArray(this.geometry.attributes.instanceMatrix.data,Z*16),$.lightmapData)$.lightmapData.toArray(this.geometry.attributes.lightmapScaleOffset.data,Z*4),this.geometry.attributes.lightmapScaleOffset.needsUpdate=!0}),this.geometry.instancedCount=this.instanceRenderList.length,this.geometry.attributes.instanceMatrix.needsUpdate=!0},this.onBeforeRender(this.frustumCullFunction)}removeFrustumCull(){this.offBeforeRender(this.frustumCullFunction),this.geometry.instancedCount=this.totalInstanceCount,this.instanceTransforms.forEach((J,Q)=>{if(J.matrix.toArray(this.geometry.attributes.instanceMatrix.data,Q*16),J.lightmapData)J.lightmapData.toArray(this.geometry.attributes.lightmapScaleOffset.data,Q*4),this.geometry.attributes.lightmapScaleOffset.needsUpdate=!0}),this.geometry.attributes.instanceMatrix.needsUpdate=!0}}var LD={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array,"image/jpeg":Uint8Array,"image/png":Uint8Array,"image/webp":Uint8Array},vV={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},RD={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},gV={translation:"position",rotation:"quaternion",scale:"scale"};class aW{static setDracoManager(J){this.dracoManager=J}static setBasisManager(J){this.basisManager=J}static async load(J,Q){let $=Q.split("/").slice(0,-1).join("/")+"/",Z=await this.parseDesc(Q);return this.parse(J,Z,$)}static async parse(J,Q,$){if(Q.asset===void 0||Q.asset.version[0]<2)console.warn("Only GLTF >=2.0 supported. Attempting to parse.");if(Q.extensionsRequired?.includes("KHR_draco_mesh_compression")&&!this.dracoManager)console.warn("KHR_draco_mesh_compression extension required but no manager supplied. Use .setDracoManager()");if(Q.extensionsRequired?.includes("KHR_texture_basisu")&&!this.basisManager)console.warn("KHR_texture_basisu extension required but no manager supplied. Use .setBasisManager()");let Z=await this.loadBuffers(Q,$);J.renderer.bindVertexArray(null);let K=this.parseBufferViews(J,Q,Z),W=await this.parseImages(J,Q,$,K),H=this.parseTextures(J,Q,W),U=this.parseMaterials(J,Q,H),q=this.parseSkins(J,Q,K),X=await this.parseMeshes(J,Q,K,U,q),[F,N]=this.parseNodes(J,Q,X,q,W);this.populateSkins(q,F);let L=this.parseAnimations(J,Q,F,K),Y=this.parseScenes(Q,F),B=Y[Q.scene],M=this.parseLights(J,Q,F,Y);for(let V=F.length;V>=0;V--)if(!F[V])F.splice(V,1);return{json:Q,buffers:Z,bufferViews:K,cameras:N,images:W,textures:H,materials:U,meshes:X,nodes:F,lights:M,animations:L,scenes:Y,scene:B}}static parseDesc(J){return fetch(J,{mode:"cors"}).then((Q)=>Q.arrayBuffer()).then((Q)=>{let $=new TextDecoder;if($.decode(new Uint8Array(Q,0,4))==="glTF")return this.unpackGLB(Q);else return JSON.parse($.decode(Q))})}static unpackGLB(J){let Q=new Uint32Array(J,0,3);if(Q[0]!==1179937895)throw new Error("Invalid glTF asset.");else if(Q[1]!==2)throw new Error(`Unsupported glTF binary version, "${Q[1]}".`);let $=new Uint32Array(J,12,2),Z=20,K=$[0];if($[1]!==1313821514)throw new Error("Unexpected GLB layout.");let W=new TextDecoder().decode(J.slice(Z,Z+K)),H=JSON.parse(W);if(Z+K===J.byteLength)return H;let U=new Uint32Array(J,Z+K,2);if(U[1]!==5130562)throw new Error("Unexpected GLB layout.");let q=Z+K+8,X=U[0],F=J.slice(q,q+X);return H.buffers[0].binary=F,H}static resolveURI(J,Q){if(typeof J!=="string"||J==="")return"";if(/^https?:\/\//i.test(Q)&&/^\//.test(J))Q=Q.replace(/(^https?:\/\/[^\/]+).*/i,"$1");if(/^(https?:)?\/\//i.test(J))return J;if(/^data:.*,.*$/i.test(J))return J;if(/^blob:.*$/i.test(J))return J;return Q+J}static loadBuffers(J,Q){if(!J.buffers)return null;return Promise.all(J.buffers.map(($)=>{if($.binary)return $.binary;let Z=this.resolveURI($.uri,Q);return fetch(Z,{mode:"cors"}).then((K)=>K.arrayBuffer())}))}static parseBufferViews(J,Q,$){if(!Q.bufferViews)return null;let Z=Q.bufferViews;return Q.meshes&&Q.meshes.forEach(({primitives:K})=>{K.forEach(({attributes:W,indices:H,extensions:U})=>{for(let q in W){let X=Q.accessors[W[q]];if(X.bufferView===void 0&&!!U){if(U.KHR_draco_mesh_compression)X.bufferView=U.KHR_draco_mesh_compression.bufferView,Z[X.bufferView].isDraco=!0}Z[X.bufferView].isAttribute=!0}if(H!==void 0){let q=Q.accessors[H];if(q.bufferView===void 0&&!!U){if(U.KHR_draco_mesh_compression)q.bufferView=U.KHR_draco_mesh_compression.bufferView,Z[q.bufferView].isDraco=!0}Z[q.bufferView].isAttribute=!0,Z[q.bufferView].target=J.ELEMENT_ARRAY_BUFFER}})}),Q.accessors.forEach(({bufferView:K,componentType:W})=>{if(K===void 0)return;Z[K].componentType=W}),Q.images&&Q.images.forEach(({uri:K,bufferView:W,mimeType:H})=>{if(W===void 0)return;Z[W].mimeType=H}),Z.forEach(({buffer:K,byteOffset:W=0,byteLength:H,byteStride:U,target:q=J.ARRAY_BUFFER,name:X,extensions:F,extras:N,componentType:L,mimeType:Y,isAttribute:B,isDraco:M},V)=>{if(Z[V].data=$[K].slice(W,W+H),!B||M)return;let A=J.createBuffer();J.bindBuffer(q,A),J.renderer.state.boundBuffer=A,J.bufferData(q,Z[V].data,J.STATIC_DRAW),Z[V].buffer=A}),Z}static parseImages(J,Q,$,Z){if(!Q.images)return null;return Promise.all(Q.images.map(async({uri:K,bufferView:W,mimeType:H,name:U})=>{if(H==="image/ktx2"){let{data:X}=Z[W];return await this.basisManager.parseTexture(X)}let q=new Image;if(q.name=U,K)q.src=this.resolveURI(K,$);else if(W!==void 0){let{data:X}=Z[W],F=new Blob([X],{type:H});q.src=URL.createObjectURL(F)}return q.ready=new Promise((X)=>{q.onload=()=>X()}),q}))}static parseTextures(J,Q,$){if(!Q.textures)return null;return Q.textures.map((Z)=>this.createTexture(J,Q,$,Z))}static createTexture(J,Q,$,{sampler:Z,source:K,name:W,extensions:H,extras:U}){if(K===void 0&&!!H){if(H.EXT_texture_webp)K=H.EXT_texture_webp.source;if(H.KHR_texture_basisu)K=H.KHR_texture_basisu.source}let q=$[K];if(q.texture)return q.texture;let X={flipY:!1,wrapS:J.REPEAT,wrapT:J.REPEAT},F=Z!==void 0?Q.samplers[Z]:null;if(F)["magFilter","minFilter","wrapS","wrapT"].forEach((L)=>{if(F[L])X[L]=F[L]});if(q.isBasis){if(X.image=q,X.internalFormat=q.internalFormat,q.isCompressedTexture){if(X.generateMipmaps=!1,q.length>1)this.minFilter=J.NEAREST_MIPMAP_LINEAR}let L=new fJ(J,X);return L.name=W,q.texture=L,L}let N=new fJ(J,X);return N.name=W,q.texture=N,q.ready.then(()=>{N.image=q}),N}static parseMaterials(J,Q,$){if(!Q.materials)return null;return Q.materials.map(({name:Z,extensions:K,extras:W,pbrMetallicRoughness:H={},normalTexture:U,occlusionTexture:q,emissiveTexture:X,emissiveFactor:F=[0,0,0],alphaMode:N="OPAQUE",alphaCutoff:L=0.5,doubleSided:Y=!1})=>{let{baseColorFactor:B=[1,1,1,1],baseColorTexture:M,metallicFactor:V=1,roughnessFactor:A=1,metallicRoughnessTexture:I}=H;if(M)M.texture=$[M.index];if(U)U.texture=$[U.index];if(I)I.texture=$[I.index];if(q)q.texture=$[q.index];if(X)X.texture=$[X.index];return{name:Z,extensions:K,extras:W,baseColorFactor:B,baseColorTexture:M,metallicFactor:V,roughnessFactor:A,metallicRoughnessTexture:I,normalTexture:U,occlusionTexture:q,emissiveTexture:X,emissiveFactor:F,alphaMode:N,alphaCutoff:L,doubleSided:Y}})}static parseSkins(J,Q,$){if(!Q.skins)return null;return Q.skins.map(({inverseBindMatrices:Z,skeleton:K,joints:W})=>{return{inverseBindMatrices:this.parseAccessor(Z,Q,$),skeleton:K,joints:W}})}static parseMeshes(J,Q,$,Z,K){if(!Q.meshes)return null;return Promise.all(Q.meshes.map(async({primitives:W,weights:H,name:U,extensions:q,extras:X={}},F)=>{let N=0,L=[],Y=!1;if(Q.nodes&&Q.nodes.forEach(({mesh:M,skin:V,extras:A})=>{if(M===F){if(N++,V!==void 0)L.push(V);if(A&&A.lightmap_scale_offset)Y=!0}}),!!L.length)W=await Promise.all(L.map(async(M)=>{return(await this.parsePrimitives(J,W,Q,$,Z,1,Y)).map(({geometry:V,program:A,mode:I})=>{let P=new L6(J,{skeleton:K[M],geometry:V,program:A,mode:I});if(P.name=U,P.extras=X,q)P.extensions=q;return P.frustumCulled=!1,P})})),W.instanceCount=0,W.numInstances=N;else W=(await this.parsePrimitives(J,W,Q,$,Z,N,Y)).map(({geometry:M,program:V,mode:A})=>{let P=new(M.attributes.instanceMatrix?JG:EJ)(J,{geometry:M,program:V,mode:A});if(P.name=U,P.extras=X,q)P.extensions=q;return P.numInstances=N,P});return{primitives:W,weights:H,name:U}}))}static parsePrimitives(J,Q,$,Z,K,W,H){return Promise.all(Q.map(async({attributes:U,indices:q,material:X,mode:F=4,targets:N,extensions:L,extras:Y})=>{let B=new YD(J);if(X!==void 0)B.gltfMaterial=K[X];let M=new nZ(J);if(Y)M.extras=Y;if(L)M.extensions=L;if(L&&L.KHR_draco_mesh_compression){let V=L.KHR_draco_mesh_compression.bufferView,A=L.KHR_draco_mesh_compression.attributes,I={},P={},j={},T={};for(let S in U){let y=$.accessors[U[S]],f=RD[S];I[f]=A[S],P[f]=y.componentType,j[f]=LD[y.componentType].name,T[f]=y.normalized===!0}let{data:w}=Z[V],_=await this.dracoManager.decodeGeometry(w,{attributeIds:I,attributeTypes:j});for(let S=0;S<_.attributes.length;S++){let y=_.attributes[S],f=y.name,u=y.array,v=y.itemSize,m=P[f],l=T[f],H0=J.createBuffer();J.bindBuffer(J.ARRAY_BUFFER,H0),J.renderer.state.boundBuffer=H0,J.bufferData(J.ARRAY_BUFFER,u,J.STATIC_DRAW),M.addAttribute(f,{data:u,size:v,type:m,normalized:l,buffer:H0})}if(_.index){let S=_.index.array,y=_.index.itemSize,f=J.createBuffer();J.bindBuffer(J.ELEMENT_ARRAY_BUFFER,f),J.renderer.state.boundBuffer=f,J.bufferData(J.ELEMENT_ARRAY_BUFFER,S,J.STATIC_DRAW),M.addAttribute("index",{data:S,size:y,type:5125,normalized:!1,buffer:f})}}else{for(let V in U)M.addAttribute(RD[V],this.parseAccessor(U[V],$,Z));if(q!==void 0)M.addAttribute("index",this.parseAccessor(q,$,Z))}if(W>1)M.addAttribute("instanceMatrix",{instanced:1,size:16,data:new Float32Array(W*16)});if(H)M.addAttribute("lightmapScaleOffset",{instanced:1,size:4,data:new Float32Array(W*4)});return{geometry:M,program:B,mode:F}}))}static parseAccessor(J,Q,$){let{bufferView:Z,byteOffset:K=0,componentType:W,normalized:H=!1,count:U,type:q,min:X,max:F,sparse:N}=Q.accessors[J],{data:L,buffer:Y,byteOffset:B=0,byteStride:M=0,target:V}=$[Z],A=vV[q],I=LD[W],P=I.BYTES_PER_ELEMENT,j=M/P,T=!!M&&j!==A,w;if(T){let _=new I(L,K);w=new I(U*A);for(let S=0;S{let P=U!==void 0,j=P?new O7(J):new NJ;if(P){let y=Q.cameras[U];if(y.type==="perspective"){let{yfov:f,znear:u,zfar:v}=y.perspective;j.perspective({fov:f*(180/Math.PI),near:u,far:v})}else{let{xmag:f,ymag:u,znear:v,zfar:m}=y.orthographic;j.orthographic({near:v,far:m,left:-f,right:f,top:-u,bottom:u})}W.push(j)}if(V)j.name=V;if(I)j.extras=I;if(A)j.extensions=A;if(I&&I.lightmapTexture!==void 0)I.lightmapTexture.texture=this.createTexture(J,Q,K,{source:I.lightmapTexture.index});if(F)j.matrix.copy(F),j.decompose();else{if(L)j.quaternion.copy(L);if(Y)j.scale.copy(Y);if(B)j.position.copy(B);j.updateMatrix()}let T=!1,w=!0,_=!1,S=X!==void 0;if(N!==void 0)if(S){if($[N].primitives[$[N].primitives.instanceCount].forEach((y)=>{if(I)Object.assign(y.extras,I);y.setParent(j)}),$[N].primitives.instanceCount++,$[N].primitives.instanceCount===$[N].primitives.numInstances)delete $[N].primitives.numInstances,delete $[N].primitives.instanceCount}else $[N].primitives.forEach((y)=>{if(I)Object.assign(y.extras,I);if(y.geometry.isInstanced){if(T=!0,!y.instanceCount)y.instanceCount=0;else w=!1;if(y.geometry.attributes.instanceMatrix)_=!0,j.matrix.toArray(y.geometry.attributes.instanceMatrix.data,y.instanceCount*16);if(y.geometry.attributes.lightmapScaleOffset)y.geometry.attributes.lightmapScaleOffset.data.set(I.lightmap_scale_offset,y.instanceCount*4);if(y.instanceCount++,y.instanceCount===y.numInstances){if(delete y.numInstances,delete y.instanceCount,y.geometry.attributes.instanceMatrix)y.geometry.attributes.instanceMatrix.needsUpdate=!0;if(y.geometry.attributes.lightmapScaleOffset)y.geometry.attributes.lightmapScaleOffset.needsUpdate=!0}}if(T){if(w)y.setParent(j)}else y.setParent(j)});if(_){if(!w)return null;j.matrix.identity(),j.decompose()}return j});return Q.nodes.forEach(({children:U=[]},q)=>{U.forEach((X)=>{if(!H[X])return;H[X].setParent(H[q])})}),$.forEach(({primitives:U},q)=>{U.forEach((X,F)=>{if(X.isInstancedMesh)X.addFrustumCull()})}),[H,W]}static populateSkins(J,Q){if(!J)return;J.forEach(($)=>{if($.joints=$.joints.map((Z,K)=>{let W=Q[Z];return W.skin=$,W.bindInverse=new zJ(...$.inverseBindMatrices.data.slice(K*16,(K+1)*16)),W}),$.skeleton)$.skeleton=Q[$.skeleton]})}static parseAnimations(J,Q,$,Z){if(!Q.animations)return null;return Q.animations.map(({channels:K,samplers:W,name:H},U)=>{let q=K.map(({sampler:X,target:F})=>{let{input:N,interpolation:L="LINEAR",output:Y}=W[X],{node:B,path:M}=F,V=$[B],A=gV[M],I=this.parseAccessor(N,Q,Z).data,P=this.parseAccessor(Y,Q,Z).data;if(!V.animations)V.animations=[];if(!V.animations.includes(U))V.animations.push(U);return{node:V,transform:A,interpolation:L,times:I,values:P}});return{name:H,animation:new e5(q)}})}static parseScenes(J,Q){if(!J.scenes)return null;return J.scenes.map(({nodes:$=[],name:Z,extensions:K,extras:W})=>{let H=$.reduce((U,q)=>{if(Q[q])U.push(Q[q]);return U},[]);return H.extras=W,H})}static parseLights(J,Q,$,Z){let K={directional:[],point:[],spot:[]};Z.forEach((H)=>H.forEach((U)=>U.updateMatrixWorld()));let W=Q.extensions?.KHR_lights_punctual?.lights||[];return $.forEach((H)=>{if(!H?.extensions?.KHR_lights_punctual)return;let U=H.extensions.KHR_lights_punctual.light,q=W[U],X={name:q.name||"",color:{value:new k0().set(q.color||1)}};if(q.intensity!==void 0)X.color.value.multiply(q.intensity);switch(q.type){case"directional":X.direction={value:new k0(0,0,1).transformDirection(H.worldMatrix)};break;case"point":X.position={value:new k0().applyMatrix4(H.worldMatrix)},X.distance={value:q.range},X.decay={value:2};break;case"spot":Object.assign(X,q);break}K[q.type].push(X)}),K}}class tW{constructor(){this.gl=new ZJ,this.instance=new mW({canvas:this.gl.canvas,powerPreference:"high-performance",alpha:!0,premultipliedAlpha:!0}),this.instance.dpr=this.gl.sizes.pixelRatio,this.instance.setSize(this.gl.sizes.width,this.gl.sizes.height)}update(){for(let J in this.gl.world.scenes)this.gl.world.scenes[J].renderPipeline();this.instance.render({scene:this.gl.scene,camera:this.gl.camera})}resize(){this.instance.dpr=this.gl.sizes.pixelRatio,this.instance.setSize(this.gl.sizes.width,this.gl.sizes.height)}}var GG=0,XG=1,YG=2,NG=3,OG=4,FG=5,DG=6,LG=7;class ZH{addEventListener(J,Q){if(this._listeners===void 0)this._listeners={};let $=this._listeners;if($[J]===void 0)$[J]=[];if($[J].indexOf(Q)===-1)$[J].push(Q)}hasEventListener(J,Q){let $=this._listeners;if($===void 0)return!1;return $[J]!==void 0&&$[J].indexOf(Q)!==-1}removeEventListener(J,Q){let $=this._listeners;if($===void 0)return;let Z=$[J];if(Z!==void 0){let K=Z.indexOf(Q);if(K!==-1)Z.splice(K,1)}}dispatchEvent(J){let Q=this._listeners;if(Q===void 0)return;let $=Q[J.type];if($!==void 0){J.target=this;let Z=$.slice(0);for(let K=0,W=Z.length;K>8&255]+iJ[J>>16&255]+iJ[J>>24&255]+"-"+iJ[Q&255]+iJ[Q>>8&255]+"-"+iJ[Q>>16&15|64]+iJ[Q>>24&255]+"-"+iJ[$&63|128]+iJ[$>>8&255]+"-"+iJ[$>>16&255]+iJ[$>>24&255]+iJ[Z&255]+iJ[Z>>8&255]+iJ[Z>>16&255]+iJ[Z>>24&255]).toLowerCase()}function _9(J,Q,$){return Math.max(Q,Math.min($,J))}function BG(J,Q){return(J%Q+Q)%Q}function uV(J,Q,$,Z,K){return Z+(J-Q)*(K-Z)/($-Q)}function dV(J,Q,$){if(J!==Q)return($-J)/(Q-J);else return 0}function iZ(J,Q,$){return(1-$)*J+$*Q}function mV(J,Q,$,Z){return iZ(J,Q,1-Math.exp(-$*Z))}function cV(J,Q=1){return Q-Math.abs(BG(J,Q*2)-Q)}function pV(J,Q,$){if(J<=Q)return 0;if(J>=$)return 1;return J=(J-Q)/($-Q),J*J*(3-2*J)}function lV(J,Q,$){if(J<=Q)return 0;if(J>=$)return 1;return J=(J-Q)/($-Q),J*J*J*(J*(J*6-15)+10)}function nV(J,Q){return J+Math.floor(Math.random()*(Q-J+1))}function oV(J,Q){return J+Math.random()*(Q-J)}function sV(J){return J*(0.5-Math.random())}function iV(J){if(J!==void 0)BD=J;let Q=BD+=1831565813;return Q=Math.imul(Q^Q>>>15,Q|1),Q^=Q+Math.imul(Q^Q>>>7,Q|61),((Q^Q>>>14)>>>0)/4294967296}function rV(J){return J*SD}function aV(J){return J*RG}function tV(J){return(J&J-1)===0&&J!==0}function eV(J){return Math.pow(2,Math.ceil(Math.log(J)/Math.LN2))}function JA(J){return Math.pow(2,Math.floor(Math.log(J)/Math.LN2))}function QA(J,Q,$,Z,K){let{cos:W,sin:H}=Math,U=W($/2),q=H($/2),X=W((Q+Z)/2),F=H((Q+Z)/2),N=W((Q-Z)/2),L=H((Q-Z)/2),Y=W((Z-Q)/2),B=H((Z-Q)/2);switch(K){case"XYX":J.set(U*F,q*N,q*L,U*X);break;case"YZY":J.set(q*L,U*F,q*N,U*X);break;case"ZXZ":J.set(q*N,q*L,U*F,U*X);break;case"XZX":J.set(U*F,q*B,q*Y,U*X);break;case"YXY":J.set(q*Y,U*F,q*B,U*X);break;case"ZYZ":J.set(q*B,q*Y,U*F,U*X);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+K)}}function $A(J,Q){switch(Q.constructor){case Float32Array:return J;case Uint32Array:return J/4294967295;case Uint16Array:return J/65535;case Uint8Array:return J/255;case Int32Array:return Math.max(J/2147483647,-1);case Int16Array:return Math.max(J/32767,-1);case Int8Array:return Math.max(J/127,-1);default:throw new Error("Invalid component type.")}}function ZA(J,Q){switch(Q.constructor){case Float32Array:return J;case Uint32Array:return Math.round(J*4294967295);case Uint16Array:return Math.round(J*65535);case Uint8Array:return Math.round(J*255);case Int32Array:return Math.round(J*2147483647);case Int16Array:return Math.round(J*32767);case Int8Array:return Math.round(J*127);default:throw new Error("Invalid component type.")}}var aJ={DEG2RAD:SD,RAD2DEG:RG,generateUUID:KH,clamp:_9,euclideanModulo:BG,mapLinear:uV,inverseLerp:dV,lerp:iZ,damp:mV,pingpong:cV,smoothstep:pV,smootherstep:lV,randInt:nV,randFloat:oV,randFloatSpread:sV,seededRandom:iV,degToRad:rV,radToDeg:aV,isPowerOfTwo:tV,ceilPowerOfTwo:eV,floorPowerOfTwo:JA,setQuaternionFromProperEuler:QA,normalize:ZA,denormalize:$A};class x9{constructor(J=0,Q=0){x9.prototype.isVector2=!0,this.x=J,this.y=Q}get width(){return this.x}set width(J){this.x=J}get height(){return this.y}set height(J){this.y=J}set(J,Q){return this.x=J,this.y=Q,this}setScalar(J){return this.x=J,this.y=J,this}setX(J){return this.x=J,this}setY(J){return this.y=J,this}setComponent(J,Q){switch(J){case 0:this.x=Q;break;case 1:this.y=Q;break;default:throw new Error("index is out of range: "+J)}return this}getComponent(J){switch(J){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+J)}}clone(){return new this.constructor(this.x,this.y)}copy(J){return this.x=J.x,this.y=J.y,this}add(J){return this.x+=J.x,this.y+=J.y,this}addScalar(J){return this.x+=J,this.y+=J,this}addVectors(J,Q){return this.x=J.x+Q.x,this.y=J.y+Q.y,this}addScaledVector(J,Q){return this.x+=J.x*Q,this.y+=J.y*Q,this}sub(J){return this.x-=J.x,this.y-=J.y,this}subScalar(J){return this.x-=J,this.y-=J,this}subVectors(J,Q){return this.x=J.x-Q.x,this.y=J.y-Q.y,this}multiply(J){return this.x*=J.x,this.y*=J.y,this}multiplyScalar(J){return this.x*=J,this.y*=J,this}divide(J){return this.x/=J.x,this.y/=J.y,this}divideScalar(J){return this.multiplyScalar(1/J)}applyMatrix3(J){let Q=this.x,$=this.y,Z=J.elements;return this.x=Z[0]*Q+Z[3]*$+Z[6],this.y=Z[1]*Q+Z[4]*$+Z[7],this}min(J){return this.x=Math.min(this.x,J.x),this.y=Math.min(this.y,J.y),this}max(J){return this.x=Math.max(this.x,J.x),this.y=Math.max(this.y,J.y),this}clamp(J,Q){return this.x=_9(this.x,J.x,Q.x),this.y=_9(this.y,J.y,Q.y),this}clampScalar(J,Q){return this.x=_9(this.x,J,Q),this.y=_9(this.y,J,Q),this}clampLength(J,Q){let $=this.length();return this.divideScalar($||1).multiplyScalar(_9($,J,Q))}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(J){return this.x*J.x+this.y*J.y}cross(J){return this.x*J.y-this.y*J.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(J){let Q=Math.sqrt(this.lengthSq()*J.lengthSq());if(Q===0)return Math.PI/2;let $=this.dot(J)/Q;return Math.acos(_9($,-1,1))}distanceTo(J){return Math.sqrt(this.distanceToSquared(J))}distanceToSquared(J){let Q=this.x-J.x,$=this.y-J.y;return Q*Q+$*$}manhattanDistanceTo(J){return Math.abs(this.x-J.x)+Math.abs(this.y-J.y)}setLength(J){return this.normalize().multiplyScalar(J)}lerp(J,Q){return this.x+=(J.x-this.x)*Q,this.y+=(J.y-this.y)*Q,this}lerpVectors(J,Q,$){return this.x=J.x+(Q.x-J.x)*$,this.y=J.y+(Q.y-J.y)*$,this}equals(J){return J.x===this.x&&J.y===this.y}fromArray(J,Q=0){return this.x=J[Q],this.y=J[Q+1],this}toArray(J=[],Q=0){return J[Q]=this.x,J[Q+1]=this.y,J}fromBufferAttribute(J,Q){return this.x=J.getX(Q),this.y=J.getY(Q),this}rotateAround(J,Q){let $=Math.cos(Q),Z=Math.sin(Q),K=this.x-J.x,W=this.y-J.y;return this.x=K*$-W*Z+J.x,this.y=K*Z+W*$+J.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vQ{constructor(J=0,Q=0,$=0,Z=1){this.isQuaternion=!0,this._x=J,this._y=Q,this._z=$,this._w=Z}static slerpFlat(J,Q,$,Z,K,W,H){let U=$[Z+0],q=$[Z+1],X=$[Z+2],F=$[Z+3],N=K[W+0],L=K[W+1],Y=K[W+2],B=K[W+3];if(H===0){J[Q+0]=U,J[Q+1]=q,J[Q+2]=X,J[Q+3]=F;return}if(H===1){J[Q+0]=N,J[Q+1]=L,J[Q+2]=Y,J[Q+3]=B;return}if(F!==B||U!==N||q!==L||X!==Y){let M=1-H,V=U*N+q*L+X*Y+F*B,A=V>=0?1:-1,I=1-V*V;if(I>Number.EPSILON){let j=Math.sqrt(I),T=Math.atan2(j,V*A);M=Math.sin(M*T)/j,H=Math.sin(H*T)/j}let P=H*A;if(U=U*M+N*P,q=q*M+L*P,X=X*M+Y*P,F=F*M+B*P,M===1-H){let j=1/Math.sqrt(U*U+q*q+X*X+F*F);U*=j,q*=j,X*=j,F*=j}}J[Q]=U,J[Q+1]=q,J[Q+2]=X,J[Q+3]=F}static multiplyQuaternionsFlat(J,Q,$,Z,K,W){let H=$[Z],U=$[Z+1],q=$[Z+2],X=$[Z+3],F=K[W],N=K[W+1],L=K[W+2],Y=K[W+3];return J[Q]=H*Y+X*F+U*L-q*N,J[Q+1]=U*Y+X*N+q*F-H*L,J[Q+2]=q*Y+X*L+H*N-U*F,J[Q+3]=X*Y-H*F-U*N-q*L,J}get x(){return this._x}set x(J){this._x=J,this._onChangeCallback()}get y(){return this._y}set y(J){this._y=J,this._onChangeCallback()}get z(){return this._z}set z(J){this._z=J,this._onChangeCallback()}get w(){return this._w}set w(J){this._w=J,this._onChangeCallback()}set(J,Q,$,Z){return this._x=J,this._y=Q,this._z=$,this._w=Z,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(J){return this._x=J.x,this._y=J.y,this._z=J.z,this._w=J.w,this._onChangeCallback(),this}setFromEuler(J,Q=!0){let{_x:$,_y:Z,_z:K,_order:W}=J,H=Math.cos,U=Math.sin,q=H($/2),X=H(Z/2),F=H(K/2),N=U($/2),L=U(Z/2),Y=U(K/2);switch(W){case"XYZ":this._x=N*X*F+q*L*Y,this._y=q*L*F-N*X*Y,this._z=q*X*Y+N*L*F,this._w=q*X*F-N*L*Y;break;case"YXZ":this._x=N*X*F+q*L*Y,this._y=q*L*F-N*X*Y,this._z=q*X*Y-N*L*F,this._w=q*X*F+N*L*Y;break;case"ZXY":this._x=N*X*F-q*L*Y,this._y=q*L*F+N*X*Y,this._z=q*X*Y+N*L*F,this._w=q*X*F-N*L*Y;break;case"ZYX":this._x=N*X*F-q*L*Y,this._y=q*L*F+N*X*Y,this._z=q*X*Y-N*L*F,this._w=q*X*F+N*L*Y;break;case"YZX":this._x=N*X*F+q*L*Y,this._y=q*L*F+N*X*Y,this._z=q*X*Y-N*L*F,this._w=q*X*F-N*L*Y;break;case"XZY":this._x=N*X*F-q*L*Y,this._y=q*L*F-N*X*Y,this._z=q*X*Y+N*L*F,this._w=q*X*F+N*L*Y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+W)}if(Q===!0)this._onChangeCallback();return this}setFromAxisAngle(J,Q){let $=Q/2,Z=Math.sin($);return this._x=J.x*Z,this._y=J.y*Z,this._z=J.z*Z,this._w=Math.cos($),this._onChangeCallback(),this}setFromRotationMatrix(J){let Q=J.elements,$=Q[0],Z=Q[4],K=Q[8],W=Q[1],H=Q[5],U=Q[9],q=Q[2],X=Q[6],F=Q[10],N=$+H+F;if(N>0){let L=0.5/Math.sqrt(N+1);this._w=0.25/L,this._x=(X-U)*L,this._y=(K-q)*L,this._z=(W-Z)*L}else if($>H&&$>F){let L=2*Math.sqrt(1+$-H-F);this._w=(X-U)/L,this._x=0.25*L,this._y=(Z+W)/L,this._z=(K+q)/L}else if(H>F){let L=2*Math.sqrt(1+H-$-F);this._w=(K-q)/L,this._x=(Z+W)/L,this._y=0.25*L,this._z=(U+X)/L}else{let L=2*Math.sqrt(1+F-$-H);this._w=(W-Z)/L,this._x=(K+q)/L,this._y=(U+X)/L,this._z=0.25*L}return this._onChangeCallback(),this}setFromUnitVectors(J,Q){let $=J.dot(Q)+1;if($<0.00000001)if($=0,Math.abs(J.x)>Math.abs(J.z))this._x=-J.y,this._y=J.x,this._z=0,this._w=$;else this._x=0,this._y=-J.z,this._z=J.y,this._w=$;else this._x=J.y*Q.z-J.z*Q.y,this._y=J.z*Q.x-J.x*Q.z,this._z=J.x*Q.y-J.y*Q.x,this._w=$;return this.normalize()}angleTo(J){return 2*Math.acos(Math.abs(_9(this.dot(J),-1,1)))}rotateTowards(J,Q){let $=this.angleTo(J);if($===0)return this;let Z=Math.min(1,Q/$);return this.slerp(J,Z),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(J){return this._x*J._x+this._y*J._y+this._z*J._z+this._w*J._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 J=this.length();if(J===0)this._x=0,this._y=0,this._z=0,this._w=1;else J=1/J,this._x=this._x*J,this._y=this._y*J,this._z=this._z*J,this._w=this._w*J;return this._onChangeCallback(),this}multiply(J){return this.multiplyQuaternions(this,J)}premultiply(J){return this.multiplyQuaternions(J,this)}multiplyQuaternions(J,Q){let{_x:$,_y:Z,_z:K,_w:W}=J,H=Q._x,U=Q._y,q=Q._z,X=Q._w;return this._x=$*X+W*H+Z*q-K*U,this._y=Z*X+W*U+K*H-$*q,this._z=K*X+W*q+$*U-Z*H,this._w=W*X-$*H-Z*U-K*q,this._onChangeCallback(),this}slerp(J,Q){if(Q===0)return this;if(Q===1)return this.copy(J);let $=this._x,Z=this._y,K=this._z,W=this._w,H=W*J._w+$*J._x+Z*J._y+K*J._z;if(H<0)this._w=-J._w,this._x=-J._x,this._y=-J._y,this._z=-J._z,H=-H;else this.copy(J);if(H>=1)return this._w=W,this._x=$,this._y=Z,this._z=K,this;let U=1-H*H;if(U<=Number.EPSILON){let L=1-Q;return this._w=L*W+Q*this._w,this._x=L*$+Q*this._x,this._y=L*Z+Q*this._y,this._z=L*K+Q*this._z,this.normalize(),this}let q=Math.sqrt(U),X=Math.atan2(q,H),F=Math.sin((1-Q)*X)/q,N=Math.sin(Q*X)/q;return this._w=W*F+this._w*N,this._x=$*F+this._x*N,this._y=Z*F+this._y*N,this._z=K*F+this._z*N,this._onChangeCallback(),this}slerpQuaternions(J,Q,$){return this.copy(J).slerp(Q,$)}random(){let J=2*Math.PI*Math.random(),Q=2*Math.PI*Math.random(),$=Math.random(),Z=Math.sqrt(1-$),K=Math.sqrt($);return this.set(Z*Math.sin(J),Z*Math.cos(J),K*Math.sin(Q),K*Math.cos(Q))}equals(J){return J._x===this._x&&J._y===this._y&&J._z===this._z&&J._w===this._w}fromArray(J,Q=0){return this._x=J[Q],this._y=J[Q+1],this._z=J[Q+2],this._w=J[Q+3],this._onChangeCallback(),this}toArray(J=[],Q=0){return J[Q]=this._x,J[Q+1]=this._y,J[Q+2]=this._z,J[Q+3]=this._w,J}fromBufferAttribute(J,Q){return this._x=J.getX(Q),this._y=J.getY(Q),this._z=J.getZ(Q),this._w=J.getW(Q),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(J){return this._onChangeCallback=J,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class R9{constructor(J=0,Q=0,$=0){R9.prototype.isVector3=!0,this.x=J,this.y=Q,this.z=$}set(J,Q,$){if($===void 0)$=this.z;return this.x=J,this.y=Q,this.z=$,this}setScalar(J){return this.x=J,this.y=J,this.z=J,this}setX(J){return this.x=J,this}setY(J){return this.y=J,this}setZ(J){return this.z=J,this}setComponent(J,Q){switch(J){case 0:this.x=Q;break;case 1:this.y=Q;break;case 2:this.z=Q;break;default:throw new Error("index is out of range: "+J)}return this}getComponent(J){switch(J){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+J)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(J){return this.x=J.x,this.y=J.y,this.z=J.z,this}add(J){return this.x+=J.x,this.y+=J.y,this.z+=J.z,this}addScalar(J){return this.x+=J,this.y+=J,this.z+=J,this}addVectors(J,Q){return this.x=J.x+Q.x,this.y=J.y+Q.y,this.z=J.z+Q.z,this}addScaledVector(J,Q){return this.x+=J.x*Q,this.y+=J.y*Q,this.z+=J.z*Q,this}sub(J){return this.x-=J.x,this.y-=J.y,this.z-=J.z,this}subScalar(J){return this.x-=J,this.y-=J,this.z-=J,this}subVectors(J,Q){return this.x=J.x-Q.x,this.y=J.y-Q.y,this.z=J.z-Q.z,this}multiply(J){return this.x*=J.x,this.y*=J.y,this.z*=J.z,this}multiplyScalar(J){return this.x*=J,this.y*=J,this.z*=J,this}multiplyVectors(J,Q){return this.x=J.x*Q.x,this.y=J.y*Q.y,this.z=J.z*Q.z,this}applyEuler(J){return this.applyQuaternion(MD.setFromEuler(J))}applyAxisAngle(J,Q){return this.applyQuaternion(MD.setFromAxisAngle(J,Q))}applyMatrix3(J){let Q=this.x,$=this.y,Z=this.z,K=J.elements;return this.x=K[0]*Q+K[3]*$+K[6]*Z,this.y=K[1]*Q+K[4]*$+K[7]*Z,this.z=K[2]*Q+K[5]*$+K[8]*Z,this}applyNormalMatrix(J){return this.applyMatrix3(J).normalize()}applyMatrix4(J){let Q=this.x,$=this.y,Z=this.z,K=J.elements,W=1/(K[3]*Q+K[7]*$+K[11]*Z+K[15]);return this.x=(K[0]*Q+K[4]*$+K[8]*Z+K[12])*W,this.y=(K[1]*Q+K[5]*$+K[9]*Z+K[13])*W,this.z=(K[2]*Q+K[6]*$+K[10]*Z+K[14])*W,this}applyQuaternion(J){let Q=this.x,$=this.y,Z=this.z,K=J.x,W=J.y,H=J.z,U=J.w,q=2*(W*Z-H*$),X=2*(H*Q-K*Z),F=2*(K*$-W*Q);return this.x=Q+U*q+W*F-H*X,this.y=$+U*X+H*q-K*F,this.z=Z+U*F+K*X-W*q,this}project(J){return this.applyMatrix4(J.matrixWorldInverse).applyMatrix4(J.projectionMatrix)}unproject(J){return this.applyMatrix4(J.projectionMatrixInverse).applyMatrix4(J.matrixWorld)}transformDirection(J){let Q=this.x,$=this.y,Z=this.z,K=J.elements;return this.x=K[0]*Q+K[4]*$+K[8]*Z,this.y=K[1]*Q+K[5]*$+K[9]*Z,this.z=K[2]*Q+K[6]*$+K[10]*Z,this.normalize()}divide(J){return this.x/=J.x,this.y/=J.y,this.z/=J.z,this}divideScalar(J){return this.multiplyScalar(1/J)}min(J){return this.x=Math.min(this.x,J.x),this.y=Math.min(this.y,J.y),this.z=Math.min(this.z,J.z),this}max(J){return this.x=Math.max(this.x,J.x),this.y=Math.max(this.y,J.y),this.z=Math.max(this.z,J.z),this}clamp(J,Q){return this.x=_9(this.x,J.x,Q.x),this.y=_9(this.y,J.y,Q.y),this.z=_9(this.z,J.z,Q.z),this}clampScalar(J,Q){return this.x=_9(this.x,J,Q),this.y=_9(this.y,J,Q),this.z=_9(this.z,J,Q),this}clampLength(J,Q){let $=this.length();return this.divideScalar($||1).multiplyScalar(_9($,J,Q))}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(J){return this.x*J.x+this.y*J.y+this.z*J.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(J){return this.normalize().multiplyScalar(J)}lerp(J,Q){return this.x+=(J.x-this.x)*Q,this.y+=(J.y-this.y)*Q,this.z+=(J.z-this.z)*Q,this}lerpVectors(J,Q,$){return this.x=J.x+(Q.x-J.x)*$,this.y=J.y+(Q.y-J.y)*$,this.z=J.z+(Q.z-J.z)*$,this}cross(J){return this.crossVectors(this,J)}crossVectors(J,Q){let{x:$,y:Z,z:K}=J,W=Q.x,H=Q.y,U=Q.z;return this.x=Z*U-K*H,this.y=K*W-$*U,this.z=$*H-Z*W,this}projectOnVector(J){let Q=J.lengthSq();if(Q===0)return this.set(0,0,0);let $=J.dot(this)/Q;return this.copy(J).multiplyScalar($)}projectOnPlane(J){return QG.copy(this).projectOnVector(J),this.sub(QG)}reflect(J){return this.sub(QG.copy(J).multiplyScalar(2*this.dot(J)))}angleTo(J){let Q=Math.sqrt(this.lengthSq()*J.lengthSq());if(Q===0)return Math.PI/2;let $=this.dot(J)/Q;return Math.acos(_9($,-1,1))}distanceTo(J){return Math.sqrt(this.distanceToSquared(J))}distanceToSquared(J){let Q=this.x-J.x,$=this.y-J.y,Z=this.z-J.z;return Q*Q+$*$+Z*Z}manhattanDistanceTo(J){return Math.abs(this.x-J.x)+Math.abs(this.y-J.y)+Math.abs(this.z-J.z)}setFromSpherical(J){return this.setFromSphericalCoords(J.radius,J.phi,J.theta)}setFromSphericalCoords(J,Q,$){let Z=Math.sin(Q)*J;return this.x=Z*Math.sin($),this.y=Math.cos(Q)*J,this.z=Z*Math.cos($),this}setFromCylindrical(J){return this.setFromCylindricalCoords(J.radius,J.theta,J.y)}setFromCylindricalCoords(J,Q,$){return this.x=J*Math.sin(Q),this.y=$,this.z=J*Math.cos(Q),this}setFromMatrixPosition(J){let Q=J.elements;return this.x=Q[12],this.y=Q[13],this.z=Q[14],this}setFromMatrixScale(J){let Q=this.setFromMatrixColumn(J,0).length(),$=this.setFromMatrixColumn(J,1).length(),Z=this.setFromMatrixColumn(J,2).length();return this.x=Q,this.y=$,this.z=Z,this}setFromMatrixColumn(J,Q){return this.fromArray(J.elements,Q*4)}setFromMatrix3Column(J,Q){return this.fromArray(J.elements,Q*3)}setFromEuler(J){return this.x=J._x,this.y=J._y,this.z=J._z,this}setFromColor(J){return this.x=J.r,this.y=J.g,this.z=J.b,this}equals(J){return J.x===this.x&&J.y===this.y&&J.z===this.z}fromArray(J,Q=0){return this.x=J[Q],this.y=J[Q+1],this.z=J[Q+2],this}toArray(J=[],Q=0){return J[Q]=this.x,J[Q+1]=this.y,J[Q+2]=this.z,J}fromBufferAttribute(J,Q){return this.x=J.getX(Q),this.y=J.getY(Q),this.z=J.getZ(Q),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let J=Math.random()*Math.PI*2,Q=Math.random()*2-1,$=Math.sqrt(1-Q*Q);return this.x=$*Math.cos(J),this.y=Q,this.z=$*Math.sin(J),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}var QG=new R9,MD=new vQ;class $9{constructor(J,Q,$,Z,K,W,H,U,q){if($9.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],J!==void 0)this.set(J,Q,$,Z,K,W,H,U,q)}set(J,Q,$,Z,K,W,H,U,q){let X=this.elements;return X[0]=J,X[1]=Z,X[2]=H,X[3]=Q,X[4]=K,X[5]=U,X[6]=$,X[7]=W,X[8]=q,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(J){let Q=this.elements,$=J.elements;return Q[0]=$[0],Q[1]=$[1],Q[2]=$[2],Q[3]=$[3],Q[4]=$[4],Q[5]=$[5],Q[6]=$[6],Q[7]=$[7],Q[8]=$[8],this}extractBasis(J,Q,$){return J.setFromMatrix3Column(this,0),Q.setFromMatrix3Column(this,1),$.setFromMatrix3Column(this,2),this}setFromMatrix4(J){let Q=J.elements;return this.set(Q[0],Q[4],Q[8],Q[1],Q[5],Q[9],Q[2],Q[6],Q[10]),this}multiply(J){return this.multiplyMatrices(this,J)}premultiply(J){return this.multiplyMatrices(J,this)}multiplyMatrices(J,Q){let $=J.elements,Z=Q.elements,K=this.elements,W=$[0],H=$[3],U=$[6],q=$[1],X=$[4],F=$[7],N=$[2],L=$[5],Y=$[8],B=Z[0],M=Z[3],V=Z[6],A=Z[1],I=Z[4],P=Z[7],j=Z[2],T=Z[5],w=Z[8];return K[0]=W*B+H*A+U*j,K[3]=W*M+H*I+U*T,K[6]=W*V+H*P+U*w,K[1]=q*B+X*A+F*j,K[4]=q*M+X*I+F*T,K[7]=q*V+X*P+F*w,K[2]=N*B+L*A+Y*j,K[5]=N*M+L*I+Y*T,K[8]=N*V+L*P+Y*w,this}multiplyScalar(J){let Q=this.elements;return Q[0]*=J,Q[3]*=J,Q[6]*=J,Q[1]*=J,Q[4]*=J,Q[7]*=J,Q[2]*=J,Q[5]*=J,Q[8]*=J,this}determinant(){let J=this.elements,Q=J[0],$=J[1],Z=J[2],K=J[3],W=J[4],H=J[5],U=J[6],q=J[7],X=J[8];return Q*W*X-Q*H*q-$*K*X+$*H*U+Z*K*q-Z*W*U}invert(){let J=this.elements,Q=J[0],$=J[1],Z=J[2],K=J[3],W=J[4],H=J[5],U=J[6],q=J[7],X=J[8],F=X*W-H*q,N=H*U-X*K,L=q*K-W*U,Y=Q*F+$*N+Z*L;if(Y===0)return this.set(0,0,0,0,0,0,0,0,0);let B=1/Y;return J[0]=F*B,J[1]=(Z*q-X*$)*B,J[2]=(H*$-Z*W)*B,J[3]=N*B,J[4]=(X*Q-Z*U)*B,J[5]=(Z*K-H*Q)*B,J[6]=L*B,J[7]=($*U-q*Q)*B,J[8]=(W*Q-$*K)*B,this}transpose(){let J,Q=this.elements;return J=Q[1],Q[1]=Q[3],Q[3]=J,J=Q[2],Q[2]=Q[6],Q[6]=J,J=Q[5],Q[5]=Q[7],Q[7]=J,this}getNormalMatrix(J){return this.setFromMatrix4(J).invert().transpose()}transposeIntoArray(J){let Q=this.elements;return J[0]=Q[0],J[1]=Q[3],J[2]=Q[6],J[3]=Q[1],J[4]=Q[4],J[5]=Q[7],J[6]=Q[2],J[7]=Q[5],J[8]=Q[8],this}setUvTransform(J,Q,$,Z,K,W,H){let U=Math.cos(K),q=Math.sin(K);return this.set($*U,$*q,-$*(U*W+q*H)+W+J,-Z*q,Z*U,-Z*(-q*W+U*H)+H+Q,0,0,1),this}scale(J,Q){return this.premultiply($G.makeScale(J,Q)),this}rotate(J){return this.premultiply($G.makeRotation(-J)),this}translate(J,Q){return this.premultiply($G.makeTranslation(J,Q)),this}makeTranslation(J,Q){if(J.isVector2)this.set(1,0,J.x,0,1,J.y,0,0,1);else this.set(1,0,J,0,1,Q,0,0,1);return this}makeRotation(J){let Q=Math.cos(J),$=Math.sin(J);return this.set(Q,-$,0,$,Q,0,0,0,1),this}makeScale(J,Q){return this.set(J,0,0,0,Q,0,0,0,1),this}equals(J){let Q=this.elements,$=J.elements;for(let Z=0;Z<9;Z++)if(Q[Z]!==$[Z])return!1;return!0}fromArray(J,Q=0){for(let $=0;$<9;$++)this.elements[$]=J[$+Q];return this}toArray(J=[],Q=0){let $=this.elements;return J[Q]=$[0],J[Q+1]=$[1],J[Q+2]=$[2],J[Q+3]=$[3],J[Q+4]=$[4],J[Q+5]=$[5],J[Q+6]=$[6],J[Q+7]=$[7],J[Q+8]=$[8],J}clone(){return new this.constructor().fromArray(this.elements)}}var $G=new $9;function UG(J){return document.createElementNS("http://www.w3.org/1999/xhtml",J)}var zD={};function qG(J){if(J in zD)return;zD[J]=!0,console.warn(J)}var kD=new $9().set(0.4123908,0.3575843,0.1804808,0.212639,0.7151687,0.0721923,0.0193308,0.1191948,0.9505322),VD=new $9().set(3.2409699,-1.5373832,-0.4986108,-0.9692436,1.8759675,0.0415551,0.0556301,-0.203977,1.0569715);function KA(){let J={enabled:!0,workingColorSpace:"srgb-linear",spaces:{},convert:function(K,W,H){if(this.enabled===!1||W===H||!W||!H)return K;if(this.spaces[W].transfer==="srgb")K.r=$Q(K.r),K.g=$Q(K.g),K.b=$Q(K.b);if(this.spaces[W].primaries!==this.spaces[H].primaries)K.applyMatrix3(this.spaces[W].toXYZ),K.applyMatrix3(this.spaces[H].fromXYZ);if(this.spaces[H].transfer==="srgb")K.r=k6(K.r),K.g=k6(K.g),K.b=k6(K.b);return K},workingToColorSpace:function(K,W){return this.convert(K,this.workingColorSpace,W)},colorSpaceToWorking:function(K,W){return this.convert(K,W,this.workingColorSpace)},getPrimaries:function(K){return this.spaces[K].primaries},getTransfer:function(K){if(K==="")return"linear";return this.spaces[K].transfer},getToneMappingMode:function(K){return this.spaces[K].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(K,W=this.workingColorSpace){return K.fromArray(this.spaces[W].luminanceCoefficients)},define:function(K){Object.assign(this.spaces,K)},_getMatrix:function(K,W,H){return K.copy(this.spaces[W].toXYZ).multiply(this.spaces[H].fromXYZ)},_getDrawingBufferColorSpace:function(K){return this.spaces[K].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(K=this.workingColorSpace){return this.spaces[K].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(K,W){return qG("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),J.workingToColorSpace(K,W)},toWorkingColorSpace:function(K,W){return qG("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),J.colorSpaceToWorking(K,W)}},Q=[0.64,0.33,0.3,0.6,0.15,0.06],$=[0.2126,0.7152,0.0722],Z=[0.3127,0.329];return J.define({["srgb-linear"]:{primaries:Q,whitePoint:Z,transfer:"linear",toXYZ:kD,fromXYZ:VD,luminanceCoefficients:$,workingColorSpaceConfig:{unpackColorSpace:"srgb"},outputColorSpaceConfig:{drawingBufferColorSpace:"srgb"}},["srgb"]:{primaries:Q,whitePoint:Z,transfer:"srgb",toXYZ:kD,fromXYZ:VD,luminanceCoefficients:$,outputColorSpaceConfig:{drawingBufferColorSpace:"srgb"}}}),J}var t8=KA();function $Q(J){return J<0.04045?J*0.0773993808:Math.pow(J*0.9478672986+0.0521327014,2.4)}function k6(J){return J<0.0031308?J*12.92:1.055*Math.pow(J,0.41666)-0.055}var R6;class MG{static getDataURL(J,Q="image/png"){if(/^data:/i.test(J.src))return J.src;if(typeof HTMLCanvasElement==="undefined")return J.src;let $;if(J instanceof HTMLCanvasElement)$=J;else{if(R6===void 0)R6=UG("canvas");R6.width=J.width,R6.height=J.height;let Z=R6.getContext("2d");if(J instanceof ImageData)Z.putImageData(J,0,0);else Z.drawImage(J,0,0,J.width,J.height);$=R6}return $.toDataURL(Q)}static sRGBToLinear(J){if(typeof HTMLImageElement!=="undefined"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&J instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&J instanceof ImageBitmap){let Q=UG("canvas");Q.width=J.width,Q.height=J.height;let $=Q.getContext("2d");$.drawImage(J,0,0,J.width,J.height);let Z=$.getImageData(0,0,J.width,J.height),K=Z.data;for(let W=0;W1?!0:!1,this.pmremVersion=0}get width(){return this.source.getSize(KG).x}get height(){return this.source.getSize(KG).y}get depth(){return this.source.getSize(KG).z}get image(){return this.source.data}set image(J=null){this.source.data=J}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(J,Q){this.updateRanges.push({start:J,count:Q})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(J){return this.name=J.name,this.source=J.source,this.mipmaps=J.mipmaps.slice(0),this.mapping=J.mapping,this.channel=J.channel,this.wrapS=J.wrapS,this.wrapT=J.wrapT,this.magFilter=J.magFilter,this.minFilter=J.minFilter,this.anisotropy=J.anisotropy,this.format=J.format,this.internalFormat=J.internalFormat,this.type=J.type,this.offset.copy(J.offset),this.repeat.copy(J.repeat),this.center.copy(J.center),this.rotation=J.rotation,this.matrixAutoUpdate=J.matrixAutoUpdate,this.matrix.copy(J.matrix),this.generateMipmaps=J.generateMipmaps,this.premultiplyAlpha=J.premultiplyAlpha,this.flipY=J.flipY,this.unpackAlignment=J.unpackAlignment,this.colorSpace=J.colorSpace,this.renderTarget=J.renderTarget,this.isRenderTargetTexture=J.isRenderTargetTexture,this.isArrayTexture=J.isArrayTexture,this.userData=JSON.parse(JSON.stringify(J.userData)),this.needsUpdate=!0,this}setValues(J){for(let Q in J){let $=J[Q];if($===void 0){console.warn(`THREE.Texture.setValues(): parameter '${Q}' has value of undefined.`);continue}let Z=this[Q];if(Z===void 0){console.warn(`THREE.Texture.setValues(): property '${Q}' does not exist.`);continue}if(Z&&$&&(Z.isVector2&&$.isVector2))Z.copy($);else if(Z&&$&&(Z.isVector3&&$.isVector3))Z.copy($);else if(Z&&$&&(Z.isMatrix3&&$.isMatrix3))Z.copy($);else this[Q]=$}}toJSON(J){let Q=J===void 0||typeof J==="string";if(!Q&&J.textures[this.uuid]!==void 0)return J.textures[this.uuid];let $={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(J).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};if(Object.keys(this.userData).length>0)$.userData=this.userData;if(!Q)J.textures[this.uuid]=$;return $}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(J){if(this.mapping!==300)return J;if(J.applyMatrix3(this.matrix),J.x<0||J.x>1)switch(this.wrapS){case 1000:J.x=J.x-Math.floor(J.x);break;case 1001:J.x=J.x<0?0:1;break;case 1002:if(Math.abs(Math.floor(J.x)%2)===1)J.x=Math.ceil(J.x)-J.x;else J.x=J.x-Math.floor(J.x);break}if(J.y<0||J.y>1)switch(this.wrapT){case 1000:J.y=J.y-Math.floor(J.y);break;case 1001:J.y=J.y<0?0:1;break;case 1002:if(Math.abs(Math.floor(J.y)%2)===1)J.y=Math.ceil(J.y)-J.y;else J.y=J.y-Math.floor(J.y);break}if(this.flipY)J.y=1-J.y;return J}set needsUpdate(J){if(J===!0)this.version++,this.source.needsUpdate=!0}set needsPMREMUpdate(J){if(J===!0)this.pmremVersion++}}fQ.DEFAULT_IMAGE=null;fQ.DEFAULT_MAPPING=300;fQ.DEFAULT_ANISOTROPY=1;class T7{constructor(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M){if(T7.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],J!==void 0)this.set(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M)}set(J,Q,$,Z,K,W,H,U,q,X,F,N,L,Y,B,M){let V=this.elements;return V[0]=J,V[4]=Q,V[8]=$,V[12]=Z,V[1]=K,V[5]=W,V[9]=H,V[13]=U,V[2]=q,V[6]=X,V[10]=F,V[14]=N,V[3]=L,V[7]=Y,V[11]=B,V[15]=M,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new T7().fromArray(this.elements)}copy(J){let Q=this.elements,$=J.elements;return Q[0]=$[0],Q[1]=$[1],Q[2]=$[2],Q[3]=$[3],Q[4]=$[4],Q[5]=$[5],Q[6]=$[6],Q[7]=$[7],Q[8]=$[8],Q[9]=$[9],Q[10]=$[10],Q[11]=$[11],Q[12]=$[12],Q[13]=$[13],Q[14]=$[14],Q[15]=$[15],this}copyPosition(J){let Q=this.elements,$=J.elements;return Q[12]=$[12],Q[13]=$[13],Q[14]=$[14],this}setFromMatrix3(J){let Q=J.elements;return this.set(Q[0],Q[3],Q[6],0,Q[1],Q[4],Q[7],0,Q[2],Q[5],Q[8],0,0,0,0,1),this}extractBasis(J,Q,$){return J.setFromMatrixColumn(this,0),Q.setFromMatrixColumn(this,1),$.setFromMatrixColumn(this,2),this}makeBasis(J,Q,$){return this.set(J.x,Q.x,$.x,0,J.y,Q.y,$.y,0,J.z,Q.z,$.z,0,0,0,0,1),this}extractRotation(J){let Q=this.elements,$=J.elements,Z=1/B6.setFromMatrixColumn(J,0).length(),K=1/B6.setFromMatrixColumn(J,1).length(),W=1/B6.setFromMatrixColumn(J,2).length();return Q[0]=$[0]*Z,Q[1]=$[1]*Z,Q[2]=$[2]*Z,Q[3]=0,Q[4]=$[4]*K,Q[5]=$[5]*K,Q[6]=$[6]*K,Q[7]=0,Q[8]=$[8]*W,Q[9]=$[9]*W,Q[10]=$[10]*W,Q[11]=0,Q[12]=0,Q[13]=0,Q[14]=0,Q[15]=1,this}makeRotationFromEuler(J){let Q=this.elements,$=J.x,Z=J.y,K=J.z,W=Math.cos($),H=Math.sin($),U=Math.cos(Z),q=Math.sin(Z),X=Math.cos(K),F=Math.sin(K);if(J.order==="XYZ"){let N=W*X,L=W*F,Y=H*X,B=H*F;Q[0]=U*X,Q[4]=-U*F,Q[8]=q,Q[1]=L+Y*q,Q[5]=N-B*q,Q[9]=-H*U,Q[2]=B-N*q,Q[6]=Y+L*q,Q[10]=W*U}else if(J.order==="YXZ"){let N=U*X,L=U*F,Y=q*X,B=q*F;Q[0]=N+B*H,Q[4]=Y*H-L,Q[8]=W*q,Q[1]=W*F,Q[5]=W*X,Q[9]=-H,Q[2]=L*H-Y,Q[6]=B+N*H,Q[10]=W*U}else if(J.order==="ZXY"){let N=U*X,L=U*F,Y=q*X,B=q*F;Q[0]=N-B*H,Q[4]=-W*F,Q[8]=Y+L*H,Q[1]=L+Y*H,Q[5]=W*X,Q[9]=B-N*H,Q[2]=-W*q,Q[6]=H,Q[10]=W*U}else if(J.order==="ZYX"){let N=W*X,L=W*F,Y=H*X,B=H*F;Q[0]=U*X,Q[4]=Y*q-L,Q[8]=N*q+B,Q[1]=U*F,Q[5]=B*q+N,Q[9]=L*q-Y,Q[2]=-q,Q[6]=H*U,Q[10]=W*U}else if(J.order==="YZX"){let N=W*U,L=W*q,Y=H*U,B=H*q;Q[0]=U*X,Q[4]=B-N*F,Q[8]=Y*F+L,Q[1]=F,Q[5]=W*X,Q[9]=-H*X,Q[2]=-q*X,Q[6]=L*F+Y,Q[10]=N-B*F}else if(J.order==="XZY"){let N=W*U,L=W*q,Y=H*U,B=H*q;Q[0]=U*X,Q[4]=-F,Q[8]=q*X,Q[1]=N*F+B,Q[5]=W*X,Q[9]=L*F-Y,Q[2]=Y*F-L,Q[6]=H*X,Q[10]=B*F+N}return Q[3]=0,Q[7]=0,Q[11]=0,Q[12]=0,Q[13]=0,Q[14]=0,Q[15]=1,this}makeRotationFromQuaternion(J){return this.compose(UA,J,qA)}lookAt(J,Q,$){let Z=this.elements;if(x8.subVectors(J,Q),x8.lengthSq()===0)x8.z=1;if(x8.normalize(),hQ.crossVectors($,x8),hQ.lengthSq()===0){if(Math.abs($.z)===1)x8.x+=0.0001;else x8.z+=0.0001;x8.normalize(),hQ.crossVectors($,x8)}return hQ.normalize(),eW.crossVectors(x8,hQ),Z[0]=hQ.x,Z[4]=eW.x,Z[8]=x8.x,Z[1]=hQ.y,Z[5]=eW.y,Z[9]=x8.y,Z[2]=hQ.z,Z[6]=eW.z,Z[10]=x8.z,this}multiply(J){return this.multiplyMatrices(this,J)}premultiply(J){return this.multiplyMatrices(J,this)}multiplyMatrices(J,Q){let $=J.elements,Z=Q.elements,K=this.elements,W=$[0],H=$[4],U=$[8],q=$[12],X=$[1],F=$[5],N=$[9],L=$[13],Y=$[2],B=$[6],M=$[10],V=$[14],A=$[3],I=$[7],P=$[11],j=$[15],T=Z[0],w=Z[4],_=Z[8],S=Z[12],y=Z[1],f=Z[5],u=Z[9],v=Z[13],m=Z[2],l=Z[6],H0=Z[10],N0=Z[14],Q0=Z[3],Z0=Z[7],D0=Z[11],b=Z[15];return K[0]=W*T+H*y+U*m+q*Q0,K[4]=W*w+H*f+U*l+q*Z0,K[8]=W*_+H*u+U*H0+q*D0,K[12]=W*S+H*v+U*N0+q*b,K[1]=X*T+F*y+N*m+L*Q0,K[5]=X*w+F*f+N*l+L*Z0,K[9]=X*_+F*u+N*H0+L*D0,K[13]=X*S+F*v+N*N0+L*b,K[2]=Y*T+B*y+M*m+V*Q0,K[6]=Y*w+B*f+M*l+V*Z0,K[10]=Y*_+B*u+M*H0+V*D0,K[14]=Y*S+B*v+M*N0+V*b,K[3]=A*T+I*y+P*m+j*Q0,K[7]=A*w+I*f+P*l+j*Z0,K[11]=A*_+I*u+P*H0+j*D0,K[15]=A*S+I*v+P*N0+j*b,this}multiplyScalar(J){let Q=this.elements;return Q[0]*=J,Q[4]*=J,Q[8]*=J,Q[12]*=J,Q[1]*=J,Q[5]*=J,Q[9]*=J,Q[13]*=J,Q[2]*=J,Q[6]*=J,Q[10]*=J,Q[14]*=J,Q[3]*=J,Q[7]*=J,Q[11]*=J,Q[15]*=J,this}determinant(){let J=this.elements,Q=J[0],$=J[4],Z=J[8],K=J[12],W=J[1],H=J[5],U=J[9],q=J[13],X=J[2],F=J[6],N=J[10],L=J[14],Y=J[3],B=J[7],M=J[11],V=J[15];return Y*(+K*U*F-Z*q*F-K*H*N+$*q*N+Z*H*L-$*U*L)+B*(+Q*U*L-Q*q*N+K*W*N-Z*W*L+Z*q*X-K*U*X)+M*(+Q*q*F-Q*H*L-K*W*F+$*W*L+K*H*X-$*q*X)+V*(-Z*H*X-Q*U*F+Q*H*N+Z*W*F-$*W*N+$*U*X)}transpose(){let J=this.elements,Q;return Q=J[1],J[1]=J[4],J[4]=Q,Q=J[2],J[2]=J[8],J[8]=Q,Q=J[6],J[6]=J[9],J[9]=Q,Q=J[3],J[3]=J[12],J[12]=Q,Q=J[7],J[7]=J[13],J[13]=Q,Q=J[11],J[11]=J[14],J[14]=Q,this}setPosition(J,Q,$){let Z=this.elements;if(J.isVector3)Z[12]=J.x,Z[13]=J.y,Z[14]=J.z;else Z[12]=J,Z[13]=Q,Z[14]=$;return this}invert(){let J=this.elements,Q=J[0],$=J[1],Z=J[2],K=J[3],W=J[4],H=J[5],U=J[6],q=J[7],X=J[8],F=J[9],N=J[10],L=J[11],Y=J[12],B=J[13],M=J[14],V=J[15],A=F*M*q-B*N*q+B*U*L-H*M*L-F*U*V+H*N*V,I=Y*N*q-X*M*q-Y*U*L+W*M*L+X*U*V-W*N*V,P=X*B*q-Y*F*q+Y*H*L-W*B*L-X*H*V+W*F*V,j=Y*F*U-X*B*U-Y*H*N+W*B*N+X*H*M-W*F*M,T=Q*A+$*I+Z*P+K*j;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/T;return J[0]=A*w,J[1]=(B*N*K-F*M*K-B*Z*L+$*M*L+F*Z*V-$*N*V)*w,J[2]=(H*M*K-B*U*K+B*Z*q-$*M*q-H*Z*V+$*U*V)*w,J[3]=(F*U*K-H*N*K-F*Z*q+$*N*q+H*Z*L-$*U*L)*w,J[4]=I*w,J[5]=(X*M*K-Y*N*K+Y*Z*L-Q*M*L-X*Z*V+Q*N*V)*w,J[6]=(Y*U*K-W*M*K-Y*Z*q+Q*M*q+W*Z*V-Q*U*V)*w,J[7]=(W*N*K-X*U*K+X*Z*q-Q*N*q-W*Z*L+Q*U*L)*w,J[8]=P*w,J[9]=(Y*F*K-X*B*K-Y*$*L+Q*B*L+X*$*V-Q*F*V)*w,J[10]=(W*B*K-Y*H*K+Y*$*q-Q*B*q-W*$*V+Q*H*V)*w,J[11]=(X*H*K-W*F*K-X*$*q+Q*F*q+W*$*L-Q*H*L)*w,J[12]=j*w,J[13]=(X*B*Z-Y*F*Z+Y*$*N-Q*B*N-X*$*M+Q*F*M)*w,J[14]=(Y*H*Z-W*B*Z-Y*$*U+Q*B*U+W*$*M-Q*H*M)*w,J[15]=(W*F*Z-X*H*Z+X*$*U-Q*F*U-W*$*N+Q*H*N)*w,this}scale(J){let Q=this.elements,$=J.x,Z=J.y,K=J.z;return Q[0]*=$,Q[4]*=Z,Q[8]*=K,Q[1]*=$,Q[5]*=Z,Q[9]*=K,Q[2]*=$,Q[6]*=Z,Q[10]*=K,Q[3]*=$,Q[7]*=Z,Q[11]*=K,this}getMaxScaleOnAxis(){let J=this.elements,Q=J[0]*J[0]+J[1]*J[1]+J[2]*J[2],$=J[4]*J[4]+J[5]*J[5]+J[6]*J[6],Z=J[8]*J[8]+J[9]*J[9]+J[10]*J[10];return Math.sqrt(Math.max(Q,$,Z))}makeTranslation(J,Q,$){if(J.isVector3)this.set(1,0,0,J.x,0,1,0,J.y,0,0,1,J.z,0,0,0,1);else this.set(1,0,0,J,0,1,0,Q,0,0,1,$,0,0,0,1);return this}makeRotationX(J){let Q=Math.cos(J),$=Math.sin(J);return this.set(1,0,0,0,0,Q,-$,0,0,$,Q,0,0,0,0,1),this}makeRotationY(J){let Q=Math.cos(J),$=Math.sin(J);return this.set(Q,0,$,0,0,1,0,0,-$,0,Q,0,0,0,0,1),this}makeRotationZ(J){let Q=Math.cos(J),$=Math.sin(J);return this.set(Q,-$,0,0,$,Q,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(J,Q){let $=Math.cos(Q),Z=Math.sin(Q),K=1-$,W=J.x,H=J.y,U=J.z,q=K*W,X=K*H;return this.set(q*W+$,q*H-Z*U,q*U+Z*H,0,q*H+Z*U,X*H+$,X*U-Z*W,0,q*U-Z*H,X*U+Z*W,K*U*U+$,0,0,0,0,1),this}makeScale(J,Q,$){return this.set(J,0,0,0,0,Q,0,0,0,0,$,0,0,0,0,1),this}makeShear(J,Q,$,Z,K,W){return this.set(1,$,K,0,J,1,W,0,Q,Z,1,0,0,0,0,1),this}compose(J,Q,$){let Z=this.elements,K=Q._x,W=Q._y,H=Q._z,U=Q._w,q=K+K,X=W+W,F=H+H,N=K*q,L=K*X,Y=K*F,B=W*X,M=W*F,V=H*F,A=U*q,I=U*X,P=U*F,j=$.x,T=$.y,w=$.z;return Z[0]=(1-(B+V))*j,Z[1]=(L+P)*j,Z[2]=(Y-I)*j,Z[3]=0,Z[4]=(L-P)*T,Z[5]=(1-(N+V))*T,Z[6]=(M+A)*T,Z[7]=0,Z[8]=(Y+I)*w,Z[9]=(M-A)*w,Z[10]=(1-(N+B))*w,Z[11]=0,Z[12]=J.x,Z[13]=J.y,Z[14]=J.z,Z[15]=1,this}decompose(J,Q,$){let Z=this.elements,K=B6.set(Z[0],Z[1],Z[2]).length(),W=B6.set(Z[4],Z[5],Z[6]).length(),H=B6.set(Z[8],Z[9],Z[10]).length();if(this.determinant()<0)K=-K;J.x=Z[12],J.y=Z[13],J.z=Z[14],D7.copy(this);let q=1/K,X=1/W,F=1/H;return D7.elements[0]*=q,D7.elements[1]*=q,D7.elements[2]*=q,D7.elements[4]*=X,D7.elements[5]*=X,D7.elements[6]*=X,D7.elements[8]*=F,D7.elements[9]*=F,D7.elements[10]*=F,Q.setFromRotationMatrix(D7),$.x=K,$.y=W,$.z=H,this}makePerspective(J,Q,$,Z,K,W,H=2000,U=!1){let q=this.elements,X=2*K/(Q-J),F=2*K/($-Z),N=(Q+J)/(Q-J),L=($+Z)/($-Z),Y,B;if(U)Y=K/(W-K),B=W*K/(W-K);else if(H===2000)Y=-(W+K)/(W-K),B=-2*W*K/(W-K);else if(H===2001)Y=-W/(W-K),B=-W*K/(W-K);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+H);return q[0]=X,q[4]=0,q[8]=N,q[12]=0,q[1]=0,q[5]=F,q[9]=L,q[13]=0,q[2]=0,q[6]=0,q[10]=Y,q[14]=B,q[3]=0,q[7]=0,q[11]=-1,q[15]=0,this}makeOrthographic(J,Q,$,Z,K,W,H=2000,U=!1){let q=this.elements,X=2/(Q-J),F=2/($-Z),N=-(Q+J)/(Q-J),L=-($+Z)/($-Z),Y,B;if(U)Y=1/(W-K),B=W/(W-K);else if(H===2000)Y=-2/(W-K),B=-(W+K)/(W-K);else if(H===2001)Y=-1/(W-K),B=-K/(W-K);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+H);return q[0]=X,q[4]=0,q[8]=0,q[12]=N,q[1]=0,q[5]=F,q[9]=0,q[13]=L,q[2]=0,q[6]=0,q[10]=Y,q[14]=B,q[3]=0,q[7]=0,q[11]=0,q[15]=1,this}equals(J){let Q=this.elements,$=J.elements;for(let Z=0;Z<16;Z++)if(Q[Z]!==$[Z])return!1;return!0}fromArray(J,Q=0){for(let $=0;$<16;$++)this.elements[$]=J[$+Q];return this}toArray(J=[],Q=0){let $=this.elements;return J[Q]=$[0],J[Q+1]=$[1],J[Q+2]=$[2],J[Q+3]=$[3],J[Q+4]=$[4],J[Q+5]=$[5],J[Q+6]=$[6],J[Q+7]=$[7],J[Q+8]=$[8],J[Q+9]=$[9],J[Q+10]=$[10],J[Q+11]=$[11],J[Q+12]=$[12],J[Q+13]=$[13],J[Q+14]=$[14],J[Q+15]=$[15],J}}var B6=new R9,D7=new T7,UA=new R9(0,0,0),qA=new R9(1,1,1),hQ=new R9,eW=new R9,x8=new R9,AD=new T7,ID=new vQ;class rZ{constructor(J=0,Q=0,$=0,Z=rZ.DEFAULT_ORDER){this.isEuler=!0,this._x=J,this._y=Q,this._z=$,this._order=Z}get x(){return this._x}set x(J){this._x=J,this._onChangeCallback()}get y(){return this._y}set y(J){this._y=J,this._onChangeCallback()}get z(){return this._z}set z(J){this._z=J,this._onChangeCallback()}get order(){return this._order}set order(J){this._order=J,this._onChangeCallback()}set(J,Q,$,Z=this._order){return this._x=J,this._y=Q,this._z=$,this._order=Z,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(J){return this._x=J._x,this._y=J._y,this._z=J._z,this._order=J._order,this._onChangeCallback(),this}setFromRotationMatrix(J,Q=this._order,$=!0){let Z=J.elements,K=Z[0],W=Z[4],H=Z[8],U=Z[1],q=Z[5],X=Z[9],F=Z[2],N=Z[6],L=Z[10];switch(Q){case"XYZ":if(this._y=Math.asin(_9(H,-1,1)),Math.abs(H)<0.9999999)this._x=Math.atan2(-X,L),this._z=Math.atan2(-W,K);else this._x=Math.atan2(N,q),this._z=0;break;case"YXZ":if(this._x=Math.asin(-_9(X,-1,1)),Math.abs(X)<0.9999999)this._y=Math.atan2(H,L),this._z=Math.atan2(U,q);else this._y=Math.atan2(-F,K),this._z=0;break;case"ZXY":if(this._x=Math.asin(_9(N,-1,1)),Math.abs(N)<0.9999999)this._y=Math.atan2(-F,L),this._z=Math.atan2(-W,q);else this._y=0,this._z=Math.atan2(U,K);break;case"ZYX":if(this._y=Math.asin(-_9(F,-1,1)),Math.abs(F)<0.9999999)this._x=Math.atan2(N,L),this._z=Math.atan2(U,K);else this._x=0,this._z=Math.atan2(-W,q);break;case"YZX":if(this._z=Math.asin(_9(U,-1,1)),Math.abs(U)<0.9999999)this._x=Math.atan2(-X,q),this._y=Math.atan2(-F,K);else this._x=0,this._y=Math.atan2(H,L);break;case"XZY":if(this._z=Math.asin(-_9(W,-1,1)),Math.abs(W)<0.9999999)this._x=Math.atan2(N,q),this._y=Math.atan2(H,K);else this._x=Math.atan2(-X,L),this._y=0;break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+Q)}if(this._order=Q,$===!0)this._onChangeCallback();return this}setFromQuaternion(J,Q,$){return AD.makeRotationFromQuaternion(J),this.setFromRotationMatrix(AD,Q,$)}setFromVector3(J,Q=this._order){return this.set(J.x,J.y,J.z,Q)}reorder(J){return ID.setFromEuler(this),this.setFromQuaternion(ID,J)}equals(J){return J._x===this._x&&J._y===this._y&&J._z===this._z&&J._order===this._order}fromArray(J){if(this._x=J[0],this._y=J[1],this._z=J[2],J[3]!==void 0)this._order=J[3];return this._onChangeCallback(),this}toArray(J=[],Q=0){return J[Q]=this._x,J[Q+1]=this._y,J[Q+2]=this._z,J[Q+3]=this._order,J}_onChange(J){return this._onChangeCallback=J,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}rZ.DEFAULT_ORDER="XYZ";class kG{constructor(){this.mask=1}set(J){this.mask=(1<>>0}enable(J){this.mask|=1<1){for(let Q=0;Q1){for(let $=0;$0)Z.userData=this.userData;if(Z.layers=this.layers.mask,Z.matrix=this.matrix.toArray(),Z.up=this.up.toArray(),this.matrixAutoUpdate===!1)Z.matrixAutoUpdate=!1;if(this.isInstancedMesh){if(Z.type="InstancedMesh",Z.count=this.count,Z.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null)Z.instanceColor=this.instanceColor.toJSON()}if(this.isBatchedMesh){if(Z.type="BatchedMesh",Z.perObjectFrustumCulled=this.perObjectFrustumCulled,Z.sortObjects=this.sortObjects,Z.drawRanges=this._drawRanges,Z.reservedRanges=this._reservedRanges,Z.geometryInfo=this._geometryInfo.map((H)=>({...H,boundingBox:H.boundingBox?H.boundingBox.toJSON():void 0,boundingSphere:H.boundingSphere?H.boundingSphere.toJSON():void 0})),Z.instanceInfo=this._instanceInfo.map((H)=>({...H})),Z.availableInstanceIds=this._availableInstanceIds.slice(),Z.availableGeometryIds=this._availableGeometryIds.slice(),Z.nextIndexStart=this._nextIndexStart,Z.nextVertexStart=this._nextVertexStart,Z.geometryCount=this._geometryCount,Z.maxInstanceCount=this._maxInstanceCount,Z.maxVertexCount=this._maxVertexCount,Z.maxIndexCount=this._maxIndexCount,Z.geometryInitialized=this._geometryInitialized,Z.matricesTexture=this._matricesTexture.toJSON(J),Z.indirectTexture=this._indirectTexture.toJSON(J),this._colorsTexture!==null)Z.colorsTexture=this._colorsTexture.toJSON(J);if(this.boundingSphere!==null)Z.boundingSphere=this.boundingSphere.toJSON();if(this.boundingBox!==null)Z.boundingBox=this.boundingBox.toJSON()}function K(H,U){if(H[U.uuid]===void 0)H[U.uuid]=U.toJSON(J);return U.uuid}if(this.isScene){if(this.background){if(this.background.isColor)Z.background=this.background.toJSON();else if(this.background.isTexture)Z.background=this.background.toJSON(J).uuid}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0)Z.environment=this.environment.toJSON(J).uuid}else if(this.isMesh||this.isLine||this.isPoints){Z.geometry=K(J.geometries,this.geometry);let H=this.geometry.parameters;if(H!==void 0&&H.shapes!==void 0){let U=H.shapes;if(Array.isArray(U))for(let q=0,X=U.length;q0){Z.children=[];for(let H=0;H0){Z.animations=[];for(let H=0;H0)$.geometries=H;if(U.length>0)$.materials=U;if(q.length>0)$.textures=q;if(X.length>0)$.images=X;if(F.length>0)$.shapes=F;if(N.length>0)$.skeletons=N;if(L.length>0)$.animations=L;if(Y.length>0)$.nodes=Y}return $.object=Z,$;function W(H){let U=[];for(let q in H){let X=H[q];delete X.metadata,U.push(X)}return U}}clone(J){return new this.constructor().copy(this,J)}copy(J,Q=!0){if(this.name=J.name,this.up.copy(J.up),this.position.copy(J.position),this.rotation.order=J.rotation.order,this.quaternion.copy(J.quaternion),this.scale.copy(J.scale),this.matrix.copy(J.matrix),this.matrixWorld.copy(J.matrixWorld),this.matrixAutoUpdate=J.matrixAutoUpdate,this.matrixWorldAutoUpdate=J.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=J.matrixWorldNeedsUpdate,this.layers.mask=J.layers.mask,this.visible=J.visible,this.castShadow=J.castShadow,this.receiveShadow=J.receiveShadow,this.frustumCulled=J.frustumCulled,this.renderOrder=J.renderOrder,this.animations=J.animations.slice(),this.userData=JSON.parse(JSON.stringify(J.userData)),Q===!0)for(let $=0;$1)$-=1;if($<0.16666666666666666)return J+(Q-J)*6*$;if($<0.5)return Q;if($<0.6666666666666666)return J+(Q-J)*6*(0.6666666666666666-$);return J}class bJ{constructor(J,Q,$){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(J,Q,$)}set(J,Q,$){if(Q===void 0&&$===void 0){let Z=J;if(Z&&Z.isColor)this.copy(Z);else if(typeof Z==="number")this.setHex(Z);else if(typeof Z==="string")this.setStyle(Z)}else this.setRGB(J,Q,$);return this}setScalar(J){return this.r=J,this.g=J,this.b=J,this}setHex(J,Q="srgb"){return J=Math.floor(J),this.r=(J>>16&255)/255,this.g=(J>>8&255)/255,this.b=(J&255)/255,t8.colorSpaceToWorking(this,Q),this}setRGB(J,Q,$,Z=t8.workingColorSpace){return this.r=J,this.g=Q,this.b=$,t8.colorSpaceToWorking(this,Z),this}setHSL(J,Q,$,Z=t8.workingColorSpace){if(J=BG(J,1),Q=_9(Q,0,1),$=_9($,0,1),Q===0)this.r=this.g=this.b=$;else{let K=$<=0.5?$*(1+Q):$+Q-$*Q,W=2*$-K;this.r=HG(W,K,J+0.3333333333333333),this.g=HG(W,K,J),this.b=HG(W,K,J-0.3333333333333333)}return t8.colorSpaceToWorking(this,Z),this}setStyle(J,Q="srgb"){function $(K){if(K===void 0)return;if(parseFloat(K)<1)console.warn("THREE.Color: Alpha component of "+J+" will be ignored.")}let Z;if(Z=/^(\w+)\(([^\)]*)\)/.exec(J)){let K,W=Z[1],H=Z[2];switch(W){case"rgb":case"rgba":if(K=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(H))return $(K[4]),this.setRGB(Math.min(255,parseInt(K[1],10))/255,Math.min(255,parseInt(K[2],10))/255,Math.min(255,parseInt(K[3],10))/255,Q);if(K=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(H))return $(K[4]),this.setRGB(Math.min(100,parseInt(K[1],10))/100,Math.min(100,parseInt(K[2],10))/100,Math.min(100,parseInt(K[3],10))/100,Q);break;case"hsl":case"hsla":if(K=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(H))return $(K[4]),this.setHSL(parseFloat(K[1])/360,parseFloat(K[2])/100,parseFloat(K[3])/100,Q);break;default:console.warn("THREE.Color: Unknown color model "+J)}}else if(Z=/^\#([A-Fa-f\d]+)$/.exec(J)){let K=Z[1],W=K.length;if(W===3)return this.setRGB(parseInt(K.charAt(0),16)/15,parseInt(K.charAt(1),16)/15,parseInt(K.charAt(2),16)/15,Q);else if(W===6)return this.setHex(parseInt(K,16),Q);else console.warn("THREE.Color: Invalid hex color "+J)}else if(J&&J.length>0)return this.setColorName(J,Q);return this}setColorName(J,Q="srgb"){let $=_D[J.toLowerCase()];if($!==void 0)this.setHex($,Q);else console.warn("THREE.Color: Unknown color "+J);return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(J){return this.r=J.r,this.g=J.g,this.b=J.b,this}copySRGBToLinear(J){return this.r=$Q(J.r),this.g=$Q(J.g),this.b=$Q(J.b),this}copyLinearToSRGB(J){return this.r=k6(J.r),this.g=k6(J.g),this.b=k6(J.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(J="srgb"){return t8.workingToColorSpace(rJ.copy(this),J),Math.round(_9(rJ.r*255,0,255))*65536+Math.round(_9(rJ.g*255,0,255))*256+Math.round(_9(rJ.b*255,0,255))}getHexString(J="srgb"){return("000000"+this.getHex(J).toString(16)).slice(-6)}getHSL(J,Q=t8.workingColorSpace){t8.workingToColorSpace(rJ.copy(this),Q);let{r:$,g:Z,b:K}=rJ,W=Math.max($,Z,K),H=Math.min($,Z,K),U,q,X=(H+W)/2;if(H===W)U=0,q=0;else{let F=W-H;switch(q=X<=0.5?F/(W+H):F/(2-W-H),W){case $:U=(Z-K)/F+(Z=K)){let H=Q[1];if(J=K)break Q}W=$,$=0;break $}break J}while($>>1;if(JQ)--W;if(++W,K!==0||W!==Z){if(K>=W)W=Math.max(W,1),K=W-1;let H=this.getValueSize();this.times=$.slice(K,W),this.values=this.values.slice(K*H,W*H)}return this}validate(){let J=!0,Q=this.getValueSize();if(Q-Math.floor(Q)!==0)console.error("THREE.KeyframeTrack: Invalid value size in track.",this),J=!1;let $=this.times,Z=this.values,K=$.length;if(K===0)console.error("THREE.KeyframeTrack: Track is empty.",this),J=!1;let W=null;for(let H=0;H!==K;H++){let U=$[H];if(typeof U==="number"&&isNaN(U)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,H,U),J=!1;break}if(W!==null&&W>U){console.error("THREE.KeyframeTrack: Out of order keys.",this,H,U,W),J=!1;break}W=U}if(Z!==void 0){if(OA(Z))for(let H=0,U=Z.length;H!==U;++H){let q=Z[H];if(isNaN(q)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,H,q),J=!1;break}}}return J}optimize(){let J=this.times.slice(),Q=this.values.slice(),$=this.getValueSize(),Z=this.getInterpolation()===2302,K=J.length-1,W=1;for(let H=1;H0){J[W]=J[K];for(let H=K*$,U=W*$,q=0;q!==$;++q)Q[U+q]=Q[H+q];++W}if(W!==J.length)this.times=J.slice(0,W),this.values=Q.slice(0,W*$);else this.times=J,this.values=Q;return this}clone(){let J=this.times.slice(),Q=this.values.slice(),Z=new this.constructor(this.name,J,Q);return Z.createInterpolant=this.createInterpolant,Z}}e8.prototype.ValueTypeName="";e8.prototype.TimeBufferType=Float32Array;e8.prototype.ValueBufferType=Float32Array;e8.prototype.DefaultInterpolation=2301;class V$ extends e8{constructor(J,Q,$){super(J,Q,$)}}V$.prototype.ValueTypeName="bool";V$.prototype.ValueBufferType=Array;V$.prototype.DefaultInterpolation=2300;V$.prototype.InterpolantFactoryMethodLinear=void 0;V$.prototype.InterpolantFactoryMethodSmooth=void 0;class EG extends e8{constructor(J,Q,$,Z){super(J,Q,$,Z)}}EG.prototype.ValueTypeName="color";class CG extends e8{constructor(J,Q,$,Z){super(J,Q,$,Z)}}CG.prototype.ValueTypeName="number";class PG extends V6{constructor(J,Q,$,Z){super(J,Q,$,Z)}interpolate_(J,Q,$,Z){let K=this.resultBuffer,W=this.sampleValues,H=this.valueSize,U=($-Q)/(Z-Q),q=J*H;for(let X=q+H;q!==X;q+=4)vQ.slerpFlat(K,0,W,q-H,W,q,U);return K}}class WH extends e8{constructor(J,Q,$,Z){super(J,Q,$,Z)}InterpolantFactoryMethodLinear(J){return new PG(this.times,this.values,this.getValueSize(),J)}}WH.prototype.ValueTypeName="quaternion";WH.prototype.InterpolantFactoryMethodSmooth=void 0;class A$ extends e8{constructor(J,Q,$){super(J,Q,$)}}A$.prototype.ValueTypeName="string";A$.prototype.ValueBufferType=Array;A$.prototype.DefaultInterpolation=2300;A$.prototype.InterpolantFactoryMethodLinear=void 0;A$.prototype.InterpolantFactoryMethodSmooth=void 0;class jG extends e8{constructor(J,Q,$,Z){super(J,Q,$,Z)}}jG.prototype.ValueTypeName="vector";class TG{constructor(J,Q,$){let Z=this,K=!1,W=0,H=0,U=void 0,q=[];this.onStart=void 0,this.onLoad=J,this.onProgress=Q,this.onError=$,this.abortController=new AbortController,this.itemStart=function(X){if(H++,K===!1){if(Z.onStart!==void 0)Z.onStart(X,W,H)}K=!0},this.itemEnd=function(X){if(W++,Z.onProgress!==void 0)Z.onProgress(X,W,H);if(W===H){if(K=!1,Z.onLoad!==void 0)Z.onLoad()}},this.itemError=function(X){if(Z.onError!==void 0)Z.onError(X)},this.resolveURL=function(X){if(U)return U(X);return X},this.setURLModifier=function(X){return U=X,this},this.addHandler=function(X,F){return q.push(X,F),this},this.removeHandler=function(X){let F=q.indexOf(X);if(F!==-1)q.splice(F,2);return this},this.getHandler=function(X){for(let F=0,N=q.length;F 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`,vA=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,gA=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,uA=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,dA=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,mA=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,cA=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; #endif`,pA=`#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`,lA=`#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`,nA=`#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`,oA=`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`,sA=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,iA=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,rA=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; #endif`,aA=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,tA="gl_FragColor = linearToOutputTexel( gl_FragColor );",eA=`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 ); }`,JI=`#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`,QI=`#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`,$I=`#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`,ZI=`#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`,KI=`#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`,WI=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,HI=`#ifdef USE_FOG varying float vFogDepth; #endif`,UI=`#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`,qI=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,GI=`#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 }`,XI=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,YI=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,NI=`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`,OI=`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`,FI=`#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`,DI=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,LI=`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`,RI=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,BI=`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`,MI=`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`,zI=`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 ); }`,kI=` 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`,VI=`#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`,AI=`#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`,II=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,EI=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,CI=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER varying float vFragDepth; varying float vIsPerspective; #endif`,PI=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,jI=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; #endif`,TI=`#ifdef USE_MAP uniform sampler2D map; #endif`,SI=`#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`,_I=`#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`,yI=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,wI=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,hI=`#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`,xI=`#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`,fI=`#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`,bI=`#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`,vI=`#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`,gI=`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;`,uI=`#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`,dI=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,mI=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,cI=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,pI=`#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`,lI=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,nI=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,oI=`#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`,sI=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,iI=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rI=`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 ); }`,aI=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,tI=`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;`,eI=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,J2=`#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`,Q2=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,$2=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,Z2=`#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 ) { float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); #ifdef USE_REVERSED_DEPTH_BUFFER return step( depth, compare ); #else return step( compare, depth ); #endif } 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 ); #ifdef USE_REVERSED_DEPTH_BUFFER float hard_shadow = step( distribution.x, compare ); #else float hard_shadow = step( compare, distribution.x ); #endif 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`,K2=`#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`,W2=`#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`,H2=`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; }`,U2=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,q2=`#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`,G2=`#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`,X2=`#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`,Y2=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,N2=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,O2=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,F2=`#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; }`,D2=`#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`,L2=`#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`,R2=`#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`,B2=`#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`,M2=`#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`,z2=`#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`,k2=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,V2=`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 #include }`,A2=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,I2=`#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 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 #include }`,E2=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,C2=`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 #include }`,P2=`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,j2=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include #ifdef USE_REVERSED_DEPTH_BUFFER float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; #else float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; #endif #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 }`,T2=`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,S2=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,_2=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,y2=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,w2=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include #include }`,h2=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,x2=`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,f2=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include 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 reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,b2=`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,v2=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,g2=`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,u2=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include 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 #include #include #include #include #include }`,d2=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,m2=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,c2=`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,p2=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,l2=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,n2=`#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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include 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 #include #include #include #include #include }`,o2=`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,s2=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,i2=`uniform float size; uniform float scale; #include #include #include #include #include #include #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 #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,r2=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,a2=`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,t2=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,e2=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include 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 #include #include }`,JE=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`,U9={alphahash_fragment:VA,alphahash_pars_fragment:AA,alphamap_fragment:IA,alphamap_pars_fragment:EA,alphatest_fragment:CA,alphatest_pars_fragment:PA,aomap_fragment:jA,aomap_pars_fragment:TA,batching_pars_vertex:SA,batching_vertex:_A,begin_vertex:yA,beginnormal_vertex:wA,bsdfs:hA,iridescence_fragment:xA,bumpmap_pars_fragment:fA,clipping_planes_fragment:bA,clipping_planes_pars_fragment:vA,clipping_planes_pars_vertex:gA,clipping_planes_vertex:uA,color_fragment:dA,color_pars_fragment:mA,color_pars_vertex:cA,color_vertex:pA,common:lA,cube_uv_reflection_fragment:nA,defaultnormal_vertex:oA,displacementmap_pars_vertex:sA,displacementmap_vertex:iA,emissivemap_fragment:rA,emissivemap_pars_fragment:aA,colorspace_fragment:tA,colorspace_pars_fragment:eA,envmap_fragment:JI,envmap_common_pars_fragment:QI,envmap_pars_fragment:$I,envmap_pars_vertex:ZI,envmap_physical_pars_fragment:FI,envmap_vertex:KI,fog_vertex:WI,fog_pars_vertex:HI,fog_fragment:UI,fog_pars_fragment:qI,gradientmap_pars_fragment:GI,lightmap_pars_fragment:XI,lights_lambert_fragment:YI,lights_lambert_pars_fragment:NI,lights_pars_begin:OI,lights_toon_fragment:DI,lights_toon_pars_fragment:LI,lights_phong_fragment:RI,lights_phong_pars_fragment:BI,lights_physical_fragment:MI,lights_physical_pars_fragment:zI,lights_fragment_begin:kI,lights_fragment_maps:VI,lights_fragment_end:AI,logdepthbuf_fragment:II,logdepthbuf_pars_fragment:EI,logdepthbuf_pars_vertex:CI,logdepthbuf_vertex:PI,map_fragment:jI,map_pars_fragment:TI,map_particle_fragment:SI,map_particle_pars_fragment:_I,metalnessmap_fragment:yI,metalnessmap_pars_fragment:wI,morphinstance_vertex:hI,morphcolor_vertex:xI,morphnormal_vertex:fI,morphtarget_pars_vertex:bI,morphtarget_vertex:vI,normal_fragment_begin:gI,normal_fragment_maps:uI,normal_pars_fragment:dI,normal_pars_vertex:mI,normal_vertex:cI,normalmap_pars_fragment:pI,clearcoat_normal_fragment_begin:lI,clearcoat_normal_fragment_maps:nI,clearcoat_pars_fragment:oI,iridescence_pars_fragment:sI,opaque_fragment:iI,packing:rI,premultiplied_alpha_fragment:aI,project_vertex:tI,dithering_fragment:eI,dithering_pars_fragment:J2,roughnessmap_fragment:Q2,roughnessmap_pars_fragment:$2,shadowmap_pars_fragment:Z2,shadowmap_pars_vertex:K2,shadowmap_vertex:W2,shadowmask_pars_fragment:H2,skinbase_vertex:U2,skinning_pars_vertex:q2,skinning_vertex:G2,skinnormal_vertex:X2,specularmap_fragment:Y2,specularmap_pars_fragment:N2,tonemapping_fragment:O2,tonemapping_pars_fragment:F2,transmission_fragment:D2,transmission_pars_fragment:L2,uv_pars_fragment:R2,uv_pars_vertex:B2,uv_vertex:M2,worldpos_vertex:z2,background_vert:k2,background_frag:V2,backgroundCube_vert:A2,backgroundCube_frag:I2,cube_vert:E2,cube_frag:C2,depth_vert:P2,depth_frag:j2,distanceRGBA_vert:T2,distanceRGBA_frag:S2,equirect_vert:_2,equirect_frag:y2,linedashed_vert:w2,linedashed_frag:h2,meshbasic_vert:x2,meshbasic_frag:f2,meshlambert_vert:b2,meshlambert_frag:v2,meshmatcap_vert:g2,meshmatcap_frag:u2,meshnormal_vert:d2,meshnormal_frag:m2,meshphong_vert:c2,meshphong_frag:p2,meshphysical_vert:l2,meshphysical_frag:n2,meshtoon_vert:o2,meshtoon_frag:s2,points_vert:i2,points_frag:r2,shadow_vert:a2,shadow_frag:t2,sprite_vert:e2,sprite_frag:JE},A0={common:{diffuse:{value:new bJ(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new $9},alphaMap:{value:null},alphaMapTransform:{value:new $9},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new $9}},envmap:{envMap:{value:null},envMapRotation:{value:new $9},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:0.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new $9}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new $9}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new $9},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new $9},normalScale:{value:new x9(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new $9},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new $9}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new $9}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new $9}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:0.00025},fogNear:{value:1},fogFar:{value:2000},fogColor:{value:new bJ(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 bJ(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new $9},alphaTest:{value:0},uvTransform:{value:new $9}},sprite:{diffuse:{value:new bJ(16777215)},opacity:{value:1},center:{value:new x9(0.5,0.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new $9},alphaMap:{value:null},alphaMapTransform:{value:new $9},alphaTest:{value:0}}},xD={basic:{uniforms:q8([A0.common,A0.specularmap,A0.envmap,A0.aomap,A0.lightmap,A0.fog]),vertexShader:U9.meshbasic_vert,fragmentShader:U9.meshbasic_frag},lambert:{uniforms:q8([A0.common,A0.specularmap,A0.envmap,A0.aomap,A0.lightmap,A0.emissivemap,A0.bumpmap,A0.normalmap,A0.displacementmap,A0.fog,A0.lights,{emissive:{value:new bJ(0)}}]),vertexShader:U9.meshlambert_vert,fragmentShader:U9.meshlambert_frag},phong:{uniforms:q8([A0.common,A0.specularmap,A0.envmap,A0.aomap,A0.lightmap,A0.emissivemap,A0.bumpmap,A0.normalmap,A0.displacementmap,A0.fog,A0.lights,{emissive:{value:new bJ(0)},specular:{value:new bJ(1118481)},shininess:{value:30}}]),vertexShader:U9.meshphong_vert,fragmentShader:U9.meshphong_frag},standard:{uniforms:q8([A0.common,A0.envmap,A0.aomap,A0.lightmap,A0.emissivemap,A0.bumpmap,A0.normalmap,A0.displacementmap,A0.roughnessmap,A0.metalnessmap,A0.fog,A0.lights,{emissive:{value:new bJ(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:U9.meshphysical_vert,fragmentShader:U9.meshphysical_frag},toon:{uniforms:q8([A0.common,A0.aomap,A0.lightmap,A0.emissivemap,A0.bumpmap,A0.normalmap,A0.displacementmap,A0.gradientmap,A0.fog,A0.lights,{emissive:{value:new bJ(0)}}]),vertexShader:U9.meshtoon_vert,fragmentShader:U9.meshtoon_frag},matcap:{uniforms:q8([A0.common,A0.bumpmap,A0.normalmap,A0.displacementmap,A0.fog,{matcap:{value:null}}]),vertexShader:U9.meshmatcap_vert,fragmentShader:U9.meshmatcap_frag},points:{uniforms:q8([A0.points,A0.fog]),vertexShader:U9.points_vert,fragmentShader:U9.points_frag},dashed:{uniforms:q8([A0.common,A0.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:U9.linedashed_vert,fragmentShader:U9.linedashed_frag},depth:{uniforms:q8([A0.common,A0.displacementmap]),vertexShader:U9.depth_vert,fragmentShader:U9.depth_frag},normal:{uniforms:q8([A0.common,A0.bumpmap,A0.normalmap,A0.displacementmap,{opacity:{value:1}}]),vertexShader:U9.meshnormal_vert,fragmentShader:U9.meshnormal_frag},sprite:{uniforms:q8([A0.sprite,A0.fog]),vertexShader:U9.sprite_vert,fragmentShader:U9.sprite_frag},background:{uniforms:{uvTransform:{value:new $9},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:U9.background_vert,fragmentShader:U9.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new $9}},vertexShader:U9.backgroundCube_vert,fragmentShader:U9.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:U9.cube_vert,fragmentShader:U9.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:U9.equirect_vert,fragmentShader:U9.equirect_frag},distanceRGBA:{uniforms:q8([A0.common,A0.displacementmap,{referencePosition:{value:new R9},nearDistance:{value:1},farDistance:{value:1000}}]),vertexShader:U9.distanceRGBA_vert,fragmentShader:U9.distanceRGBA_frag},shadow:{uniforms:q8([A0.lights,A0.fog,{color:{value:new bJ(0)},opacity:{value:1}}]),vertexShader:U9.shadow_vert,fragmentShader:U9.shadow_frag}};xD.physical={uniforms:q8([xD.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new $9},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new $9},clearcoatNormalScale:{value:new x9(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new $9},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new $9},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new $9},sheen:{value:0},sheenColor:{value:new bJ(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new $9},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new $9},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new $9},transmissionSamplerSize:{value:new x9},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new $9},attenuationDistance:{value:0},attenuationColor:{value:new bJ(0)},specularColor:{value:new bJ(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new $9},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new $9},anisotropyVector:{value:new x9},anisotropyMap:{value:null},anisotropyMapTransform:{value:new $9}}]),vertexShader:U9.meshphysical_vert,fragmentShader:U9.meshphysical_frag};var I$=(1+Math.sqrt(5))/2,A6=1/I$,$u=[new R9(-I$,A6,0),new R9(I$,A6,0),new R9(-A6,0,I$),new R9(A6,0,I$),new R9(0,I$,-A6),new R9(0,I$,A6),new R9(-1,1,-1),new R9(1,1,-1),new R9(-1,1,1),new R9(1,1,1)];var Zu=new Float32Array(16),Ku=new Float32Array(9),Wu=new Float32Array(4);var Hu={[GG]:XG,[YG]:DG,[OG]:LG,[NG]:FG,[XG]:GG,[DG]:YG,[LG]:OG,[FG]:NG};var aZ=` #define KERNEL_RADIUS 3 vec4 gaussianBlur(sampler2D t, vec2 uv, vec2 direction, vec2 resolution, float strength, float aspect) { vec2 texelSize = vec2(0.00069, 0.00069); vec2 blurVec = direction * texelSize * strength / float(KERNEL_RADIUS); vec4 result = vec4(0.0); float weightSum = 0.0; float sigma = float(KERNEL_RADIUS) / 2.0; for (int i = -KERNEL_RADIUS; i <= KERNEL_RADIUS; i++) { float weight = exp(-(float(i) * float(i)) / (2.0 * sigma * sigma)); vec4 color = texture2D(t, uv + blurVec * float(i)); color.rgb = mix(vec3(1.0), color.rgb, color.a); result += color * weight; weightSum += weight; } return result / weightSum; } `,UH=` float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { // -near maps to 0; -far maps to 1 return ( viewZ + near ) / ( near - far ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { // maps perspective depth in [ 0, 1 ] to viewZ return ( near * far ) / ( ( far - near ) * depth - far ); } float readDepth( sampler2D depthSampler, vec2 coord ) { float fragCoordZ = texture2D( depthSampler, coord ).x; float viewZ = perspectiveDepthToViewZ( fragCoordZ, 0.1, 10. ); return viewZToOrthographicDepth( viewZ, 6.0, 7.0); // Change here for focus point for the blur } `,tZ=` float blendOverlay(float base, float blend) { return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend)); } vec3 blendOverlay(vec3 base, vec3 blend) { return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b)); } `,I6=` vec4 add(vec4 a, vec4 b) { float newAlpha = mix(b.w, 1.0, a.w); vec3 newColor = mix(b.w * b.xyz, a.xyz, a.w); float divideFactor = (newAlpha > 0.001 ? (1.0 / newAlpha) : 1.0); return vec4(divideFactor * newColor, newAlpha); } `,qH=` vec2 rotateUV(vec2 uv, float angle, vec2 pivot) { float s = sin(angle); float c = cos(angle); // Translate UV to origin (pivot as center) uv -= pivot; // Apply 2D rotation uv = mat2(c, -s, s, c) * uv; // Translate back uv += pivot; return uv; } `,fD=` vec3 blendHardLight(vec3 base, vec3 blend) { return blendOverlay(blend,base); } vec3 blendHardLight(vec3 base, vec3 blend, float opacity) { return (blendHardLight(base, blend) * opacity + base * (1.0 - opacity)); } `,bD=` vec2 getUvFromGrid(vec2 uv, float index) { float tilesPerRow = 3.0; // Calculate column and row from the index float col = mod(index, tilesPerRow); float row = floor(index / tilesPerRow); // We need to flip the row for GLSL's texture coordinate system, // where (0,0) is at the bottom-left. float flippedRow = (tilesPerRow - 1.0) - row; // Scale and offset UVs to select the correct tile vec2 tileUv = vec2( (uv.x + col) / tilesPerRow, (uv.y + flippedRow) / tilesPerRow ); return tileUv; } `;function GH(J,Q){if(!Q||!Q.scene)return null;let $=new Map,K=(Array.isArray(Q.scene)?Q.scene:[Q.scene]).map((q)=>vD(J,q,$)),W=Array.isArray(Q.nodes)?Q.nodes.map((q)=>$.get(q)).filter(Boolean):[],H=Array.isArray(Q.cameras)?Q.cameras.map((q)=>$.get(q)).filter(Boolean):[];QE(Q,$);let U=$E(Q.animations,$);return{scene:K,nodes:W,cameras:H,animations:U}}function vD(J,Q,$){let Z=typeof Q?.draw==="function"&&Q?.geometry,K=!!(Q&&(Q.skeleton||Q.skin&&Q.skin.joints)),W=Z?K?new L6(J||Q.gl,{skeleton:Q.skeleton||{joints:[]},geometry:Q.geometry,program:Q.program,mode:Q.mode}):new EJ(J||Q.gl,{geometry:Q.geometry,program:Q.program,mode:Q.mode}):new NJ;if($.set(Q,W),Q.name)W.name=Q.name;if(Q.position&&W.position)W.position.set(Q.position.x,Q.position.y,Q.position.z);if(Q.rotation&&W.rotation)W.rotation.set(Q.rotation.x,Q.rotation.y,Q.rotation.z);if(Q.scale&&W.scale)W.scale.set(Q.scale.x,Q.scale.y,Q.scale.z);if(typeof Q.fov==="number")W.fov=Q.fov;if(typeof Q.near==="number")W.near=Q.near;if(typeof Q.far==="number")W.far=Q.far;if(Q.children&&Q.children.length)for(let H=0;H{let q=Q.get(U)||U;if(U.bindInverse)q.bindInverse=U.bindInverse;return q});W.skin={...K.skin,joints:H}}if(K.skeleton&&Array.isArray(K.skeleton.joints)){let H=K.skeleton.joints.map((U)=>{let q=Q.get(U)||U;if(U.bindInverse)q.bindInverse=U.bindInverse;return q});if(W.skeleton={...K.skeleton,joints:H},typeof W.createBoneTexture==="function")W.createBoneTexture()}if(Array.isArray(K.joints))W.joints=K.joints.map((H)=>{let U=Q.get(H)||H;if(H.bindInverse)U.bindInverse=H.bindInverse;return U});if(Array.isArray(K.morphTargetInfluences))W.morphTargetInfluences=[...K.morphTargetInfluences];if(Array.isArray(K.morphTargetDictionary))W.morphTargetDictionary=[...K.morphTargetDictionary]}}function $E(J,Q){if(!Array.isArray(J))return[];return J.map(($)=>{let Z=$&&$.animation;if(!Z||!Array.isArray(Z.data))return $;let K=Z.data.map((W)=>{let H=Q.get(W.node)||W.node;return H===W.node?W:{...W,node:H}});return{...$,animation:{...Z,data:K}}})}function ZE(J){let Q=[],$=(Z)=>{if(Q.push(Z),Z.children&&Z.children.length)for(let K=0;K991)this.instance0.mesh.program.uniforms.uBlurryObjectsPosition0.value.set(-0.2-this.shiftWithoutObjects.desktop.a.x,1+this.shiftWithoutObjects.desktop.a.y),this.instance0.mesh.program.uniforms.uBlurryObjectsPosition1.value.set(-0.4+this.shiftWithoutObjects.desktop.b.x,0.75+this.shiftWithoutObjects.desktop.b.y),this.instance0.mesh.program.uniforms.uBlurryObjectScale0.value=0.33,this.instance0.mesh.program.uniforms.uBlurryObjectScale1.value=0.6;else this.instance0.mesh.program.uniforms.uBlurryObjectsPosition0.value.set(0.05-this.shiftWithoutObjects.mobile.a.x,0.7+this.shiftWithoutObjects.mobile.a.y),this.instance0.mesh.program.uniforms.uBlurryObjectsPosition1.value.set(0.1+this.shiftWithoutObjects.mobile.b.x,0.5+this.shiftWithoutObjects.mobile.b.y),this.instance0.mesh.program.uniforms.uBlurryObjectScale0.value=0.5775,this.instance0.mesh.program.uniforms.uBlurryObjectScale1.value=0.8999999999999999}setColor(J){this.instance0.mesh.program.uniforms.COLOR_OBJECT_0_A.value=this.colors[J][0],this.instance0.mesh.program.uniforms.COLOR_OBJECT_0_B.value=this.colors[J][1],this.instance0.mesh.program.uniforms.COLOR_OBJECT_1.value=this.colors[J][2],this.instance1.mesh.program.uniforms.COLOR_BACKROUND_GRADIENT_0.value=this.backgroundColors[J][0],this.instance1.mesh.program.uniforms.COLOR_BACKROUND_GRADIENT_1.value=this.backgroundColors[J][1],this.instance1.mesh.program.uniforms.COLOR_BACKROUND_GRADIENT_2.value=this.backgroundColors[J][2]}setVariant(J){if(J==="full-with-model")this.active=this.instance0,this.shiftWithoutObjects.desktop.a.set(0,0),this.shiftWithoutObjects.desktop.b.set(0,0),this.shiftWithoutObjects.mobile.a.set(0,0),this.shiftWithoutObjects.mobile.b.set(0,0),this.setObjectPositions();else if(J==="bottom_full")this.active=this.instance0,this.shiftWithoutObjects.desktop.a.set(0.3,0),this.shiftWithoutObjects.desktop.b.set(1.2,0),this.shiftWithoutObjects.mobile.a.set(0.2,-0.5),this.shiftWithoutObjects.mobile.b.set(0.6,0),this.setObjectPositions();else if(J==="bottom_soft")this.active=this.instance1,this.active.mesh.program.uniforms.uIsFull.value=0}resize(){this.renderTarget.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio),this.active.mesh.program.uniforms.uResolution.value.set(this.gl.sizes.width,this.gl.sizes.height),this.active.mesh.program.uniforms.uAspect.value=this.gl.sizes.aspect,this.setDefaults()}renderPipeline(){if(!this.isRendering)return;this.gl.renderer.instance.render({scene:this.active.mesh,target:this.renderTarget})}update(){if(this.active.mesh.program.uniforms.uBlurryObjectPositionAnimation0)this.active.mesh.program.uniforms.uBlurryObjectPositionAnimation0.value.set(Math.sin(-this.gl.time.elapsed*0.25)*0.05,Math.cos(-this.gl.time.elapsed*0.25)*0.05),this.active.mesh.program.uniforms.uBlurryObjectPositionAnimation1.value.set(Math.sin(this.gl.time.elapsed*0.5)*0.05,Math.cos(this.gl.time.elapsed*0.5)*0.05),this.active.mesh.program.uniforms.uBlurryObjectScaleAnimation0.value=Math.sin(this.gl.time.elapsed*0.5)*0.05,this.active.mesh.program.uniforms.uBlurryObjectScaleAnimation1.value=Math.sin(-this.gl.time.elapsed)*0.05;this.active.mesh.program.uniforms.uTime.value=this.gl.time.elapsed*0.05}}class YH{constructor(J){this.gl=new ZJ,this.isRendering=!0,this.params=J,this.scene=new NJ,this.renderTarget=new i8(this.gl.renderer.instance.gl,{width:this.gl.sizes.width*this.gl.sizes.pixelRatio,height:this.gl.sizes.height*this.gl.sizes.pixelRatio,type:this.gl.renderer.instance.gl.HALF_FLOAT,internalFormat:this.gl.renderer.instance.gl.RGBA16F})}resize(){this.renderTarget.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio)}renderPipeline(){if(!this.isRendering)return;this.gl.renderer.instance.render({scene:this.scene,camera:this.params.camera,target:this.renderTarget})}update(){}}class NH{constructor(J){this.gl=new ZJ,this.isRendering=!0,this.isVisible=!0,this.scene=new NJ,this.params=J,this.globalUniforms={uBlurStrength:{value:40},uMinimalBlurStrength:{value:10},uBlurStart:{value:0.66},uBlurEnd:{value:0.5}},this.sceneRenderTarget=new i8(this.gl.renderer.instance.gl,{width:this.gl.sizes.width*this.gl.sizes.pixelRatio,height:this.gl.sizes.height*this.gl.sizes.pixelRatio}),this.feedbackRenderTargetA=new i8(this.gl.renderer.instance.gl,{width:this.gl.sizes.width*this.gl.sizes.pixelRatio,height:this.gl.sizes.height*this.gl.sizes.pixelRatio}),this.feedbackRenderTargetB=new i8(this.gl.renderer.instance.gl,{width:this.gl.sizes.width*this.gl.sizes.pixelRatio,height:this.gl.sizes.height*this.gl.sizes.pixelRatio}),this.hBlurRenderTarget=new i8(this.gl.renderer.instance.gl,{width:this.gl.sizes.width*this.gl.sizes.pixelRatio,height:this.gl.sizes.height*this.gl.sizes.pixelRatio}),this.feedback={plane:new EJ(this.gl.renderer.instance.gl,{geometry:new r8(this.gl.renderer.instance.gl),program:new M8(this.gl.renderer.instance.gl,{uniforms:{tCurrentFrame:{value:null},tPreviousFrame:{value:null},uDecay:{value:0.65}},vertex:` attribute vec2 uv; attribute vec3 position; varying vec2 vUv; void main() { vUv = uv; gl_Position = vec4(position.xy * 2.0, 0.0, 1.0); } `,fragment:` precision highp float; varying vec2 vUv; uniform sampler2D tCurrentFrame; uniform sampler2D tPreviousFrame; uniform float uDecay; void main() { vec4 currentColor = texture2D(tCurrentFrame, vUv); vec4 previousColor = texture2D(tPreviousFrame, vUv); gl_FragColor = currentColor + previousColor * uDecay; } `})})},this.blur={hPlane:new EJ(this.gl.renderer.instance.gl,{geometry:new r8(this.gl.renderer.instance.gl),program:new M8(this.gl.renderer.instance.gl,{uniforms:{...this.globalUniforms,tMap:{value:null},uResolution:{value:new Y9(this.gl.sizes.width,this.gl.sizes.height)},uAspect:{value:this.gl.sizes.aspect}},vertex:` attribute vec2 uv; attribute vec3 position; varying vec2 vUv; void main() { vUv = uv; gl_Position = vec4(position.xy * 2.0, 0.0, 1.0); } `,fragment:` precision highp float; varying vec2 vUv; uniform vec2 uResolution; uniform sampler2D tMap; uniform float uBlurStrength; uniform float uMinimalBlurStrength; uniform float uBlurStart; uniform float uBlurEnd; uniform float uAspect; ${UH} ${aZ} void main() { vec4 blurredColor = gaussianBlur(tMap, vUv, vec2(1.0, 0.0), uResolution, max(smoothstep(uBlurStart, uBlurEnd, vUv.x) * uBlurStrength, uMinimalBlurStrength), uAspect); gl_FragColor = blurredColor; } `})}),vPlane:new EJ(this.gl.renderer.instance.gl,{geometry:new r8(this.gl.renderer.instance.gl),program:new M8(this.gl.renderer.instance.gl,{uniforms:{...this.globalUniforms,tMap:{value:null},uResolution:{value:new Y9(this.gl.sizes.width,this.gl.sizes.height)},uAspect:{value:this.gl.sizes.aspect}},vertex:` attribute vec2 uv; attribute vec3 position; varying vec2 vUv; void main() { vUv = uv; gl_Position = vec4(position.xy * 2.0, 0.0, 1.0); } `,fragment:` precision highp float; varying vec2 vUv; uniform vec2 uResolution; uniform sampler2D tMap; uniform float uBlurStrength; uniform float uMinimalBlurStrength; uniform float uBlurStart; uniform float uBlurEnd; uniform float uAspect; ${aZ} void main() { gl_FragColor = gaussianBlur(tMap, vUv, vec2(0.0, 1.0), uResolution, max(smoothstep(uBlurStart, uBlurEnd, vUv.x) * uBlurStrength, uMinimalBlurStrength), uAspect); } `})})},this.program=new M8(this.gl.renderer.instance.gl,{uniforms:{tMatcap:{value:this.gl.assets.textures.matcaps.glass},tGradients:{value:this.gl.assets.textures.gradients},tBackground:{value:null},uRefractionStrength:{value:0.9},uGradientIndex:{value:0},uTransparency:{value:1},uReveal:{value:0}},vertex:` precision highp float; attribute vec2 uv; attribute vec3 position; attribute vec3 normal; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; uniform mat3 normalMatrix; uniform float uReveal; varying vec2 vUv; varying vec3 vNormal; varying vec4 vViewPosition; varying vec4 vClipPosition; void main() { vec3 transformed = position; transformed.y -= (1.0 - uReveal) * 5.0; vec4 clipPosition = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0); vUv = uv; vNormal = normalize(normalMatrix * normal); vViewPosition = -modelViewMatrix * vec4(transformed, 1.0); vClipPosition = clipPosition; gl_Position = clipPosition; } `,fragment:` precision lowp float; uniform sampler2D tMatcap; uniform sampler2D tGradients; uniform sampler2D tBackground; uniform float uRefractionStrength; uniform float uGradientIndex; uniform float uTransparency; varying vec2 vUv; varying vec3 vNormal; varying vec4 vViewPosition; varying vec4 vClipPosition; ${bD} ${tZ} ${I6} void main() { /* Matcap */ vec2 matcapUv = vNormal.xy * 0.5 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks vec3 matcap = texture2D(tMatcap, matcapUv).rgb; /* Fresnel */ float fresnel = 1.0 - abs(dot(normalize(vNormal), normalize(vViewPosition.xyz))); fresnel = pow(fresnel, 2.0); /* Gradient */ vec3 gradient = texture2D(tGradients, getUvFromGrid(vec2(vUv.x, 1.0 - vUv.y), uGradientIndex)).rgb; // vec3 gradient = texture2D(tGradients, vUv).rgb; // gradient = pow(gradient, vec3(2.2)); /* Refracted UV */ vec3 refractedBlurryObject = refract(vec3(0.0, 0.0, -1.0), vNormal, uRefractionStrength); vec2 uvRefractedBlurryObject = (vClipPosition.xy / vClipPosition.w * 0.5 + 0.5) + refractedBlurryObject.xy; /* Blurry Objects */ vec4 textureBlurryObjects = texture2D(tBackground, uvRefractedBlurryObject); /* Object Color */ // vec3 objectColorWithoutBackground = mix(vec3(0.9), gradient, 0.25); // vec3 objectColorWithoutBackground = gradient; // vec3 objectColorWithBackground = gradient; // vec3 objectColor = mix(objectColorWithoutBackground, objectColorWithBackground, smoothstep(-10.0, 10.0, -vViewPosition.x)); /* Color */ vec3 color = blendOverlay(add(textureBlurryObjects, vec4(vec3(0.9), 1.0)).rgb + matcap, vec3(fresnel)); color = mix(gradient, blendOverlay(gradient, color), uTransparency); /* Alpha */ // gl_FragColor = vec4(color, max(min(matcap + fresnel, 1.0), max(vUv.y, 0.5))); gl_FragColor = vec4(color, 1.0); } `}),this.instance=GH(this.gl.renderer.instance.gl,this.gl.assets.models.targets),this.mouse=this.instance.scene.find((Q)=>Q.name==="mouse").children[0],this.star=this.instance.scene.find((Q)=>Q.name==="star").children[0],this.code=this.instance.scene.find((Q)=>Q.name==="code").children[0],this.warning=this.instance.scene.find((Q)=>Q.name==="warning").children[0],this.compass=this.instance.scene.find((Q)=>Q.name==="compass").children[0],this.cards=this.instance.scene.find((Q)=>Q.name==="cards").children[0],this.objects={mouse:this.mouse,star:this.star,code:this.code,warning:this.warning,compass:this.compass,cards:this.cards};for(let Q in this.objects)this.objects[Q].program=this.program,this.objects[Q].setParent(this.scene),this.objects[Q].visible=!1;this.setScale(),this.setUniforms(),this.setActiveObject("mouse"),this.setColor(0),this.reveal()}reveal(){for(let J in this.objects)S9.to(this.objects[J].program.uniforms.uReveal,{value:1,duration:2.5,ease:"expo.out",delay:0.5}),S9.fromTo(this.objects[J].rotation,{y:Math.PI*0.25},{y:0,duration:2.5,ease:"back.out",delay:0.5})}setScale(){if(window.innerWidth>991)for(let J in this.objects)this.objects[J].scale.set(1,1,1);else for(let J in this.objects)this.objects[J].scale.set(0.75,0.75,0.75)}setUniforms(){if(window.innerWidth>991)this.globalUniforms.uBlurStart.value=0.66,this.globalUniforms.uBlurEnd.value=0.5;else this.globalUniforms.uBlurStart.value=0.4,this.globalUniforms.uBlurEnd.value=0.3}setVisible(J){if(this.isVisible=J,this.isVisible&&this.active)this.active.visible=!0;else for(let Q in this.objects)this.objects[Q].visible=!1}setActiveObject(J){if(this.active)this.active.visible=!1;if(!this.objects[J])return;this.active=this.objects[J],this.active.visible=this.isVisible?!0:!1}setColor(J,Q=1){for(let $ in this.objects)this.objects[$].program.uniforms.uGradientIndex.value=J,this.objects[$].program.uniforms.uTransparency.value=Q}resize(){this.sceneRenderTarget.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio),this.feedbackRenderTargetA.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio),this.feedbackRenderTargetB.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio),this.hBlurRenderTarget.setSize(this.gl.sizes.width*this.gl.sizes.pixelRatio,this.gl.sizes.height*this.gl.sizes.pixelRatio),this.blur.hPlane.program.uniforms.uResolution.value.set(this.gl.sizes.width,this.gl.sizes.height),this.blur.vPlane.program.uniforms.uResolution.value.set(this.gl.sizes.width,this.gl.sizes.height),this.setScale(),this.setUniforms()}renderPipeline(){if(!this.isRendering)return;this.gl.renderer.instance.render({scene:this.scene,camera:this.params.camera,target:this.sceneRenderTarget}),this.blur.hPlane.program.uniforms.tMap.value=this.sceneRenderTarget.texture,this.gl.renderer.instance.render({scene:this.blur.hPlane,target:this.hBlurRenderTarget}),this.blur.vPlane.program.uniforms.tMap.value=this.hBlurRenderTarget.texture,this.gl.renderer.instance.render({scene:this.blur.vPlane,target:this.sceneRenderTarget}),this.feedback.plane.program.uniforms.tCurrentFrame.value=this.sceneRenderTarget.texture,this.feedback.plane.program.uniforms.tPreviousFrame.value=this.feedbackRenderTargetA.texture,this.gl.renderer.instance.render({scene:this.feedback.plane,target:this.feedbackRenderTargetB});let J=this.feedbackRenderTargetA;this.feedbackRenderTargetA=this.feedbackRenderTargetB,this.feedbackRenderTargetB=J}update(){}}class OH{constructor(J){if(S9.registerPlugin(s0),this.id="post-processing",this.params=J,this.isRendering=!0,this.isDesktop=window.innerWidth>991?1:0,this.gl=new ZJ,this.renderPlane={mesh:new EJ(this.gl.renderer.instance.gl,{geometry:new r8(this.gl.renderer.instance.gl,{width:1,height:1}),program:new M8(this.gl.renderer.instance.gl,{transparent:!0,uniforms:{tObjectDefault:{value:null},tObjectGhosted:{value:null},tBackground:{value:null},tMatcap:{value:this.gl.assets.textures.matcaps.glass},tNoise:{value:this.gl.assets.textures.noise},tGlassReflection:{value:this.gl.assets.textures.glassReflection},uScale:{value:new Y9(this.gl.sizes.width,this.gl.sizes.height)},uResolution:{value:new Y9(this.gl.sizes.width,this.gl.sizes.height)},uPosition:{value:new Y9(0,0)},uAspect:{value:this.gl.sizes.aspect},uRefractionStrengthObject:{value:0.1},uRefractionStrength1:{value:0.015},uRefractionNoiseDistortionStrength:{value:3},uRefractionNoiseDensity:{value:9},uDecayOpacity:{value:0.9},uReveal:{value:0}},vertex:` attribute vec2 uv; attribute vec3 position; attribute vec3 normal; varying vec2 vUv; varying vec3 vNormal; varying vec4 vViewPosition; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; uniform mat3 normalMatrix; uniform vec2 uPosition; uniform vec2 uScale; uniform vec2 uResolution; void main() { vec2 pos = position.xy * 2.0; // Scale pos.x *= uScale.x / uResolution.x; pos.y *= uScale.y / uResolution.y; // Position pos.x += - 1.0 + uPosition.x / uResolution.x * 2. + uScale.x / uResolution.x; pos.y -= uPosition.y / uResolution.y * 2.0; gl_Position = vec4(pos.xy, 0.0, 1.0); // Varyings vUv = uv; } `,fragment:` precision highp float; // uniform sampler2D tForeground; uniform sampler2D tObjectDefault; uniform sampler2D tObjectGhosted; uniform sampler2D tBackground; uniform sampler2D tMatcap; uniform sampler2D tNoise; uniform sampler2D tGlassReflection; uniform float uRefractionStrengthObject; uniform float uRefractionStrength1; uniform float uRefractionNoiseDistortionStrength; uniform float uRefractionNoiseDensity; uniform float uDecayOpacity; uniform float uReveal; uniform float uAspect; uniform vec2 uResolution; varying vec2 vUv; ${I6} ${qH} ${tZ} ${fD} void main() { /* UV */ vec2 uvN = vec2(vUv.x * uAspect, vUv.y); /* Foreground Texture */ // vec4 textureForeground = texture2D(tForeground, vUv); /* Noise */ float textureNoise = texture2D(tNoise, vec2(uvN.x, 0.0)).r; /* Matcap */ // vec2 matcapUv = textureForeground.rgb.xy * 0.5 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks // vec3 matcap = texture2D(tMatcap, matcapUv).rgb; /* Fresnel */ // float fresnel = 1.0 - abs(dot(normalize(textureForeground.rgb), normalize(vec3(0.0, 0.0, -1.0)))); // fresnel = pow(fresnel, 2.0); /* Refraction */ float refraction = fract(uvN.x * uRefractionNoiseDensity + textureNoise * uRefractionNoiseDistortionStrength); // float refractionColorDetail = fract(vUv.x * uRefractionNoiseDensity + textureNoise * uRefractionNoiseDistortionStrength); /* Blurry Objects */ // vec3 refractedBlurryObject = refract(vec3(0.0, 0.0, -1.0), textureForeground.rgb, uRefractionStrengthObject); // vec2 uvRefractedBlurryObject = vUv + refractedBlurryObject.xy; float refraction0 = refraction * uRefractionStrengthObject; vec2 uvRefractedBlurryObject = vUv + vec2(refraction0, 0.0); // vec2 uvBlurryObject0 = rotateUV((uvRefractedBlurryObject + vec2(-0.4, 1.0)) * 0.33 + uBlurryObjectsOffset, radians(-45.0), vec2(0.5, 0.5)); // vec2 uvBlurryObject1 = rotateUV((uvRefractedBlurryObject + vec2(-0.4, 0.75)) * 0.6 + uBlurryObjectsOffset, radians(-45.0), vec2(0.5, 0.5)); // float blurryObjectTexture0 = texture2D(tBlurryObject0, uvBlurryObject0).a; // float blurryObjectTexture1 = texture2D(tBlurryObject1, uvBlurryObject1).a; // vec4 blurryObject0 = vec4(pow(COLOR_OBJECT_0, vec3(2.2)), blurryObjectTexture0); // vec4 blurryObject1 = vec4(pow(COLOR_OBJECT_1, vec3(2.2)), blurryObjectTexture1); // vec4 blurryObjects = add(blurryObject1, blurryObject0); vec4 textureBlurryObjects = texture2D(tBackground, uvRefractedBlurryObject); /* Refraction */ // vec3 refractedMainObject = refract(vec3(0.0, 0.0, -1.0), textureForeground.rgb, uRefractionStrength1); float refraction1 = refraction * uRefractionStrength1; vec2 uvRefractedMainObject = vUv + vec2(refraction1, 0.0); /* Background Texture */ vec4 textureObjectDefault = texture2D(tObjectDefault, uvRefractedMainObject); vec4 textureObjectGhosted = texture2D(tObjectGhosted, uvRefractedMainObject); textureObjectGhosted.a *= 1.0 - refraction; vec4 object = mix(textureObjectDefault, vec4(textureObjectGhosted.rgb, textureObjectGhosted.a * uDecayOpacity), 1.0 - textureObjectDefault.a); /* Background */ // vec3 background = mix(vec3(1.0), textureObjectGhosted.rgb, textureObjectGhosted.a); /* Glass Reflection */ float textureGlassReflection = texture2D(tGlassReflection, vec2(refraction, vUv.y)).r; /* Color */ vec4 color = add(object, textureBlurryObjects); // color.rgb += fresnel + matcap; /* Light */ // float light = 1.0 - max(dot(textureForeground.rgb, vec3(1.0, 0.0, 1.0)), 0.0); // gl_FragColor.rgb = blendHardLight(color.rgb, vec3(textureGlassReflection), 0.2); gl_FragColor.rgb = mix(vec3(1.0), blendHardLight(color.rgb, vec3(textureGlassReflection), 0.2), color.a * uReveal); gl_FragColor.a = 1.0; // gl_FragColor = textureBlurryObjects; // Debug // gl_FragColor.rgb += vec3(vUv.x, vUv.y, 0.0); // gl_FragColor.a = 1.0; } `})})},this.renderPlane.mesh.frustumCulled=!1,this.renderPlane.mesh.matrixAutoUpdate=!1,this.bounds={},this.camera=new O7(this.gl.renderer.instance.gl),this.camera.perspective({fov:32,aspect:this.gl.sizes.aspect,near:0.1,far:100}),this.camera.position.z=20,this.gl.isDebug)this.controls=new D6(this.camera,{target:new k0(0,0,0)});if(this.background=new XH({}),this.glass=new YH({camera:this.camera}),this.target=new NH({camera:this.camera}),this.raycaster=new sW,this.raycastedPosition={current:new k0(0,0,0),target:new k0(0,0,0),ease:0.025,multiplyObjectPosition:1,multiplyBlurPosition:0.005},this.setDefault(),this.easedMouse={normalized:this.gl.mouse.createEasedNormalized(0.025),pace:this.gl.mouse.createEasedPace(0.025)},this.reveal(),this.gl.state.data)this.setVariants();if(this.gl.isDebug)this.setDebug();U8.on("WEBGL_DATA",(Q)=>{this.gl.state.data=Q,this.setVariants()})}reveal(){S9.to(this.renderPlane.mesh.program.uniforms.uReveal,{value:1,duration:1,ease:"power1.inOut",delay:0.5})}setDefault(){if(window.innerWidth>991)this.default={position:new k0(5,1,0),multiply:new k0(5,3,0),multiplayRotation:new k0(5,10,0)};else this.default={position:new k0(0.25,-2.25,0),multiply:new k0(0.75,0.75,0),multiplayRotation:new k0(0,0,0)}}resize(){this.background.resize(),this.glass.resize(),this.target.resize(),this.renderPlane.mesh.program.uniforms.uResolution.value.set(this.gl.sizes.width,this.gl.sizes.height),this.renderPlane.mesh.program.uniforms.uScale.value.set(this.gl.sizes.width,this.gl.sizes.height),this.renderPlane.mesh.program.uniforms.uAspect.value=this.gl.sizes.aspect,this.camera.perspective({aspect:this.gl.sizes.aspect}),this.setDefault(),this.isDesktop=window.innerWidth>991?1:0}setVariants(){if(this.target.setActiveObject(this.gl.state.data.model),this.background.setColor(this.gl.state.data.color),this.target.setColor(this.gl.state.data.color,this.gl.state.data.color==4?0.33:1),this.gl.state.data.scene==="full-with-model")this.target.setVisible(!0);else this.target.setVisible(!1);if(this.gl.state.data.scene==="bottom-soft")this.renderPlane.mesh.program.uniforms.uRefractionNoiseDensity.value=5,this.renderPlane.mesh.program.uniforms.uRefractionNoiseDistortionStrength.value=4;else this.renderPlane.mesh.program.uniforms.uRefractionNoiseDensity.value=9,this.renderPlane.mesh.program.uniforms.uRefractionNoiseDistortionStrength.value=3;this.background.setVariant(this.gl.state.data.scene)}setDebug(){this.gl.world.debugSceneParamsFolder.addBinding({value:"mouse"},"value",{label:"Object",options:{mouse:"mouse",star:"star",code:"code",warning:"warning",compass:"compass",cards:"cards"}}).on("change",(J)=>{this.target.setActiveObject(J.value)}),this.gl.world.debugSceneParamsFolder.addBinding({value:0},"value",{label:"Background Color",options:{"Blue / Baby Pink":0,"Purple / Pink":1,"Red / Orange":2,"Green / Pink":3,"Blue / Orange":4,"Blue / Pink":5}}).on("change",(J)=>{this.background.setColor(J.value),this.target.setColor(J.value,J.value==4?0.33:1)}),this.gl.world.debugSceneParamsFolder.addBinding({value:"full-with-model"},"value",{label:"Scene Variant",options:{"Full with model":"full-with-model","Full without model":"full-without-model","Bottom full":"bottom_full","Bottom soft":"bottom_soft"}}).on("change",(J)=>{if(J.value==="full-with-model")this.target.setVisible(!0);else this.target.setVisible(!1);if(J.value==="bottom_soft")this.renderPlane.mesh.program.uniforms.uRefractionNoiseDensity.value=5,this.renderPlane.mesh.program.uniforms.uRefractionNoiseDistortionStrength.value=4;else this.renderPlane.mesh.program.uniforms.uRefractionNoiseDensity.value=9,this.renderPlane.mesh.program.uniforms.uRefractionNoiseDistortionStrength.value=3;this.background.setVariant(J.value)}),this.refractionFolder=this.gl.world.debugWorldFolder.addFolder({title:"Refraction"}),this.refractionFolder.addBinding(this.renderPlane.mesh.program.uniforms.uRefractionStrengthObject,"value",{label:"Background",min:0,max:1,step:0.001}),this.refractionFolder.addBinding(this.target.active.program.uniforms.uRefractionStrength,"value",{label:"Background inside object",min:0,max:1,step:0.001}),this.refractionFolder.addBinding(this.renderPlane.mesh.program.uniforms.uRefractionStrength1,"value",{label:"Object",min:0,max:1,step:0.001}),this.refractionFolder.addBinding(this.renderPlane.mesh.program.uniforms.uRefractionNoiseDistortionStrength,"value",{label:"Noise Distortion Strength",min:0.1,max:10,step:0.01}),this.refractionFolder.addBinding(this.renderPlane.mesh.program.uniforms.uRefractionNoiseDensity,"value",{label:"Noise Density",min:0.1,max:100,step:0.01}),this.cameraFolder=this.gl.world.debugWorldFolder.addFolder({title:"Camera"}),this.cameraFolder.addBinding(this.camera.position,"x",{label:"Camera Position X"}),this.blurFolder=this.gl.world.debugWorldFolder.addFolder({title:"Blur"}),this.blurFolder.addBinding(this.target.blur.hPlane.program.uniforms.uBlurStrength,"value",{label:"Blur Strength"}),this.blurFolder.addBinding(this.target.blur.hPlane.program.uniforms.uMinimalBlurStrength,"value",{label:"Minimal Blur Strength"}),this.blurFolder.addBinding(this.target.blur.hPlane.program.uniforms.uBlurStart,"value",{label:"Blur Start",min:0,max:1,step:0.001}),this.blurFolder.addBinding(this.target.blur.hPlane.program.uniforms.uBlurEnd,"value",{label:"Blur End",min:0,max:1,step:0.001}),this.decayFolder=this.gl.world.debugWorldFolder.addFolder({title:"Decay"}),this.decayFolder.addBinding(this.target.feedback.plane.program.uniforms.uDecay,"value",{label:"Strength",min:0,max:1,step:0.001}),this.decayFolder.addBinding(this.renderPlane.mesh.program.uniforms.uDecayOpacity,"value",{label:"Opacity",min:0,max:1,step:0.001})}setEvents(){document.addEventListener("mousemove",()=>{let J=this.getSpatialPosition();this.raycastedPosition.target.set(J.x*this.raycastedPosition.multiplyObjectPosition,J.y*this.raycastedPosition.multiplyObjectPosition,J.z*this.raycastedPosition.multiplyObjectPosition)})}getSpatialPosition(J=!1){if(J)this.raycaster.castMouse(this.camera,[J.x,J.y]);else this.raycaster.castMouse(this.camera,[this.gl.mouse.normalized.current.x,this.gl.mouse.normalized.current.y]);return this.raycaster.intersectBounds(this.glass.glass.raycastingMesh.children[0])[0].hit.point}renderPipeline(){if(!this.isRendering)return;if(this.background.renderPipeline(),this.target.active)this.target.active.program.uniforms.tBackground.value=this.background.renderTarget.texture;this.glass.renderPipeline(),this.target.renderPipeline(),this.renderPlane.mesh.program.uniforms.tBackground.value=this.background.renderTarget.texture,this.renderPlane.mesh.program.uniforms.tObjectDefault.value=this.target.sceneRenderTarget.texture,this.renderPlane.mesh.program.uniforms.tObjectGhosted.value=this.target.feedbackRenderTargetB.texture}update(){if(!this.isRendering)return;if(this.easedMouse.normalized.update(this.gl.time.delta),this.easedMouse.pace.update(this.gl.time.delta),this.background.update(),this.glass.update(),this.target.update(),this.background.active.mesh.program.uniforms.uBlurryObjectsOffset0)this.background.active.mesh.program.uniforms.uBlurryObjectsOffset0.value.set(-this.easedMouse.normalized.value.x*0.05,-this.easedMouse.normalized.value.y*0.05),this.background.active.mesh.program.uniforms.uBlurryObjectsOffset1.value.set(-this.easedMouse.normalized.value.x*0.025,-this.easedMouse.normalized.value.y*0.025);if(this.background.instance1.mesh.program.uniforms.uMousePosition.value.set(this.easedMouse.normalized.value.x,this.easedMouse.normalized.value.y),this.target.active)this.target.active.position.set(this.default.position.x+this.easedMouse.normalized.value.x*this.default.multiply.x,this.default.position.y+this.easedMouse.normalized.value.y*this.default.multiply.y+Math.sin(this.gl.time.elapsed)*0.2,this.default.position.z),this.target.active.rotation.x=this.easedMouse.pace.value.separated.y*this.default.multiplayRotation.y,this.target.active.rotation.z=-this.easedMouse.pace.value.separated.x*this.default.multiplayRotation.x;if(this.camera.lookAt([0,0,0]),this.gl.isDebug&&this.gl.world.isControlsAllowed)this.controls.update()}}class FH{constructor(){if(this.gl=new ZJ,this.isControlsAllowed=!1,this.selectors=[],this.scenes=[],this.gl.isDebug)this.setDebug()}setDebug(){this.debugSceneParamsFolder=this.gl.debug.gui.addFolder({title:"Scene Parameters"}),this.debugWorldFolder=this.gl.debug.gui.addFolder({title:"World",expanded:!1}),this.debugWorldFolder.addBinding(this,"isControlsAllowed",{label:"Controls Allowed"})}add(){this.scenes.push(new OH);for(let J in this.scenes)this.scenes[J].renderPlane.mesh.setParent(this.gl.scene)}resize(){for(let J in this.scenes)this.scenes[J].resize()}update(){for(let J in this.scenes)this.scenes[J].update()}}class DH{constructor(){this.clock=new HH,this.elapsed=0,this.delta=0}update(){this.delta=Math.min(this.clock.getDelta(),0.03333333333333333)*100,this.elapsed=this.clock.getElapsedTime()}}class LH{constructor(){this.isPixelRatioOverride=!1,this.width=window.innerWidth,this.height=window.innerHeight,this.pixelRatio=Math.min(window.devicePixelRatio,1.5),this.aspect=this.width/this.height}resize(J=!1){if(this.width=J?J.clientWidth:window.innerWidth,this.height=J?J.clientHeight:window.innerHeight,!this.isPixelRatioOverride)this.pixelRatio=Math.min(window.devicePixelRatio,1.5);this.aspect=this.width/this.height}}/*! Tweakpane 4.0.5 (c) 2016 cocopon, licensed under the MIT license. */function V8(J){return J}function f9(J){return J===null||J===void 0}function iG(J){return J!==null&&typeof J==="object"}function dG(J){return J!==null&&typeof J==="object"}function HE(J,Q){if(J.length!==Q.length)return!1;for(let $=0;${let W=J[K],H=Q[K];return dG(W)&&dG(H)?Object.assign(Object.assign({},Z),{[K]:T$(W,H)}):Object.assign(Object.assign({},Z),{[K]:K in Q?H:W})},{})}function rG(J){if(!iG(J))return!1;return"target"in J}var UE={alreadydisposed:()=>"View has been already disposed",invalidparams:(J)=>`Invalid parameters for '${J.name}'`,nomatchingcontroller:(J)=>`No matching controller for '${J.key}'`,nomatchingview:(J)=>`No matching view for '${JSON.stringify(J.params)}'`,notbindable:()=>"Value is not bindable",notcompatible:(J)=>`Not compatible with plugin '${J.id}'`,propertynotfound:(J)=>`Property '${J.name}' not found`,shouldneverhappen:()=>"This error should never happen"};class KJ{static alreadyDisposed(){return new KJ({type:"alreadydisposed"})}static notBindable(){return new KJ({type:"notbindable"})}static notCompatible(J,Q){return new KJ({type:"notcompatible",context:{id:`${J}.${Q}`}})}static propertyNotFound(J){return new KJ({type:"propertynotfound",context:{name:J}})}static shouldNeverHappen(){return new KJ({type:"shouldneverhappen"})}constructor(J){var Q;this.message=(Q=UE[J.type](V8(J.context)))!==null&&Q!==void 0?Q:"Unexpected error",this.name=this.constructor.name,this.stack=new Error(this.message).stack,this.type=J.type}toString(){return this.message}}class zH{constructor(J,Q){this.obj_=J,this.key=Q}static isBindable(J){if(J===null)return!1;if(typeof J!=="object"&&typeof J!=="function")return!1;return!0}read(){return this.obj_[this.key]}write(J){this.obj_[this.key]=J}writeProperty(J,Q){let $=this.read();if(!zH.isBindable($))throw KJ.notBindable();if(!(J in $))throw KJ.propertyNotFound(J);$[J]=Q}}class OJ{constructor(){this.observers_={}}on(J,Q,$){var Z;let K=this.observers_[J];if(!K)K=this.observers_[J]=[];return K.push({handler:Q,key:(Z=$===null||$===void 0?void 0:$.key)!==null&&Z!==void 0?Z:Q}),this}off(J,Q){let $=this.observers_[J];if($)this.observers_[J]=$.filter((Z)=>{return Z.key!==Q});return this}emit(J,Q){let $=this.observers_[J];if(!$)return;$.forEach((Z)=>{Z.handler(Q)})}}class GL{constructor(J,Q){var $;this.constraint_=Q===null||Q===void 0?void 0:Q.constraint,this.equals_=($=Q===null||Q===void 0?void 0:Q.equals)!==null&&$!==void 0?$:(Z,K)=>Z===K,this.emitter=new OJ,this.rawValue_=J}get constraint(){return this.constraint_}get rawValue(){return this.rawValue_}set rawValue(J){this.setRawValue(J,{forceEmit:!1,last:!0})}setRawValue(J,Q){let $=Q!==null&&Q!==void 0?Q:{forceEmit:!1,last:!0},Z=this.constraint_?this.constraint_.constrain(J):J,K=this.rawValue_;if(!!this.equals_(K,Z)&&!$.forceEmit)return;this.emitter.emit("beforechange",{sender:this}),this.rawValue_=Z,this.emitter.emit("change",{options:$,previousRawValue:K,rawValue:Z,sender:this})}}class XL{constructor(J){this.emitter=new OJ,this.value_=J}get rawValue(){return this.value_}set rawValue(J){this.setRawValue(J,{forceEmit:!1,last:!0})}setRawValue(J,Q){let $=Q!==null&&Q!==void 0?Q:{forceEmit:!1,last:!0},Z=this.value_;if(Z===J&&!$.forceEmit)return;this.emitter.emit("beforechange",{sender:this}),this.value_=J,this.emitter.emit("change",{options:$,previousRawValue:Z,rawValue:this.value_,sender:this})}}class YL{constructor(J){this.emitter=new OJ,this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.value_=J,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_)}get rawValue(){return this.value_.rawValue}onValueBeforeChange_(J){this.emitter.emit("beforechange",Object.assign(Object.assign({},J),{sender:this}))}onValueChange_(J){this.emitter.emit("change",Object.assign(Object.assign({},J),{sender:this}))}}function p9(J,Q){let $=Q===null||Q===void 0?void 0:Q.constraint,Z=Q===null||Q===void 0?void 0:Q.equals;if(!$&&!Z)return new XL(J);return new GL(J,Q)}function qE(J){return[new YL(J),(Q,$)=>{J.setRawValue(Q,$)}]}class e0{constructor(J){this.emitter=new OJ,this.valMap_=J;for(let Q in this.valMap_)this.valMap_[Q].emitter.on("change",()=>{this.emitter.emit("change",{key:Q,sender:this})})}static createCore(J){return Object.keys(J).reduce(($,Z)=>{return Object.assign($,{[Z]:p9(J[Z])})},{})}static fromObject(J){let Q=this.createCore(J);return new e0(Q)}get(J){return this.valMap_[J].rawValue}set(J,Q){this.valMap_[J].rawValue=Q}value(J){return this.valMap_[J]}}class S6{constructor(J){this.values=e0.fromObject({max:J.max,min:J.min})}constrain(J){let Q=this.values.get("max"),$=this.values.get("min");return Math.min(Math.max(J,$),Q)}}class NL{constructor(J){this.values=e0.fromObject({max:J.max,min:J.min})}constrain(J){let Q=this.values.get("max"),$=this.values.get("min"),Z=J;if(!f9($))Z=Math.max(Z,$);if(!f9(Q))Z=Math.min(Z,Q);return Z}}class OL{constructor(J,Q=0){this.step=J,this.origin=Q}constrain(J){let Q=this.origin%this.step,$=Math.round((J-Q)/this.step);return Q+$*this.step}}class FL{constructor(J){this.text=J}evaluate(){return Number(this.text)}toString(){return this.text}}var GE={"**":(J,Q)=>Math.pow(J,Q),"*":(J,Q)=>J*Q,"/":(J,Q)=>J/Q,"%":(J,Q)=>J%Q,"+":(J,Q)=>J+Q,"-":(J,Q)=>J-Q,"<<":(J,Q)=>J<>":(J,Q)=>J>>Q,">>>":(J,Q)=>J>>>Q,"&":(J,Q)=>J&Q,"^":(J,Q)=>J^Q,"|":(J,Q)=>J|Q};class DL{constructor(J,Q,$){this.left=Q,this.operator=J,this.right=$}evaluate(){let J=GE[this.operator];if(!J)throw new Error(`unexpected binary operator: '${this.operator}`);return J(this.left.evaluate(),this.right.evaluate())}toString(){return["b(",this.left.toString(),this.operator,this.right.toString(),")"].join(" ")}}var XE={"+":(J)=>J,"-":(J)=>-J,"~":(J)=>~J};class LL{constructor(J,Q){this.operator=J,this.expression=Q}evaluate(){let J=XE[this.operator];if(!J)throw new Error(`unexpected unary operator: '${this.operator}`);return J(this.expression.evaluate())}toString(){return["u(",this.operator,this.expression.toString(),")"].join(" ")}}function aG(J){return(Q,$)=>{for(let Z=0;ZQ.startsWith(K,$))[0];if(!Z)return null;return $+=Z.length,$+=ZK(Q,$).length,{cursor:$,operator:Z}}function TE(J,Q){return($,Z)=>{let K=J($,Z);if(!K)return null;Z=K.cursor;let W=K.evaluable;for(;;){let H=jE(Q,$,Z);if(!H)break;Z=H.cursor;let U=J($,Z);if(!U)return null;Z=U.cursor,W=new DL(H.operator,W,U.evaluable)}return W?{cursor:Z,evaluable:W}:null}}var SE=[["**"],["*","/","%"],["+","-"],["<<",">>>",">>"],["&"],["^"],["|"]].reduce((J,Q)=>{return TE(J,Q)},BL);function ML(J,Q){return Q+=ZK(J,Q).length,SE(J,Q)}function _E(J){let Q=ML(J,0);if(!Q)return null;if(Q.cursor+ZK(J,Q.cursor).length!==J.length)return null;return Q.evaluable}function UQ(J){var Q;let $=_E(J);return(Q=$===null||$===void 0?void 0:$.evaluate())!==null&&Q!==void 0?Q:null}function zL(J){if(typeof J==="number")return J;if(typeof J==="string"){let Q=UQ(J);if(!f9(Q))return Q}return 0}function yE(J){return String(J)}function k8(J){return(Q)=>{return Q.toFixed(Math.max(Math.min(J,20),0))}}function V9(J,Q,$,Z,K){let W=(J-Q)/($-Q);return Z+W*(K-Z)}function gD(J){return String(J.toFixed(10)).split(".")[1].replace(/0+$/,"").length}function CJ(J,Q,$){return Math.min(Math.max(J,Q),$)}function kL(J,Q){return(J%Q+Q)%Q}function wE(J,Q){return!f9(J.step)?gD(J.step):Math.max(gD(Q),2)}function VL(J){var Q;return(Q=J.step)!==null&&Q!==void 0?Q:1}function AL(J,Q){var $;let Z=Math.abs(($=J.step)!==null&&$!==void 0?$:Q);return Z===0?0.1:Math.pow(10,Math.floor(Math.log10(Z))-1)}function IL(J,Q){if(!f9(J.step))return new OL(J.step,Q);return null}function EL(J){if(!f9(J.max)&&!f9(J.min))return new S6({max:J.max,min:J.min});if(!f9(J.max)||!f9(J.min))return new NL({max:J.max,min:J.min});return null}function CL(J,Q){var $,Z,K;return{formatter:($=J.format)!==null&&$!==void 0?$:k8(wE(J,Q)),keyScale:(Z=J.keyScale)!==null&&Z!==void 0?Z:VL(J),pointerScale:(K=J.pointerScale)!==null&&K!==void 0?K:AL(J,Q)}}function PL(J){return{format:J.optional.function,keyScale:J.optional.number,max:J.optional.number,min:J.optional.number,pointerScale:J.optional.number,step:J.optional.number}}function eG(J){return{constraint:J.constraint,textProps:e0.fromObject(CL(J.params,J.initialValue))}}class pQ{constructor(J){this.controller=J}get element(){return this.controller.view.element}get disabled(){return this.controller.viewProps.get("disabled")}set disabled(J){this.controller.viewProps.set("disabled",J)}get hidden(){return this.controller.viewProps.get("hidden")}set hidden(J){this.controller.viewProps.set("hidden",J)}dispose(){this.controller.viewProps.set("disposed",!0)}importState(J){return this.controller.importState(J)}exportState(){return this.controller.exportState()}}class qK{constructor(J){this.target=J}}class _6 extends qK{constructor(J,Q,$){super(J);this.value=Q,this.last=$!==null&&$!==void 0?$:!0}}class jL extends qK{constructor(J,Q){super(J);this.expanded=Q}}class TL extends qK{constructor(J,Q){super(J);this.index=Q}}class SL extends qK{constructor(J,Q){super(J);this.native=Q}}class P6 extends pQ{constructor(J){super(J);this.onValueChange_=this.onValueChange_.bind(this),this.emitter_=new OJ,this.controller.value.emitter.on("change",this.onValueChange_)}get label(){return this.controller.labelController.props.get("label")}set label(J){this.controller.labelController.props.set("label",J)}get key(){return this.controller.value.binding.target.key}get tag(){return this.controller.tag}set tag(J){this.controller.tag=J}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}refresh(){this.controller.value.fetch()}onValueChange_(J){let Q=this.controller.value;this.emitter_.emit("change",new _6(this,V8(Q.binding.target.read()),J.options.last))}}class _L{constructor(J,Q){this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=Q,this.value_=J,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.emitter=new OJ}get rawValue(){return this.value_.rawValue}set rawValue(J){this.value_.rawValue=J}setRawValue(J,Q){this.value_.setRawValue(J,Q)}fetch(){this.value_.rawValue=this.binding.read()}push(){this.binding.write(this.value_.rawValue)}onValueBeforeChange_(J){this.emitter.emit("beforechange",Object.assign(Object.assign({},J),{sender:this}))}onValueChange_(J){this.push(),this.emitter.emit("change",Object.assign(Object.assign({},J),{sender:this}))}}function hE(J){if(!("binding"in J))return!1;let Q=J.binding;return rG(Q)&&"read"in Q&&"write"in Q}function xE(J,Q){let Z=Object.keys(Q).reduce((K,W)=>{if(K===void 0)return;let H=Q[W],U=H(J[W]);return U.succeeded?Object.assign(Object.assign({},K),{[W]:U.value}):void 0},{});return V8(Z)}function fE(J,Q){return J.reduce(($,Z)=>{if($===void 0)return;let K=Q(Z);if(!K.succeeded||K.value===void 0)return;return[...$,K.value]},[])}function bE(J){if(J===null)return!1;return typeof J==="object"}function ZQ(J){return(Q)=>($)=>{if(!Q&&$===void 0)return{succeeded:!1,value:void 0};if(Q&&$===void 0)return{succeeded:!0,value:void 0};let Z=J($);return Z!==void 0?{succeeded:!0,value:Z}:{succeeded:!1,value:void 0}}}function uD(J){return{custom:(Q)=>ZQ(Q)(J),boolean:ZQ((Q)=>typeof Q==="boolean"?Q:void 0)(J),number:ZQ((Q)=>typeof Q==="number"?Q:void 0)(J),string:ZQ((Q)=>typeof Q==="string"?Q:void 0)(J),function:ZQ((Q)=>typeof Q==="function"?Q:void 0)(J),constant:(Q)=>ZQ(($)=>$===Q?Q:void 0)(J),raw:ZQ((Q)=>Q)(J),object:(Q)=>ZQ(($)=>{if(!bE($))return;return xE($,Q)})(J),array:(Q)=>ZQ(($)=>{if(!Array.isArray($))return;return fE($,Q)})(J)}}var mG={optional:uD(!0),required:uD(!1)};function r9(J,Q){let $=Q(mG),Z=mG.required.object($)(J);return Z.succeeded?Z.value:void 0}function f8(J,Q,$,Z){if(Q&&!Q(J))return!1;let K=r9(J,$);return K?Z(K):!1}function b8(J,Q){var $;return T$(($=J===null||J===void 0?void 0:J())!==null&&$!==void 0?$:{},Q)}function C$(J){return"value"in J}function yL(J){if(!iG(J)||!("binding"in J))return!1;let Q=J.binding;return rG(Q)}var S7="http://www.w3.org/2000/svg";function kH(J){J.offsetHeight}function vE(J,Q){let $=J.style.transition;J.style.transition="none",Q(),J.style.transition=$}function JX(J){return J.ontouchstart!==void 0}function gE(){return globalThis}function uE(){return V8(gE()).document}function dE(J){let Q=J.ownerDocument.defaultView;if(!Q)return null;return"document"in Q?J.getContext("2d",{willReadFrequently:!0}):null}var mE={check:'',dropdown:'',p2dpad:''};function CH(J,Q){let $=J.createElementNS(S7,"svg");return $.innerHTML=mE[Q],$}function wL(J,Q,$){J.insertBefore(Q,J.children[$])}function QX(J){if(J.parentElement)J.parentElement.removeChild(J)}function hL(J){while(J.children.length>0)J.removeChild(J.children[0])}function cE(J){while(J.childNodes.length>0)J.removeChild(J.childNodes[0])}function xL(J){if(J.relatedTarget)return V8(J.relatedTarget);if("explicitOriginalTarget"in J)return J.explicitOriginalTarget;return null}function WQ(J,Q){J.emitter.on("change",($)=>{Q($.rawValue)}),Q(J.rawValue)}function _7(J,Q,$){WQ(J.value(Q),$)}var pE="tp";function F9(J){return($,Z)=>{return[pE,"-",J,"v",$?`_${$}`:"",Z?`-${Z}`:""].join("")}}var eZ=F9("lbl");function lE(J,Q){let $=J.createDocumentFragment();return Q.split(` `).map((K)=>{return J.createTextNode(K)}).forEach((K,W)=>{if(W>0)$.appendChild(J.createElement("br"));$.appendChild(K)}),$}class $X{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(eZ()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(eZ("l")),_7(Q.props,"label",(K)=>{if(f9(K))this.element.classList.add(eZ(void 0,"nol"));else this.element.classList.remove(eZ(void 0,"nol")),cE($),$.appendChild(lE(J,K))}),this.element.appendChild($),this.labelElement=$;let Z=J.createElement("div");Z.classList.add(eZ("v")),this.element.appendChild(Z),this.valueElement=Z}}class ZX{constructor(J,Q){this.props=Q.props,this.valueController=Q.valueController,this.viewProps=Q.valueController.viewProps,this.view=new $X(J,{props:Q.props,viewProps:this.viewProps}),this.view.valueElement.appendChild(this.valueController.view.element)}importProps(J){return f8(J,null,(Q)=>({label:Q.optional.string}),(Q)=>{return this.props.set("label",Q.label),!0})}exportProps(){return b8(null,{label:this.props.get("label")})}}function nE(){return["veryfirst","first","last","verylast"]}var dD=F9(""),mD={veryfirst:"vfst",first:"fst",last:"lst",verylast:"vlst"};class GK{constructor(J){this.parent_=null,this.blade=J.blade,this.view=J.view,this.viewProps=J.viewProps;let Q=this.view.element;this.blade.value("positions").emitter.on("change",()=>{nE().forEach(($)=>{Q.classList.remove(dD(void 0,mD[$]))}),this.blade.get("positions").forEach(($)=>{Q.classList.add(dD(void 0,mD[$]))})}),this.viewProps.handleDispose(()=>{QX(Q)})}get parent(){return this.parent_}set parent(J){this.parent_=J,this.viewProps.set("parent",this.parent_?this.parent_.viewProps:null)}importState(J){return f8(J,null,(Q)=>({disabled:Q.required.boolean,hidden:Q.required.boolean}),(Q)=>{return this.viewProps.importState(Q),!0})}exportState(){return b8(null,Object.assign({},this.viewProps.exportState()))}}class cQ extends GK{constructor(J,Q){if(Q.value!==Q.valueController.value)throw KJ.shouldNeverHappen();let $=Q.valueController.viewProps,Z=new ZX(J,{blade:Q.blade,props:Q.props,valueController:Q.valueController});super(Object.assign(Object.assign({},Q),{view:new $X(J,{props:Q.props,viewProps:$}),viewProps:$}));this.labelController=Z,this.value=Q.value,this.valueController=Q.valueController,this.view.valueElement.appendChild(this.valueController.view.element)}importState(J){return f8(J,(Q)=>{var $,Z,K;return super.importState(Q)&&this.labelController.importProps(Q)&&((K=(Z=($=this.valueController).importProps)===null||Z===void 0?void 0:Z.call($,J))!==null&&K!==void 0?K:!0)},(Q)=>({value:Q.optional.raw}),(Q)=>{if(Q.value)this.value.rawValue=Q.value;return!0})}exportState(){var J,Q,$;return b8(()=>super.exportState(),Object.assign(Object.assign({value:this.value.rawValue},this.labelController.exportProps()),($=(Q=(J=this.valueController).exportProps)===null||Q===void 0?void 0:Q.call(J))!==null&&$!==void 0?$:{}))}}function cD(J){let Q=Object.assign({},J);return delete Q.value,Q}class KX extends cQ{constructor(J,Q){super(J,Q);this.tag=Q.tag}importState(J){return f8(J,(Q)=>super.importState(cD(J)),(Q)=>({tag:Q.optional.string}),(Q)=>{return this.tag=Q.tag,!0})}exportState(){return b8(()=>cD(super.exportState()),{binding:{key:this.value.binding.target.key,value:this.value.binding.target.read()},tag:this.tag})}}function oE(J){return C$(J)&&yL(J.value)}class fL extends KX{importState(J){return f8(J,(Q)=>super.importState(Q),(Q)=>({binding:Q.required.object({value:Q.required.raw})}),(Q)=>{return this.value.binding.inject(Q.binding.value),this.value.fetch(),!0})}}function sE(J){return C$(J)&&hE(J.value)}function bL(J,Q){while(J.lengthJ.length)$.splice(0,$.length-J.length);else bL($,J.length);return $}class vL{constructor(J){this.emitter=new OJ,this.onTick_=this.onTick_.bind(this),this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=J.binding,this.value_=p9(iE(J.bufferSize)),this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.ticker=J.ticker,this.ticker.emitter.on("tick",this.onTick_),this.fetch()}get rawValue(){return this.value_.rawValue}set rawValue(J){this.value_.rawValue=J}setRawValue(J,Q){this.value_.setRawValue(J,Q)}fetch(){this.value_.rawValue=aE(this.value_.rawValue,this.binding.read())}onTick_(){this.fetch()}onValueBeforeChange_(J){this.emitter.emit("beforechange",Object.assign(Object.assign({},J),{sender:this}))}onValueChange_(J){this.emitter.emit("change",Object.assign(Object.assign({},J),{sender:this}))}}function tE(J){if(!("binding"in J))return!1;let Q=J.binding;return rG(Q)&&"read"in Q&&!("write"in Q)}class gL extends KX{exportState(){return b8(()=>super.exportState(),{binding:{readonly:!0}})}}function eE(J){return C$(J)&&tE(J.value)}class uL extends pQ{get label(){return this.controller.labelController.props.get("label")}set label(J){this.controller.labelController.props.set("label",J)}get title(){var J;return(J=this.controller.buttonController.props.get("title"))!==null&&J!==void 0?J:""}set title(J){this.controller.buttonController.props.set("title",J)}on(J,Q){let $=Q.bind(this);return this.controller.buttonController.emitter.on(J,(K)=>{$(new SL(this,K.nativeEvent))}),this}off(J,Q){return this.controller.buttonController.emitter.off(J,Q),this}}function JC(J,Q,$){if($)J.classList.add(Q);else J.classList.remove(Q)}function y6(J,Q){return($)=>{JC(J,Q,$)}}function WX(J,Q){WQ(J,($)=>{Q.textContent=$!==null&&$!==void 0?$:""})}var wG=F9("btn");class dL{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(wG()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("button");$.classList.add(wG("b")),Q.viewProps.bindDisabled($),this.element.appendChild($),this.buttonElement=$;let Z=J.createElement("div");Z.classList.add(wG("t")),WX(Q.props.value("title"),Z),this.buttonElement.appendChild(Z)}}class mL{constructor(J,Q){this.emitter=new OJ,this.onClick_=this.onClick_.bind(this),this.props=Q.props,this.viewProps=Q.viewProps,this.view=new dL(J,{props:this.props,viewProps:this.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}importProps(J){return f8(J,null,(Q)=>({title:Q.optional.string}),(Q)=>{return this.props.set("title",Q.title),!0})}exportProps(){return b8(null,{title:this.props.get("title")})}onClick_(J){this.emitter.emit("click",{nativeEvent:J,sender:this})}}class cG extends GK{constructor(J,Q){let $=new mL(J,{props:Q.buttonProps,viewProps:Q.viewProps}),Z=new ZX(J,{blade:Q.blade,props:Q.labelProps,valueController:$});super({blade:Q.blade,view:Z.view,viewProps:Q.viewProps});this.buttonController=$,this.labelController=Z}importState(J){return f8(J,(Q)=>super.importState(Q)&&this.buttonController.importProps(Q)&&this.labelController.importProps(Q),()=>({}),()=>!0)}exportState(){return b8(()=>super.exportState(),Object.assign(Object.assign({},this.buttonController.exportProps()),this.labelController.exportProps()))}}class HX{constructor(J){let[Q,$]=J.split("-"),Z=Q.split(".");this.major=parseInt(Z[0],10),this.minor=parseInt(Z[1],10),this.patch=parseInt(Z[2],10),this.prerelease=$!==null&&$!==void 0?$:null}toString(){let J=[this.major,this.minor,this.patch].join(".");return this.prerelease!==null?[J,this.prerelease].join("-"):J}}var w6=new HX("2.0.5");function X8(J){return Object.assign({core:w6},J)}var QC=X8({id:"button",type:"blade",accept(J){let Q=r9(J,($)=>({title:$.required.string,view:$.required.constant("button"),label:$.optional.string}));return Q?{params:Q}:null},controller(J){return new cG(J.document,{blade:J.blade,buttonProps:e0.fromObject({title:J.params.title}),labelProps:e0.fromObject({label:J.params.label}),viewProps:J.viewProps})},api(J){if(J.controller instanceof cG)return new uL(J.controller);return null}});function $C(J,Q){return J.addBlade(Object.assign(Object.assign({},Q),{view:"button"}))}function ZC(J,Q){return J.addBlade(Object.assign(Object.assign({},Q),{view:"folder"}))}function KC(J,Q){return J.addBlade(Object.assign(Object.assign({},Q),{view:"tab"}))}function WC(J){if(!iG(J))return!1;return"refresh"in J&&typeof J.refresh==="function"}function HC(J,Q){if(!zH.isBindable(J))throw KJ.notBindable();return new zH(J,Q)}class cL{constructor(J,Q){this.onRackValueChange_=this.onRackValueChange_.bind(this),this.controller_=J,this.emitter_=new OJ,this.pool_=Q,this.controller_.rack.emitter.on("valuechange",this.onRackValueChange_)}get children(){return this.controller_.rack.children.map((J)=>this.pool_.createApi(J))}addBinding(J,Q,$){let Z=$!==null&&$!==void 0?$:{},K=this.controller_.element.ownerDocument,W=this.pool_.createBinding(K,HC(J,Q),Z),H=this.pool_.createBindingApi(W);return this.add(H,Z.index)}addFolder(J){return ZC(this,J)}addButton(J){return $C(this,J)}addTab(J){return KC(this,J)}add(J,Q){let $=J.controller;return this.controller_.rack.add($,Q),J}remove(J){this.controller_.rack.remove(J.controller)}addBlade(J){let Q=this.controller_.element.ownerDocument,$=this.pool_.createBlade(Q,J),Z=this.pool_.createApi($);return this.add(Z,J.index)}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}refresh(){this.children.forEach((J)=>{if(WC(J))J.refresh()})}onRackValueChange_(J){let Q=J.bladeController,$=this.pool_.createApi(Q),Z=yL(Q.value)?Q.value.binding:null;this.emitter_.emit("change",new _6($,Z?Z.target.read():Q.value.rawValue,J.options.last))}}class PH extends pQ{constructor(J,Q){super(J);this.rackApi_=new cL(J.rackController,Q)}refresh(){this.rackApi_.refresh()}}class jH extends GK{constructor(J){super({blade:J.blade,view:J.view,viewProps:J.rackController.viewProps});this.rackController=J.rackController}importState(J){return f8(J,(Q)=>super.importState(Q),(Q)=>({children:Q.required.array(Q.required.raw)}),(Q)=>{return this.rackController.rack.children.every(($,Z)=>{return $.importState(Q.children[Z])})})}exportState(){return b8(()=>super.exportState(),{children:this.rackController.rack.children.map((J)=>J.exportState())})}}function pG(J){return"rackController"in J}class pL{constructor(J){this.emitter=new OJ,this.items_=[],this.cache_=new Set,this.onSubListAdd_=this.onSubListAdd_.bind(this),this.onSubListRemove_=this.onSubListRemove_.bind(this),this.extract_=J}get items(){return this.items_}allItems(){return Array.from(this.cache_)}find(J){for(let Q of this.allItems())if(J(Q))return Q;return null}includes(J){return this.cache_.has(J)}add(J,Q){if(this.includes(J))throw KJ.shouldNeverHappen();let $=Q!==void 0?Q:this.items_.length;this.items_.splice($,0,J),this.cache_.add(J);let Z=this.extract_(J);if(Z)Z.emitter.on("add",this.onSubListAdd_),Z.emitter.on("remove",this.onSubListRemove_),Z.allItems().forEach((K)=>{this.cache_.add(K)});this.emitter.emit("add",{index:$,item:J,root:this,target:this})}remove(J){let Q=this.items_.indexOf(J);if(Q<0)return;this.items_.splice(Q,1),this.cache_.delete(J);let $=this.extract_(J);if($)$.allItems().forEach((Z)=>{this.cache_.delete(Z)}),$.emitter.off("add",this.onSubListAdd_),$.emitter.off("remove",this.onSubListRemove_);this.emitter.emit("remove",{index:Q,item:J,root:this,target:this})}onSubListAdd_(J){this.cache_.add(J.item),this.emitter.emit("add",{index:J.index,item:J.item,root:this,target:J.target})}onSubListRemove_(J){this.cache_.delete(J.item),this.emitter.emit("remove",{index:J.index,item:J.item,root:this,target:J.target})}}function UC(J,Q){for(let $=0;$!Z.viewProps.get("hidden")),Q=J[0],$=J[J.length-1];this.bcSet_.items.forEach((Z)=>{let K=[];if(Z===Q){if(K.push("first"),!this.blade_||this.blade_.get("positions").includes("veryfirst"))K.push("veryfirst")}if(Z===$){if(K.push("last"),!this.blade_||this.blade_.get("positions").includes("verylast"))K.push("verylast")}Z.blade.set("positions",K)})}onChildPositionsChange_(){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildViewPropsChange_(J){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildDispose_(){this.bcSet_.items.filter((Q)=>{return Q.viewProps.get("disposed")}).forEach((Q)=>{this.bcSet_.remove(Q)})}onChildValueChange_(J){let Q=UC(this.find(C$),J.sender);if(!Q)throw KJ.alreadyDisposed();this.emitter.emit("valuechange",{bladeController:Q,options:J.options,sender:this})}onRackLayout_(J){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onRackValueChange_(J){this.emitter.emit("valuechange",{bladeController:J.bladeController,options:J.options,sender:this})}onBladePositionsChange_(){this.updatePositions_()}}class TH{constructor(J){this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this),this.element=J.element,this.viewProps=J.viewProps;let Q=new lL({blade:J.root?void 0:J.blade,viewProps:J.viewProps});Q.emitter.on("add",this.onRackAdd_),Q.emitter.on("remove",this.onRackRemove_),this.rack=Q,this.viewProps.handleDispose(()=>{for(let $=this.rack.children.length-1;$>=0;$--)this.rack.children[$].viewProps.set("disposed",!0)})}onRackAdd_(J){if(!J.root)return;wL(this.element,J.bladeController.view.element,J.index)}onRackRemove_(J){if(!J.root)return;QX(J.bladeController.view.element)}}function h6(){return new e0({positions:p9([],{equals:HE})})}class XK extends e0{constructor(J){super(J)}static create(J){let Q={completed:!0,expanded:J,expandedHeight:null,shouldFixHeight:!1,temporaryExpanded:null},$=e0.createCore(Q);return new XK($)}get styleExpanded(){var J;return(J=this.get("temporaryExpanded"))!==null&&J!==void 0?J:this.get("expanded")}get styleHeight(){if(!this.styleExpanded)return"0";let J=this.get("expandedHeight");if(this.get("shouldFixHeight")&&!f9(J))return`${J}px`;return"auto"}bindExpandedClass(J,Q){let $=()=>{if(this.styleExpanded)J.classList.add(Q);else J.classList.remove(Q)};_7(this,"expanded",$),_7(this,"temporaryExpanded",$)}cleanUpTransition(){this.set("shouldFixHeight",!1),this.set("expandedHeight",null),this.set("completed",!0)}}function GC(J,Q){let $=0;return vE(Q,()=>{J.set("expandedHeight",null),J.set("temporaryExpanded",!0),kH(Q),$=Q.clientHeight,J.set("temporaryExpanded",null),kH(Q)}),$}function pD(J,Q){Q.style.height=J.styleHeight}function UX(J,Q){J.value("expanded").emitter.on("beforechange",()=>{if(J.set("completed",!1),f9(J.get("expandedHeight"))){let $=GC(J,Q);if($>0)J.set("expandedHeight",$)}J.set("shouldFixHeight",!0),kH(Q)}),J.emitter.on("change",()=>{pD(J,Q)}),pD(J,Q),Q.addEventListener("transitionend",($)=>{if($.propertyName!=="height")return;J.cleanUpTransition()})}class qX extends PH{constructor(J,Q){super(J,Q);this.emitter_=new OJ,this.controller.foldable.value("expanded").emitter.on("change",($)=>{this.emitter_.emit("fold",new jL(this,$.sender.rawValue))}),this.rackApi_.on("change",($)=>{this.emitter_.emit("change",$)})}get expanded(){return this.controller.foldable.get("expanded")}set expanded(J){this.controller.foldable.set("expanded",J)}get title(){return this.controller.props.get("title")}set title(J){this.controller.props.set("title",J)}get children(){return this.rackApi_.children}addBinding(J,Q,$){return this.rackApi_.addBinding(J,Q,$)}addFolder(J){return this.rackApi_.addFolder(J)}addButton(J){return this.rackApi_.addButton(J)}addTab(J){return this.rackApi_.addTab(J)}add(J,Q){return this.rackApi_.add(J,Q)}remove(J){this.rackApi_.remove(J)}addBlade(J){return this.rackApi_.addBlade(J)}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}}var nL=F9("cnt");class oL{constructor(J,Q){var $;this.className_=F9(($=Q.viewName)!==null&&$!==void 0?$:"fld"),this.element=J.createElement("div"),this.element.classList.add(this.className_(),nL()),Q.viewProps.bindClassModifiers(this.element),this.foldable_=Q.foldable,this.foldable_.bindExpandedClass(this.element,this.className_(void 0,"expanded")),_7(this.foldable_,"completed",y6(this.element,this.className_(void 0,"cpl")));let Z=J.createElement("button");Z.classList.add(this.className_("b")),_7(Q.props,"title",(q)=>{if(f9(q))this.element.classList.add(this.className_(void 0,"not"));else this.element.classList.remove(this.className_(void 0,"not"))}),Q.viewProps.bindDisabled(Z),this.element.appendChild(Z),this.buttonElement=Z;let K=J.createElement("div");K.classList.add(this.className_("i")),this.element.appendChild(K);let W=J.createElement("div");W.classList.add(this.className_("t")),WX(Q.props.value("title"),W),this.buttonElement.appendChild(W),this.titleElement=W;let H=J.createElement("div");H.classList.add(this.className_("m")),this.buttonElement.appendChild(H);let U=J.createElement("div");U.classList.add(this.className_("c")),this.element.appendChild(U),this.containerElement=U}}class VH extends jH{constructor(J,Q){var $;let Z=XK.create(($=Q.expanded)!==null&&$!==void 0?$:!0),K=new oL(J,{foldable:Z,props:Q.props,viewName:Q.root?"rot":void 0,viewProps:Q.viewProps});super(Object.assign(Object.assign({},Q),{rackController:new TH({blade:Q.blade,element:K.containerElement,root:Q.root,viewProps:Q.viewProps}),view:K}));this.onTitleClick_=this.onTitleClick_.bind(this),this.props=Q.props,this.foldable=Z,UX(this.foldable,this.view.containerElement),this.rackController.rack.emitter.on("add",()=>{this.foldable.cleanUpTransition()}),this.rackController.rack.emitter.on("remove",()=>{this.foldable.cleanUpTransition()}),this.view.buttonElement.addEventListener("click",this.onTitleClick_)}get document(){return this.view.element.ownerDocument}importState(J){return f8(J,(Q)=>super.importState(Q),(Q)=>({expanded:Q.required.boolean,title:Q.optional.string}),(Q)=>{return this.foldable.set("expanded",Q.expanded),this.props.set("title",Q.title),!0})}exportState(){return b8(()=>super.exportState(),{expanded:this.foldable.get("expanded"),title:this.props.get("title")})}onTitleClick_(){this.foldable.set("expanded",!this.foldable.get("expanded"))}}var XC=X8({id:"folder",type:"blade",accept(J){let Q=r9(J,($)=>({title:$.required.string,view:$.required.constant("folder"),expanded:$.optional.boolean}));return Q?{params:Q}:null},controller(J){return new VH(J.document,{blade:J.blade,expanded:J.params.expanded,props:e0.fromObject({title:J.params.title}),viewProps:J.viewProps})},api(J){if(!(J.controller instanceof VH))return null;return new qX(J.controller,J.pool)}}),YC=F9("");function lD(J,Q){return y6(J,YC(void 0,Q))}class XQ extends e0{constructor(J){var Q;super(J);this.onDisabledChange_=this.onDisabledChange_.bind(this),this.onParentChange_=this.onParentChange_.bind(this),this.onParentGlobalDisabledChange_=this.onParentGlobalDisabledChange_.bind(this),[this.globalDisabled_,this.setGlobalDisabled_]=qE(p9(this.getGlobalDisabled_())),this.value("disabled").emitter.on("change",this.onDisabledChange_),this.value("parent").emitter.on("change",this.onParentChange_),(Q=this.get("parent"))===null||Q===void 0||Q.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_)}static create(J){var Q,$,Z;let K=J!==null&&J!==void 0?J:{};return new XQ(e0.createCore({disabled:(Q=K.disabled)!==null&&Q!==void 0?Q:!1,disposed:!1,hidden:($=K.hidden)!==null&&$!==void 0?$:!1,parent:(Z=K.parent)!==null&&Z!==void 0?Z:null}))}get globalDisabled(){return this.globalDisabled_}bindClassModifiers(J){WQ(this.globalDisabled_,lD(J,"disabled")),_7(this,"hidden",lD(J,"hidden"))}bindDisabled(J){WQ(this.globalDisabled_,(Q)=>{J.disabled=Q})}bindTabIndex(J){WQ(this.globalDisabled_,(Q)=>{J.tabIndex=Q?-1:0})}handleDispose(J){this.value("disposed").emitter.on("change",(Q)=>{if(Q)J()})}importState(J){this.set("disabled",J.disabled),this.set("hidden",J.hidden)}exportState(){return{disabled:this.get("disabled"),hidden:this.get("hidden")}}getGlobalDisabled_(){let J=this.get("parent");return(J?J.globalDisabled.rawValue:!1)||this.get("disabled")}updateGlobalDisabled_(){this.setGlobalDisabled_(this.getGlobalDisabled_())}onDisabledChange_(){this.updateGlobalDisabled_()}onParentGlobalDisabledChange_(){this.updateGlobalDisabled_()}onParentChange_(J){var Q;let $=J.previousRawValue;$===null||$===void 0||$.globalDisabled.emitter.off("change",this.onParentGlobalDisabledChange_),(Q=this.get("parent"))===null||Q===void 0||Q.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_),this.updateGlobalDisabled_()}}var nD=F9("tbp");class sL{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(nD()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(nD("c")),this.element.appendChild($),this.containerElement=$}}var JK=F9("tbi");class iL{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(JK()),Q.viewProps.bindClassModifiers(this.element),_7(Q.props,"selected",(K)=>{if(K)this.element.classList.add(JK(void 0,"sel"));else this.element.classList.remove(JK(void 0,"sel"))});let $=J.createElement("button");$.classList.add(JK("b")),Q.viewProps.bindDisabled($),this.element.appendChild($),this.buttonElement=$;let Z=J.createElement("div");Z.classList.add(JK("t")),WX(Q.props.value("title"),Z),this.buttonElement.appendChild(Z),this.titleElement=Z}}class rL{constructor(J,Q){this.emitter=new OJ,this.onClick_=this.onClick_.bind(this),this.props=Q.props,this.viewProps=Q.viewProps,this.view=new iL(J,{props:Q.props,viewProps:Q.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}onClick_(){this.emitter.emit("click",{sender:this})}}class AH extends jH{constructor(J,Q){let $=new sL(J,{viewProps:Q.viewProps});super(Object.assign(Object.assign({},Q),{rackController:new TH({blade:Q.blade,element:$.containerElement,viewProps:Q.viewProps}),view:$}));this.onItemClick_=this.onItemClick_.bind(this),this.ic_=new rL(J,{props:Q.itemProps,viewProps:XQ.create()}),this.ic_.emitter.on("click",this.onItemClick_),this.props=Q.props,_7(this.props,"selected",(Z)=>{this.itemController.props.set("selected",Z),this.viewProps.set("hidden",!Z)})}get itemController(){return this.ic_}importState(J){return f8(J,(Q)=>super.importState(Q),(Q)=>({selected:Q.required.boolean,title:Q.required.string}),(Q)=>{return this.ic_.props.set("selected",Q.selected),this.ic_.props.set("title",Q.title),!0})}exportState(){return b8(()=>super.exportState(),{selected:this.ic_.props.get("selected"),title:this.ic_.props.get("title")})}onItemClick_(){this.props.set("selected",!0)}}class aL extends PH{constructor(J,Q){super(J,Q);this.emitter_=new OJ,this.onSelect_=this.onSelect_.bind(this),this.pool_=Q,this.rackApi_.on("change",($)=>{this.emitter_.emit("change",$)}),this.controller.tab.selectedIndex.emitter.on("change",this.onSelect_)}get pages(){return this.rackApi_.children}addPage(J){let Q=this.controller.view.element.ownerDocument,$=new AH(Q,{blade:h6(),itemProps:e0.fromObject({selected:!1,title:J.title}),props:e0.fromObject({selected:!1}),viewProps:XQ.create()}),Z=this.pool_.createApi($);return this.rackApi_.add(Z,J.index)}removePage(J){this.rackApi_.remove(this.rackApi_.children[J])}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}onSelect_(J){this.emitter_.emit("select",new TL(this,J.rawValue))}}class tL extends PH{get title(){var J;return(J=this.controller.itemController.props.get("title"))!==null&&J!==void 0?J:""}set title(J){this.controller.itemController.props.set("title",J)}get selected(){return this.controller.props.get("selected")}set selected(J){this.controller.props.set("selected",J)}get children(){return this.rackApi_.children}addButton(J){return this.rackApi_.addButton(J)}addFolder(J){return this.rackApi_.addFolder(J)}addTab(J){return this.rackApi_.addTab(J)}add(J,Q){this.rackApi_.add(J,Q)}remove(J){this.rackApi_.remove(J)}addBinding(J,Q,$){return this.rackApi_.addBinding(J,Q,$)}addBlade(J){return this.rackApi_.addBlade(J)}}var oD=-1;class eL{constructor(){this.onItemSelectedChange_=this.onItemSelectedChange_.bind(this),this.empty=p9(!0),this.selectedIndex=p9(oD),this.items_=[]}add(J,Q){let $=Q!==null&&Q!==void 0?Q:this.items_.length;this.items_.splice($,0,J),J.emitter.on("change",this.onItemSelectedChange_),this.keepSelection_()}remove(J){let Q=this.items_.indexOf(J);if(Q<0)return;this.items_.splice(Q,1),J.emitter.off("change",this.onItemSelectedChange_),this.keepSelection_()}keepSelection_(){if(this.items_.length===0){this.selectedIndex.rawValue=oD,this.empty.rawValue=!0;return}let J=this.items_.findIndex((Q)=>Q.rawValue);if(J<0)this.items_.forEach((Q,$)=>{Q.rawValue=$===0}),this.selectedIndex.rawValue=0;else this.items_.forEach((Q,$)=>{Q.rawValue=$===J}),this.selectedIndex.rawValue=J;this.empty.rawValue=!1}onItemSelectedChange_(J){if(J.rawValue){let Q=this.items_.findIndex(($)=>$===J.sender);this.items_.forEach(($,Z)=>{$.rawValue=Z===Q}),this.selectedIndex.rawValue=Q}else this.keepSelection_()}}var QK=F9("tab");class JR{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(QK(),nL()),Q.viewProps.bindClassModifiers(this.element),WQ(Q.empty,y6(this.element,QK(void 0,"nop")));let $=J.createElement("div");$.classList.add(QK("t")),this.element.appendChild($),this.itemsElement=$;let Z=J.createElement("div");Z.classList.add(QK("i")),this.element.appendChild(Z);let K=J.createElement("div");K.classList.add(QK("c")),this.element.appendChild(K),this.contentsElement=K}}class lG extends jH{constructor(J,Q){let $=new eL,Z=new JR(J,{empty:$.empty,viewProps:Q.viewProps});super({blade:Q.blade,rackController:new TH({blade:Q.blade,element:Z.contentsElement,viewProps:Q.viewProps}),view:Z});this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this);let K=this.rackController.rack;K.emitter.on("add",this.onRackAdd_),K.emitter.on("remove",this.onRackRemove_),this.tab=$}add(J,Q){this.rackController.rack.add(J,Q)}remove(J){this.rackController.rack.remove(this.rackController.rack.children[J])}onRackAdd_(J){if(!J.root)return;let Q=J.bladeController;wL(this.view.itemsElement,Q.itemController.view.element,J.index),Q.itemController.viewProps.set("parent",this.viewProps),this.tab.add(Q.props.value("selected"))}onRackRemove_(J){if(!J.root)return;let Q=J.bladeController;QX(Q.itemController.view.element),Q.itemController.viewProps.set("parent",null),this.tab.remove(Q.props.value("selected"))}}var QR=X8({id:"tab",type:"blade",accept(J){let Q=r9(J,($)=>({pages:$.required.array($.required.object({title:$.required.string})),view:$.required.constant("tab")}));if(!Q||Q.pages.length===0)return null;return{params:Q}},controller(J){let Q=new lG(J.document,{blade:J.blade,viewProps:J.viewProps});return J.params.pages.forEach(($)=>{let Z=new AH(J.document,{blade:h6(),itemProps:e0.fromObject({selected:!1,title:$.title}),props:e0.fromObject({selected:!1}),viewProps:XQ.create()});Q.add(Z)}),Q},api(J){if(J.controller instanceof lG)return new aL(J.controller,J.pool);if(J.controller instanceof AH)return new tL(J.controller,J.pool);return null}});function NC(J,Q){let $=J.accept(Q.params);if(!$)return null;let Z=r9(Q.params,(K)=>({disabled:K.optional.boolean,hidden:K.optional.boolean}));return J.controller({blade:h6(),document:Q.document,params:V8(Object.assign(Object.assign({},$.params),{disabled:Z===null||Z===void 0?void 0:Z.disabled,hidden:Z===null||Z===void 0?void 0:Z.hidden})),viewProps:XQ.create({disabled:Z===null||Z===void 0?void 0:Z.disabled,hidden:Z===null||Z===void 0?void 0:Z.hidden})})}class SH extends P6{get options(){return this.controller.valueController.props.get("options")}set options(J){this.controller.valueController.props.set("options",J)}}class $R{constructor(){this.disabled=!1,this.emitter=new OJ}dispose(){}tick(){if(this.disabled)return;this.emitter.emit("tick",{sender:this})}}class ZR{constructor(J,Q){this.disabled_=!1,this.timerId_=null,this.onTick_=this.onTick_.bind(this),this.doc_=J,this.emitter=new OJ,this.interval_=Q,this.setTimer_()}get disabled(){return this.disabled_}set disabled(J){if(this.disabled_=J,this.disabled_)this.clearTimer_();else this.setTimer_()}dispose(){this.clearTimer_()}clearTimer_(){if(this.timerId_===null)return;let J=this.doc_.defaultView;if(J)J.clearInterval(this.timerId_);this.timerId_=null}setTimer_(){if(this.clearTimer_(),this.interval_<=0)return;let J=this.doc_.defaultView;if(J)this.timerId_=J.setInterval(this.onTick_,this.interval_)}onTick_(){if(this.disabled_)return;this.emitter.emit("tick",{sender:this})}}class x6{constructor(J){this.constraints=J}constrain(J){return this.constraints.reduce((Q,$)=>{return $.constrain(Q)},J)}}function IH(J,Q){if(J instanceof Q)return J;if(J instanceof x6){let $=J.constraints.reduce((Z,K)=>{if(Z)return Z;return K instanceof Q?K:null},null);if($)return $}return null}class f6{constructor(J){this.values=e0.fromObject({options:J})}constrain(J){let Q=this.values.get("options");if(Q.length===0)return J;return Q.filter((Z)=>{return Z.value===J}).length>0?J:Q[0].value}}function YK(J){var Q;let $=mG;if(Array.isArray(J))return(Q=r9({items:J},(Z)=>({items:Z.required.array(Z.required.object({text:Z.required.string,value:Z.required.raw}))})))===null||Q===void 0?void 0:Q.items;if(typeof J==="object")return $.required.raw(J).value;return}function GX(J){if(Array.isArray(J))return J;let Q=[];return Object.keys(J).forEach(($)=>{Q.push({text:$,value:J[$]})}),Q}function XX(J){return!f9(J)?new f6(GX(V8(J))):null}var hG=F9("lst");class KR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),this.props_=Q.props,this.element=J.createElement("div"),this.element.classList.add(hG()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("select");$.classList.add(hG("s")),Q.viewProps.bindDisabled($),this.element.appendChild($),this.selectElement=$;let Z=J.createElement("div");Z.classList.add(hG("m")),Z.appendChild(CH(J,"dropdown")),this.element.appendChild(Z),Q.value.emitter.on("change",this.onValueChange_),this.value_=Q.value,_7(this.props_,"options",(K)=>{hL(this.selectElement),K.forEach((W)=>{let H=J.createElement("option");H.textContent=W.text,this.selectElement.appendChild(H)}),this.update_()})}update_(){let J=this.props_.get("options").map((Q)=>Q.value);this.selectElement.selectedIndex=J.indexOf(this.value_.rawValue)}onValueChange_(){this.update_()}}class qQ{constructor(J,Q){this.onSelectChange_=this.onSelectChange_.bind(this),this.props=Q.props,this.value=Q.value,this.viewProps=Q.viewProps,this.view=new KR(J,{props:this.props,value:this.value,viewProps:this.viewProps}),this.view.selectElement.addEventListener("change",this.onSelectChange_)}onSelectChange_(J){let Q=V8(J.currentTarget);this.value.rawValue=this.props.get("options")[Q.selectedIndex].value}importProps(J){return f8(J,null,(Q)=>({options:Q.required.custom(YK)}),(Q)=>{return this.props.set("options",GX(Q.options)),!0})}exportProps(){return b8(null,{options:this.props.get("options")})}}var sD=F9("pop");class WR{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(sD()),Q.viewProps.bindClassModifiers(this.element),WQ(Q.shows,y6(this.element,sD(void 0,"v")))}}class YX{constructor(J,Q){this.shows=p9(!1),this.viewProps=Q.viewProps,this.view=new WR(J,{shows:this.shows,viewProps:this.viewProps})}}var iD=F9("txt");class HR{constructor(J,Q){this.onChange_=this.onChange_.bind(this),this.element=J.createElement("div"),this.element.classList.add(iD()),Q.viewProps.bindClassModifiers(this.element),this.props_=Q.props,this.props_.emitter.on("change",this.onChange_);let $=J.createElement("input");$.classList.add(iD("i")),$.type="text",Q.viewProps.bindDisabled($),this.element.appendChild($),this.inputElement=$,Q.value.emitter.on("change",this.onChange_),this.value_=Q.value,this.refresh()}refresh(){let J=this.props_.get("formatter");this.inputElement.value=J(this.value_.rawValue)}onChange_(){this.refresh()}}class j6{constructor(J,Q){this.onInputChange_=this.onInputChange_.bind(this),this.parser_=Q.parser,this.props=Q.props,this.value=Q.value,this.viewProps=Q.viewProps,this.view=new HR(J,{props:Q.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_)}onInputChange_(J){let $=V8(J.currentTarget).value,Z=this.parser_($);if(!f9(Z))this.value.rawValue=Z;this.view.refresh()}}function OC(J){return String(J)}function UR(J){if(J==="false")return!1;return!!J}function rD(J){return OC(J)}function FC(J){return(Q)=>{return J.reduce(($,Z)=>{if($!==null)return $;return Z(Q)},null)}}var DC=k8(0);function EH(J){return DC(J)+"%"}function qR(J){return String(J)}function nG(J){return J}function b6({primary:J,secondary:Q,forward:$,backward:Z}){let K=!1;function W(H){if(K)return;K=!0,H(),K=!1}J.emitter.on("change",(H)=>{W(()=>{Q.setRawValue($(J.rawValue,Q.rawValue),H.options)})}),Q.emitter.on("change",(H)=>{W(()=>{J.setRawValue(Z(J.rawValue,Q.rawValue),H.options)}),W(()=>{Q.setRawValue($(J.rawValue,Q.rawValue),H.options)})}),W(()=>{Q.setRawValue($(J.rawValue,Q.rawValue),{forceEmit:!1,last:!0})})}function z8(J,Q){let $=J*(Q.altKey?0.1:1)*(Q.shiftKey?10:1);if(Q.upKey)return+$;else if(Q.downKey)return-$;return 0}function WK(J){return{altKey:J.altKey,downKey:J.key==="ArrowDown",shiftKey:J.shiftKey,upKey:J.key==="ArrowUp"}}function GQ(J){return{altKey:J.altKey,downKey:J.key==="ArrowLeft",shiftKey:J.shiftKey,upKey:J.key==="ArrowRight"}}function LC(J){return J==="ArrowUp"||J==="ArrowDown"}function GR(J){return LC(J)||J==="ArrowLeft"||J==="ArrowRight"}function xG(J,Q){var $,Z;let K=Q.ownerDocument.defaultView,W=Q.getBoundingClientRect();return{x:J.pageX-((($=K&&K.scrollX)!==null&&$!==void 0?$:0)+W.left),y:J.pageY-(((Z=K&&K.scrollY)!==null&&Z!==void 0?Z:0)+W.top)}}class lQ{constructor(J){this.lastTouch_=null,this.onDocumentMouseMove_=this.onDocumentMouseMove_.bind(this),this.onDocumentMouseUp_=this.onDocumentMouseUp_.bind(this),this.onMouseDown_=this.onMouseDown_.bind(this),this.onTouchEnd_=this.onTouchEnd_.bind(this),this.onTouchMove_=this.onTouchMove_.bind(this),this.onTouchStart_=this.onTouchStart_.bind(this),this.elem_=J,this.emitter=new OJ,J.addEventListener("touchstart",this.onTouchStart_,{passive:!1}),J.addEventListener("touchmove",this.onTouchMove_,{passive:!0}),J.addEventListener("touchend",this.onTouchEnd_),J.addEventListener("mousedown",this.onMouseDown_)}computePosition_(J){let Q=this.elem_.getBoundingClientRect();return{bounds:{width:Q.width,height:Q.height},point:J?{x:J.x,y:J.y}:null}}onMouseDown_(J){var Q;J.preventDefault(),(Q=J.currentTarget)===null||Q===void 0||Q.focus();let $=this.elem_.ownerDocument;$.addEventListener("mousemove",this.onDocumentMouseMove_),$.addEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("down",{altKey:J.altKey,data:this.computePosition_(xG(J,this.elem_)),sender:this,shiftKey:J.shiftKey})}onDocumentMouseMove_(J){this.emitter.emit("move",{altKey:J.altKey,data:this.computePosition_(xG(J,this.elem_)),sender:this,shiftKey:J.shiftKey})}onDocumentMouseUp_(J){let Q=this.elem_.ownerDocument;Q.removeEventListener("mousemove",this.onDocumentMouseMove_),Q.removeEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("up",{altKey:J.altKey,data:this.computePosition_(xG(J,this.elem_)),sender:this,shiftKey:J.shiftKey})}onTouchStart_(J){J.preventDefault();let Q=J.targetTouches.item(0),$=this.elem_.getBoundingClientRect();this.emitter.emit("down",{altKey:J.altKey,data:this.computePosition_(Q?{x:Q.clientX-$.left,y:Q.clientY-$.top}:void 0),sender:this,shiftKey:J.shiftKey}),this.lastTouch_=Q}onTouchMove_(J){let Q=J.targetTouches.item(0),$=this.elem_.getBoundingClientRect();this.emitter.emit("move",{altKey:J.altKey,data:this.computePosition_(Q?{x:Q.clientX-$.left,y:Q.clientY-$.top}:void 0),sender:this,shiftKey:J.shiftKey}),this.lastTouch_=Q}onTouchEnd_(J){var Q;let $=(Q=J.targetTouches.item(0))!==null&&Q!==void 0?Q:this.lastTouch_,Z=this.elem_.getBoundingClientRect();this.emitter.emit("up",{altKey:J.altKey,data:this.computePosition_($?{x:$.clientX-Z.left,y:$.clientY-Z.top}:void 0),sender:this,shiftKey:J.shiftKey})}}var J7=F9("txt");class XR{constructor(J,Q){if(this.onChange_=this.onChange_.bind(this),this.props_=Q.props,this.props_.emitter.on("change",this.onChange_),this.element=J.createElement("div"),this.element.classList.add(J7(),J7(void 0,"num")),Q.arrayPosition)this.element.classList.add(J7(void 0,Q.arrayPosition));Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("input");$.classList.add(J7("i")),$.type="text",Q.viewProps.bindDisabled($),this.element.appendChild($),this.inputElement=$,this.onDraggingChange_=this.onDraggingChange_.bind(this),this.dragging_=Q.dragging,this.dragging_.emitter.on("change",this.onDraggingChange_),this.element.classList.add(J7()),this.inputElement.classList.add(J7("i"));let Z=J.createElement("div");Z.classList.add(J7("k")),this.element.appendChild(Z),this.knobElement=Z;let K=J.createElementNS(S7,"svg");K.classList.add(J7("g")),this.knobElement.appendChild(K);let W=J.createElementNS(S7,"path");W.classList.add(J7("gb")),K.appendChild(W),this.guideBodyElem_=W;let H=J.createElementNS(S7,"path");H.classList.add(J7("gh")),K.appendChild(H),this.guideHeadElem_=H;let U=J.createElement("div");U.classList.add(F9("tt")()),this.knobElement.appendChild(U),this.tooltipElem_=U,Q.value.emitter.on("change",this.onChange_),this.value=Q.value,this.refresh()}onDraggingChange_(J){if(J.rawValue===null){this.element.classList.remove(J7(void 0,"drg"));return}this.element.classList.add(J7(void 0,"drg"));let Q=J.rawValue/this.props_.get("pointerScale"),$=Q+(Q>0?-1:Q<0?1:0),Z=CJ(-$,-4,4);this.guideHeadElem_.setAttributeNS(null,"d",[`M ${$+Z},0 L${$},4 L${$+Z},8`,`M ${Q},-1 L${Q},9`].join(" ")),this.guideBodyElem_.setAttributeNS(null,"d",`M 0,4 L${Q},4`);let K=this.props_.get("formatter");this.tooltipElem_.textContent=K(this.value.rawValue),this.tooltipElem_.style.left=`${Q}px`}refresh(){let J=this.props_.get("formatter");this.inputElement.value=J(this.value.rawValue)}onChange_(){this.refresh()}}class v6{constructor(J,Q){var $;this.originRawValue_=0,this.onInputChange_=this.onInputChange_.bind(this),this.onInputKeyDown_=this.onInputKeyDown_.bind(this),this.onInputKeyUp_=this.onInputKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.parser_=Q.parser,this.props=Q.props,this.sliderProps_=($=Q.sliderProps)!==null&&$!==void 0?$:null,this.value=Q.value,this.viewProps=Q.viewProps,this.dragging_=p9(null),this.view=new XR(J,{arrayPosition:Q.arrayPosition,dragging:this.dragging_,props:this.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.inputElement.addEventListener("keydown",this.onInputKeyDown_),this.view.inputElement.addEventListener("keyup",this.onInputKeyUp_);let Z=new lQ(this.view.knobElement);Z.emitter.on("down",this.onPointerDown_),Z.emitter.on("move",this.onPointerMove_),Z.emitter.on("up",this.onPointerUp_)}constrainValue_(J){var Q,$;let Z=(Q=this.sliderProps_)===null||Q===void 0?void 0:Q.get("min"),K=($=this.sliderProps_)===null||$===void 0?void 0:$.get("max"),W=J;if(Z!==void 0)W=Math.max(W,Z);if(K!==void 0)W=Math.min(W,K);return W}onInputChange_(J){let $=V8(J.currentTarget).value,Z=this.parser_($);if(!f9(Z))this.value.rawValue=this.constrainValue_(Z);this.view.refresh()}onInputKeyDown_(J){let Q=z8(this.props.get("keyScale"),WK(J));if(Q===0)return;this.value.setRawValue(this.constrainValue_(this.value.rawValue+Q),{forceEmit:!1,last:!1})}onInputKeyUp_(J){if(z8(this.props.get("keyScale"),WK(J))===0)return;this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}onPointerDown_(){this.originRawValue_=this.value.rawValue,this.dragging_.rawValue=0}computeDraggingValue_(J){if(!J.point)return null;let Q=J.point.x-J.bounds.width/2;return this.constrainValue_(this.originRawValue_+Q*this.props.get("pointerScale"))}onPointerMove_(J){let Q=this.computeDraggingValue_(J.data);if(Q===null)return;this.value.setRawValue(Q,{forceEmit:!1,last:!1}),this.dragging_.rawValue=this.value.rawValue-this.originRawValue_}onPointerUp_(J){let Q=this.computeDraggingValue_(J.data);if(Q===null)return;this.value.setRawValue(Q,{forceEmit:!0,last:!0}),this.dragging_.rawValue=null}}var fG=F9("sld");class YR{constructor(J,Q){this.onChange_=this.onChange_.bind(this),this.props_=Q.props,this.props_.emitter.on("change",this.onChange_),this.element=J.createElement("div"),this.element.classList.add(fG()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(fG("t")),Q.viewProps.bindTabIndex($),this.element.appendChild($),this.trackElement=$;let Z=J.createElement("div");Z.classList.add(fG("k")),this.trackElement.appendChild(Z),this.knobElement=Z,Q.value.emitter.on("change",this.onChange_),this.value=Q.value,this.update_()}update_(){let J=CJ(V9(this.value.rawValue,this.props_.get("min"),this.props_.get("max"),0,100),0,100);this.knobElement.style.width=`${J}%`}onChange_(){this.update_()}}class NR{constructor(J,Q){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDownOrMove_=this.onPointerDownOrMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.props=Q.props,this.view=new YR(J,{props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new lQ(this.view.trackElement),this.ptHandler_.emitter.on("down",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("move",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.trackElement.addEventListener("keydown",this.onKeyDown_),this.view.trackElement.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(J,Q){if(!J.point)return;this.value.setRawValue(V9(CJ(J.point.x,0,J.bounds.width),0,J.bounds.width,this.props.get("min"),this.props.get("max")),Q)}onPointerDownOrMove_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerUp_(J){this.handlePointerEvent_(J.data,{forceEmit:!0,last:!0})}onKeyDown_(J){let Q=z8(this.props.get("keyScale"),GQ(J));if(Q===0)return;this.value.setRawValue(this.value.rawValue+Q,{forceEmit:!1,last:!1})}onKeyUp_(J){if(z8(this.props.get("keyScale"),GQ(J))===0)return;this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}var bG=F9("sldtxt");class OR{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(bG());let $=J.createElement("div");$.classList.add(bG("s")),this.sliderView_=Q.sliderView,$.appendChild(this.sliderView_.element),this.element.appendChild($);let Z=J.createElement("div");Z.classList.add(bG("t")),this.textView_=Q.textView,Z.appendChild(this.textView_.element),this.element.appendChild(Z)}}class HK{constructor(J,Q){this.value=Q.value,this.viewProps=Q.viewProps,this.sliderC_=new NR(J,{props:Q.sliderProps,value:Q.value,viewProps:this.viewProps}),this.textC_=new v6(J,{parser:Q.parser,props:Q.textProps,sliderProps:Q.sliderProps,value:Q.value,viewProps:Q.viewProps}),this.view=new OR(J,{sliderView:this.sliderC_.view,textView:this.textC_.view})}get sliderController(){return this.sliderC_}get textController(){return this.textC_}importProps(J){return f8(J,null,(Q)=>({max:Q.required.number,min:Q.required.number}),(Q)=>{let $=this.sliderC_.props;return $.set("max",Q.max),$.set("min",Q.min),!0})}exportProps(){let J=this.sliderC_.props;return b8(null,{max:J.get("max"),min:J.get("min")})}}function FR(J){return{sliderProps:new e0({keyScale:J.keyScale,max:J.max,min:J.min}),textProps:new e0({formatter:p9(J.formatter),keyScale:J.keyScale,pointerScale:p9(J.pointerScale)})}}var RC={containerUnitSize:"cnt-usz"};function DR(J){return`--${RC[J]}`}function UK(J){return PL(J)}function mQ(J){if(!dG(J))return;return r9(J,UK)}function KQ(J,Q){if(!J)return;let $=[],Z=IL(J,Q);if(Z)$.push(Z);let K=EL(J);if(K)$.push(K);return new x6($)}function BC(J){if(!J)return!1;return J.major===w6.major}function LR(J){if(J==="inline"||J==="popup")return J;return}function NK(J,Q){J.write(Q)}var RH=F9("ckb");class RR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),this.element=J.createElement("div"),this.element.classList.add(RH()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("label");$.classList.add(RH("l")),this.element.appendChild($),this.labelElement=$;let Z=J.createElement("input");Z.classList.add(RH("i")),Z.type="checkbox",this.labelElement.appendChild(Z),this.inputElement=Z,Q.viewProps.bindDisabled(this.inputElement);let K=J.createElement("div");K.classList.add(RH("w")),this.labelElement.appendChild(K);let W=CH(J,"check");K.appendChild(W),Q.value.emitter.on("change",this.onValueChange_),this.value=Q.value,this.update_()}update_(){this.inputElement.checked=this.value.rawValue}onValueChange_(){this.update_()}}class BR{constructor(J,Q){this.onInputChange_=this.onInputChange_.bind(this),this.onLabelMouseDown_=this.onLabelMouseDown_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.view=new RR(J,{value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.labelElement.addEventListener("mousedown",this.onLabelMouseDown_)}onInputChange_(J){let Q=V8(J.currentTarget);this.value.rawValue=Q.checked,J.preventDefault(),J.stopPropagation()}onLabelMouseDown_(J){J.preventDefault()}}function MC(J){let Q=[],$=XX(J.options);if($)Q.push($);return new x6(Q)}var zC=X8({id:"input-bool",type:"input",accept:(J,Q)=>{if(typeof J!=="boolean")return null;let $=r9(Q,(Z)=>({options:Z.optional.custom(YK),readonly:Z.optional.constant(!1)}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>UR,constraint:(J)=>MC(J.params),writer:(J)=>NK},controller:(J)=>{let{document:Q,value:$,constraint:Z}=J,K=Z&&IH(Z,f6);if(K)return new qQ(Q,{props:new e0({options:K.values.value("options")}),value:$,viewProps:J.viewProps});return new BR(Q,{value:$,viewProps:J.viewProps})},api(J){if(typeof J.controller.value.rawValue!=="boolean")return null;if(J.controller.valueController instanceof qQ)return new SH(J.controller);return null}}),E$=F9("col");class MR{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(E$()),Q.foldable.bindExpandedClass(this.element,E$(void 0,"expanded")),_7(Q.foldable,"completed",y6(this.element,E$(void 0,"cpl")));let $=J.createElement("div");$.classList.add(E$("h")),this.element.appendChild($);let Z=J.createElement("div");Z.classList.add(E$("s")),$.appendChild(Z),this.swatchElement=Z;let K=J.createElement("div");if(K.classList.add(E$("t")),$.appendChild(K),this.textElement=K,Q.pickerLayout==="inline"){let W=J.createElement("div");W.classList.add(E$("p")),this.element.appendChild(W),this.pickerElement=W}else this.pickerElement=null}}function kC(J,Q,$){let Z=CJ(J/255,0,1),K=CJ(Q/255,0,1),W=CJ($/255,0,1),H=Math.max(Z,K,W),U=Math.min(Z,K,W),q=H-U,X=0,F=0,N=(U+H)/2;if(q!==0){if(F=q/(1-Math.abs(H+U-1)),Z===H)X=(K-W)/q;else if(K===H)X=2+(W-Z)/q;else X=4+(Z-K)/q;X=X/6+(X<0?1:0)}return[X*360,F*100,N*100]}function VC(J,Q,$){let Z=(J%360+360)%360,K=CJ(Q/100,0,1),W=CJ($/100,0,1),H=(1-Math.abs(2*W-1))*K,U=H*(1-Math.abs(Z/60%2-1)),q=W-H/2,X,F,N;if(Z>=0&&Z<60)[X,F,N]=[H,U,0];else if(Z>=60&&Z<120)[X,F,N]=[U,H,0];else if(Z>=120&&Z<180)[X,F,N]=[0,H,U];else if(Z>=180&&Z<240)[X,F,N]=[0,U,H];else if(Z>=240&&Z<300)[X,F,N]=[U,0,H];else[X,F,N]=[H,0,U];return[(X+q)*255,(F+q)*255,(N+q)*255]}function AC(J,Q,$){let Z=CJ(J/255,0,1),K=CJ(Q/255,0,1),W=CJ($/255,0,1),H=Math.max(Z,K,W),U=Math.min(Z,K,W),q=H-U,X;if(q===0)X=0;else if(H===Z)X=60*(((K-W)/q%6+6)%6);else if(H===K)X=60*((W-Z)/q+2);else X=60*((Z-K)/q+4);let F=H===0?0:q/H,N=H;return[X,F*100,N*100]}function zR(J,Q,$){let Z=kL(J,360),K=CJ(Q/100,0,1),W=CJ($/100,0,1),H=W*K,U=H*(1-Math.abs(Z/60%2-1)),q=W-H,X,F,N;if(Z>=0&&Z<60)[X,F,N]=[H,U,0];else if(Z>=60&&Z<120)[X,F,N]=[U,H,0];else if(Z>=120&&Z<180)[X,F,N]=[0,H,U];else if(Z>=180&&Z<240)[X,F,N]=[0,U,H];else if(Z>=240&&Z<300)[X,F,N]=[U,0,H];else[X,F,N]=[H,0,U];return[(X+q)*255,(F+q)*255,(N+q)*255]}function IC(J,Q,$){let Z=$+Q*(100-Math.abs(2*$-100))/200;return[J,Z!==0?Q*(100-Math.abs(2*$-100))/Z:0,$+Q*(100-Math.abs(2*$-100))/200]}function EC(J,Q,$){let Z=100-Math.abs($*(200-Q)/100-100);return[J,Z!==0?Q*$/Z:0,$*(200-Q)/200]}function y7(J){return[J[0],J[1],J[2]]}function _H(J,Q){return[J[0],J[1],J[2],Q]}var CC={hsl:{hsl:(J,Q,$)=>[J,Q,$],hsv:IC,rgb:VC},hsv:{hsl:EC,hsv:(J,Q,$)=>[J,Q,$],rgb:zR},rgb:{hsl:kC,hsv:AC,rgb:(J,Q,$)=>[J,Q,$]}};function T6(J,Q){return[Q==="float"?1:J==="rgb"?255:360,Q==="float"?1:J==="rgb"?255:100,Q==="float"?1:J==="rgb"?255:100]}function PC(J,Q){return J===Q?Q:kL(J,Q)}function kR(J,Q,$){var Z;let K=T6(Q,$);return[Q==="rgb"?CJ(J[0],0,K[0]):PC(J[0],K[0]),CJ(J[1],0,K[1]),CJ(J[2],0,K[2]),CJ((Z=J[3])!==null&&Z!==void 0?Z:1,0,1)]}function aD(J,Q,$,Z){let K=T6(Q,$),W=T6(Q,Z);return J.map((H,U)=>H/K[U]*W[U])}function VR(J,Q,$){let Z=aD(J,Q.mode,Q.type,"int"),K=CC[Q.mode][$.mode](...Z);return aD(K,$.mode,"int",$.type)}class B9{static black(){return new B9([0,0,0],"rgb")}constructor(J,Q){this.type="int",this.mode=Q,this.comps_=kR(J,Q,this.type)}getComponents(J){return _H(VR(y7(this.comps_),{mode:this.mode,type:this.type},{mode:J!==null&&J!==void 0?J:this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){let J=this.getComponents("rgb");return{r:J[0],g:J[1],b:J[2],a:J[3]}}}var gQ=F9("colp");class AR{constructor(J,Q){this.alphaViews_=null,this.element=J.createElement("div"),this.element.classList.add(gQ()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(gQ("hsv"));let Z=J.createElement("div");Z.classList.add(gQ("sv")),this.svPaletteView_=Q.svPaletteView,Z.appendChild(this.svPaletteView_.element),$.appendChild(Z);let K=J.createElement("div");K.classList.add(gQ("h")),this.hPaletteView_=Q.hPaletteView,K.appendChild(this.hPaletteView_.element),$.appendChild(K),this.element.appendChild($);let W=J.createElement("div");if(W.classList.add(gQ("rgb")),this.textsView_=Q.textsView,W.appendChild(this.textsView_.element),this.element.appendChild(W),Q.alphaViews){this.alphaViews_={palette:Q.alphaViews.palette,text:Q.alphaViews.text};let H=J.createElement("div");H.classList.add(gQ("a"));let U=J.createElement("div");U.classList.add(gQ("ap")),U.appendChild(this.alphaViews_.palette.element),H.appendChild(U);let q=J.createElement("div");q.classList.add(gQ("at")),q.appendChild(this.alphaViews_.text.element),H.appendChild(q),this.element.appendChild(H)}}get allFocusableElements(){let J=[this.svPaletteView_.element,this.hPaletteView_.element,this.textsView_.modeSelectElement,...this.textsView_.inputViews.map((Q)=>Q.inputElement)];if(this.alphaViews_)J.push(this.alphaViews_.palette.element,this.alphaViews_.text.inputElement);return J}}function jC(J){return J==="int"?"int":J==="float"?"float":void 0}function NX(J){return r9(J,(Q)=>({color:Q.optional.object({alpha:Q.optional.boolean,type:Q.optional.custom(jC)}),expanded:Q.optional.boolean,picker:Q.optional.custom(LR),readonly:Q.optional.constant(!1)}))}function S$(J){return J?0.1:1}function IR(J){var Q;return(Q=J.color)===null||Q===void 0?void 0:Q.type}class yH{constructor(J,Q){this.type="float",this.mode=Q,this.comps_=kR(J,Q,this.type)}getComponents(J){return _H(VR(y7(this.comps_),{mode:this.mode,type:this.type},{mode:J!==null&&J!==void 0?J:this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){let J=this.getComponents("rgb");return{r:J[0],g:J[1],b:J[2],a:J[3]}}}var TC={int:(J,Q)=>new B9(J,Q),float:(J,Q)=>new yH(J,Q)};function OX(J,Q,$){return TC[$](J,Q)}function SC(J){return J.type==="float"}function _C(J){return J.type==="int"}function yC(J){let Q=J.getComponents(),$=T6(J.mode,"int");return new B9([Math.round(V9(Q[0],0,1,0,$[0])),Math.round(V9(Q[1],0,1,0,$[1])),Math.round(V9(Q[2],0,1,0,$[2])),Q[3]],J.mode)}function wC(J){let Q=J.getComponents(),$=T6(J.mode,"int");return new yH([V9(Q[0],0,$[0],0,1),V9(Q[1],0,$[1],0,1),V9(Q[2],0,$[2],0,1),Q[3]],J.mode)}function G8(J,Q){if(J.type===Q)return J;if(_C(J)&&Q==="float")return wC(J);if(SC(J)&&Q==="int")return yC(J);throw KJ.shouldNeverHappen()}function hC(J,Q){return J.alpha===Q.alpha&&J.mode===Q.mode&&J.notation===Q.notation&&J.type===Q.type}function Q7(J,Q){let $=J.match(/^(.+)%$/);if(!$)return Math.min(parseFloat(J),Q);return Math.min(parseFloat($[1])*0.01*Q,Q)}var xC={deg:(J)=>J,grad:(J)=>J*360/400,rad:(J)=>J*360/(2*Math.PI),turn:(J)=>J*360};function ER(J){let Q=J.match(/^([0-9.]+?)(deg|grad|rad|turn)$/);if(!Q)return parseFloat(J);let $=parseFloat(Q[1]),Z=Q[2];return xC[Z]($)}function CR(J){let Q=J.match(/^rgb\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!Q)return null;let $=[Q7(Q[1],255),Q7(Q[2],255),Q7(Q[3],255)];if(isNaN($[0])||isNaN($[1])||isNaN($[2]))return null;return $}function fC(J){let Q=CR(J);return Q?new B9(Q,"rgb"):null}function PR(J){let Q=J.match(/^rgba\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!Q)return null;let $=[Q7(Q[1],255),Q7(Q[2],255),Q7(Q[3],255),Q7(Q[4],1)];if(isNaN($[0])||isNaN($[1])||isNaN($[2])||isNaN($[3]))return null;return $}function bC(J){let Q=PR(J);return Q?new B9(Q,"rgb"):null}function jR(J){let Q=J.match(/^hsl\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!Q)return null;let $=[ER(Q[1]),Q7(Q[2],100),Q7(Q[3],100)];if(isNaN($[0])||isNaN($[1])||isNaN($[2]))return null;return $}function vC(J){let Q=jR(J);return Q?new B9(Q,"hsl"):null}function TR(J){let Q=J.match(/^hsla\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!Q)return null;let $=[ER(Q[1]),Q7(Q[2],100),Q7(Q[3],100),Q7(Q[4],1)];if(isNaN($[0])||isNaN($[1])||isNaN($[2])||isNaN($[3]))return null;return $}function gC(J){let Q=TR(J);return Q?new B9(Q,"hsl"):null}function SR(J){let Q=J.match(/^#([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(Q)return[parseInt(Q[1]+Q[1],16),parseInt(Q[2]+Q[2],16),parseInt(Q[3]+Q[3],16)];let $=J.match(/^(?:#|0x)([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);if($)return[parseInt($[1],16),parseInt($[2],16),parseInt($[3],16)];return null}function uC(J){let Q=SR(J);return Q?new B9(Q,"rgb"):null}function _R(J){let Q=J.match(/^#([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(Q)return[parseInt(Q[1]+Q[1],16),parseInt(Q[2]+Q[2],16),parseInt(Q[3]+Q[3],16),V9(parseInt(Q[4]+Q[4],16),0,255,0,1)];let $=J.match(/^(?:#|0x)?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);if($)return[parseInt($[1],16),parseInt($[2],16),parseInt($[3],16),V9(parseInt($[4],16),0,255,0,1)];return null}function dC(J){let Q=_R(J);return Q?new B9(Q,"rgb"):null}function yR(J){let Q=J.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!Q)return null;let $=[parseFloat(Q[1]),parseFloat(Q[2]),parseFloat(Q[3])];if(isNaN($[0])||isNaN($[1])||isNaN($[2]))return null;return $}function tD(J){return(Q)=>{let $=yR(Q);return $?OX($,"rgb",J):null}}function wR(J){let Q=J.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*a\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!Q)return null;let $=[parseFloat(Q[1]),parseFloat(Q[2]),parseFloat(Q[3]),parseFloat(Q[4])];if(isNaN($[0])||isNaN($[1])||isNaN($[2])||isNaN($[3]))return null;return $}function eD(J){return(Q)=>{let $=wR(Q);return $?OX($,"rgb",J):null}}var mC=[{parser:SR,result:{alpha:!1,mode:"rgb",notation:"hex"}},{parser:_R,result:{alpha:!0,mode:"rgb",notation:"hex"}},{parser:CR,result:{alpha:!1,mode:"rgb",notation:"func"}},{parser:PR,result:{alpha:!0,mode:"rgb",notation:"func"}},{parser:jR,result:{alpha:!1,mode:"hsl",notation:"func"}},{parser:TR,result:{alpha:!0,mode:"hsl",notation:"func"}},{parser:yR,result:{alpha:!1,mode:"rgb",notation:"object"}},{parser:wR,result:{alpha:!0,mode:"rgb",notation:"object"}}];function cC(J){return mC.reduce((Q,{parser:$,result:Z})=>{if(Q)return Q;return $(J)?Z:null},null)}function pC(J,Q="int"){let $=cC(J);if(!$)return null;if($.notation==="hex"&&Q!=="float")return Object.assign(Object.assign({},$),{type:"int"});if($.notation==="func")return Object.assign(Object.assign({},$),{type:Q});return null}function OK(J){let Q=[uC,dC,fC,bC,vC,gC];if(J==="int")Q.push(tD("int"),eD("int"));if(J==="float")Q.push(tD("float"),eD("float"));let $=FC(Q);return(Z)=>{let K=$(Z);return K?G8(K,J):null}}function lC(J){let Q=OK("int");if(typeof J!=="string")return B9.black();let $=Q(J);return $!==null&&$!==void 0?$:B9.black()}function hR(J){let Q=CJ(Math.floor(J),0,255).toString(16);return Q.length===1?`0${Q}`:Q}function FX(J,Q="#"){let $=y7(J.getComponents("rgb")).map(hR).join("");return`${Q}${$}`}function DX(J,Q="#"){let $=J.getComponents("rgb"),Z=[$[0],$[1],$[2],$[3]*255].map(hR).join("");return`${Q}${Z}`}function xR(J){let Q=k8(0),$=G8(J,"int");return`rgb(${y7($.getComponents("rgb")).map((K)=>Q(K)).join(", ")})`}function BH(J){let Q=k8(2),$=k8(0);return`rgba(${G8(J,"int").getComponents("rgb").map((W,H)=>{return(H===3?Q:$)(W)}).join(", ")})`}function nC(J){let Q=[k8(0),EH,EH],$=G8(J,"int");return`hsl(${y7($.getComponents("hsl")).map((K,W)=>Q[W](K)).join(", ")})`}function oC(J){let Q=[k8(0),EH,EH,k8(2)];return`hsla(${G8(J,"int").getComponents("hsl").map((K,W)=>Q[W](K)).join(", ")})`}function fR(J,Q){let $=k8(Q==="float"?2:0),Z=["r","g","b"],K=G8(J,Q);return`{${y7(K.getComponents("rgb")).map((H,U)=>`${Z[U]}: ${$(H)}`).join(", ")}}`}function sC(J){return(Q)=>fR(Q,J)}function bR(J,Q){let $=k8(2),Z=k8(Q==="float"?2:0),K=["r","g","b","a"];return`{${G8(J,Q).getComponents("rgb").map((U,q)=>{let X=q===3?$:Z;return`${K[q]}: ${X(U)}`}).join(", ")}}`}function iC(J){return(Q)=>bR(Q,J)}var rC=[{format:{alpha:!1,mode:"rgb",notation:"hex",type:"int"},stringifier:FX},{format:{alpha:!0,mode:"rgb",notation:"hex",type:"int"},stringifier:DX},{format:{alpha:!1,mode:"rgb",notation:"func",type:"int"},stringifier:xR},{format:{alpha:!0,mode:"rgb",notation:"func",type:"int"},stringifier:BH},{format:{alpha:!1,mode:"hsl",notation:"func",type:"int"},stringifier:nC},{format:{alpha:!0,mode:"hsl",notation:"func",type:"int"},stringifier:oC},...["int","float"].reduce((J,Q)=>{return[...J,{format:{alpha:!1,mode:"rgb",notation:"object",type:Q},stringifier:sC(Q)},{format:{alpha:!0,mode:"rgb",notation:"object",type:Q},stringifier:iC(Q)}]},[])];function vR(J){return rC.reduce((Q,$)=>{if(Q)return Q;return hC($.format,J)?$.stringifier:null},null)}var $K=F9("apl");class gR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),this.value=Q.value,this.value.emitter.on("change",this.onValueChange_),this.element=J.createElement("div"),this.element.classList.add($K()),Q.viewProps.bindClassModifiers(this.element),Q.viewProps.bindTabIndex(this.element);let $=J.createElement("div");$.classList.add($K("b")),this.element.appendChild($);let Z=J.createElement("div");Z.classList.add($K("c")),$.appendChild(Z),this.colorElem_=Z;let K=J.createElement("div");K.classList.add($K("m")),this.element.appendChild(K),this.markerElem_=K;let W=J.createElement("div");W.classList.add($K("p")),this.markerElem_.appendChild(W),this.previewElem_=W,this.update_()}update_(){let J=this.value.rawValue,Q=J.getComponents("rgb"),$=new B9([Q[0],Q[1],Q[2],0],"rgb"),Z=new B9([Q[0],Q[1],Q[2],255],"rgb"),K=["to right",BH($),BH(Z)];this.colorElem_.style.background=`linear-gradient(${K.join(",")})`,this.previewElem_.style.backgroundColor=BH(J);let W=V9(Q[3],0,1,0,100);this.markerElem_.style.left=`${W}%`}onValueChange_(){this.update_()}}class uR{constructor(J,Q){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.view=new gR(J,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new lQ(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(J,Q){if(!J.point)return;let $=J.point.x/J.bounds.width,Z=this.value.rawValue,[K,W,H]=Z.getComponents("hsv");this.value.setRawValue(new B9([K,W,H,$],"hsv"),Q)}onPointerDown_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerMove_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerUp_(J){this.handlePointerEvent_(J.data,{forceEmit:!0,last:!0})}onKeyDown_(J){let Q=z8(S$(!0),GQ(J));if(Q===0)return;let $=this.value.rawValue,[Z,K,W,H]=$.getComponents("hsv");this.value.setRawValue(new B9([Z,K,W,H+Q],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(J){if(z8(S$(!0),GQ(J))===0)return;this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}var E6=F9("coltxt");function aC(J){let Q=J.createElement("select"),$=[{text:"RGB",value:"rgb"},{text:"HSL",value:"hsl"},{text:"HSV",value:"hsv"},{text:"HEX",value:"hex"}];return Q.appendChild($.reduce((Z,K)=>{let W=J.createElement("option");return W.textContent=K.text,W.value=K.value,Z.appendChild(W),Z},J.createDocumentFragment())),Q}class dR{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(E6()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(E6("m")),this.modeElem_=aC(J),this.modeElem_.classList.add(E6("ms")),$.appendChild(this.modeSelectElement),Q.viewProps.bindDisabled(this.modeElem_);let Z=J.createElement("div");Z.classList.add(E6("mm")),Z.appendChild(CH(J,"dropdown")),$.appendChild(Z),this.element.appendChild($);let K=J.createElement("div");K.classList.add(E6("w")),this.element.appendChild(K),this.inputsElem_=K,this.inputViews_=Q.inputViews,this.applyInputViews_(),WQ(Q.mode,(W)=>{this.modeElem_.value=W})}get modeSelectElement(){return this.modeElem_}get inputViews(){return this.inputViews_}set inputViews(J){this.inputViews_=J,this.applyInputViews_()}applyInputViews_(){hL(this.inputsElem_);let J=this.element.ownerDocument;this.inputViews_.forEach((Q)=>{let $=J.createElement("div");$.classList.add(E6("c")),$.appendChild(Q.element),this.inputsElem_.appendChild($)})}}function tC(J){return k8(J==="float"?2:0)}function eC(J,Q,$){let Z=T6(J,Q)[$];return new S6({min:0,max:Z})}function JP(J,Q,$){return new v6(J,{arrayPosition:$===0?"fst":$===2?"lst":"mid",parser:Q.parser,props:e0.fromObject({formatter:tC(Q.colorType),keyScale:S$(!1),pointerScale:Q.colorType==="float"?0.01:1}),value:p9(0,{constraint:eC(Q.colorMode,Q.colorType,$)}),viewProps:Q.viewProps})}function QP(J,Q){let $={colorMode:Q.colorMode,colorType:Q.colorType,parser:UQ,viewProps:Q.viewProps};return[0,1,2].map((Z)=>{let K=JP(J,$,Z);return b6({primary:Q.value,secondary:K.value,forward(W){return G8(W,Q.colorType).getComponents(Q.colorMode)[Z]},backward(W,H){let U=Q.colorMode,X=G8(W,Q.colorType).getComponents(U);X[Z]=H;let F=OX(_H(y7(X),X[3]),U,Q.colorType);return G8(F,"int")}}),K})}function $P(J,Q){let $=new j6(J,{parser:OK("int"),props:e0.fromObject({formatter:FX}),value:p9(B9.black()),viewProps:Q.viewProps});return b6({primary:Q.value,secondary:$.value,forward:(Z)=>new B9(y7(Z.getComponents()),Z.mode),backward:(Z,K)=>new B9(_H(y7(K.getComponents(Z.mode)),Z.getComponents()[3]),Z.mode)}),[$]}function ZP(J){return J!=="hex"}class mR{constructor(J,Q){this.onModeSelectChange_=this.onModeSelectChange_.bind(this),this.colorType_=Q.colorType,this.value=Q.value,this.viewProps=Q.viewProps,this.colorMode=p9(this.value.rawValue.mode),this.ccs_=this.createComponentControllers_(J),this.view=new dR(J,{mode:this.colorMode,inputViews:[this.ccs_[0].view,this.ccs_[1].view,this.ccs_[2].view],viewProps:this.viewProps}),this.view.modeSelectElement.addEventListener("change",this.onModeSelectChange_)}createComponentControllers_(J){let Q=this.colorMode.rawValue;if(ZP(Q))return QP(J,{colorMode:Q,colorType:this.colorType_,value:this.value,viewProps:this.viewProps});return $P(J,{value:this.value,viewProps:this.viewProps})}onModeSelectChange_(J){let Q=J.currentTarget;this.colorMode.rawValue=Q.value,this.ccs_=this.createComponentControllers_(this.view.element.ownerDocument),this.view.inputViews=this.ccs_.map(($)=>$.view)}}var vG=F9("hpl");class cR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),this.value=Q.value,this.value.emitter.on("change",this.onValueChange_),this.element=J.createElement("div"),this.element.classList.add(vG()),Q.viewProps.bindClassModifiers(this.element),Q.viewProps.bindTabIndex(this.element);let $=J.createElement("div");$.classList.add(vG("c")),this.element.appendChild($);let Z=J.createElement("div");Z.classList.add(vG("m")),this.element.appendChild(Z),this.markerElem_=Z,this.update_()}update_(){let J=this.value.rawValue,[Q]=J.getComponents("hsv");this.markerElem_.style.backgroundColor=xR(new B9([Q,100,100],"hsv"));let $=V9(Q,0,360,0,100);this.markerElem_.style.left=`${$}%`}onValueChange_(){this.update_()}}class pR{constructor(J,Q){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.view=new cR(J,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new lQ(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(J,Q){if(!J.point)return;let $=V9(CJ(J.point.x,0,J.bounds.width),0,J.bounds.width,0,360),Z=this.value.rawValue,[,K,W,H]=Z.getComponents("hsv");this.value.setRawValue(new B9([$,K,W,H],"hsv"),Q)}onPointerDown_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerMove_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerUp_(J){this.handlePointerEvent_(J.data,{forceEmit:!0,last:!0})}onKeyDown_(J){let Q=z8(S$(!1),GQ(J));if(Q===0)return;let $=this.value.rawValue,[Z,K,W,H]=$.getComponents("hsv");this.value.setRawValue(new B9([Z+Q,K,W,H],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(J){if(z8(S$(!1),GQ(J))===0)return;this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}var gG=F9("svp"),JL=64;class lR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),this.value=Q.value,this.value.emitter.on("change",this.onValueChange_),this.element=J.createElement("div"),this.element.classList.add(gG()),Q.viewProps.bindClassModifiers(this.element),Q.viewProps.bindTabIndex(this.element);let $=J.createElement("canvas");$.height=JL,$.width=JL,$.classList.add(gG("c")),this.element.appendChild($),this.canvasElement=$;let Z=J.createElement("div");Z.classList.add(gG("m")),this.element.appendChild(Z),this.markerElem_=Z,this.update_()}update_(){let J=dE(this.canvasElement);if(!J)return;let $=this.value.rawValue.getComponents("hsv"),Z=this.canvasElement.width,K=this.canvasElement.height,W=J.getImageData(0,0,Z,K),H=W.data;for(let X=0;X$.getComponents()[3],backward:($,Z)=>{let K=$.getComponents();return K[3]=Z,new B9(K,$.mode)}});this.textsC_=new mR(J,{colorType:Q.colorType,value:this.value,viewProps:this.viewProps}),this.view=new AR(J,{alphaViews:this.alphaIcs_?{palette:this.alphaIcs_.palette.view,text:this.alphaIcs_.text.view}:null,hPaletteView:this.hPaletteC_.view,supportsAlpha:Q.supportsAlpha,svPaletteView:this.svPaletteC_.view,textsView:this.textsC_.view,viewProps:this.viewProps})}get textsController(){return this.textsC_}}var uG=F9("colsw");class sR{constructor(J,Q){this.onValueChange_=this.onValueChange_.bind(this),Q.value.emitter.on("change",this.onValueChange_),this.value=Q.value,this.element=J.createElement("div"),this.element.classList.add(uG()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(uG("sw")),this.element.appendChild($),this.swatchElem_=$;let Z=J.createElement("button");Z.classList.add(uG("b")),Q.viewProps.bindDisabled(Z),this.element.appendChild(Z),this.buttonElement=Z,this.update_()}update_(){let J=this.value.rawValue;this.swatchElem_.style.backgroundColor=DX(J)}onValueChange_(){this.update_()}}class iR{constructor(J,Q){this.value=Q.value,this.viewProps=Q.viewProps,this.view=new sR(J,{value:this.value,viewProps:this.viewProps})}}class wH{constructor(J,Q){this.onButtonBlur_=this.onButtonBlur_.bind(this),this.onButtonClick_=this.onButtonClick_.bind(this),this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.foldable_=XK.create(Q.expanded),this.swatchC_=new iR(J,{value:this.value,viewProps:this.viewProps});let $=this.swatchC_.view.buttonElement;$.addEventListener("blur",this.onButtonBlur_),$.addEventListener("click",this.onButtonClick_),this.textC_=new j6(J,{parser:Q.parser,props:e0.fromObject({formatter:Q.formatter}),value:this.value,viewProps:this.viewProps}),this.view=new MR(J,{foldable:this.foldable_,pickerLayout:Q.pickerLayout}),this.view.swatchElement.appendChild(this.swatchC_.view.element),this.view.textElement.appendChild(this.textC_.view.element),this.popC_=Q.pickerLayout==="popup"?new YX(J,{viewProps:this.viewProps}):null;let Z=new oR(J,{colorType:Q.colorType,supportsAlpha:Q.supportsAlpha,value:this.value,viewProps:this.viewProps});if(Z.view.allFocusableElements.forEach((K)=>{K.addEventListener("blur",this.onPopupChildBlur_),K.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=Z,this.popC_)this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(Z.view.element),b6({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:(K)=>K,backward:(K,W)=>W});else if(this.view.pickerElement)this.view.pickerElement.appendChild(this.pickerC_.view.element),UX(this.foldable_,this.view.pickerElement)}get textController(){return this.textC_}onButtonBlur_(J){if(!this.popC_)return;let Q=this.view.element,$=V8(J.relatedTarget);if(!$||!Q.contains($))this.popC_.shows.rawValue=!1}onButtonClick_(){if(this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded"))this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(J){if(!this.popC_)return;let Q=this.popC_.view.element,$=xL(J);if($&&Q.contains($))return;if($&&$===this.swatchC_.view.buttonElement&&!JX(Q.ownerDocument))return;this.popC_.shows.rawValue=!1}onPopupChildKeydown_(J){if(this.popC_){if(J.key==="Escape")this.popC_.shows.rawValue=!1}else if(this.view.pickerElement){if(J.key==="Escape")this.swatchC_.view.buttonElement.focus()}}}function KP(J){return y7(J.getComponents("rgb")).reduce((Q,$)=>{return Q<<8|Math.floor($)&255},0)}function WP(J){return J.getComponents("rgb").reduce((Q,$,Z)=>{let K=Math.floor(Z===3?$*255:$)&255;return Q<<8|K},0)>>>0}function HP(J){return new B9([J>>16&255,J>>8&255,J&255],"rgb")}function UP(J){return new B9([J>>24&255,J>>16&255,J>>8&255,V9(J&255,0,255,0,1)],"rgb")}function qP(J){if(typeof J!=="number")return B9.black();return HP(J)}function GP(J){if(typeof J!=="number")return B9.black();return UP(J)}function MH(J,Q){if(typeof J!=="object"||f9(J))return!1;return Q in J&&typeof J[Q]==="number"}function rR(J){return MH(J,"r")&&MH(J,"g")&&MH(J,"b")}function aR(J){return rR(J)&&MH(J,"a")}function tR(J){return rR(J)}function LX(J,Q){if(J.mode!==Q.mode)return!1;if(J.type!==Q.type)return!1;let $=J.getComponents(),Z=Q.getComponents();for(let K=0;K<$.length;K++)if($[K]!==Z[K])return!1;return!0}function QL(J){return"a"in J?[J.r,J.g,J.b,J.a]:[J.r,J.g,J.b]}function XP(J){let Q=vR(J);return Q?($,Z)=>{NK($,Q(Z))}:null}function YP(J){let Q=J?WP:KP;return($,Z)=>{NK($,Q(Z))}}function NP(J,Q,$){let K=G8(Q,$).toRgbaObject();J.writeProperty("r",K.r),J.writeProperty("g",K.g),J.writeProperty("b",K.b),J.writeProperty("a",K.a)}function OP(J,Q,$){let K=G8(Q,$).toRgbaObject();J.writeProperty("r",K.r),J.writeProperty("g",K.g),J.writeProperty("b",K.b)}function FP(J,Q){return($,Z)=>{if(J)NP($,Z,Q);else OP($,Z,Q)}}function DP(J){var Q;if((Q=J===null||J===void 0?void 0:J.color)===null||Q===void 0?void 0:Q.alpha)return!0;return!1}function LP(J){return J?(Q)=>DX(Q,"0x"):(Q)=>FX(Q,"0x")}function RP(J){if("color"in J)return!0;if(J.view==="color")return!0;return!1}var BP=X8({id:"input-color-number",type:"input",accept:(J,Q)=>{if(typeof J!=="number")return null;if(!RP(Q))return null;let $=NX(Q);return $?{initialValue:J,params:Object.assign(Object.assign({},$),{supportsAlpha:DP(Q)})}:null},binding:{reader:(J)=>{return J.params.supportsAlpha?GP:qP},equals:LX,writer:(J)=>{return YP(J.params.supportsAlpha)}},controller:(J)=>{var Q,$;return new wH(J.document,{colorType:"int",expanded:(Q=J.params.expanded)!==null&&Q!==void 0?Q:!1,formatter:LP(J.params.supportsAlpha),parser:OK("int"),pickerLayout:($=J.params.picker)!==null&&$!==void 0?$:"popup",supportsAlpha:J.params.supportsAlpha,value:J.value,viewProps:J.viewProps})}});function MP(J,Q){if(!tR(J))return G8(B9.black(),Q);if(Q==="int"){let $=QL(J);return new B9($,"rgb")}if(Q==="float"){let $=QL(J);return new yH($,"rgb")}return G8(B9.black(),"int")}function zP(J){return aR(J)}function kP(J){return(Q)=>{let $=MP(Q,J);return G8($,"int")}}function VP(J,Q){return($)=>{if(J)return bR($,Q);return fR($,Q)}}var AP=X8({id:"input-color-object",type:"input",accept:(J,Q)=>{var $;if(!tR(J))return null;let Z=NX(Q);return Z?{initialValue:J,params:Object.assign(Object.assign({},Z),{colorType:($=IR(Q))!==null&&$!==void 0?$:"int"})}:null},binding:{reader:(J)=>kP(J.params.colorType),equals:LX,writer:(J)=>FP(zP(J.initialValue),J.params.colorType)},controller:(J)=>{var Q,$;let Z=aR(J.initialValue);return new wH(J.document,{colorType:J.params.colorType,expanded:(Q=J.params.expanded)!==null&&Q!==void 0?Q:!1,formatter:VP(Z,J.params.colorType),parser:OK("int"),pickerLayout:($=J.params.picker)!==null&&$!==void 0?$:"popup",supportsAlpha:Z,value:J.value,viewProps:J.viewProps})}}),IP=X8({id:"input-color-string",type:"input",accept:(J,Q)=>{if(typeof J!=="string")return null;if(Q.view==="text")return null;let $=pC(J,IR(Q));if(!$)return null;let Z=vR($);if(!Z)return null;let K=NX(Q);return K?{initialValue:J,params:Object.assign(Object.assign({},K),{format:$,stringifier:Z})}:null},binding:{reader:()=>lC,equals:LX,writer:(J)=>{let Q=XP(J.params.format);if(!Q)throw KJ.notBindable();return Q}},controller:(J)=>{var Q,$;return new wH(J.document,{colorType:J.params.format.type,expanded:(Q=J.params.expanded)!==null&&Q!==void 0?Q:!1,formatter:J.params.stringifier,parser:OK("int"),pickerLayout:($=J.params.picker)!==null&&$!==void 0?$:"popup",supportsAlpha:J.params.format.alpha,value:J.value,viewProps:J.viewProps})}});class hH{constructor(J){this.components=J.components,this.asm_=J.assembly}constrain(J){let Q=this.asm_.toComponents(J).map(($,Z)=>{var K,W;return(W=(K=this.components[Z])===null||K===void 0?void 0:K.constrain($))!==null&&W!==void 0?W:$});return this.asm_.fromComponents(Q)}}var $L=F9("pndtxt");class eR{constructor(J,Q){this.textViews=Q.textViews,this.element=J.createElement("div"),this.element.classList.add($L()),this.textViews.forEach(($)=>{let Z=J.createElement("div");Z.classList.add($L("a")),Z.appendChild($.element),this.element.appendChild(Z)})}}function EP(J,Q,$){return new v6(J,{arrayPosition:$===0?"fst":$===Q.axes.length-1?"lst":"mid",parser:Q.parser,props:Q.axes[$].textProps,value:p9(0,{constraint:Q.axes[$].constraint}),viewProps:Q.viewProps})}class xH{constructor(J,Q){this.value=Q.value,this.viewProps=Q.viewProps,this.acs_=Q.axes.map(($,Z)=>EP(J,Q,Z)),this.acs_.forEach(($,Z)=>{b6({primary:this.value,secondary:$.value,forward:(K)=>Q.assembly.toComponents(K)[Z],backward:(K,W)=>{let H=Q.assembly.toComponents(K);return H[Z]=W,Q.assembly.fromComponents(H)}})}),this.view=new eR(J,{textViews:this.acs_.map(($)=>$.view)})}get textControllers(){return this.acs_}}class JB extends P6{get max(){return this.controller.valueController.sliderController.props.get("max")}set max(J){this.controller.valueController.sliderController.props.set("max",J)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(J){this.controller.valueController.sliderController.props.set("min",J)}}function CP(J,Q){let $=[],Z=IL(J,Q);if(Z)$.push(Z);let K=EL(J);if(K)$.push(K);let W=XX(J.options);if(W)$.push(W);return new x6($)}var PP=X8({id:"input-number",type:"input",accept:(J,Q)=>{if(typeof J!=="number")return null;let $=r9(Q,(Z)=>Object.assign(Object.assign({},PL(Z)),{options:Z.optional.custom(YK),readonly:Z.optional.constant(!1)}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>zL,constraint:(J)=>CP(J.params,J.initialValue),writer:(J)=>NK},controller:(J)=>{let{value:Q,constraint:$}=J,Z=$&&IH($,f6);if(Z)return new qQ(J.document,{props:new e0({options:Z.values.value("options")}),value:Q,viewProps:J.viewProps});let K=CL(J.params,Q.rawValue),W=$&&IH($,S6);if(W)return new HK(J.document,Object.assign(Object.assign({},FR(Object.assign(Object.assign({},K),{keyScale:p9(K.keyScale),max:W.values.value("max"),min:W.values.value("min")}))),{parser:UQ,value:Q,viewProps:J.viewProps}));return new v6(J.document,{parser:UQ,props:e0.fromObject(K),value:Q,viewProps:J.viewProps})},api(J){if(typeof J.controller.value.rawValue!=="number")return null;if(J.controller.valueController instanceof HK)return new JB(J.controller);if(J.controller.valueController instanceof qQ)return new SH(J.controller);return null}});class HQ{constructor(J=0,Q=0){this.x=J,this.y=Q}getComponents(){return[this.x,this.y]}static isObject(J){if(f9(J))return!1;let{x:Q,y:$}=J;if(typeof Q!=="number"||typeof $!=="number")return!1;return!0}static equals(J,Q){return J.x===Q.x&&J.y===Q.y}toObject(){return{x:this.x,y:this.y}}}var QB={toComponents:(J)=>J.getComponents(),fromComponents:(J)=>new HQ(...J)},C6=F9("p2d");class $B{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(C6()),Q.viewProps.bindClassModifiers(this.element),WQ(Q.expanded,y6(this.element,C6(void 0,"expanded")));let $=J.createElement("div");$.classList.add(C6("h")),this.element.appendChild($);let Z=J.createElement("button");Z.classList.add(C6("b")),Z.appendChild(CH(J,"p2dpad")),Q.viewProps.bindDisabled(Z),$.appendChild(Z),this.buttonElement=Z;let K=J.createElement("div");if(K.classList.add(C6("t")),$.appendChild(K),this.textElement=K,Q.pickerLayout==="inline"){let W=J.createElement("div");W.classList.add(C6("p")),this.element.appendChild(W),this.pickerElement=W}else this.pickerElement=null}}var uQ=F9("p2dp");class ZB{constructor(J,Q){if(this.onFoldableChange_=this.onFoldableChange_.bind(this),this.onPropsChange_=this.onPropsChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.props_=Q.props,this.props_.emitter.on("change",this.onPropsChange_),this.element=J.createElement("div"),this.element.classList.add(uQ()),Q.layout==="popup")this.element.classList.add(uQ(void 0,"p"));Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("div");$.classList.add(uQ("p")),Q.viewProps.bindTabIndex($),this.element.appendChild($),this.padElement=$;let Z=J.createElementNS(S7,"svg");Z.classList.add(uQ("g")),this.padElement.appendChild(Z),this.svgElem_=Z;let K=J.createElementNS(S7,"line");K.classList.add(uQ("ax")),K.setAttributeNS(null,"x1","0"),K.setAttributeNS(null,"y1","50%"),K.setAttributeNS(null,"x2","100%"),K.setAttributeNS(null,"y2","50%"),this.svgElem_.appendChild(K);let W=J.createElementNS(S7,"line");W.classList.add(uQ("ax")),W.setAttributeNS(null,"x1","50%"),W.setAttributeNS(null,"y1","0"),W.setAttributeNS(null,"x2","50%"),W.setAttributeNS(null,"y2","100%"),this.svgElem_.appendChild(W);let H=J.createElementNS(S7,"line");H.classList.add(uQ("l")),H.setAttributeNS(null,"x1","50%"),H.setAttributeNS(null,"y1","50%"),this.svgElem_.appendChild(H),this.lineElem_=H;let U=J.createElement("div");U.classList.add(uQ("m")),this.padElement.appendChild(U),this.markerElem_=U,Q.value.emitter.on("change",this.onValueChange_),this.value=Q.value,this.update_()}get allFocusableElements(){return[this.padElement]}update_(){let[J,Q]=this.value.rawValue.getComponents(),$=this.props_.get("max"),Z=V9(J,-$,+$,0,100),K=V9(Q,-$,+$,0,100),W=this.props_.get("invertsY")?100-K:K;this.lineElem_.setAttributeNS(null,"x2",`${Z}%`),this.lineElem_.setAttributeNS(null,"y2",`${W}%`),this.markerElem_.style.left=`${Z}%`,this.markerElem_.style.top=`${W}%`}onValueChange_(){this.update_()}onPropsChange_(){this.update_()}onFoldableChange_(){this.update_()}}function ZL(J,Q,$){return[z8(Q[0],GQ(J)),z8(Q[1],WK(J))*($?1:-1)]}class KB{constructor(J,Q){this.onPadKeyDown_=this.onPadKeyDown_.bind(this),this.onPadKeyUp_=this.onPadKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.props=Q.props,this.value=Q.value,this.viewProps=Q.viewProps,this.view=new ZB(J,{layout:Q.layout,props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new lQ(this.view.padElement),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.padElement.addEventListener("keydown",this.onPadKeyDown_),this.view.padElement.addEventListener("keyup",this.onPadKeyUp_)}handlePointerEvent_(J,Q){if(!J.point)return;let $=this.props.get("max"),Z=V9(J.point.x,0,J.bounds.width,-$,+$),K=V9(this.props.get("invertsY")?J.bounds.height-J.point.y:J.point.y,0,J.bounds.height,-$,+$);this.value.setRawValue(new HQ(Z,K),Q)}onPointerDown_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerMove_(J){this.handlePointerEvent_(J.data,{forceEmit:!1,last:!1})}onPointerUp_(J){this.handlePointerEvent_(J.data,{forceEmit:!0,last:!0})}onPadKeyDown_(J){if(GR(J.key))J.preventDefault();let[Q,$]=ZL(J,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));if(Q===0&&$===0)return;this.value.setRawValue(new HQ(this.value.rawValue.x+Q,this.value.rawValue.y+$),{forceEmit:!1,last:!1})}onPadKeyUp_(J){let[Q,$]=ZL(J,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));if(Q===0&&$===0)return;this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}class WB{constructor(J,Q){var $,Z;this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.onPadButtonBlur_=this.onPadButtonBlur_.bind(this),this.onPadButtonClick_=this.onPadButtonClick_.bind(this),this.value=Q.value,this.viewProps=Q.viewProps,this.foldable_=XK.create(Q.expanded),this.popC_=Q.pickerLayout==="popup"?new YX(J,{viewProps:this.viewProps}):null;let K=new KB(J,{layout:Q.pickerLayout,props:new e0({invertsY:p9(Q.invertsY),max:p9(Q.max),xKeyScale:Q.axes[0].textProps.value("keyScale"),yKeyScale:Q.axes[1].textProps.value("keyScale")}),value:this.value,viewProps:this.viewProps});if(K.view.allFocusableElements.forEach((W)=>{W.addEventListener("blur",this.onPopupChildBlur_),W.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=K,this.textC_=new xH(J,{assembly:QB,axes:Q.axes,parser:Q.parser,value:this.value,viewProps:this.viewProps}),this.view=new $B(J,{expanded:this.foldable_.value("expanded"),pickerLayout:Q.pickerLayout,viewProps:this.viewProps}),this.view.textElement.appendChild(this.textC_.view.element),($=this.view.buttonElement)===null||$===void 0||$.addEventListener("blur",this.onPadButtonBlur_),(Z=this.view.buttonElement)===null||Z===void 0||Z.addEventListener("click",this.onPadButtonClick_),this.popC_)this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(this.pickerC_.view.element),b6({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:(W)=>W,backward:(W,H)=>H});else if(this.view.pickerElement)this.view.pickerElement.appendChild(this.pickerC_.view.element),UX(this.foldable_,this.view.pickerElement)}get textController(){return this.textC_}onPadButtonBlur_(J){if(!this.popC_)return;let Q=this.view.element,$=V8(J.relatedTarget);if(!$||!Q.contains($))this.popC_.shows.rawValue=!1}onPadButtonClick_(){if(this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded"))this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(J){if(!this.popC_)return;let Q=this.popC_.view.element,$=xL(J);if($&&Q.contains($))return;if($&&$===this.view.buttonElement&&!JX(Q.ownerDocument))return;this.popC_.shows.rawValue=!1}onPopupChildKeydown_(J){if(this.popC_){if(J.key==="Escape")this.popC_.shows.rawValue=!1}else if(this.view.pickerElement){if(J.key==="Escape")this.view.buttonElement.focus()}}}function jP(J){return HQ.isObject(J)?new HQ(J.x,J.y):new HQ}function TP(J,Q){J.writeProperty("x",Q.x),J.writeProperty("y",Q.y)}function SP(J,Q){return new hH({assembly:QB,components:[KQ(Object.assign(Object.assign({},J),J.x),Q.x),KQ(Object.assign(Object.assign({},J),J.y),Q.y)]})}function KL(J,Q){var $,Z;if(!f9(J.min)||!f9(J.max))return Math.max(Math.abs(($=J.min)!==null&&$!==void 0?$:0),Math.abs((Z=J.max)!==null&&Z!==void 0?Z:0));let K=VL(J);return Math.max(Math.abs(K)*10,Math.abs(Q)*10)}function _P(J,Q){var $,Z;let K=KL(T$(J,($=J.x)!==null&&$!==void 0?$:{}),Q.x),W=KL(T$(J,(Z=J.y)!==null&&Z!==void 0?Z:{}),Q.y);return Math.max(K,W)}function yP(J){if(!("y"in J))return!1;let Q=J.y;if(!Q)return!1;return"inverted"in Q?!!Q.inverted:!1}var wP=X8({id:"input-point2d",type:"input",accept:(J,Q)=>{if(!HQ.isObject(J))return null;let $=r9(Q,(Z)=>Object.assign(Object.assign({},UK(Z)),{expanded:Z.optional.boolean,picker:Z.optional.custom(LR),readonly:Z.optional.constant(!1),x:Z.optional.custom(mQ),y:Z.optional.object(Object.assign(Object.assign({},UK(Z)),{inverted:Z.optional.boolean}))}));return $?{initialValue:J,params:$}:null},binding:{reader:()=>jP,constraint:(J)=>SP(J.params,J.initialValue),equals:HQ.equals,writer:()=>TP},controller:(J)=>{var Q,$;let{document:Z,value:K,constraint:W}=J,H=[J.params.x,J.params.y];return new WB(Z,{axes:K.rawValue.getComponents().map((U,q)=>{var X;return eG({constraint:W.components[q],initialValue:U,params:T$(J.params,(X=H[q])!==null&&X!==void 0?X:{})})}),expanded:(Q=J.params.expanded)!==null&&Q!==void 0?Q:!1,invertsY:yP(J.params),max:_P(J.params,K.rawValue),parser:UQ,pickerLayout:($=J.params.picker)!==null&&$!==void 0?$:"popup",value:K,viewProps:J.viewProps})}});class P${constructor(J=0,Q=0,$=0){this.x=J,this.y=Q,this.z=$}getComponents(){return[this.x,this.y,this.z]}static isObject(J){if(f9(J))return!1;let{x:Q,y:$,z:Z}=J;if(typeof Q!=="number"||typeof $!=="number"||typeof Z!=="number")return!1;return!0}static equals(J,Q){return J.x===Q.x&&J.y===Q.y&&J.z===Q.z}toObject(){return{x:this.x,y:this.y,z:this.z}}}var HB={toComponents:(J)=>J.getComponents(),fromComponents:(J)=>new P$(...J)};function hP(J){return P$.isObject(J)?new P$(J.x,J.y,J.z):new P$}function xP(J,Q){J.writeProperty("x",Q.x),J.writeProperty("y",Q.y),J.writeProperty("z",Q.z)}function fP(J,Q){return new hH({assembly:HB,components:[KQ(Object.assign(Object.assign({},J),J.x),Q.x),KQ(Object.assign(Object.assign({},J),J.y),Q.y),KQ(Object.assign(Object.assign({},J),J.z),Q.z)]})}var bP=X8({id:"input-point3d",type:"input",accept:(J,Q)=>{if(!P$.isObject(J))return null;let $=r9(Q,(Z)=>Object.assign(Object.assign({},UK(Z)),{readonly:Z.optional.constant(!1),x:Z.optional.custom(mQ),y:Z.optional.custom(mQ),z:Z.optional.custom(mQ)}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>hP,constraint:(J)=>fP(J.params,J.initialValue),equals:P$.equals,writer:(J)=>xP},controller:(J)=>{let{value:Q,constraint:$}=J,Z=[J.params.x,J.params.y,J.params.z];return new xH(J.document,{assembly:HB,axes:Q.rawValue.getComponents().map((K,W)=>{var H;return eG({constraint:$.components[W],initialValue:K,params:T$(J.params,(H=Z[W])!==null&&H!==void 0?H:{})})}),parser:UQ,value:Q,viewProps:J.viewProps})}});class j${constructor(J=0,Q=0,$=0,Z=0){this.x=J,this.y=Q,this.z=$,this.w=Z}getComponents(){return[this.x,this.y,this.z,this.w]}static isObject(J){if(f9(J))return!1;let{x:Q,y:$,z:Z,w:K}=J;if(typeof Q!=="number"||typeof $!=="number"||typeof Z!=="number"||typeof K!=="number")return!1;return!0}static equals(J,Q){return J.x===Q.x&&J.y===Q.y&&J.z===Q.z&&J.w===Q.w}toObject(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}var UB={toComponents:(J)=>J.getComponents(),fromComponents:(J)=>new j$(...J)};function vP(J){return j$.isObject(J)?new j$(J.x,J.y,J.z,J.w):new j$}function gP(J,Q){J.writeProperty("x",Q.x),J.writeProperty("y",Q.y),J.writeProperty("z",Q.z),J.writeProperty("w",Q.w)}function uP(J,Q){return new hH({assembly:UB,components:[KQ(Object.assign(Object.assign({},J),J.x),Q.x),KQ(Object.assign(Object.assign({},J),J.y),Q.y),KQ(Object.assign(Object.assign({},J),J.z),Q.z),KQ(Object.assign(Object.assign({},J),J.w),Q.w)]})}var dP=X8({id:"input-point4d",type:"input",accept:(J,Q)=>{if(!j$.isObject(J))return null;let $=r9(Q,(Z)=>Object.assign(Object.assign({},UK(Z)),{readonly:Z.optional.constant(!1),w:Z.optional.custom(mQ),x:Z.optional.custom(mQ),y:Z.optional.custom(mQ),z:Z.optional.custom(mQ)}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>vP,constraint:(J)=>uP(J.params,J.initialValue),equals:j$.equals,writer:(J)=>gP},controller:(J)=>{let{value:Q,constraint:$}=J,Z=[J.params.x,J.params.y,J.params.z,J.params.w];return new xH(J.document,{assembly:UB,axes:Q.rawValue.getComponents().map((K,W)=>{var H;return eG({constraint:$.components[W],initialValue:K,params:T$(J.params,(H=Z[W])!==null&&H!==void 0?H:{})})}),parser:UQ,value:Q,viewProps:J.viewProps})}});function mP(J){let Q=[],$=XX(J.options);if($)Q.push($);return new x6(Q)}var cP=X8({id:"input-string",type:"input",accept:(J,Q)=>{if(typeof J!=="string")return null;let $=r9(Q,(Z)=>({readonly:Z.optional.constant(!1),options:Z.optional.custom(YK)}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>qR,constraint:(J)=>mP(J.params),writer:(J)=>NK},controller:(J)=>{let{document:Q,value:$,constraint:Z}=J,K=Z&&IH(Z,f6);if(K)return new qQ(Q,{props:new e0({options:K.values.value("options")}),value:$,viewProps:J.viewProps});return new j6(Q,{parser:(W)=>W,props:e0.fromObject({formatter:nG}),value:$,viewProps:J.viewProps})},api(J){if(typeof J.controller.value.rawValue!=="string")return null;if(J.controller.valueController instanceof qQ)return new SH(J.controller);return null}}),FK={monitor:{defaultInterval:200,defaultRows:3}},WL=F9("mll");class qB{constructor(J,Q){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=Q.formatter,this.element=J.createElement("div"),this.element.classList.add(WL()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("textarea");$.classList.add(WL("i")),$.style.height=`calc(var(${DR("containerUnitSize")}) * ${Q.rows})`,$.readOnly=!0,Q.viewProps.bindDisabled($),this.element.appendChild($),this.textareaElem_=$,Q.value.emitter.on("change",this.onValueUpdate_),this.value=Q.value,this.update_()}update_(){let J=this.textareaElem_,Q=J.scrollTop===J.scrollHeight-J.clientHeight,$=[];if(this.value.rawValue.forEach((Z)=>{if(Z!==void 0)$.push(this.formatter_(Z))}),J.textContent=$.join(` `),Q)J.scrollTop=J.scrollHeight}onValueUpdate_(){this.update_()}}class fH{constructor(J,Q){this.value=Q.value,this.viewProps=Q.viewProps,this.view=new qB(J,{formatter:Q.formatter,rows:Q.rows,value:this.value,viewProps:this.viewProps})}}var HL=F9("sgl");class GB{constructor(J,Q){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=Q.formatter,this.element=J.createElement("div"),this.element.classList.add(HL()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("input");$.classList.add(HL("i")),$.readOnly=!0,$.type="text",Q.viewProps.bindDisabled($),this.element.appendChild($),this.inputElement=$,Q.value.emitter.on("change",this.onValueUpdate_),this.value=Q.value,this.update_()}update_(){let J=this.value.rawValue,Q=J[J.length-1];this.inputElement.value=Q!==void 0?this.formatter_(Q):""}onValueUpdate_(){this.update_()}}class bH{constructor(J,Q){this.value=Q.value,this.viewProps=Q.viewProps,this.view=new GB(J,{formatter:Q.formatter,value:this.value,viewProps:this.viewProps})}}var pP=X8({id:"monitor-bool",type:"monitor",accept:(J,Q)=>{if(typeof J!=="boolean")return null;let $=r9(Q,(Z)=>({readonly:Z.required.constant(!0),rows:Z.optional.number}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>UR},controller:(J)=>{var Q;if(J.value.rawValue.length===1)return new bH(J.document,{formatter:rD,value:J.value,viewProps:J.viewProps});return new fH(J.document,{formatter:rD,rows:(Q=J.params.rows)!==null&&Q!==void 0?Q:FK.monitor.defaultRows,value:J.value,viewProps:J.viewProps})}});class XB extends P6{get max(){return this.controller.valueController.props.get("max")}set max(J){this.controller.valueController.props.set("max",J)}get min(){return this.controller.valueController.props.get("min")}set min(J){this.controller.valueController.props.set("min",J)}}var dQ=F9("grl");class YB{constructor(J,Q){this.onCursorChange_=this.onCursorChange_.bind(this),this.onValueUpdate_=this.onValueUpdate_.bind(this),this.element=J.createElement("div"),this.element.classList.add(dQ()),Q.viewProps.bindClassModifiers(this.element),this.formatter_=Q.formatter,this.props_=Q.props,this.cursor_=Q.cursor,this.cursor_.emitter.on("change",this.onCursorChange_);let $=J.createElementNS(S7,"svg");$.classList.add(dQ("g")),$.style.height=`calc(var(${DR("containerUnitSize")}) * ${Q.rows})`,this.element.appendChild($),this.svgElem_=$;let Z=J.createElementNS(S7,"polyline");this.svgElem_.appendChild(Z),this.lineElem_=Z;let K=J.createElement("div");K.classList.add(dQ("t"),F9("tt")()),this.element.appendChild(K),this.tooltipElem_=K,Q.value.emitter.on("change",this.onValueUpdate_),this.value=Q.value,this.update_()}get graphElement(){return this.svgElem_}update_(){let{clientWidth:J,clientHeight:Q}=this.element,$=this.value.rawValue.length-1,Z=this.props_.get("min"),K=this.props_.get("max"),W=[];this.value.rawValue.forEach((F,N)=>{if(F===void 0)return;let L=V9(N,0,$,0,J),Y=V9(F,Z,K,Q,0);W.push([L,Y].join(","))}),this.lineElem_.setAttributeNS(null,"points",W.join(" "));let H=this.tooltipElem_,U=this.value.rawValue[this.cursor_.rawValue];if(U===void 0){H.classList.remove(dQ("t","a"));return}let q=V9(this.cursor_.rawValue,0,$,0,J),X=V9(U,Z,K,Q,0);if(H.style.left=`${q}px`,H.style.top=`${X}px`,H.textContent=`${this.formatter_(U)}`,!H.classList.contains(dQ("t","a")))H.classList.add(dQ("t","a"),dQ("t","in")),kH(H),H.classList.remove(dQ("t","in"))}onValueUpdate_(){this.update_()}onCursorChange_(){this.update_()}}class RX{constructor(J,Q){if(this.onGraphMouseMove_=this.onGraphMouseMove_.bind(this),this.onGraphMouseLeave_=this.onGraphMouseLeave_.bind(this),this.onGraphPointerDown_=this.onGraphPointerDown_.bind(this),this.onGraphPointerMove_=this.onGraphPointerMove_.bind(this),this.onGraphPointerUp_=this.onGraphPointerUp_.bind(this),this.props=Q.props,this.value=Q.value,this.viewProps=Q.viewProps,this.cursor_=p9(-1),this.view=new YB(J,{cursor:this.cursor_,formatter:Q.formatter,rows:Q.rows,props:this.props,value:this.value,viewProps:this.viewProps}),!JX(J))this.view.element.addEventListener("mousemove",this.onGraphMouseMove_),this.view.element.addEventListener("mouseleave",this.onGraphMouseLeave_);else{let $=new lQ(this.view.element);$.emitter.on("down",this.onGraphPointerDown_),$.emitter.on("move",this.onGraphPointerMove_),$.emitter.on("up",this.onGraphPointerUp_)}}importProps(J){return f8(J,null,(Q)=>({max:Q.required.number,min:Q.required.number}),(Q)=>{return this.props.set("max",Q.max),this.props.set("min",Q.min),!0})}exportProps(){return b8(null,{max:this.props.get("max"),min:this.props.get("min")})}onGraphMouseLeave_(){this.cursor_.rawValue=-1}onGraphMouseMove_(J){let{clientWidth:Q}=this.view.element;this.cursor_.rawValue=Math.floor(V9(J.offsetX,0,Q,0,this.value.rawValue.length))}onGraphPointerDown_(J){this.onGraphPointerMove_(J)}onGraphPointerMove_(J){if(!J.data.point){this.cursor_.rawValue=-1;return}this.cursor_.rawValue=Math.floor(V9(J.data.point.x,0,J.data.bounds.width,0,this.value.rawValue.length))}onGraphPointerUp_(){this.cursor_.rawValue=-1}}function oG(J){return!f9(J.format)?J.format:k8(2)}function lP(J){var Q;if(J.value.rawValue.length===1)return new bH(J.document,{formatter:oG(J.params),value:J.value,viewProps:J.viewProps});return new fH(J.document,{formatter:oG(J.params),rows:(Q=J.params.rows)!==null&&Q!==void 0?Q:FK.monitor.defaultRows,value:J.value,viewProps:J.viewProps})}function nP(J){var Q,$,Z;return new RX(J.document,{formatter:oG(J.params),rows:(Q=J.params.rows)!==null&&Q!==void 0?Q:FK.monitor.defaultRows,props:e0.fromObject({max:($=J.params.max)!==null&&$!==void 0?$:100,min:(Z=J.params.min)!==null&&Z!==void 0?Z:0}),value:J.value,viewProps:J.viewProps})}function UL(J){return J.view==="graph"}var oP=X8({id:"monitor-number",type:"monitor",accept:(J,Q)=>{if(typeof J!=="number")return null;let $=r9(Q,(Z)=>({format:Z.optional.function,max:Z.optional.number,min:Z.optional.number,readonly:Z.required.constant(!0),rows:Z.optional.number,view:Z.optional.string}));return $?{initialValue:J,params:$}:null},binding:{defaultBufferSize:(J)=>UL(J)?64:1,reader:(J)=>zL},controller:(J)=>{if(UL(J.params))return nP(J);return lP(J)},api:(J)=>{if(J.controller.valueController instanceof RX)return new XB(J.controller);return null}}),sP=X8({id:"monitor-string",type:"monitor",accept:(J,Q)=>{if(typeof J!=="string")return null;let $=r9(Q,(Z)=>({multiline:Z.optional.boolean,readonly:Z.required.constant(!0),rows:Z.optional.number}));return $?{initialValue:J,params:$}:null},binding:{reader:(J)=>qR},controller:(J)=>{var Q;let $=J.value;if($.rawValue.length>1||J.params.multiline)return new fH(J.document,{formatter:nG,rows:(Q=J.params.rows)!==null&&Q!==void 0?Q:FK.monitor.defaultRows,value:$,viewProps:J.viewProps});return new bH(J.document,{formatter:nG,value:$,viewProps:J.viewProps})}});class NB{constructor(){this.map_=new Map}get(J){var Q;return(Q=this.map_.get(J))!==null&&Q!==void 0?Q:null}has(J){return this.map_.has(J)}add(J,Q){return this.map_.set(J,Q),J.viewProps.handleDispose(()=>{this.map_.delete(J)}),Q}}class OB{constructor(J){this.target=J.target,this.reader_=J.reader,this.writer_=J.writer}read(){return this.reader_(this.target.read())}write(J){this.writer_(this.target,J)}inject(J){this.write(this.reader_(J))}}function iP(J,Q){var $;let Z=J.accept(Q.target.read(),Q.params);if(f9(Z))return null;let K={target:Q.target,initialValue:Z.initialValue,params:Z.params},W=r9(Q.params,(N)=>({disabled:N.optional.boolean,hidden:N.optional.boolean,label:N.optional.string,tag:N.optional.string})),H=J.binding.reader(K),U=J.binding.constraint?J.binding.constraint(K):void 0,q=new OB({reader:H,target:Q.target,writer:J.binding.writer(K)}),X=new _L(p9(H(Z.initialValue),{constraint:U,equals:J.binding.equals}),q),F=J.controller({constraint:U,document:Q.document,initialValue:Z.initialValue,params:Z.params,value:X,viewProps:XQ.create({disabled:W===null||W===void 0?void 0:W.disabled,hidden:W===null||W===void 0?void 0:W.hidden})});return new fL(Q.document,{blade:h6(),props:e0.fromObject({label:"label"in Q.params?($=W===null||W===void 0?void 0:W.label)!==null&&$!==void 0?$:null:Q.target.key}),tag:W===null||W===void 0?void 0:W.tag,value:X,valueController:F})}class FB{constructor(J){this.target=J.target,this.reader_=J.reader}read(){return this.reader_(this.target.read())}}function rP(J,Q){return Q===0?new $R:new ZR(J,Q!==null&&Q!==void 0?Q:FK.monitor.defaultInterval)}function aP(J,Q){var $,Z,K;let W=J.accept(Q.target.read(),Q.params);if(f9(W))return null;let H={target:Q.target,initialValue:W.initialValue,params:W.params},U=r9(Q.params,(L)=>({bufferSize:L.optional.number,disabled:L.optional.boolean,hidden:L.optional.boolean,interval:L.optional.number,label:L.optional.string})),q=J.binding.reader(H),X=(Z=($=U===null||U===void 0?void 0:U.bufferSize)!==null&&$!==void 0?$:J.binding.defaultBufferSize&&J.binding.defaultBufferSize(W.params))!==null&&Z!==void 0?Z:1,F=new vL({binding:new FB({reader:q,target:Q.target}),bufferSize:X,ticker:rP(Q.document,U===null||U===void 0?void 0:U.interval)}),N=J.controller({document:Q.document,params:W.params,value:F,viewProps:XQ.create({disabled:U===null||U===void 0?void 0:U.disabled,hidden:U===null||U===void 0?void 0:U.hidden})});return N.viewProps.bindDisabled(F.ticker),N.viewProps.handleDispose(()=>{F.ticker.dispose()}),new gL(Q.document,{blade:h6(),props:e0.fromObject({label:"label"in Q.params?(K=U===null||U===void 0?void 0:U.label)!==null&&K!==void 0?K:null:Q.target.key}),value:F,valueController:N})}class DB{constructor(J){this.pluginsMap_={blades:[],inputs:[],monitors:[]},this.apiCache_=J}getAll(){return[...this.pluginsMap_.blades,...this.pluginsMap_.inputs,...this.pluginsMap_.monitors]}register(J,Q){if(!BC(Q.core))throw KJ.notCompatible(J,Q.id);if(Q.type==="blade")this.pluginsMap_.blades.unshift(Q);else if(Q.type==="input")this.pluginsMap_.inputs.unshift(Q);else if(Q.type==="monitor")this.pluginsMap_.monitors.unshift(Q)}createInput_(J,Q,$){return this.pluginsMap_.inputs.reduce((Z,K)=>Z!==null&&Z!==void 0?Z:iP(K,{document:J,target:Q,params:$}),null)}createMonitor_(J,Q,$){return this.pluginsMap_.monitors.reduce((Z,K)=>Z!==null&&Z!==void 0?Z:aP(K,{document:J,params:$,target:Q}),null)}createBinding(J,Q,$){let Z=Q.read();if(f9(Z))throw new KJ({context:{key:Q.key},type:"nomatchingcontroller"});let K=this.createInput_(J,Q,$);if(K)return K;let W=this.createMonitor_(J,Q,$);if(W)return W;throw new KJ({context:{key:Q.key},type:"nomatchingcontroller"})}createBlade(J,Q){let $=this.pluginsMap_.blades.reduce((Z,K)=>Z!==null&&Z!==void 0?Z:NC(K,{document:J,params:Q}),null);if(!$)throw new KJ({type:"nomatchingview",context:{params:Q}});return $}createInputBindingApi_(J){let Q=this.pluginsMap_.inputs.reduce(($,Z)=>{var K,W;if($)return $;return(W=(K=Z.api)===null||K===void 0?void 0:K.call(Z,{controller:J}))!==null&&W!==void 0?W:null},null);return this.apiCache_.add(J,Q!==null&&Q!==void 0?Q:new P6(J))}createMonitorBindingApi_(J){let Q=this.pluginsMap_.monitors.reduce(($,Z)=>{var K,W;if($)return $;return(W=(K=Z.api)===null||K===void 0?void 0:K.call(Z,{controller:J}))!==null&&W!==void 0?W:null},null);return this.apiCache_.add(J,Q!==null&&Q!==void 0?Q:new P6(J))}createBindingApi(J){if(this.apiCache_.has(J))return this.apiCache_.get(J);if(sE(J))return this.createInputBindingApi_(J);if(eE(J))return this.createMonitorBindingApi_(J);throw KJ.shouldNeverHappen()}createApi(J){if(this.apiCache_.has(J))return this.apiCache_.get(J);if(oE(J))return this.createBindingApi(J);let Q=this.pluginsMap_.blades.reduce(($,Z)=>$!==null&&$!==void 0?$:Z.api({controller:J,pool:this}),null);if(!Q)throw KJ.shouldNeverHappen();return this.apiCache_.add(J,Q)}}var tP=new NB;function eP(){let J=new DB(tP);return[wP,bP,dP,cP,PP,IP,AP,BP,zC,pP,sP,oP,QC,XC,QR].forEach((Q)=>{J.register("core",Q)}),J}class LB extends pQ{constructor(J){super(J);this.emitter_=new OJ,this.controller.value.emitter.on("change",(Q)=>{this.emitter_.emit("change",new _6(this,Q.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(J){this.controller.labelController.props.set("label",J)}get options(){return this.controller.valueController.props.get("options")}set options(J){this.controller.valueController.props.set("options",J)}get value(){return this.controller.value.rawValue}set value(J){this.controller.value.rawValue=J}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}}class RB extends pQ{}class BB extends pQ{constructor(J){super(J);this.emitter_=new OJ,this.controller.value.emitter.on("change",(Q)=>{this.emitter_.emit("change",new _6(this,Q.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(J){this.controller.labelController.props.set("label",J)}get max(){return this.controller.valueController.sliderController.props.get("max")}set max(J){this.controller.valueController.sliderController.props.set("max",J)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(J){this.controller.valueController.sliderController.props.set("min",J)}get value(){return this.controller.value.rawValue}set value(J){this.controller.value.rawValue=J}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}}class MB extends pQ{constructor(J){super(J);this.emitter_=new OJ,this.controller.value.emitter.on("change",(Q)=>{this.emitter_.emit("change",new _6(this,Q.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(J){this.controller.labelController.props.set("label",J)}get formatter(){return this.controller.valueController.props.get("formatter")}set formatter(J){this.controller.valueController.props.set("formatter",J)}get value(){return this.controller.value.rawValue}set value(J){this.controller.value.rawValue=J}on(J,Q){let $=Q.bind(this);return this.emitter_.on(J,(Z)=>{$(Z)},{key:Q}),this}off(J,Q){return this.emitter_.off(J,Q),this}}var J3=function(){return{id:"list",type:"blade",core:w6,accept(J){let Q=r9(J,($)=>({options:$.required.custom(YK),value:$.required.raw,view:$.required.constant("list"),label:$.optional.string}));return Q?{params:Q}:null},controller(J){let Q=new f6(GX(J.params.options)),$=p9(J.params.value,{constraint:Q}),Z=new qQ(J.document,{props:new e0({options:Q.values.value("options")}),value:$,viewProps:J.viewProps});return new cQ(J.document,{blade:J.blade,props:e0.fromObject({label:J.params.label}),value:$,valueController:Z})},api(J){if(!(J.controller instanceof cQ))return null;if(!(J.controller.valueController instanceof qQ))return null;return new LB(J.controller)}}}();class zB extends qX{constructor(J,Q){super(J,Q)}get element(){return this.controller.view.element}}class kB extends VH{constructor(J,Q){super(J,{expanded:Q.expanded,blade:Q.blade,props:Q.props,root:!0,viewProps:Q.viewProps})}}var qL=F9("spr");class VB{constructor(J,Q){this.element=J.createElement("div"),this.element.classList.add(qL()),Q.viewProps.bindClassModifiers(this.element);let $=J.createElement("hr");$.classList.add(qL("r")),this.element.appendChild($)}}class sG extends GK{constructor(J,Q){super(Object.assign(Object.assign({},Q),{view:new VB(J,{viewProps:Q.viewProps})}))}}var Q3={id:"separator",type:"blade",core:w6,accept(J){let Q=r9(J,($)=>({view:$.required.constant("separator")}));return Q?{params:Q}:null},controller(J){return new sG(J.document,{blade:J.blade,viewProps:J.viewProps})},api(J){if(!(J.controller instanceof sG))return null;return new RB(J.controller)}},$3={id:"slider",type:"blade",core:w6,accept(J){let Q=r9(J,($)=>({max:$.required.number,min:$.required.number,view:$.required.constant("slider"),format:$.optional.function,label:$.optional.string,value:$.optional.number}));return Q?{params:Q}:null},controller(J){var Q,$;let Z=(Q=J.params.value)!==null&&Q!==void 0?Q:0,K=new S6({max:J.params.max,min:J.params.min}),W=p9(Z,{constraint:K}),H=new HK(J.document,Object.assign(Object.assign({},FR({formatter:($=J.params.format)!==null&&$!==void 0?$:yE,keyScale:p9(1),max:K.values.value("max"),min:K.values.value("min"),pointerScale:AL(J.params,Z)})),{parser:UQ,value:W,viewProps:J.viewProps}));return new cQ(J.document,{blade:J.blade,props:e0.fromObject({label:J.params.label}),value:W,valueController:H})},api(J){if(!(J.controller instanceof cQ))return null;if(!(J.controller.valueController instanceof HK))return null;return new BB(J.controller)}},Z3=function(){return{id:"text",type:"blade",core:w6,accept(J){let Q=r9(J,($)=>({parse:$.required.function,value:$.required.raw,view:$.required.constant("text"),format:$.optional.function,label:$.optional.string}));return Q?{params:Q}:null},controller(J){var Q;let $=p9(J.params.value),Z=new j6(J.document,{parser:J.params.parse,props:e0.fromObject({formatter:(Q=J.params.format)!==null&&Q!==void 0?Q:(K)=>String(K)}),value:$,viewProps:J.viewProps});return new cQ(J.document,{blade:J.blade,props:e0.fromObject({label:J.params.label}),value:$,valueController:Z})},api(J){if(!(J.controller instanceof cQ))return null;if(!(J.controller.valueController instanceof j6))return null;return new MB(J.controller)}}}();function K3(J){let Q=J.createElement("div");if(Q.classList.add(F9("dfw")()),J.body)J.body.appendChild(Q);return Q}function W3(J,Q,$){if(J.querySelector(`style[data-tp-style=${Q}]`))return;let Z=J.createElement("style");Z.dataset.tpStyle=Q,Z.textContent=$,J.head.appendChild(Z)}class BX extends zB{constructor(J){var Q,$;let Z=J!==null&&J!==void 0?J:{},K=(Q=Z.document)!==null&&Q!==void 0?Q:uE(),W=eP(),H=new kB(K,{expanded:Z.expanded,blade:h6(),props:e0.fromObject({title:Z.title}),viewProps:XQ.create()});super(H,W);this.pool_=W,this.containerElem_=($=Z.container)!==null&&$!==void 0?$:K3(K),this.containerElem_.appendChild(this.element),this.doc_=K,this.usesDefaultWrapper_=!Z.container,this.setUpDefaultPlugins_()}get document(){if(!this.doc_)throw KJ.alreadyDisposed();return this.doc_}dispose(){let J=this.containerElem_;if(!J)throw KJ.alreadyDisposed();if(this.usesDefaultWrapper_){let Q=J.parentElement;if(Q)Q.removeChild(J)}this.containerElem_=null,this.doc_=null,super.dispose()}registerPlugin(J){if(J.css)W3(this.document,`plugin-${J.id}`,J.css);("plugin"in J?[J.plugin]:("plugins"in J)?J.plugins:[]).forEach(($)=>{this.pool_.register(J.id,$)})}setUpDefaultPlugins_(){this.registerPlugin({id:"default",css:".tp-tbiv_b,.tp-coltxtv_ms,.tp-colswv_b,.tp-ckbv_i,.tp-sglv_i,.tp-mllv_i,.tp-grlv_g,.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw,.tp-rotv_b,.tp-fldv_b,.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:rgba(0,0,0,0);border-width:0;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0;outline:none;padding:0}.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{background-color:var(--btn-bg);border-radius:var(--bld-br);color:var(--btn-fg);cursor:pointer;display:block;font-weight:bold;height:var(--cnt-usz);line-height:var(--cnt-usz);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-p2dv_b:hover,.tp-btnv_b:hover,.tp-lstv_s:hover{background-color:var(--btn-bg-h)}.tp-p2dv_b:focus,.tp-btnv_b:focus,.tp-lstv_s:focus{background-color:var(--btn-bg-f)}.tp-p2dv_b:active,.tp-btnv_b:active,.tp-lstv_s:active{background-color:var(--btn-bg-a)}.tp-p2dv_b:disabled,.tp-btnv_b:disabled,.tp-lstv_s:disabled{opacity:.5}.tp-rotv_c>.tp-cntv.tp-v-lst,.tp-tbpv_c>.tp-cntv.tp-v-lst,.tp-fldv_c>.tp-cntv.tp-v-lst{margin-bottom:calc(-1*var(--cnt-vp))}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_c{border-bottom-left-radius:0}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_b{border-bottom-left-radius:0}.tp-rotv_c>*:not(.tp-v-fst),.tp-tbpv_c>*:not(.tp-v-fst),.tp-fldv_c>*:not(.tp-v-fst){margin-top:var(--cnt-usp)}.tp-rotv_c>.tp-sprv:not(.tp-v-fst),.tp-tbpv_c>.tp-sprv:not(.tp-v-fst),.tp-fldv_c>.tp-sprv:not(.tp-v-fst),.tp-rotv_c>.tp-cntv:not(.tp-v-fst),.tp-tbpv_c>.tp-cntv:not(.tp-v-fst),.tp-fldv_c>.tp-cntv:not(.tp-v-fst){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-rotv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-cntv+*:not(.tp-v-hidden){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-tbpv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-fldv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-rotv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-tbpv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-fldv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv{margin-top:0}.tp-tbpv_c>.tp-cntv,.tp-fldv_c>.tp-cntv{margin-left:4px}.tp-tbpv_c>.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-fldv>.tp-fldv_b{border-top-left-radius:var(--bld-br);border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b{border-bottom-left-radius:0}.tp-tbpv_c .tp-fldv>.tp-fldv_c,.tp-fldv_c .tp-fldv>.tp-fldv_c{border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-cntv+.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-cntv+.tp-fldv>.tp-fldv_b{border-top-left-radius:0}.tp-tbpv_c>.tp-cntv+.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-cntv+.tp-tabv>.tp-tabv_t{border-top-left-radius:0}.tp-tbpv_c>.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-tabv>.tp-tabv_t{border-top-left-radius:var(--bld-br)}.tp-tbpv_c .tp-tabv>.tp-tabv_c,.tp-fldv_c .tp-tabv>.tp-tabv_c{border-bottom-left-radius:var(--bld-br)}.tp-rotv_b,.tp-fldv_b{background-color:var(--cnt-bg);color:var(--cnt-fg);cursor:pointer;display:block;height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);overflow:hidden;padding-left:var(--cnt-hp);padding-right:calc(4px + var(--cnt-usz) + var(--cnt-hp));position:relative;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:border-radius .2s ease-in-out .2s}.tp-rotv_b:hover,.tp-fldv_b:hover{background-color:var(--cnt-bg-h)}.tp-rotv_b:focus,.tp-fldv_b:focus{background-color:var(--cnt-bg-f)}.tp-rotv_b:active,.tp-fldv_b:active{background-color:var(--cnt-bg-a)}.tp-rotv_b:disabled,.tp-fldv_b:disabled{opacity:.5}.tp-rotv_m,.tp-fldv_m{background:linear-gradient(to left, var(--cnt-fg), var(--cnt-fg) 2px, transparent 2px, transparent 4px, var(--cnt-fg) 4px);border-radius:2px;bottom:0;content:\"\";display:block;height:6px;right:calc(var(--cnt-hp) + (var(--cnt-usz) + 4px - 6px)/2 - 2px);margin:auto;opacity:.5;position:absolute;top:0;transform:rotate(90deg);transition:transform .2s ease-in-out;width:6px}.tp-rotv.tp-rotv-expanded .tp-rotv_m,.tp-fldv.tp-fldv-expanded>.tp-fldv_b>.tp-fldv_m{transform:none}.tp-rotv_c,.tp-fldv_c{box-sizing:border-box;height:0;opacity:0;overflow:hidden;padding-bottom:0;padding-top:0;position:relative;transition:height .2s ease-in-out,opacity .2s linear,padding .2s ease-in-out}.tp-rotv.tp-rotv-cpl:not(.tp-rotv-expanded) .tp-rotv_c,.tp-fldv.tp-fldv-cpl:not(.tp-fldv-expanded)>.tp-fldv_c{display:none}.tp-rotv.tp-rotv-expanded .tp-rotv_c,.tp-fldv.tp-fldv-expanded>.tp-fldv_c{opacity:1;padding-bottom:var(--cnt-vp);padding-top:var(--cnt-vp);transform:none;overflow:visible;transition:height .2s ease-in-out,opacity .2s linear .2s,padding .2s ease-in-out}.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw{background-color:var(--in-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--in-fg);font-family:inherit;height:var(--cnt-usz);line-height:var(--cnt-usz);min-width:0;width:100%}.tp-txtv_i:hover,.tp-p2dpv_p:hover,.tp-colswv_sw:hover{background-color:var(--in-bg-h)}.tp-txtv_i:focus,.tp-p2dpv_p:focus,.tp-colswv_sw:focus{background-color:var(--in-bg-f)}.tp-txtv_i:active,.tp-p2dpv_p:active,.tp-colswv_sw:active{background-color:var(--in-bg-a)}.tp-txtv_i:disabled,.tp-p2dpv_p:disabled,.tp-colswv_sw:disabled{opacity:.5}.tp-lstv,.tp-coltxtv_m{position:relative}.tp-lstv_s{padding:0 20px 0 4px;width:100%}.tp-lstv_m,.tp-coltxtv_mm{bottom:0;margin:auto;pointer-events:none;position:absolute;right:2px;top:0}.tp-lstv_m svg,.tp-coltxtv_mm svg{bottom:0;height:16px;margin:auto;position:absolute;right:0;top:0;width:16px}.tp-lstv_m svg path,.tp-coltxtv_mm svg path{fill:currentColor}.tp-sglv_i,.tp-mllv_i,.tp-grlv_g{background-color:var(--mo-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--mo-fg);height:var(--cnt-usz);scrollbar-color:currentColor rgba(0,0,0,0);scrollbar-width:thin;width:100%}.tp-sglv_i::-webkit-scrollbar,.tp-mllv_i::-webkit-scrollbar,.tp-grlv_g::-webkit-scrollbar{height:8px;width:8px}.tp-sglv_i::-webkit-scrollbar-corner,.tp-mllv_i::-webkit-scrollbar-corner,.tp-grlv_g::-webkit-scrollbar-corner{background-color:rgba(0,0,0,0)}.tp-sglv_i::-webkit-scrollbar-thumb,.tp-mllv_i::-webkit-scrollbar-thumb,.tp-grlv_g::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:currentColor;border:rgba(0,0,0,0) solid 2px;border-radius:4px}.tp-pndtxtv,.tp-coltxtv_w{display:flex}.tp-pndtxtv_a,.tp-coltxtv_c{width:100%}.tp-pndtxtv_a+.tp-pndtxtv_a,.tp-coltxtv_c+.tp-pndtxtv_a,.tp-pndtxtv_a+.tp-coltxtv_c,.tp-coltxtv_c+.tp-coltxtv_c{margin-left:2px}.tp-rotv{--bs-bg: var(--tp-base-background-color, hsl(230, 7%, 17%));--bs-br: var(--tp-base-border-radius, 6px);--bs-ff: var(--tp-base-font-family, Roboto Mono, Source Code Pro, Menlo, Courier, monospace);--bs-sh: var(--tp-base-shadow-color, rgba(0, 0, 0, 0.2));--bld-br: var(--tp-blade-border-radius, 2px);--bld-hp: var(--tp-blade-horizontal-padding, 4px);--bld-vw: var(--tp-blade-value-width, 160px);--btn-bg: var(--tp-button-background-color, hsl(230, 7%, 70%));--btn-bg-a: var(--tp-button-background-color-active, #d6d7db);--btn-bg-f: var(--tp-button-background-color-focus, #c8cad0);--btn-bg-h: var(--tp-button-background-color-hover, #bbbcc4);--btn-fg: var(--tp-button-foreground-color, hsl(230, 7%, 17%));--cnt-bg: var(--tp-container-background-color, rgba(187, 188, 196, 0.1));--cnt-bg-a: var(--tp-container-background-color-active, rgba(187, 188, 196, 0.25));--cnt-bg-f: var(--tp-container-background-color-focus, rgba(187, 188, 196, 0.2));--cnt-bg-h: var(--tp-container-background-color-hover, rgba(187, 188, 196, 0.15));--cnt-fg: var(--tp-container-foreground-color, hsl(230, 7%, 75%));--cnt-hp: var(--tp-container-horizontal-padding, 4px);--cnt-vp: var(--tp-container-vertical-padding, 4px);--cnt-usp: var(--tp-container-unit-spacing, 4px);--cnt-usz: var(--tp-container-unit-size, 20px);--in-bg: var(--tp-input-background-color, rgba(187, 188, 196, 0.1));--in-bg-a: var(--tp-input-background-color-active, rgba(187, 188, 196, 0.25));--in-bg-f: var(--tp-input-background-color-focus, rgba(187, 188, 196, 0.2));--in-bg-h: var(--tp-input-background-color-hover, rgba(187, 188, 196, 0.15));--in-fg: var(--tp-input-foreground-color, hsl(230, 7%, 75%));--lbl-fg: var(--tp-label-foreground-color, rgba(187, 188, 196, 0.7));--mo-bg: var(--tp-monitor-background-color, rgba(0, 0, 0, 0.2));--mo-fg: var(--tp-monitor-foreground-color, rgba(187, 188, 196, 0.7));--grv-fg: var(--tp-groove-foreground-color, rgba(187, 188, 196, 0.1))}.tp-btnv_b{width:100%}.tp-btnv_t{text-align:center}.tp-ckbv_l{display:block;position:relative}.tp-ckbv_i{left:0;opacity:0;position:absolute;top:0}.tp-ckbv_w{background-color:var(--in-bg);border-radius:var(--bld-br);cursor:pointer;display:block;height:var(--cnt-usz);position:relative;width:var(--cnt-usz)}.tp-ckbv_w svg{display:block;height:16px;inset:0;margin:auto;opacity:0;position:absolute;width:16px}.tp-ckbv_w svg path{fill:none;stroke:var(--in-fg);stroke-width:2}.tp-ckbv_i:hover+.tp-ckbv_w{background-color:var(--in-bg-h)}.tp-ckbv_i:focus+.tp-ckbv_w{background-color:var(--in-bg-f)}.tp-ckbv_i:active+.tp-ckbv_w{background-color:var(--in-bg-a)}.tp-ckbv_i:checked+.tp-ckbv_w svg{opacity:1}.tp-ckbv.tp-v-disabled .tp-ckbv_w{opacity:.5}.tp-colv{position:relative}.tp-colv_h{display:flex}.tp-colv_s{flex-grow:0;flex-shrink:0;width:var(--cnt-usz)}.tp-colv_t{flex:1;margin-left:4px}.tp-colv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-colv.tp-colv-expanded.tp-colv-cpl .tp-colv_p{overflow:visible}.tp-colv.tp-colv-expanded .tp-colv_p{margin-top:var(--cnt-usp);opacity:1}.tp-colv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-colpv_h,.tp-colpv_ap{margin-left:6px;margin-right:6px}.tp-colpv_h{margin-top:var(--cnt-usp)}.tp-colpv_rgb{display:flex;margin-top:var(--cnt-usp);width:100%}.tp-colpv_a{display:flex;margin-top:var(--cnt-vp);padding-top:calc(var(--cnt-vp) + 2px);position:relative}.tp-colpv_a::before{background-color:var(--grv-fg);content:\"\";height:2px;left:calc(-1*var(--cnt-hp));position:absolute;right:calc(-1*var(--cnt-hp));top:0}.tp-colpv.tp-v-disabled .tp-colpv_a::before{opacity:.5}.tp-colpv_ap{align-items:center;display:flex;flex:3}.tp-colpv_at{flex:1;margin-left:4px}.tp-svpv{border-radius:var(--bld-br);outline:none;overflow:hidden;position:relative}.tp-svpv.tp-v-disabled{opacity:.5}.tp-svpv_c{cursor:crosshair;display:block;height:calc(var(--cnt-usz)*4);width:100%}.tp-svpv_m{border-radius:100%;border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;filter:drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));height:12px;margin-left:-6px;margin-top:-6px;pointer-events:none;position:absolute;width:12px}.tp-svpv:focus .tp-svpv_m{border-color:#fff}.tp-hplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative}.tp-hplv.tp-v-disabled{opacity:.5}.tp-hplv_c{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAAQ0lEQVQoU2P8z8Dwn0GCgQEDi2OK/RBgYHjBgIpfovFh8j8YBIgzFGQxuqEgPhaDOT5gOhPkdCxOZeBg+IDFZZiGAgCaSSMYtcRHLgAAAABJRU5ErkJggg==);background-position:left top;background-repeat:no-repeat;background-size:100% 100%;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;position:absolute;top:50%;width:100%}.tp-hplv_m{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;height:12px;left:50%;margin-left:-6px;margin-top:-6px;position:absolute;top:50%;width:12px}.tp-hplv:focus .tp-hplv_m{border-color:#fff}.tp-aplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative;width:100%}.tp-aplv.tp-v-disabled{opacity:.5}.tp-aplv_b{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:4px 4px;background-position:0 0,2px 2px;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;overflow:hidden;position:absolute;top:50%;width:100%}.tp-aplv_c{inset:0;position:absolute}.tp-aplv_m{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:12px 12px;background-position:0 0,6px 6px;border-radius:var(--bld-br);box-shadow:0 0 2px rgba(0,0,0,.1);height:12px;left:50%;margin-left:-6px;margin-top:-6px;overflow:hidden;position:absolute;top:50%;width:12px}.tp-aplv_p{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;inset:0;position:absolute}.tp-aplv:focus .tp-aplv_p{border-color:#fff}.tp-colswv{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:10px 10px;background-position:0 0,5px 5px;border-radius:var(--bld-br);overflow:hidden}.tp-colswv.tp-v-disabled{opacity:.5}.tp-colswv_sw{border-radius:0}.tp-colswv_b{cursor:pointer;display:block;height:var(--cnt-usz);left:0;position:absolute;top:0;width:var(--cnt-usz)}.tp-colswv_b:focus::after{border:rgba(255,255,255,.75) solid 2px;border-radius:var(--bld-br);content:\"\";display:block;inset:0;position:absolute}.tp-coltxtv{display:flex;width:100%}.tp-coltxtv_m{margin-right:4px}.tp-coltxtv_ms{border-radius:var(--bld-br);color:var(--lbl-fg);cursor:pointer;height:var(--cnt-usz);line-height:var(--cnt-usz);padding:0 18px 0 4px}.tp-coltxtv_ms:hover{background-color:var(--in-bg-h)}.tp-coltxtv_ms:focus{background-color:var(--in-bg-f)}.tp-coltxtv_ms:active{background-color:var(--in-bg-a)}.tp-coltxtv_mm{color:var(--lbl-fg)}.tp-coltxtv.tp-v-disabled .tp-coltxtv_mm{opacity:.5}.tp-coltxtv_w{flex:1}.tp-dfwv{position:absolute;top:8px;right:8px;width:256px}.tp-fldv{position:relative}.tp-fldv_t{padding-left:4px}.tp-fldv_b:disabled .tp-fldv_m{display:none}.tp-fldv_c{padding-left:4px}.tp-fldv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-fldv_i::before{background-color:currentColor;bottom:0;content:\"\";left:0;position:absolute;top:0;width:4px}.tp-fldv_b:hover+.tp-fldv_i{color:var(--cnt-bg-h)}.tp-fldv_b:focus+.tp-fldv_i{color:var(--cnt-bg-f)}.tp-fldv_b:active+.tp-fldv_i{color:var(--cnt-bg-a)}.tp-fldv.tp-v-disabled>.tp-fldv_i{opacity:.5}.tp-grlv{position:relative}.tp-grlv_g{display:block;height:calc(var(--cnt-usz)*3)}.tp-grlv_g polyline{fill:none;stroke:var(--mo-fg);stroke-linejoin:round}.tp-grlv_t{margin-top:-4px;transition:left .05s,top .05s;visibility:hidden}.tp-grlv_t.tp-grlv_t-a{visibility:visible}.tp-grlv_t.tp-grlv_t-in{transition:none}.tp-grlv.tp-v-disabled .tp-grlv_g{opacity:.5}.tp-grlv .tp-ttv{background-color:var(--mo-fg)}.tp-grlv .tp-ttv::before{border-top-color:var(--mo-fg)}.tp-lblv{align-items:center;display:flex;line-height:1.3;padding-left:var(--cnt-hp);padding-right:var(--cnt-hp)}.tp-lblv.tp-lblv-nol{display:block}.tp-lblv_l{color:var(--lbl-fg);flex:1;-webkit-hyphens:auto;hyphens:auto;overflow:hidden;padding-left:4px;padding-right:16px}.tp-lblv.tp-v-disabled .tp-lblv_l{opacity:.5}.tp-lblv.tp-lblv-nol .tp-lblv_l{display:none}.tp-lblv_v{align-self:flex-start;flex-grow:0;flex-shrink:0;width:var(--bld-vw)}.tp-lblv.tp-lblv-nol .tp-lblv_v{width:100%}.tp-lstv_s{padding:0 20px 0 var(--bld-hp);width:100%}.tp-lstv_m{color:var(--btn-fg)}.tp-sglv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-sglv.tp-v-disabled .tp-sglv_i{opacity:.5}.tp-mllv_i{display:block;height:calc(var(--cnt-usz)*3);line-height:var(--cnt-usz);padding-left:var(--bld-hp);padding-right:var(--bld-hp);resize:none;white-space:pre}.tp-mllv.tp-v-disabled .tp-mllv_i{opacity:.5}.tp-p2dv{position:relative}.tp-p2dv_h{display:flex}.tp-p2dv_b{height:var(--cnt-usz);margin-right:4px;position:relative;width:var(--cnt-usz)}.tp-p2dv_b svg{display:block;height:16px;left:50%;margin-left:-8px;margin-top:-8px;position:absolute;top:50%;width:16px}.tp-p2dv_b svg path{stroke:currentColor;stroke-width:2}.tp-p2dv_b svg circle{fill:currentColor}.tp-p2dv_t{flex:1}.tp-p2dv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-p2dv.tp-p2dv-expanded .tp-p2dv_p{margin-top:var(--cnt-usp);opacity:1}.tp-p2dv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-p2dpv{padding-left:calc(var(--cnt-usz) + 4px)}.tp-p2dpv_p{cursor:crosshair;height:0;overflow:hidden;padding-bottom:100%;position:relative}.tp-p2dpv.tp-v-disabled .tp-p2dpv_p{opacity:.5}.tp-p2dpv_g{display:block;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.tp-p2dpv_ax{opacity:.1;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_l{opacity:.5;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_m{border:var(--in-fg) solid 1px;border-radius:50%;box-sizing:border-box;height:4px;margin-left:-2px;margin-top:-2px;position:absolute;width:4px}.tp-p2dpv_p:focus .tp-p2dpv_m{background-color:var(--in-fg);border-width:0}.tp-popv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);display:none;max-width:var(--bld-vw);padding:var(--cnt-vp) var(--cnt-hp);position:absolute;visibility:hidden;z-index:1000}.tp-popv.tp-popv-v{display:block;visibility:visible}.tp-sldv.tp-v-disabled{opacity:.5}.tp-sldv_t{box-sizing:border-box;cursor:pointer;height:var(--cnt-usz);margin:0 6px;outline:none;position:relative}.tp-sldv_t::before{background-color:var(--in-bg);border-radius:1px;content:\"\";display:block;height:2px;inset:0;margin:auto;position:absolute}.tp-sldv_k{height:100%;left:0;position:absolute;top:0}.tp-sldv_k::before{background-color:var(--in-fg);border-radius:1px;content:\"\";display:block;height:2px;inset:0;margin-bottom:auto;margin-top:auto;position:absolute}.tp-sldv_k::after{background-color:var(--btn-bg);border-radius:var(--bld-br);bottom:0;content:\"\";display:block;height:12px;margin-bottom:auto;margin-top:auto;position:absolute;right:-6px;top:0;width:12px}.tp-sldv_t:hover .tp-sldv_k::after{background-color:var(--btn-bg-h)}.tp-sldv_t:focus .tp-sldv_k::after{background-color:var(--btn-bg-f)}.tp-sldv_t:active .tp-sldv_k::after{background-color:var(--btn-bg-a)}.tp-sldtxtv{display:flex}.tp-sldtxtv_s{flex:2}.tp-sldtxtv_t{flex:1;margin-left:4px}.tp-tabv{position:relative}.tp-tabv_t{align-items:flex-end;color:var(--cnt-bg);display:flex;overflow:hidden;position:relative}.tp-tabv_t:hover{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus){color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active){color:var(--cnt-bg-a)}.tp-tabv_t::before{background-color:currentColor;bottom:0;content:\"\";height:2px;left:0;pointer-events:none;position:absolute;right:0}.tp-tabv.tp-v-disabled .tp-tabv_t::before{opacity:.5}.tp-tabv.tp-tabv-nop .tp-tabv_t{height:calc(var(--cnt-usz) + 4px);position:relative}.tp-tabv.tp-tabv-nop .tp-tabv_t::before{background-color:var(--cnt-bg);bottom:0;content:\"\";height:2px;left:0;position:absolute;right:0}.tp-tabv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-tabv_i::before{background-color:currentColor;bottom:0;content:\"\";left:0;position:absolute;top:0;width:4px}.tp-tabv_t:hover+.tp-tabv_i{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus)+.tp-tabv_i{color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active)+.tp-tabv_i{color:var(--cnt-bg-a)}.tp-tabv.tp-v-disabled>.tp-tabv_i{opacity:.5}.tp-tbiv{flex:1;min-width:0;position:relative}.tp-tbiv+.tp-tbiv{margin-left:2px}.tp-tbiv+.tp-tbiv.tp-v-disabled::before{opacity:.5}.tp-tbiv_b{display:block;padding-left:calc(var(--cnt-hp) + 4px);padding-right:calc(var(--cnt-hp) + 4px);position:relative;width:100%}.tp-tbiv_b:disabled{opacity:.5}.tp-tbiv_b::before{background-color:var(--cnt-bg);content:\"\";inset:0 0 2px;pointer-events:none;position:absolute}.tp-tbiv_b:hover::before{background-color:var(--cnt-bg-h)}.tp-tbiv_b:focus::before{background-color:var(--cnt-bg-f)}.tp-tbiv_b:active::before{background-color:var(--cnt-bg-a)}.tp-tbiv_t{color:var(--cnt-fg);height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);opacity:.5;overflow:hidden;position:relative;text-overflow:ellipsis}.tp-tbiv.tp-tbiv-sel .tp-tbiv_t{opacity:1}.tp-tbpv_c{padding-bottom:var(--cnt-vp);padding-left:4px;padding-top:var(--cnt-vp)}.tp-txtv{position:relative}.tp-txtv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-txtv.tp-txtv-fst .tp-txtv_i{border-bottom-right-radius:0;border-top-right-radius:0}.tp-txtv.tp-txtv-mid .tp-txtv_i{border-radius:0}.tp-txtv.tp-txtv-lst .tp-txtv_i{border-bottom-left-radius:0;border-top-left-radius:0}.tp-txtv.tp-txtv-num .tp-txtv_i{text-align:right}.tp-txtv.tp-txtv-drg .tp-txtv_i{opacity:.3}.tp-txtv_k{cursor:pointer;height:100%;left:calc(var(--bld-hp) - 5px);position:absolute;top:0;width:12px}.tp-txtv_k::before{background-color:var(--in-fg);border-radius:1px;bottom:0;content:\"\";height:calc(var(--cnt-usz) - 4px);left:50%;margin-bottom:auto;margin-left:-1px;margin-top:auto;opacity:.1;position:absolute;top:0;transition:border-radius .1s,height .1s,transform .1s,width .1s;width:2px}.tp-txtv_k:hover::before,.tp-txtv.tp-txtv-drg .tp-txtv_k::before{opacity:1}.tp-txtv.tp-txtv-drg .tp-txtv_k::before{border-radius:50%;height:4px;transform:translateX(-1px);width:4px}.tp-txtv_g{bottom:0;display:block;height:8px;left:50%;margin:auto;overflow:visible;pointer-events:none;position:absolute;top:0;visibility:hidden;width:100%}.tp-txtv.tp-txtv-drg .tp-txtv_g{visibility:visible}.tp-txtv_gb{fill:none;stroke:var(--in-fg);stroke-dasharray:1}.tp-txtv_gh{fill:none;stroke:var(--in-fg)}.tp-txtv .tp-ttv{margin-left:6px;visibility:hidden}.tp-txtv.tp-txtv-drg .tp-ttv{visibility:visible}.tp-ttv{background-color:var(--in-fg);border-radius:var(--bld-br);color:var(--bs-bg);padding:2px 4px;pointer-events:none;position:absolute;transform:translate(-50%, -100%)}.tp-ttv::before{border-color:var(--in-fg) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:2px;box-sizing:border-box;content:\"\";font-size:.9em;height:4px;left:50%;margin-left:-2px;position:absolute;top:100%;width:4px}.tp-rotv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);font-family:var(--bs-ff);font-size:11px;font-weight:500;line-height:1;text-align:left}.tp-rotv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br);border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br);padding-left:calc(4px + var(--cnt-usz) + var(--cnt-hp));text-align:center}.tp-rotv.tp-rotv-expanded .tp-rotv_b{border-bottom-left-radius:0;border-bottom-right-radius:0;transition-delay:0s;transition-duration:0s}.tp-rotv.tp-rotv-not>.tp-rotv_b{display:none}.tp-rotv_b:disabled .tp-rotv_m{display:none}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst.tp-fldv-expanded>.tp-fldv_b{transition-delay:0s;transition-duration:0s}.tp-rotv_c .tp-fldv.tp-v-vlst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-right-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst>.tp-fldv_b{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst>.tp-tabv_t{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv.tp-v-disabled,.tp-rotv .tp-v-disabled{pointer-events:none}.tp-rotv.tp-v-hidden,.tp-rotv .tp-v-hidden{display:none}.tp-sprv_r{background-color:var(--grv-fg);border-width:0;display:block;height:2px;margin:0;width:100%}.tp-sprv.tp-v-disabled .tp-sprv_r{opacity:.5}",plugins:[J3,Q3,$3,QR,Z3]})}}var cu=new HX("4.0.5");class DK{constructor(J,Q,$){this.id=0,this.name=J,this.fg=Q,this.bg=$,this.gradient=null,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width="90px",this.canvas.style.height="48px",this.canvas.style.position="absolute",this.canvas.style.cssText="width:90px;height:48px;background-color: transparent !important;",this.context=this.canvas.getContext("2d"),this.initializeCanvas()}createGradient(){if(!this.context)throw new Error("No context");let J=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),Q,$=this.fg;switch(this.fg.toLowerCase()){case"#0ff":Q="#006666";break;case"#0f0":Q="#006600";break;case"#ff0":Q="#666600";break;case"#e1e1e1":Q="#666666";break;default:Q=this.bg;break}return J.addColorStop(0,Q),J.addColorStop(1,$),J}initializeCanvas(){if(!this.context)return;this.context.imageSmoothingEnabled=!1,this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.bg,this.context.globalAlpha=0.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}update(J,Q,$=0){if(!this.context||!this.gradient)return;let Z=Math.min(1/0,J),K=Math.max(Q,J);this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(`${J.toFixed($)} ${this.name} (${Z.toFixed($)}-${parseFloat(K.toFixed($))})`,this.TEXT_X,this.TEXT_Y)}updateGraph(J,Q){if(!this.context||!this.gradient)return;if(J===0&&Q===0)Q=1;Q=Math.max(Q,J,0.1),J=Math.max(J,0);let $=Math.round(this.GRAPH_X),Z=Math.round(this.GRAPH_Y),K=Math.round(this.GRAPH_WIDTH),W=Math.round(this.GRAPH_HEIGHT),H=Math.round(this.PR);this.context.drawImage(this.canvas,$+H,Z,K-H,W,$,Z,K-H,W),this.context.fillStyle=this.bg,this.context.fillRect($+K-H,Z,H,W);let U=Math.min(W,Math.round(J/Q*W));if(U>0)this.context.globalAlpha=0.9,this.context.fillStyle=this.gradient,this.context.fillRect($+K-H,Z+(W-U),H,U);this.context.globalAlpha=1}}class MX extends DK{constructor(J,Q,$){super(J,Q,$);this.vsyncValue=0,this.SMALL_HEIGHT=9*this.PR,this.HEIGHT=this.SMALL_HEIGHT,this.WIDTH=35*this.PR,this.TEXT_Y=0*this.PR,this.canvas.height=this.HEIGHT,this.canvas.width=this.WIDTH,this.canvas.style.height="9px",this.canvas.style.width="35px",this.canvas.style.cssText=` width: 35px; height: 9px; position: absolute; top: 0; left: 0; background-color: transparent !important; pointer-events: none; `,this.initializeCanvas()}initializeCanvas(){if(!this.context)return;this.context.imageSmoothingEnabled=!1,this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.globalAlpha=1}update(J,Q,$=0){if(!this.context)return;this.vsyncValue=J,this.context.clearRect(0,0,this.WIDTH,this.HEIGHT),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillText(`${J.toFixed(0)}Hz`,this.TEXT_X,this.TEXT_Y)}updateGraph(J,Q){return}setOffset(J,Q){this.canvas.style.transform=`translate(${J}px, ${Q}px)`}}var AB=class J{constructor({trackGPU:Q=!1,trackCPT:$=!1,trackHz:Z=!1,logsPerSecond:K=4,graphsPerSecond:W=30,samplesLog:H=40,samplesGraph:U=10,precision:q=2,minimal:X=!1,horizontal:F=!0,mode:N=0}={}){this.gl=null,this.ext=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.frameTimes=[],this.renderCount=0,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.gpuPanel=null,this.gpuPanelCompute=null,this.vsyncPanel=null,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.updateCounter=0,this.lastMin={},this.lastMax={},this.lastValue={},this.VSYNC_RATES=[{refreshRate:60,frameTime:16.67},{refreshRate:75,frameTime:13.33},{refreshRate:90,frameTime:11.11},{refreshRate:120,frameTime:8.33},{refreshRate:144,frameTime:6.94},{refreshRate:165,frameTime:6.06},{refreshRate:240,frameTime:4.17}],this.detectedVSync=null,this.frameTimeHistory=[],this.HISTORY_SIZE=120,this.VSYNC_THRESHOLD=0.05,this.lastFrameTime=0,this.handleClick=(Y)=>{Y.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{if(this.resizePanel(this.fpsPanel),this.resizePanel(this.msPanel),this.gpuPanel)this.resizePanel(this.gpuPanel);if(this.gpuPanelCompute)this.resizePanel(this.gpuPanelCompute)},this.mode=N,this.horizontal=F,this.minimal=X,this.trackGPU=Q,this.trackCPT=$,this.trackHz=Z,this.samplesLog=H,this.samplesGraph=U,this.precision=q,this.logsPerSecond=K,this.graphsPerSecond=W;let L=performance.now();if(this.prevGraphTime=L,this.dom=document.createElement("div"),this.initializeDOM(),this.beginTime=performance.now(),this.prevTextTime=this.beginTime,this.prevCpuTime=this.beginTime,this._panelId=0,this.fpsPanel=this.addPanel(new J.Panel("FPS","#0ff","#002")),this.msPanel=this.addPanel(new J.Panel("CPU","#0f0","#020")),this.trackHz===!0)this.vsyncPanel=new MX("","#f0f","#202"),this.dom.appendChild(this.vsyncPanel.canvas),this.vsyncPanel.setOffset(56,35);this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=` position: fixed; top: 0; left: 0; opacity: 0.9; z-index: 10000; ${this.minimal?"cursor: pointer;":""} `}setupEventListeners(){if(this.minimal)this.dom.addEventListener("click",this.handleClick),this.showPanel(this.mode);else window.addEventListener("resize",this.handleResize)}async init(Q){if(!Q){console.error('Stats: The "canvas" parameter is undefined.');return}if(this.handleThreeRenderer(Q))return;if(await this.handleWebGPURenderer(Q))return;if(this.initializeWebGL(Q)){if(this.trackGPU)this.initializeGPUTracking();return}else console.error("Stats-gl: Failed to initialize WebGL context")}handleThreeRenderer(Q){if(Q.isWebGLRenderer&&!this.threeRendererPatched){if(this.patchThreeRenderer(Q),this.gl=Q.getContext(),this.trackGPU)this.initializeGPUTracking();return!0}return!1}async handleWebGPURenderer(Q){if(Q.isWebGPURenderer){if(this.trackGPU||this.trackCPT){if(Q.backend.trackTimestamp=!0,await Q.hasFeatureAsync("timestamp-query"))this.initializeWebGPUPanels()}return this.info=Q.info,this.patchThreeWebGPU(Q),!0}return!1}initializeWebGPUPanels(){if(this.trackGPU)this.gpuPanel=this.addPanel(new J.Panel("GPU","#ff0","#220"));if(this.trackCPT)this.gpuPanelCompute=this.addPanel(new J.Panel("CPT","#e1e1e1","#212121"))}initializeWebGL(Q){if(Q instanceof WebGL2RenderingContext)this.gl=Q;else if(Q instanceof HTMLCanvasElement||Q instanceof OffscreenCanvas){if(this.gl=Q.getContext("webgl2"),!this.gl)return console.error("Stats: Unable to obtain WebGL2 context."),!1}else return console.error("Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas."),!1;return!0}initializeGPUTracking(){if(this.gl){if(this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext)this.gpuPanel=this.addPanel(new J.Panel("GPU","#ff0","#220"))}}begin(){if(this.beginProfiling("cpu-started"),!this.gl||!this.ext)return;if(this.activeQuery)this.gl.endQuery(this.ext.TIME_ELAPSED_EXT);if(this.activeQuery=this.gl.createQuery(),this.activeQuery)this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery)}end(){if(this.renderCount++,this.gl&&this.ext&&this.activeQuery)this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null;this.endProfiling("cpu-started","cpu-finished","cpu-duration")}update(){if(this.endProfiling("cpu-started","cpu-finished","cpu-duration"),!this.info)this.processGpuQueries();else this.processWebGPUTimestamps();this.updateAverages(),this.resetCounters()}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp}resetCounters(){this.renderCount=0,this.totalCpuDuration=0,this.beginTime=this.endInternal()}resizePanel(Q){if(Q.canvas.style.position="absolute",this.minimal)Q.canvas.style.display="none";else if(Q.canvas.style.display="block",this.horizontal)Q.canvas.style.top="0px",Q.canvas.style.left=Q.id*Q.WIDTH/Q.PR+"px";else Q.canvas.style.left="0px",Q.canvas.style.top=Q.id*Q.HEIGHT/Q.PR+"px"}addPanel(Q){if(Q.canvas)this.dom.appendChild(Q.canvas),Q.id=this._panelId,this.resizePanel(Q),this._panelId++;return Q}showPanel(Q){for(let $=0;${if(this.gl){let Z=this.gl.getQueryParameter(Q.query,this.gl.QUERY_RESULT_AVAILABLE),K=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(Z&&!K){let H=this.gl.getQueryParameter(Q.query,this.gl.QUERY_RESULT)*0.000001;this.totalGpuDuration+=H,this.gl.deleteQuery(Q.query),this.gpuQueries.splice($,1)}}})}detectVSync(Q){if(this.lastFrameTime===0){this.lastFrameTime=Q;return}let $=Q-this.lastFrameTime;if(this.lastFrameTime=Q,this.frameTimeHistory.push($),this.frameTimeHistory.length>this.HISTORY_SIZE)this.frameTimeHistory.shift();if(this.frameTimeHistory.length<60)return;let Z=this.frameTimeHistory.reduce((q,X)=>q+X)/this.frameTimeHistory.length,K=this.frameTimeHistory.reduce((q,X)=>q+Math.pow(X-Z,2),0)/this.frameTimeHistory.length;if(Math.sqrt(K)>2){this.detectedVSync=null;return}let H=null,U=1/0;for(let q of this.VSYNC_RATES){let X=Math.abs(Z-q.frameTime);if(X0&&this.frameTimes[0]<=$-1000)this.frameTimes.shift();let Z=Math.round(this.frameTimes.length);this.addToAverage(Z,this.averageFps);let K=$>=this.prevTextTime+1000/this.logsPerSecond,W=$>=this.prevGraphTime+1000/this.graphsPerSecond;if(this.updatePanelComponents(this.fpsPanel,this.averageFps,0,K,W),this.updatePanelComponents(this.msPanel,this.averageCpu,this.precision,K,W),this.gpuPanel)this.updatePanelComponents(this.gpuPanel,this.averageGpu,this.precision,K,W);if(this.trackCPT&&this.gpuPanelCompute)this.updatePanelComponents(this.gpuPanelCompute,this.averageGpuCompute,this.precision,K,W);if(K)this.prevTextTime=$;if(W)this.prevGraphTime=$;if(this.vsyncPanel!==null){this.detectVSync($);let H=((Q=this.detectedVSync)==null?void 0:Q.refreshRate)||0;if(K&&H>0)this.vsyncPanel.update(H,H)}return $}updatePanelComponents(Q,$,Z,K,W){if(!Q||$.logs.length===0)return;if(!(Q.name in this.lastMin))this.lastMin[Q.name]=1/0,this.lastMax[Q.name]=0,this.lastValue[Q.name]=0;let H=$.logs[$.logs.length-1];this.lastMax[Q.name]=Math.max(...$.logs),this.lastMin[Q.name]=Math.min(this.lastMin[Q.name],H),this.lastValue[Q.name]=this.lastValue[Q.name]*0.7+H*0.3;let U=Math.max(Math.max(...$.logs),...$.graph.slice(-this.samplesGraph));if(this.updateCounter++,K)Q.update(this.lastValue[Q.name],this.lastMax[Q.name],Z);if(W)Q.updateGraph(H,U)}beginProfiling(Q){if(window.performance)try{window.performance.clearMarks(Q),window.performance.mark(Q)}catch($){console.debug("Stats: Performance marking failed:",$)}}endProfiling(Q,$,Z){if(!window.performance||!$||!Q)return;try{if(window.performance.getEntriesByName(Q,"mark").length===0)this.beginProfiling(Q);window.performance.clearMarks($),window.performance.mark($),window.performance.clearMeasures(Z);let W=performance.measure(Z,Q,$);this.totalCpuDuration+=W.duration,window.performance.clearMarks(Q),window.performance.clearMarks($),window.performance.clearMeasures(Z)}catch(K){console.debug("Stats: Performance measurement failed:",K)}}updatePanel(Q,$,Z=2){if(!Q||$.logs.length===0)return;let K=performance.now();if(!(Q.name in this.lastMin))this.lastMin[Q.name]=1/0,this.lastMax[Q.name]=0,this.lastValue[Q.name]=0;let W=$.logs[$.logs.length-1],H=Math.max(...$.logs.slice(-30));this.lastMin[Q.name]=Math.min(this.lastMin[Q.name],W),this.lastMax[Q.name]=Math.max(this.lastMax[Q.name],W),this.lastValue[Q.name]=this.lastValue[Q.name]*0.7+W*0.3;let U=Math.max(H,...$.graph.slice(-this.samplesGraph));if(this.updateCounter++,this.updateCounter%(this.logsPerSecond*2)===0)this.lastMax[Q.name]=H,this.lastMin[Q.name]=W;if(Q.update){if(K>=this.prevCpuTime+1000/this.logsPerSecond)Q.update(this.lastValue[Q.name],W,this.lastMax[Q.name],U,Z);if(K>=this.prevGraphTime+1000/this.graphsPerSecond)Q.updateGraph(W,U),this.prevGraphTime=K}}updateAverages(){if(this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu),this.info&&this.totalGpuDurationCompute!==void 0)this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}addToAverage(Q,$){if($.logs.push(Q),$.logs.length>this.samplesLog)$.logs=$.logs.slice(-this.samplesLog);if($.graph.push(Q),$.graph.length>this.samplesGraph)$.graph=$.graph.slice(-this.samplesGraph)}get domElement(){return this.dom}patchThreeWebGPU(Q){let $=Q.info.reset,Z=this;Q.info.reset=function(){Z.beginProfiling("cpu-started"),$.call(this)}}patchThreeRenderer(Q){let $=Q.render,Z=this;Q.render=function(K,W){Z.begin(),$.call(this,K,W),Z.end()},this.threeRendererPatched=!0}};AB.Panel=DK;var IB=AB;class vH{constructor(){this.gl=new ZJ,this.active=!0,this.isHidden=!1,this.gui=new BX({title:"Debug Panel"}),this.gui.element.parentElement.style.position="fixed",this.gui.element.parentElement.style.zIndex="1000",this.guiStats={polygons:0,geometries:0,programs:0,textures:0,draw_calls:0},this.guiStatsFolder=this.gui.addFolder({title:"Stats",expanded:!1}),this.guiStatsFolder.addBinding(this.guiStats,"polygons",{readonly:!0}),this.guiStatsFolder.addBinding(this.guiStats,"geometries",{readonly:!0}),this.guiStatsFolder.addBinding(this.guiStats,"programs",{readonly:!0}),this.guiStatsFolder.addBinding(this.guiStats,"textures",{readonly:!0}),this.guiStatsFolder.addBinding(this.guiStats,"draw_calls",{readonly:!0}),this.stats=new IB({trackGPU:!0,trackHz:!0}),this.stats.init(this.gl.renderer.instance.gl),document.body.appendChild(this.stats.dom),this.setHideControls()}setHideControls(){document.addEventListener("keydown",(J)=>{if(this.isHidden=!this.isHidden,J.key==="h")if(this.isHidden)this.gui.element.style.display="none",this.stats.dom.style.display="none";else this.gui.element.style.display="block",this.stats.dom.style.display="block"})}update(){}}class gH{constructor(J,Q={}){this.gl=new ZJ,this.dom=J,this.bounds=this.dom?this.getPositionOfDom():{left:0,top:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight},this.params={limitToBounds:Q.limitToBounds||!1},this.isMouseHolding=!1,this.isMouseMoved=!1,this.width=this.gl.sizes.width,this.height=this.gl.sizes.height,this.default=new x9,this.normalized={current:new x9,previous:new x9},this.direction=new x9,this.pace={default:0,separated:new x9},this.pace={default:0,separated:new x9},this.drag={start:new x9,distance:{default:0,separated:new x9},side:"left",pace:{default:0,separated:new x9}},document.addEventListener("mousemove",this.mousemove.bind(this)),document.addEventListener("touchmove",this.touchmove.bind(this)),document.addEventListener("mousedown",this.down.bind(this)),document.addEventListener("touchstart",this.down.bind(this)),document.addEventListener("mouseup",this.up.bind(this)),document.addEventListener("touchend",this.up.bind(this)),document.addEventListener("mouseleave",this.mouseleave.bind(this)),document.addEventListener("touchleave",this.mouseleave.bind(this))}mouseleave(){this.direction.set(0,0),this.pace.default=0,this.pace.separated.set(0,0)}mousemove(J){if(this.isMouseMoved=!0,this.default.x=J.clientX-this.bounds.left,this.default.y=this.dom?J.pageY-this.bounds.top:J.clientY-this.bounds.top,this.params.limitToBounds){if(this.default.x<0||this.default.x>this.bounds.width||this.default.y<0||this.default.y>this.bounds.height)return;this.default.x=Math.max(0,Math.min(this.bounds.width,this.default.x)),this.default.y=Math.max(0,Math.min(this.bounds.height,this.default.y))}if(this.normalized.current.x=this.default.x/this.bounds.width*2-1,this.normalized.current.y=-(this.default.y/this.bounds.height)*2+1,this.isMouseHolding)if(this.drag.distance=this.drag.start.distanceTo(this.default),this.drag.start.xthis.bounds.width||this.default.y<0||this.default.y>this.bounds.height)return;this.default.x=Math.max(0,Math.min(this.bounds.width,this.default.x)),this.default.y=Math.max(0,Math.min(this.bounds.height,this.default.y))}if(this.normalized.current.x=this.default.x/this.bounds.width*2-1,this.normalized.current.y=-(this.default.y/this.bounds.height)*2+1,this.isMouseHolding)if(this.drag.distance.default=this.drag.start.distanceTo(this.default),this.drag.distance.separated.x=this.default.x-this.drag.start.x,this.drag.distance.separated.y=this.default.y-this.drag.start.y,this.drag.start.x{Q.x=aJ.damp(Q.x,this.default.x,$,W),Q.y=aJ.damp(Q.y,this.default.y,$,W)},setAmount:(W)=>{$=W}}}createEasedNormalized(J){let Q=new x9,$=J;return{value:Q,update:(W)=>{Q.x=aJ.damp(Q.x,this.normalized.current.x,$,W),Q.y=aJ.damp(Q.y,this.normalized.current.y,$,W)},setAmount:(W)=>{$=W}}}createEasedDirection(J){let Q=new x9,$=J;return{value:Q,update:(W)=>{Q.x=aJ.damp(Q.x,this.direction.x,$,W),Q.y=aJ.damp(Q.y,this.direction.y,$,W)},setAmount:(W)=>{$=W}}}createEasedPace(J){let Q={default:0,separated:new x9},$=J;return{value:Q,update:(W)=>{Q.default=aJ.damp(Q.default,this.pace.default,$,W),Q.separated.x=aJ.damp(Q.separated.x,this.pace.separated.x,$,W),Q.separated.y=aJ.damp(Q.separated.y,this.pace.separated.y,$,W)},setAmount:(W)=>{$=W}}}createEasedDrag(J){let Q={distance:0,pace:{default:0,separated:new x9}},$=J,Z=(W)=>{Q.distance=aJ.damp(Q.distance,this.drag.distance,$,W),Q.pace.default=aJ.damp(Q.pace.default,this.drag.pace.default,$,W),Q.pace.separated.x=aJ.damp(Q.pace.separated.x,this.drag.pace.separated.x,$,W),Q.pace.separated.y=aJ.damp(Q.pace.separated.y,this.drag.pace.separated.y,$,W)},K=(W)=>{$=W};return{value:Q,update:Z}}}class uH{constructor(){this.gl=new ZJ,this.path="https://webflow.itsoffbrand.io/sotw/",this.models={},this.textures={},this.hdris={},this.fonts={}}customTextureLoader(J,Q){return new Promise(($)=>{let Z=new fJ(this.gl.renderer.instance.gl);rW.loadImage(this.gl.renderer.instance.gl,J,Z,!0).then((K)=>{if($(),Q(Z),this.gl.isDebug)this.logProgress(J)})})}customModelLoader(J,Q){return new Promise(($)=>{aW.load(this.gl.renderer.instance.gl,J).then((Z)=>{if($(),Q(Z),this.gl.isDebug)this.logProgress(J)})})}customHdriLoader(J,Q){return new Promise(($)=>{this.rgbeLoader.load(J,(Z)=>{if($(),Q(Z),this.gl.isDebug)this.logProgress(J)},void 0,(Z)=>{console.error(Z)})})}customFontLoader(J,Q){return new Promise(($)=>{this.fontLoader.load(J,(Z)=>{if($(),Q(Z),this.gl.isDebug)this.logProgress(J)},void 0,(Z)=>{console.error(Z)})})}logProgress(J){this.promisesProgress++,console.info(`[WebGL] [ ${this.promisesProgress}/${this.promises.length} asset loaded ] -`,J)}load(){return this.promises=[],this.promisesProgress=0,new Promise(async(J)=>{if(this.promises.push(this.customTextureLoader(this.path+"textures/webp/noise-01.webp",(Q)=>{this.textures.noise=Q,this.textures.noise.wrapS=this.gl.renderer.instance.gl.REPEAT,this.textures.noise.wrapT=this.gl.renderer.instance.gl.REPEAT})),this.promises.push(this.customTextureLoader(this.path+"textures/webp/blur-01.webp",(Q)=>{this.textures.blur=Q})),this.promises.push(this.customTextureLoader(this.path+"textures/webp/blur-gradient-01.webp",(Q)=>{this.textures.blurGradient=Q})),this.promises.push(this.customTextureLoader(this.path+"textures/webp/gradients-01.webp",(Q)=>{this.textures.gradients=Q})),this.promises.push(this.customTextureLoader(this.path+"textures/webp/glass-reflection-01.webp",(Q)=>{this.textures.glassReflection=Q})),this.textures.matcaps={},this.promises.push(this.customTextureLoader(this.path+"textures/webp/glass-matcap-01.webp",(Q)=>{this.textures.matcaps.glass=Q})),this.promises.push(this.customModelLoader(this.path+"models/targets-06.glb",(Q)=>{this.models.targets=Q})),this.promises.length>0)await Promise.all(this.promises);J(),console.log("[WebGL] [ █ █ █ █ ] -","Assets loaded")})}}var zX=null;class ZJ{constructor(J){if(zX)return zX;if(zX=this,I5.isWebGL2Available())this.setup(J);else console.log("[WebGL] [ (╯︵╰,) ] -","WebGL 2.0 is not available - initializing fallback."),document.documentElement.classList.add("webgl-not-available")}setup(J){this.urlParams=new URLSearchParams(window.location.search),this.isDebug=this.urlParams.has("debug"),this.params=J,this.isLoaded=!1,this.canvas=document.querySelector(this.params.canvas),this.time=new DH,this.sizes=new LH,this.mouse=new gH(this.canvas,{limitToBounds:!0}),this.renderer=new tW,this.scene=new NJ,this.camera=new O7(this.renderer.instance.gl),this.assets=new uH,this.state={data:null,canvasContainer:null},U8.on("WEBGL_DATA",(Q)=>{if(this.isLoaded)return;this.state.data=Q}),U8.on("CANVAS_CONTAINER",(Q)=>{let $=document.querySelector('[data-gl="canvas"]').closest(".home-hero_sticky");this.state.canvasContainer=$?null:document.querySelector('[data-gl="canvas"]').parentElement,this.mouse.dom=$?null:document.querySelector('[data-gl="canvas"]').parentElement,this.resize()}),window.addEventListener("resize",()=>{this.resize()})}load(){return new Promise((J)=>{if(I5.isWebGL2Available())Promise.all([this.loadDOM(),this.assets.load()]).then(()=>{this.init(),this.isLoaded=!0,J()});else J()})}init(){if(this.isDebug)this.debug=new vH;if(this.world=new FH,T8.ticker.add(this.update.bind(this)),this.world.add(),this.mouse.updateBounds(),this.isDebug)this.world.debugSceneParamsFolder.addBinding(this.sizes,"pixelRatio",{label:"Pixel Ratio",min:0.1,max:4,step:0.1}).on("change",()=>{this.sizes.isPixelRatioOverride=!0,this.resize()});console.log("[WebGL] [ █ █ █ █ █ █ ] -","Initialized")}loadDOM(){return new Promise((J)=>{if(document.readyState==="interactive")console.log("[WebGL] [ █ █ ] -","DOM loaded"),J();else document.addEventListener("DOMContentLoaded",()=>{console.log("[WebGL] [ █ █ ] -","DOM loaded"),J()})})}update(){if(this.isLoaded){if(this.isDebug)this.debug.stats.begin();if(this.time.update(),this.world.update(),this.renderer.update(),this.mouse.update(),this.isDebug)this.debug.stats.end(),this.debug.stats.update()}}resize(){if(this.sizes.resize(this.state.canvasContainer),this.isLoaded)this.renderer.resize(),this.world.resize();this.mouse.resize()}}function LK(J){let{color:Q=0,model:$="cursor",scene:Z="full-with-model"}=J;return U8.WEBGL_DATA={color:Q,model:$,scene:Z},{color:Q,model:$,scene:Z}}function EB(J,Q){let{color:$,model:Z,scene:K}=LK(Q);U8.WEBGL_SCENE=Q.scene;let W=J.querySelector("canvas");window.WEBGL_CANVAS=W;let H=W;new ZJ({canvas:'[data-gl="canvas"]'}).load().then(()=>{}),new IntersectionObserver((X)=>{X.forEach((F)=>{if(F.isIntersecting){if(LK(Q),!J.contains(H)&&H&&!J.querySelector("canvas"))J.appendChild(H),window.WEBGL_CANVAS=H;U8.CANVAS_CONTAINER=J}else if(J.contains(H)&&H)H.remove()})},{threshold:0.01,rootMargin:"0px"}).observe(J)}function CB(J,Q){let $=J.parentElement;J.remove();let Z=!1,K=new IntersectionObserver((W)=>{W.forEach((H)=>{if(H.isIntersecting){if(LK(Q),!Z&&window.WEBGL_CANVAS&&!$.querySelector("canvas"))$.appendChild(window.WEBGL_CANVAS),Z=!0;U8.CANVAS_CONTAINER=J}else if(Z&&window.WEBGL_CANVAS&&window.WEBGL_CANVAS.parentElement===$)window.WEBGL_CANVAS.remove(),Z=!1})},{threshold:0.01,rootMargin:"0px"});return K.observe($),()=>{if(K.disconnect(),Z&&window.WEBGL_CANVAS&&window.WEBGL_CANVAS.parentElement===$)window.WEBGL_CANVAS.remove()}}var AX={"./../aeo-hero-grid.js":cq,"./../aeo-key-data.js":pq,"./../bars-graph-slider.js":U5,"./../bottom-hero-nav.js":IX,"./../chaptersection.js":q5,"./../content.webgl.js":XO,"./../cycle.ts":G5,"./../draggable.js":X5,"./../form.ts":Y5,"./../formgate.ts":N5,"./../highlighted-text.js":O5,"./../horizontal-bars.js":F5,"./../ilya.js":D5,"./../key-data-points.js":L5,"./../nav.ts":R5,"./../rive.js":M5,"./../split.ts":z5,"./../test.ts":k5,"./../text-counter.js":V5,"./../vertical-bars.js":A5,"./../webgl-receiver.js":VX,"./../webgl.js":kX};function Ad(J="module"){return Array.from(document.querySelectorAll(`[data-${J}]`)).map((Q)=>{let $=Q,Z=$.dataset[J];if($._moduleInitialized)return null;let K=AX[`./../${Z}.ts`]?`./../${Z}.ts`:`./../${Z}.js`;if(AX[K]){let W=AX[K].default;if(typeof W==="function")try{return $._moduleInitialized=!0,W($,$.dataset)}catch(H){return delete $._moduleInitialized,console.warn(`Failed to call default function for ${J} "${Z}":`,H),null}else return console.warn(`Default export is not a function for ${J} "${Z}"`),null}else return console.warn(`${J} not found: "${Z}"`),null}).filter((Q)=>Q!==null)}class _${static instance;groups=[];constructor(){}static getInstance(){if(!_$.instance)_$.instance=new _$;return _$.instance}configsMatch(J,Q){return J.root===Q.root&&J.rootMargin===Q.rootMargin}handleIntersection(J){J.forEach((Q)=>{let $=this.groups.find((X)=>{return Array.from(X.elements.keys()).includes(Q.target)});if(!$)return;let Z=Q.target,K=$.elements.get(Z);if(!K)return;let{isIntersecting:W,intersectionRatio:H,boundingClientRect:U}=Q,q=-1;if(K.lastDirection!==void 0)q=W?U.top>0?1:-1:U.top>0?-1:1;if(K.lastDirection=q,W){if(K.callbacks.isIn?.({entry:Q,direction:q}),K.callbacks.callback?.({entry:Q,direction:q,isIn:!0}),K.once)this.removeElement(Z)}else K.callbacks.isOut?.({entry:Q,direction:q}),K.callbacks.callback?.({entry:Q,direction:q,isIn:!1})})}addElement(J,Q,$){this.removeElement(J);let Z=this.groups.find((K)=>this.configsMatch(K.config,Q));if(!Z){let K=new IntersectionObserver((W)=>this.handleIntersection(W),{...Q,threshold:[0]});Z={config:Q,observer:K,elements:new Map},this.groups.push(Z)}return Z.elements.set(J,{callbacks:$,once:Q.once||!1,lastDirection:void 0}),Z.observer.observe(J),Z}removeElement(J){let Q=this.groups.find(($)=>$.elements.has(J));if(!Q)return;if(Q.observer.unobserve(J),Q.elements.delete(J),Q.elements.size===0)Q.observer.disconnect(),this.groups=this.groups.filter(($)=>$!==Q)}}class gZ{element;#J;#$;isIn(J){}isOut(J){}inView;callback;#Q=null;#Z=null;constructor(J,Q={root:null,rootMargin:"0px",threshold:0,autoStart:!1,once:!1,callback:void 0}){if(this.element=J,this.#J=Q,this.inView=!1,this.callback=Q.callback||(()=>{}),Q.autoStart)this.start()}start(){this.#$=_$.getInstance().addElement(this.element,this.#J,{isIn:(J)=>{this.inView=!0,this.isIn?.(J)},isOut:(J)=>{this.inView=!1,this.isOut?.(J)},callback:this.callback})}stop(){_$.getInstance().removeElement(this.element)}destroy(){this.stop(),this.#Q=null,this.#Z=null}}var H3="1.3.4";function TB(J,Q,$){return Math.max(J,Math.min(Q,$))}function U3(J,Q,$){return(1-$)*J+$*Q}function q3(J,Q,$,Z){return U3(J,Q,1-Math.exp(-$*Z))}function G3(J,Q){return(J%Q+Q)%Q}var X3=class{isRunning=!1;value=0;from=0;to=0;currentTime=0;lerp;duration;easing;onUpdate;advance(J){if(!this.isRunning)return;let Q=!1;if(this.duration&&this.easing){this.currentTime+=J;let $=TB(0,this.currentTime/this.duration,1);Q=$>=1;let Z=Q?1:this.easing($);this.value=this.from+(this.to-this.from)*Z}else if(this.lerp){if(this.value=q3(this.value,this.to,this.lerp*60,J),Math.round(this.value)===this.to)this.value=this.to,Q=!0}else this.value=this.to,Q=!0;if(Q)this.stop();this.onUpdate?.(this.value,Q)}stop(){this.isRunning=!1}fromTo(J,Q,{lerp:$,duration:Z,easing:K,onStart:W,onUpdate:H}){this.from=this.value=J,this.to=Q,this.lerp=$,this.duration=Z,this.easing=K,this.currentTime=0,this.isRunning=!0,W?.(),this.onUpdate=H}};function Y3(J,Q){let $;return function(...Z){let K=this;clearTimeout($),$=setTimeout(()=>{$=void 0,J.apply(K,Z)},Q)}}var N3=class{constructor(J,Q,{autoResize:$=!0,debounce:Z=250}={}){if(this.wrapper=J,this.content=Q,$){if(this.debouncedResize=Y3(this.resize,Z),this.wrapper instanceof Window)window.addEventListener("resize",this.debouncedResize,!1);else this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper);this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)}this.resize()}width=0;height=0;scrollHeight=0;scrollWidth=0;debouncedResize;wrapperResizeObserver;contentResizeObserver;destroy(){if(this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),this.wrapper===window&&this.debouncedResize)window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{if(this.wrapper instanceof Window)this.width=window.innerWidth,this.height=window.innerHeight;else this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight};onContentResize=()=>{if(this.wrapper instanceof Window)this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth;else this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},SB=class{events={};emit(J,...Q){let $=this.events[J]||[];for(let Z=0,K=$.length;Z{this.events[J]=this.events[J]?.filter(($)=>Q!==$)}}off(J,Q){this.events[J]=this.events[J]?.filter(($)=>Q!==$)}destroy(){this.events={}}},PB=16.666666666666668,nQ={passive:!1},O3=class{constructor(J,Q={wheelMultiplier:1,touchMultiplier:1}){this.element=J,this.options=Q,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,nQ),this.element.addEventListener("touchstart",this.onTouchStart,nQ),this.element.addEventListener("touchmove",this.onTouchMove,nQ),this.element.addEventListener("touchend",this.onTouchEnd,nQ)}touchStart={x:0,y:0};lastDelta={x:0,y:0};window={width:0,height:0};emitter=new SB;on(J,Q){return this.emitter.on(J,Q)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,nQ),this.element.removeEventListener("touchstart",this.onTouchStart,nQ),this.element.removeEventListener("touchmove",this.onTouchMove,nQ),this.element.removeEventListener("touchend",this.onTouchEnd,nQ)}onTouchStart=(J)=>{let{clientX:Q,clientY:$}=J.targetTouches?J.targetTouches[0]:J;this.touchStart.x=Q,this.touchStart.y=$,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:J})};onTouchMove=(J)=>{let{clientX:Q,clientY:$}=J.targetTouches?J.targetTouches[0]:J,Z=-(Q-this.touchStart.x)*this.options.touchMultiplier,K=-($-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=Q,this.touchStart.y=$,this.lastDelta={x:Z,y:K},this.emitter.emit("scroll",{deltaX:Z,deltaY:K,event:J})};onTouchEnd=(J)=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:J})};onWheel=(J)=>{let{deltaX:Q,deltaY:$,deltaMode:Z}=J,K=Z===1?PB:Z===2?this.window.width:1,W=Z===1?PB:Z===2?this.window.height:1;Q*=K,$*=W,Q*=this.options.wheelMultiplier,$*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:Q,deltaY:$,event:J})};onWindowResize=()=>{this.window={width:window.innerWidth,height:window.innerHeight}}},jB=(J)=>Math.min(1,1.001-Math.pow(2,-10*J)),_B=class{_isScrolling=!1;_isStopped=!1;_isLocked=!1;_preventNextNativeScrollEvent=!1;_resetVelocityTimeout=null;__rafID=null;isTouching;time=0;userData={};lastVelocity=0;velocity=0;direction=0;options;targetScroll;animatedScroll;animate=new X3;emitter=new SB;dimensions;virtualScroll;constructor({wrapper:J=window,content:Q=document.documentElement,eventsTarget:$=J,smoothWheel:Z=!0,syncTouch:K=!1,syncTouchLerp:W=0.075,touchInertiaMultiplier:H=35,duration:U,easing:q,lerp:X=0.1,infinite:F=!1,orientation:N="vertical",gestureOrientation:L="vertical",touchMultiplier:Y=1,wheelMultiplier:B=1,autoResize:M=!0,prevent:V,virtualScroll:A,overscroll:I=!0,autoRaf:P=!1,anchors:j=!1,autoToggle:T=!1,allowNestedScroll:w=!1,__experimental__naiveDimensions:_=!1}={}){if(window.lenisVersion=H3,!J||J===document.documentElement)J=window;if(typeof U==="number"&&typeof q!=="function")q=jB;else if(typeof q==="function"&&typeof U!=="number")U=1;if(this.options={wrapper:J,content:Q,eventsTarget:$,smoothWheel:Z,syncTouch:K,syncTouchLerp:W,touchInertiaMultiplier:H,duration:U,easing:q,lerp:X,infinite:F,gestureOrientation:L,orientation:N,touchMultiplier:Y,wheelMultiplier:B,autoResize:M,prevent:V,virtualScroll:A,overscroll:I,autoRaf:P,anchors:j,autoToggle:T,allowNestedScroll:w,__experimental__naiveDimensions:_},this.dimensions=new N3(J,Q,{autoResize:M}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.anchors&&this.options.wrapper===window)this.options.wrapper.addEventListener("click",this.onClick,!1);if(this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new O3($,{touchMultiplier:Y,wheelMultiplier:B}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle)this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0});if(this.options.autoRaf)this.__rafID=requestAnimationFrame(this.raf)}destroy(){if(this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),this.options.anchors&&this.options.wrapper===window)this.options.wrapper.removeEventListener("click",this.onClick,!1);if(this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this.__rafID)cancelAnimationFrame(this.__rafID)}on(J,Q){return this.emitter.on(J,Q)}off(J,Q){return this.emitter.off(J,Q)}onScrollEnd=(J)=>{if(!(J instanceof CustomEvent)){if(this.isScrolling==="smooth"||this.isScrolling===!1)J.stopPropagation()}};dispatchScrollendEvent=()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))};onTransitionEnd=(J)=>{if(J.propertyName.includes("overflow")){let Q=this.isHorizontal?"overflow-x":"overflow-y",$=getComputedStyle(this.rootElement)[Q];if(["hidden","clip"].includes($))this.stop();else this.start()}};setScroll(J){if(this.isHorizontal)this.options.wrapper.scrollTo({left:J,behavior:"instant"});else this.options.wrapper.scrollTo({top:J,behavior:"instant"})}onClick=(J)=>{let $=J.composedPath().find((Z)=>Z instanceof HTMLAnchorElement&&(Z.getAttribute("href")?.startsWith("#")||Z.getAttribute("href")?.startsWith("/#")||Z.getAttribute("href")?.startsWith("./#")));if($){let Z=$.getAttribute("href");if(Z){let K=typeof this.options.anchors==="object"&&this.options.anchors?this.options.anchors:void 0,W=`#${Z.split("#")[1]}`;if(["#","/#","./#","#top","/#top","./#top"].includes(Z))W=0;this.scrollTo(W,K)}}};onPointerDown=(J)=>{if(J.button===1)this.reset()};onVirtualScroll=(J)=>{if(typeof this.options.virtualScroll==="function"&&this.options.virtualScroll(J)===!1)return;let{deltaX:Q,deltaY:$,event:Z}=J;if(this.emitter.emit("virtual-scroll",{deltaX:Q,deltaY:$,event:Z}),Z.ctrlKey)return;if(Z.lenisStopPropagation)return;let K=Z.type.includes("touch"),W=Z.type.includes("wheel");this.isTouching=Z.type==="touchstart"||Z.type==="touchmove";let H=Q===0&&$===0;if(this.options.syncTouch&&K&&Z.type==="touchstart"&&H&&!this.isStopped&&!this.isLocked){this.reset();return}let q=this.options.gestureOrientation==="vertical"&&$===0||this.options.gestureOrientation==="horizontal"&&Q===0;if(H||q)return;let X=Z.composedPath();X=X.slice(0,X.indexOf(this.rootElement));let F=this.options.prevent;if(X.find((V)=>V instanceof HTMLElement&&(typeof F==="function"&&F?.(V)||V.hasAttribute?.("data-lenis-prevent")||K&&V.hasAttribute?.("data-lenis-prevent-touch")||W&&V.hasAttribute?.("data-lenis-prevent-wheel")||this.options.allowNestedScroll&&this.checkNestedScroll(V,{deltaX:Q,deltaY:$}))))return;if(this.isStopped||this.isLocked){Z.preventDefault();return}if(!(this.options.syncTouch&&K||this.options.smoothWheel&&W)){this.isScrolling="native",this.animate.stop(),Z.lenisStopPropagation=!0;return}let L=$;if(this.options.gestureOrientation==="both")L=Math.abs($)>Math.abs(Q)?$:Q;else if(this.options.gestureOrientation==="horizontal")L=Q;if(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&(this.animatedScroll>0&&this.animatedScroll0||this.animatedScroll===this.limit&&$<0))Z.lenisStopPropagation=!0;Z.preventDefault();let Y=K&&this.options.syncTouch,M=K&&Z.type==="touchend"&&Math.abs(L)>5;if(M)L=this.velocity*this.options.touchInertiaMultiplier;this.scrollTo(this.targetScroll+L,{programmatic:!1,...Y?{lerp:M?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})};resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}onNativeScroll=()=>{if(this._resetVelocityTimeout!==null)clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null;if(this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){let J=this.animatedScroll;if(this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-J,this.direction=Math.sign(this.animatedScroll-J),!this.isStopped)this.isScrolling="native";if(this.emit(),this.velocity!==0)this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400)}};reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(!this.isStopped)return;this.reset(),this.isStopped=!1,this.emit()}stop(){if(this.isStopped)return;this.reset(),this.isStopped=!0,this.emit()}raf=(J)=>{let Q=J-(this.time||J);if(this.time=J,this.animate.advance(Q*0.001),this.options.autoRaf)this.__rafID=requestAnimationFrame(this.raf)};scrollTo(J,{offset:Q=0,immediate:$=!1,lock:Z=!1,duration:K=this.options.duration,easing:W=this.options.easing,lerp:H=this.options.lerp,onStart:U,onComplete:q,force:X=!1,programmatic:F=!0,userData:N}={}){if((this.isStopped||this.isLocked)&&!X)return;if(typeof J==="string"&&["top","left","start"].includes(J))J=0;else if(typeof J==="string"&&["bottom","right","end"].includes(J))J=this.limit;else{let L;if(typeof J==="string")L=document.querySelector(J);else if(J instanceof HTMLElement&&J?.nodeType)L=J;if(L){if(this.options.wrapper!==window){let B=this.rootElement.getBoundingClientRect();Q-=this.isHorizontal?B.left:B.top}let Y=L.getBoundingClientRect();J=(this.isHorizontal?Y.left:Y.top)+this.animatedScroll}}if(typeof J!=="number")return;if(J+=Q,J=Math.round(J),this.options.infinite){if(F){this.targetScroll=this.animatedScroll=this.scroll;let L=J-this.animatedScroll;if(L>this.limit/2)J=J-this.limit;else if(L<-this.limit/2)J=J+this.limit}}else J=TB(0,J,this.limit);if(J===this.targetScroll){U?.(this),q?.(this);return}if(this.userData=N??{},$){this.animatedScroll=this.targetScroll=J,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),q?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}if(!F)this.targetScroll=J;if(typeof K==="number"&&typeof W!=="function")W=jB;else if(typeof W==="function"&&typeof K!=="number")K=1;this.animate.fromTo(this.animatedScroll,J,{duration:K,easing:W,lerp:H,onStart:()=>{if(Z)this.isLocked=!0;this.isScrolling="smooth",U?.(this)},onUpdate:(L,Y)=>{if(this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=L-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=L,this.setScroll(this.scroll),F)this.targetScroll=L;if(!Y)this.emit();if(Y)this.reset(),this.emit(),q?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent()}})}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(J,{deltaX:Q,deltaY:$}){let Z=Date.now(),K=J._lenis??={},W,H,U,q,X,F,N,L,Y=this.options.gestureOrientation;if(Z-(K.time??0)>2000){K.time=Date.now();let T=window.getComputedStyle(J);K.computedStyle=T;let{overflowX:w,overflowY:_}=T;if(W=["auto","overlay","scroll"].includes(w),H=["auto","overlay","scroll"].includes(_),K.hasOverflowX=W,K.hasOverflowY=H,!W&&!H)return!1;if(Y==="vertical"&&!H)return!1;if(Y==="horizontal"&&!W)return!1;X=J.scrollWidth,F=J.scrollHeight,N=J.clientWidth,L=J.clientHeight,U=X>N,q=F>L,K.isScrollableX=U,K.isScrollableY=q,K.scrollWidth=X,K.scrollHeight=F,K.clientWidth=N,K.clientHeight=L}else U=K.isScrollableX,q=K.isScrollableY,W=K.hasOverflowX,H=K.hasOverflowY,X=K.scrollWidth,F=K.scrollHeight,N=K.clientWidth,L=K.clientHeight;if(!W&&!H||!U&&!q)return!1;if(Y==="vertical"&&(!H||!q))return!1;if(Y==="horizontal"&&(!W||!U))return!1;let B;if(Y==="horizontal")B="x";else if(Y==="vertical")B="y";else{let T=Q!==0,w=$!==0;if(T&&W&&U)B="x";if(w&&H&&q)B="y"}if(!B)return!1;let M,V,A,I,P;if(B==="x")M=J.scrollLeft,V=X-N,A=Q,I=W,P=U;else if(B==="y")M=J.scrollTop,V=F-L,A=$,I=H,P=q;else return!1;return(A>0?M0)&&I&&P}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){if(this.options.__experimental__naiveDimensions)if(this.isHorizontal)return this.rootElement.scrollWidth-this.rootElement.clientWidth;else return this.rootElement.scrollHeight-this.rootElement.clientHeight;else return this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){let J=this.options.wrapper;return this.isHorizontal?J.scrollX??J.scrollLeft:J.scrollY??J.scrollTop}get scroll(){return this.options.infinite?G3(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(J){if(this._isScrolling!==J)this._isScrolling=J,this.updateClassName()}get isStopped(){return this._isStopped}set isStopped(J){if(this._isStopped!==J)this._isStopped=J,this.updateClassName()}get isLocked(){return this._isLocked}set isLocked(J){if(this._isLocked!==J)this._isLocked=J,this.updateClassName()}get isSmooth(){return this.isScrolling==="smooth"}get className(){let J="lenis";if(this.options.autoToggle)J+=" lenis-autoToggle";if(this.isStopped)J+=" lenis-stopped";if(this.isLocked)J+=" lenis-locked";if(this.isScrolling)J+=" lenis-scrolling";if(this.isScrolling==="smooth")J+=" lenis-smooth";return J}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};function yB(J=null){let Q=()=>{let W=document.body.firstElementChild;return W instanceof HTMLElement&&W.classList.contains("w-editor-publish-node")},$=Q(),Z=$;if(new MutationObserver((W)=>{W.forEach((H)=>{if(H.type==="childList"){let U=Q();if(U!==$){if(console.log("Editor state changed to:",U),J)J(U);$=U}}})}).observe(document.body,{childList:!0,subtree:!1}),J)J(Z);return Z}var F3={infinite:!1,lerp:0.1,smoothWheel:!0,touchMultiplier:2};class wB extends _B{#J=S9.ticker.add((J)=>this.raf(J*1000));constructor(){super(F3);this.on("scroll",this.#$.bind(this))}#$(J){this.notify(J)}toTop(){this.scrollTo(0,{immediate:!0})}#Q=[];add(J,Q=0,$=Symbol()){let Z=this.#Q.findIndex((K)=>K.priority>Q);if(Z===-1)this.#Q.push({fn:J,priority:Q,id:$});else this.#Q.splice(Z,0,{fn:J,priority:Q,id:$});return()=>this.remove($)}remove(J){this.#Q=this.#Q.filter((Q)=>Q.id!==J)}notify(J){if(this.#Q.length<1)return;this.#Q.forEach((Q)=>Q.fn(J))}}var w7=new wB;yB((J)=>{if(J)w7.destroy();else w7.start()});var hB=(J)=>{let Q=J.getBoundingClientRect();return{top:Q.top+w7.scroll,bottom:Q.bottom+w7.scroll,width:Q.width,height:Q.height,left:Q.left,right:Q.right,wh:C7.height,ww:C7.width,offset:Q.top+w7.scroll,centery:C7.height/2-Q.height/2-Q.top-w7.scroll,centerx:-C7.width/2+Q.left+Q.width/2}};function xB(J,Q,$,Z,K){return Z+(K-Z)*(J-Q)/($-Q)}function fB(J,Q,$){return Math.min(Math.max($,J),Q)}var D3={bounds:[0,1],top:"bottom",bottom:"top",callback:void 0};class gN extends gZ{value=0;init=!1;isIn(J){this.#Z()}isOut(J){}bounds;config;resize;handleScroll;#J;#$;constructor(J,Q={}){super(J,{autoStart:!0,once:!1,threshold:0});this.element=J,this.config={...D3,...Q},this.#Q(),this.#J=w7.add(this.#Z.bind(this)),this.#$=C7.add(this.#Q.bind(this)),this.init=!0,this.#Z()}#Q=()=>{this.bounds=L3(this.element,this.config),this.resize?.(this.bounds),this.#Z()};#Z(){if(!this.inView||!this.init)return;this.value=fB(0,1,xB(w7.scroll,this.bounds.top,this.bounds.bottom,this.config.bounds[0],this.config.bounds[1])),this.handleScroll?.(this.value),this.config.callback?.(this.value)}destroy(){this.config.callback=void 0,this.#J(),this.#$(),super.destroy()}}function L3(J,Q){let $=hB(J),{top:Z,bottom:K,wh:W}=$,H=W/2;return $.top=Z-(Q.top==="center"?H:Q.top==="bottom"?W:0),$.bottom=K-(Q.bottom==="center"?H:Q.bottom==="bottom"?W:0),$}function bB(J,Q){let $=document.cookie.includes("goose=true"),Z=new URLSearchParams(window.location.search).has("directaccess");if(console.log("menu Has Cookie",$),console.log("menu Has Direct Access",Z),Z&&!$)document.cookie="goose=true; path=/; max-age=31536000",console.log("Cookie set due to direct access");if($||Z)J.dataset.sotwNav="unlocked",document.querySelectorAll("[data-chapters]").forEach((A)=>{A.setAttribute("data-chapters","unlocked")});let K=J.querySelector(".ww-micro-nav_btn"),W=J.querySelector(".ww-micro-nav_close"),H=document.querySelector(".ww-micro-overlay"),U=!1,q=()=>{if(U)return;if(U=!0,K)K.setAttribute("data-micro-nav","open"),K.setAttribute("aria-expanded","true");if(H)H.setAttribute("data-micro-nav","visible")},X=()=>{if(!U)return;if(U=!1,K)K.removeAttribute("data-micro-nav"),K.setAttribute("aria-expanded","false");if(H)H.removeAttribute("data-micro-nav")},F=()=>{if(U)X();else q()},N=(V)=>{V.preventDefault(),V.stopPropagation(),F()},L=(V)=>{V.preventDefault(),V.stopPropagation(),X()},Y=()=>{X()},B=(V)=>{if(!U)return;if(!J.contains(V.target))X()},M=(V)=>{if(V.key==="Escape"&&U)X()};XJ(()=>{if(K)K.addEventListener("click",N);if(W)W.addEventListener("click",L);if(H)H.addEventListener("click",Y);document.addEventListener("click",B),document.addEventListener("keydown",M)}),YJ(()=>{if(K)K.removeEventListener("click",N);if(W)W.removeEventListener("click",L);if(H)H.removeEventListener("click",Y);document.removeEventListener("click",B),document.removeEventListener("keydown",M)})}console.log("SOTW LP loaded");})(); //# debugId=DDD591469859519D64756E2164756E21