diff --git a/apps/dashboard/build/_app/env.js.gz b/apps/dashboard/build/_app/env.js.gz index e95cbd5..e9f837d 100644 Binary files a/apps/dashboard/build/_app/env.js.gz and b/apps/dashboard/build/_app/env.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.BChctYiF.css.gz b/apps/dashboard/build/_app/immutable/assets/0.BChctYiF.css.gz index f5a8381..abec51e 100644 Binary files a/apps/dashboard/build/_app/immutable/assets/0.BChctYiF.css.gz and b/apps/dashboard/build/_app/immutable/assets/0.BChctYiF.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz index 8719f65..1e76ad0 100644 Binary files a/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz and b/apps/dashboard/build/_app/immutable/assets/5.BBx09UGv.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br deleted file mode 100644 index b06137d..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz b/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz deleted file mode 100644 index f8623d9..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js b/apps/dashboard/build/_app/immutable/chunks/BBD-8XME.js similarity index 99% rename from apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js rename to apps/dashboard/build/_app/immutable/chunks/BBD-8XME.js index fe4513c..e2808a5 100644 --- a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js +++ b/apps/dashboard/build/_app/immutable/chunks/BBD-8XME.js @@ -1 +1 @@ -var cn=Object.defineProperty;var wt=e=>{throw TypeError(e)};var _n=(e,t,n)=>t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>_n(e,typeof t!="symbol"?t+"":t,n),Ke=(e,t,n)=>t.has(e)||wt("Cannot "+n);var p=(e,t,n)=>(Ke(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(Ke(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(Ke(e,t,"access private method"),n);var vn=Array.isArray,dn=Array.prototype.indexOf,Ee=Array.prototype.includes,ar=Array.from,lr=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,hn=Object.prototype,wn=Array.prototype,kt=Object.getPrototypeOf,yt=Object.isExtensible;const yn=()=>{};function or(e){return e()}function En(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ur(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,De=4,Ie=8,Dt=1<<24,G=16,H=32,ve=64,mn=128,P=512,g=1024,R=2048,Y=4096,j=8192,$=16384,oe=32768,je=65536,Et=1<<17,It=1<<18,Pe=1<<19,Pt=1<<20,cr=1<<25,ue=65536,$e=1<<21,st=1<<22,Z=1<<23,ae=Symbol("$state"),_r=Symbol("legacy props"),vr=Symbol(""),ne=new class extends Error{constructor(){super(...arguments);de(this,"name","StaleReactionError");de(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Nt;const pr=!!((Nt=globalThis.document)!=null&&Nt.contentType)&&globalThis.document.contentType.includes("xml"),Ue=3,Ct=8;function gn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Tn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function An(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function yr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Rn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function On(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Er(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const mr=1,gr=2,Tr=4,br=8,Ar=16,Sr=1,Rr=2,Or=4,Nr=8,kr=16,xr=1,Dr=2,kn="[",xn="[!",Ir="[?",Dn="]",ft={},T=Symbol(),In="http://www.w3.org/1999/xhtml";function it(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Pr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Cr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let J=!1;function Fr(e){J=e}let m;function me(e){if(e===null)throw it(),ft;return m=e}function Mr(){return me(ee(m))}function Lr(e){if(J){if(ee(m)!==null)throw it(),ft;m=e}}function jr(e=1){if(J){for(var t=e,n=m;t--;)n=ee(n);m=n}}function Yr(e=!0){for(var t=0,n=m;;){if(n.nodeType===Ct){var r=n.data;if(r===Dn){if(t===0)return n;t-=1}else(r===kn||r===xn||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=ee(n);e&&n.remove(),n=s}}function Hr(e){if(!e||e.nodeType!==Ct)throw it(),ft;return e.data}function Ft(e){return e===this.v}function Pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Mt(e){return!Pn(e,this.v)}let Be=!1;function qr(){Be=!0}let S=null;function Ye(e){S=e}function Vr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ur(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return t.i=!0,S=t.p,{}}function Ce(){return!Be||S!==null&&S.l===null}let re=[];function Lt(){var e=re;re=[],En(e)}function mt(e){if(re.length===0&&!Oe){var t=re;queueMicrotask(()=>{t===re&&Lt()})}re.push(e)}function Cn(){for(;re.length>0;)Lt()}function Fn(e){var t=w;if(t===null)return _.f|=Z,e;if((t.f&oe)===0&&(t.f&De)===0)throw e;He(e,t)}function He(e,t){for(;t!==null;){if((t.f&mn)!==0){if((t.f&oe)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Mn=-7169;function E(e,t){e.f=e.f&Mn|t}function at(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,Y)}function jt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&ue)===0||(t.f^=ue,jt(t.deps))}function Ln(e,t,n){(e.f&R)!==0?t.add(e):(e.f&Y)!==0&&n.add(e),jt(e.deps),E(e,g)}const Me=new Set;let d=null,gt=null,b=null,N=[],Ge=null,Ze=!1,Oe=!1;var pe,he,fe,we,ke,xe,ie,U,ye,D,We,Je,Qe,Yt;const dt=class dt{constructor(){F(this,D);de(this,"current",new Map);de(this,"previous",new Map);F(this,pe,new Set);F(this,he,new Set);F(this,fe,0);F(this,we,0);F(this,ke,null);F(this,xe,new Set);F(this,ie,new Set);F(this,U,new Map);de(this,"is_fork",!1);F(this,ye,!1)}skip_effect(t){p(this,U).has(t)||p(this,U).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,U).get(t);if(n){p(this,U).delete(t);for(var r of n.d)E(r,R),B(r);for(r of n.m)E(r,Y),B(r)}}process(t){var s;N=[],this.apply();var n=[],r=[];for(const f of t)K(this,D,Je).call(this,f,n,r);if(K(this,D,We).call(this)){K(this,D,Qe).call(this,r),K(this,D,Qe).call(this,n);for(const[f,a]of p(this,U))Ut(f,a)}else{for(const f of p(this,pe))f();p(this,pe).clear(),p(this,fe)===0&&K(this,D,Yt).call(this),gt=this,d=null,Tt(r),Tt(n),gt=null,(s=p(this,ke))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Z)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),N.length>0){if(Ht(),d!==null&&d!==this)return}else p(this,fe)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,he))t(this);p(this,he).clear()}increment(t){z(this,fe,p(this,fe)+1),t&&z(this,we,p(this,we)+1)}decrement(t){z(this,fe,p(this,fe)-1),t&&z(this,we,p(this,we)-1),!p(this,ye)&&(z(this,ye,!0),mt(()=>{z(this,ye,!1),K(this,D,We).call(this)?N.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,xe))p(this,ie).delete(t),E(t,R),B(t);for(const t of p(this,ie))E(t,Y),B(t);this.flush()}oncommit(t){p(this,pe).add(t)}ondiscard(t){p(this,he).add(t)}settled(){return(p(this,ke)??z(this,ke,xt())).promise}static ensure(){if(d===null){const t=d=new dt;Me.add(d),Oe||mt(()=>{d===t&&t.flush()})}return d}apply(){}};pe=new WeakMap,he=new WeakMap,fe=new WeakMap,we=new WeakMap,ke=new WeakMap,xe=new WeakMap,ie=new WeakMap,U=new WeakMap,ye=new WeakMap,D=new WeakSet,We=function(){return this.is_fork||p(this,we)>0},Je=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,a=(f&(H|ve))!==0,l=a&&(f&g)!==0,i=l||(f&j)!==0||p(this,U).has(s);if(!i&&s.fn!==null){a?s.f^=g:(f&De)!==0?n.push(s):Fe(s)&&((f&G)!==0&&p(this,ie).add(s),be(s));var o=s.first;if(o!==null){s=o;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},Qe=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Me){if(f===this){n=!1;continue}const a=[];for(const[i,o]of this.current){if(f.current.has(i))if(n&&o!==f.current.get(i))f.current.set(i,o);else continue;a.push(i)}if(a.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var r=N;N=[];const i=new Set,o=new Map;for(const c of a)qt(c,l,i,o);if(N.length>0){d=f,f.apply();for(const c of N)K(s=f,D,Je).call(s,c,[],[]);f.deactivate()}N=r}}d=null,b=t}Me.delete(this)};let ge=dt;function jn(e){var t=Oe;Oe=!0;try{for(var n;;){if(Cn(),N.length===0&&(d==null||d.flush(),N.length===0))return Ge=null,n;Ht()}}finally{Oe=t}}function Ht(){Ze=!0;var e=null;try{for(var t=0;N.length>0;){var n=ge.ensure();if(t++>1e3){var r,s;Yn()}n.process(N),W.clear()}}finally{N=[],Ze=!1,Ge=null}}function Yn(){try{Sn()}catch(e){He(e,Ge)}}let M=null;function Tt(e){var t=e.length;if(t!==0){for(var n=0;n0)){W.clear();for(const s of M){if((s.f&($|j))!==0)continue;const f=[s];let a=s.parent;for(;a!==null;)M.has(a)&&(M.delete(a),f.push(a)),a=a.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&($|j))===0&&be(i)}}M.clear()}}M=null}}function qt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?qt(s,t,n,r):(f&(st|G))!==0&&(f&R)===0&&Vt(s,t,r)&&(E(s,R),B(s))}}function Vt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ee.call(t,s))return!0;if((s.f&A)!==0&&Vt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function B(e){var t=Ge=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(De|Ie|Dt))!==0&&(e.f&oe)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Ze&&t===w&&(r&G)!==0&&(r&It)===0&&(r&oe)!==0)return;if((r&(ve|H))!==0){if((r&g)===0)return;t.f^=g}}N.push(t)}function Ut(e,t){if(!((e.f&H)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&Y)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)Ut(n,t),n=n.next}}function Hn(e,t,n,r){const s=Ce()?lt:Bn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var a=w,l=qn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function o(u){l();try{r(u)}catch(v){(a.f&$)===0&&He(v,a)}et()}if(n.length===0){i.then(()=>o(t.map(s)));return}function c(){l(),Promise.all(n.map(u=>Un(u))).then(u=>o([...t.map(s),...u])).catch(u=>He(u,a))}i?i.then(c):c()}function qn(){var e=w,t=_,n=S,r=d;return function(f=!0){Te(e),Q(t),Ye(n),f&&(r==null||r.activate())}}function et(e=!0){Te(null),Q(null),Ye(null),e&&(d==null||d.deactivate())}function Vn(){var e=w.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function lt(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return w!==null&&(w.f|=Pe),{ctx:S,deps:null,effects:null,equals:Ft,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??w,ac:null}}function Un(e,t,n){w===null&&gn();var s=void 0,f=ut(T),a=!_,l=new Map;return er(()=>{var v;var i=xt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(et)}catch(y){i.reject(y),et()}var o=d;if(a){var c=Vn();(v=l.get(o))==null||v.reject(ne),l.delete(o),l.set(o,i)}const u=(y,h=void 0)=>{if(o.activate(),h)h!==ne&&(f.f|=Z,nt(f,h));else{(f.f&Z)!==0&&(f.f^=Z),nt(f,y);for(const[V,O]of l){if(l.delete(V),V===o)break;O.reject(ne)}}c&&c()};i.promise.then(u,y=>u(null,y||"unknown"))}),Qn(()=>{for(const i of l.values())i.reject(ne)}),new Promise(i=>{function o(c){function u(){c===s?i(f):o(s)}c.then(u,u)}o(s)})}function Br(e){const t=lt(e);return rn(t),t}function Bn(e){const t=lt(e);return t.equals=Mt,t}function Gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!zt&&Xn()}return t}function Xn(){zt=!1;for(const e of tt)(e.f&g)!==0&&E(e,Y),Fe(e)&&be(e);tt.clear()}function Xe(e){te(e,e.v+1)}function Kt(e,t){var n=e.reactions;if(n!==null)for(var r=Ce(),s=n.length,f=0;f{if(le===f)return l();var i=_,o=le;Q(null),Ot(f);var c=l();return Q(i),Ot(o),c};return r&&n.set("length",X(e.length)),new Proxy(e,{defineProperty(l,i,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Rn();var c=n.get(i);return c===void 0?a(()=>{var u=X(o.value);return n.set(i,u),u}):te(c,o.value,!0),!0},deleteProperty(l,i){var o=n.get(i);if(o===void 0){if(i in l){const c=a(()=>X(T));n.set(i,c),Xe(s)}}else te(o,T),Xe(s);return!0},get(l,i,o){var y;if(i===ae)return e;var c=n.get(i),u=i in l;if(c===void 0&&(!u||(y=Re(l,i))!=null&&y.writable)&&(c=a(()=>{var h=Ae(u?l[i]:T),V=X(h);return V}),n.set(i,c)),c!==void 0){var v=Se(c);return v===T?void 0:v}return Reflect.get(l,i,o)},getOwnPropertyDescriptor(l,i){var o=Reflect.getOwnPropertyDescriptor(l,i);if(o&&"value"in o){var c=n.get(i);c&&(o.value=Se(c))}else if(o===void 0){var u=n.get(i),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(l,i){var v;if(i===ae)return!0;var o=n.get(i),c=o!==void 0&&o.v!==T||Reflect.has(l,i);if(o!==void 0||w!==null&&(!c||(v=Re(l,i))!=null&&v.writable)){o===void 0&&(o=a(()=>{var y=c?Ae(l[i]):T,h=X(y);return h}),n.set(i,o));var u=Se(o);if(u===T)return!1}return c},set(l,i,o,c){var ht;var u=n.get(i),v=i in l;if(r&&i==="length")for(var y=o;yX(T)),n.set(y+"",h))}if(u===void 0)(!v||(ht=Re(l,i))!=null&&ht.writable)&&(u=a(()=>X(void 0)),te(u,Ae(o)),n.set(i,u));else{v=u.v!==T;var V=a(()=>Ae(o));te(u,V)}var O=Reflect.getOwnPropertyDescriptor(l,i);if(O!=null&&O.set&&O.set.call(c,o),!v){if(r&&typeof i=="string"){var pt=n.get("length"),ze=Number(i);Number.isInteger(ze)&&ze>=pt.v&&te(pt,ze+1)}Xe(s)}return!0},ownKeys(l){Se(s);var i=Reflect.ownKeys(l).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[o,c]of n)c.v!==T&&!(o in l)&&i.push(o);return i},setPrototypeOf(){On()}})}function bt(e){try{if(e!==null&&typeof e=="object"&&ae in e)return e[ae]}catch{}return e}function zr(e,t){return Object.is(bt(e),bt(t))}var At,$n,Xt,$t;function Kr(){if(At===void 0){At=window,$n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=Re(t,"firstChild").get,$t=Re(t,"nextSibling").get,yt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),yt(n)&&(n.__t=void 0)}}function qe(e=""){return document.createTextNode(e)}function Ve(e){return Xt.call(e)}function ee(e){return $t.call(e)}function Xr(e,t){if(!J)return Ve(e);var n=Ve(m);if(n===null)n=m.appendChild(qe());else if(t&&n.nodeType!==Ue){var r=qe();return n==null||n.before(r),me(r),r}return t&&ct(n),me(n),n}function $r(e,t=!1){if(!J){var n=Ve(e);return n instanceof Comment&&n.data===""?ee(n):n}if(t){if((m==null?void 0:m.nodeType)!==Ue){var r=qe();return m==null||m.before(r),me(r),r}ct(m)}return m}function Zr(e,t=1,n=!1){let r=J?m:e;for(var s;t--;)s=r,r=ee(r);if(!J)return r;if(n){if((r==null?void 0:r.nodeType)!==Ue){var f=qe();return r===null?s==null||s.after(f):r.before(f),me(f),f}ct(r)}return me(r),r}function Zn(e){e.textContent=""}function Wr(){return!1}function Jr(e,t,n){return document.createElementNS(In,e,void 0)}function ct(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ue;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qr(e){J&&Ve(e)!==null&&Zn(e)}let St=!1;function Wn(){St||(St=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function _t(e){var t=_,n=w;Q(null),Te(null);try{return e()}finally{Q(t),Te(n)}}function es(e,t,n,r=n){e.addEventListener(t,()=>_t(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Wn()}function Zt(e){w===null&&(_===null&&An(),bn()),_e&&Tn()}function Jn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function q(e,t,n){var r=w;r!==null&&(r.f&j)!==0&&(e|=j);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{be(s)}catch(l){throw ce(s),l}else t!==null&&B(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Pe)===0&&(f=f.first,(e&G)!==0&&(e&je)!==0&&f!==null&&(f.f|=je)),f!==null&&(f.parent=r,r!==null&&Jn(f,r),_!==null&&(_.f&A)!==0&&(e&ve)===0)){var a=_;(a.effects??(a.effects=[])).push(f)}return s}function Wt(){return _!==null&&!L}function Qn(e){const t=q(Ie,null,!1);return E(t,g),t.teardown=e,t}function ts(e){Zt();var t=w.f,n=!_&&(t&H)!==0&&(t&oe)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return Jt(e)}function Jt(e){return q(De|Pt,e,!1)}function ns(e){return Zt(),q(Ie|Pt,e,!0)}function rs(e){ge.ensure();const t=q(ve|Pe,e,!0);return(n={})=>new Promise(r=>{n.outro?rr(t,()=>{ce(t),r(void 0)}):(ce(t),r(void 0))})}function ss(e){return q(De,e,!1)}function er(e){return q(st|Pe,e,!0)}function fs(e,t=0){return q(Ie|t,e,!0)}function is(e,t=[],n=[],r=[]){Hn(r,t,n,s=>{q(Ie,()=>e(...s.map(Se)),!0)})}function as(e,t=0){var n=q(G|t,e,!0);return n}function ls(e){return q(H|Pe,e,!0)}function Qt(e){var t=e.teardown;if(t!==null){const n=_e,r=_;Rt(!0),Q(null);try{t.call(null)}finally{Rt(n),Q(r)}}}function vt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&_t(()=>{s.abort(ne)});var r=n.next;(n.f&ve)!==0?n.parent=null:ce(n,t),n=r}}function tr(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&H)===0&&ce(t),t=n}}function ce(e,t=!0){var n=!1;(t||(e.f&It)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(nr(e.nodes.start,e.nodes.end),n=!0),vt(e,t&&!n),Ne(e,0),E(e,$);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Qt(e);var s=e.parent;s!==null&&s.first!==null&&en(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function nr(e,t){for(;e!==null;){var n=e===t?null:ee(e);e.remove(),e=n}}function en(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function rr(e,t,n=!0){var r=[];tn(e,r,!0);var s=()=>{n&&ce(e),t&&t()},f=r.length;if(f>0){var a=()=>--f||s();for(var l of r)l.out(a)}else s()}function tn(e,t,n){if((e.f&j)===0){e.f^=j;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,a=(s.f&je)!==0||(s.f&H)!==0&&(e.f&G)!==0;tn(s,t,a?n:!1),s=f}}}function os(e){nn(e,!0)}function nn(e,t){if((e.f&j)!==0){e.f^=j,(e.f&g)===0&&(E(e,R),B(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&je)!==0||(n.f&H)!==0;nn(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const a of f)(a.is_global||t)&&a.in()}}function us(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:ee(n);t.append(n),n=s}}let Le=!1,_e=!1;function Rt(e){_e=e}let _=null,L=!1;function Q(e){_=e}let w=null;function Te(e){w=e}let C=null;function rn(e){_!==null&&(C===null?C=[e]:C.push(e))}let k=null,x=0,I=null;function sr(e){I=e}let sn=1,se=0,le=se;function Ot(e){le=e}function fn(){return++sn}function Fe(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~ue),(t&Y)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function an(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&Ee.call(C,e)))for(var s=0;s{e.ac.abort(ne)}),e.ac=null);try{e.f|=$e;var c=e.fn,u=c();e.f|=oe;var v=e.deps,y=d==null?void 0:d.is_fork;if(k!==null){var h;if(y||Ne(e,x),v!==null&&x>0)for(v.length=x+k.length,h=0;h{throw TypeError(e)};var _n=(e,t,n)=>t in e?cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>_n(e,typeof t!="symbol"?t+"":t,n),Ke=(e,t,n)=>t.has(e)||wt("Cannot "+n);var p=(e,t,n)=>(Ke(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(Ke(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(Ke(e,t,"access private method"),n);var vn=Array.isArray,dn=Array.prototype.indexOf,Ee=Array.prototype.includes,ar=Array.from,lr=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,hn=Object.prototype,wn=Array.prototype,kt=Object.getPrototypeOf,yt=Object.isExtensible;const yn=()=>{};function or(e){return e()}function En(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function ur(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,De=4,Ie=8,Dt=1<<24,G=16,H=32,ve=64,mn=128,P=512,g=1024,R=2048,Y=4096,j=8192,$=16384,oe=32768,je=65536,Et=1<<17,It=1<<18,Pe=1<<19,Pt=1<<20,cr=1<<25,ue=65536,$e=1<<21,st=1<<22,Z=1<<23,ae=Symbol("$state"),_r=Symbol("legacy props"),vr=Symbol(""),ne=new class extends Error{constructor(){super(...arguments);de(this,"name","StaleReactionError");de(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Nt;const pr=!!((Nt=globalThis.document)!=null&&Nt.contentType)&&globalThis.document.contentType.includes("xml"),Ue=3,Ct=8;function gn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Tn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function An(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function yr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Rn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function On(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Nn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Er(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const mr=1,gr=2,Tr=4,br=8,Ar=16,Sr=1,Rr=2,Or=4,Nr=8,kr=16,xr=1,Dr=2,kn="[",xn="[!",Ir="[?",Dn="]",ft={},T=Symbol(),In="http://www.w3.org/1999/xhtml";function it(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Pr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Cr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let J=!1;function Fr(e){J=e}let m;function me(e){if(e===null)throw it(),ft;return m=e}function Mr(){return me(ee(m))}function Lr(e){if(J){if(ee(m)!==null)throw it(),ft;m=e}}function jr(e=1){if(J){for(var t=e,n=m;t--;)n=ee(n);m=n}}function Yr(e=!0){for(var t=0,n=m;;){if(n.nodeType===Ct){var r=n.data;if(r===Dn){if(t===0)return n;t-=1}else(r===kn||r===xn||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=ee(n);e&&n.remove(),n=s}}function Hr(e){if(!e||e.nodeType!==Ct)throw it(),ft;return e.data}function Ft(e){return e===this.v}function Pn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Mt(e){return!Pn(e,this.v)}let Be=!1;function qr(){Be=!0}let S=null;function Ye(e){S=e}function Vr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ur(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return t.i=!0,S=t.p,{}}function Ce(){return!Be||S!==null&&S.l===null}let re=[];function Lt(){var e=re;re=[],En(e)}function mt(e){if(re.length===0&&!Oe){var t=re;queueMicrotask(()=>{t===re&&Lt()})}re.push(e)}function Cn(){for(;re.length>0;)Lt()}function Fn(e){var t=w;if(t===null)return _.f|=Z,e;if((t.f&oe)===0&&(t.f&De)===0)throw e;He(e,t)}function He(e,t){for(;t!==null;){if((t.f&mn)!==0){if((t.f&oe)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Mn=-7169;function E(e,t){e.f=e.f&Mn|t}function at(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,Y)}function jt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&ue)===0||(t.f^=ue,jt(t.deps))}function Ln(e,t,n){(e.f&R)!==0?t.add(e):(e.f&Y)!==0&&n.add(e),jt(e.deps),E(e,g)}const Me=new Set;let d=null,gt=null,b=null,N=[],Ge=null,Ze=!1,Oe=!1;var pe,he,fe,we,ke,xe,ie,U,ye,D,We,Je,Qe,Yt;const dt=class dt{constructor(){F(this,D);de(this,"current",new Map);de(this,"previous",new Map);F(this,pe,new Set);F(this,he,new Set);F(this,fe,0);F(this,we,0);F(this,ke,null);F(this,xe,new Set);F(this,ie,new Set);F(this,U,new Map);de(this,"is_fork",!1);F(this,ye,!1)}skip_effect(t){p(this,U).has(t)||p(this,U).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,U).get(t);if(n){p(this,U).delete(t);for(var r of n.d)E(r,R),B(r);for(r of n.m)E(r,Y),B(r)}}process(t){var s;N=[],this.apply();var n=[],r=[];for(const f of t)K(this,D,Je).call(this,f,n,r);if(K(this,D,We).call(this)){K(this,D,Qe).call(this,r),K(this,D,Qe).call(this,n);for(const[f,a]of p(this,U))Ut(f,a)}else{for(const f of p(this,pe))f();p(this,pe).clear(),p(this,fe)===0&&K(this,D,Yt).call(this),gt=this,d=null,Tt(r),Tt(n),gt=null,(s=p(this,ke))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Z)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),N.length>0){if(Ht(),d!==null&&d!==this)return}else p(this,fe)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,he))t(this);p(this,he).clear()}increment(t){z(this,fe,p(this,fe)+1),t&&z(this,we,p(this,we)+1)}decrement(t){z(this,fe,p(this,fe)-1),t&&z(this,we,p(this,we)-1),!p(this,ye)&&(z(this,ye,!0),mt(()=>{z(this,ye,!1),K(this,D,We).call(this)?N.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,xe))p(this,ie).delete(t),E(t,R),B(t);for(const t of p(this,ie))E(t,Y),B(t);this.flush()}oncommit(t){p(this,pe).add(t)}ondiscard(t){p(this,he).add(t)}settled(){return(p(this,ke)??z(this,ke,xt())).promise}static ensure(){if(d===null){const t=d=new dt;Me.add(d),Oe||mt(()=>{d===t&&t.flush()})}return d}apply(){}};pe=new WeakMap,he=new WeakMap,fe=new WeakMap,we=new WeakMap,ke=new WeakMap,xe=new WeakMap,ie=new WeakMap,U=new WeakMap,ye=new WeakMap,D=new WeakSet,We=function(){return this.is_fork||p(this,we)>0},Je=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,a=(f&(H|ve))!==0,l=a&&(f&g)!==0,i=l||(f&j)!==0||p(this,U).has(s);if(!i&&s.fn!==null){a?s.f^=g:(f&De)!==0?n.push(s):Fe(s)&&((f&G)!==0&&p(this,ie).add(s),be(s));var o=s.first;if(o!==null){s=o;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},Qe=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Me){if(f===this){n=!1;continue}const a=[];for(const[i,o]of this.current){if(f.current.has(i))if(n&&o!==f.current.get(i))f.current.set(i,o);else continue;a.push(i)}if(a.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var r=N;N=[];const i=new Set,o=new Map;for(const c of a)qt(c,l,i,o);if(N.length>0){d=f,f.apply();for(const c of N)K(s=f,D,Je).call(s,c,[],[]);f.deactivate()}N=r}}d=null,b=t}Me.delete(this)};let ge=dt;function jn(e){var t=Oe;Oe=!0;try{for(var n;;){if(Cn(),N.length===0&&(d==null||d.flush(),N.length===0))return Ge=null,n;Ht()}}finally{Oe=t}}function Ht(){Ze=!0;var e=null;try{for(var t=0;N.length>0;){var n=ge.ensure();if(t++>1e3){var r,s;Yn()}n.process(N),W.clear()}}finally{N=[],Ze=!1,Ge=null}}function Yn(){try{Sn()}catch(e){He(e,Ge)}}let M=null;function Tt(e){var t=e.length;if(t!==0){for(var n=0;n0)){W.clear();for(const s of M){if((s.f&($|j))!==0)continue;const f=[s];let a=s.parent;for(;a!==null;)M.has(a)&&(M.delete(a),f.push(a)),a=a.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&($|j))===0&&be(i)}}M.clear()}}M=null}}function qt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?qt(s,t,n,r):(f&(st|G))!==0&&(f&R)===0&&Vt(s,t,r)&&(E(s,R),B(s))}}function Vt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ee.call(t,s))return!0;if((s.f&A)!==0&&Vt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function B(e){var t=Ge=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(De|Ie|Dt))!==0&&(e.f&oe)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Ze&&t===w&&(r&G)!==0&&(r&It)===0&&(r&oe)!==0)return;if((r&(ve|H))!==0){if((r&g)===0)return;t.f^=g}}N.push(t)}function Ut(e,t){if(!((e.f&H)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&Y)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)Ut(n,t),n=n.next}}function Hn(e,t,n,r){const s=Ce()?lt:Bn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var a=w,l=qn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function o(u){l();try{r(u)}catch(v){(a.f&$)===0&&He(v,a)}et()}if(n.length===0){i.then(()=>o(t.map(s)));return}function c(){l(),Promise.all(n.map(u=>Un(u))).then(u=>o([...t.map(s),...u])).catch(u=>He(u,a))}i?i.then(c):c()}function qn(){var e=w,t=_,n=S,r=d;return function(f=!0){Te(e),Q(t),Ye(n),f&&(r==null||r.activate())}}function et(e=!0){Te(null),Q(null),Ye(null),e&&(d==null||d.deactivate())}function Vn(){var e=w.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function lt(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return w!==null&&(w.f|=Pe),{ctx:S,deps:null,effects:null,equals:Ft,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??w,ac:null}}function Un(e,t,n){w===null&&gn();var s=void 0,f=ut(T),a=!_,l=new Map;return er(()=>{var v;var i=xt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(et)}catch(y){i.reject(y),et()}var o=d;if(a){var c=Vn();(v=l.get(o))==null||v.reject(ne),l.delete(o),l.set(o,i)}const u=(y,h=void 0)=>{if(o.activate(),h)h!==ne&&(f.f|=Z,nt(f,h));else{(f.f&Z)!==0&&(f.f^=Z),nt(f,y);for(const[V,O]of l){if(l.delete(V),V===o)break;O.reject(ne)}}c&&c()};i.promise.then(u,y=>u(null,y||"unknown"))}),Qn(()=>{for(const i of l.values())i.reject(ne)}),new Promise(i=>{function o(c){function u(){c===s?i(f):o(s)}c.then(u,u)}o(s)})}function Br(e){const t=lt(e);return rn(t),t}function Bn(e){const t=lt(e);return t.equals=Mt,t}function Gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!zt&&Xn()}return t}function Xn(){zt=!1;for(const e of tt)(e.f&g)!==0&&E(e,Y),Fe(e)&&be(e);tt.clear()}function Xe(e){te(e,e.v+1)}function Kt(e,t){var n=e.reactions;if(n!==null)for(var r=Ce(),s=n.length,f=0;f{if(le===f)return l();var i=_,o=le;Q(null),Ot(f);var c=l();return Q(i),Ot(o),c};return r&&n.set("length",X(e.length)),new Proxy(e,{defineProperty(l,i,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&Rn();var c=n.get(i);return c===void 0?a(()=>{var u=X(o.value);return n.set(i,u),u}):te(c,o.value,!0),!0},deleteProperty(l,i){var o=n.get(i);if(o===void 0){if(i in l){const c=a(()=>X(T));n.set(i,c),Xe(s)}}else te(o,T),Xe(s);return!0},get(l,i,o){var y;if(i===ae)return e;var c=n.get(i),u=i in l;if(c===void 0&&(!u||(y=Re(l,i))!=null&&y.writable)&&(c=a(()=>{var h=Ae(u?l[i]:T),V=X(h);return V}),n.set(i,c)),c!==void 0){var v=Se(c);return v===T?void 0:v}return Reflect.get(l,i,o)},getOwnPropertyDescriptor(l,i){var o=Reflect.getOwnPropertyDescriptor(l,i);if(o&&"value"in o){var c=n.get(i);c&&(o.value=Se(c))}else if(o===void 0){var u=n.get(i),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return o},has(l,i){var v;if(i===ae)return!0;var o=n.get(i),c=o!==void 0&&o.v!==T||Reflect.has(l,i);if(o!==void 0||w!==null&&(!c||(v=Re(l,i))!=null&&v.writable)){o===void 0&&(o=a(()=>{var y=c?Ae(l[i]):T,h=X(y);return h}),n.set(i,o));var u=Se(o);if(u===T)return!1}return c},set(l,i,o,c){var ht;var u=n.get(i),v=i in l;if(r&&i==="length")for(var y=o;yX(T)),n.set(y+"",h))}if(u===void 0)(!v||(ht=Re(l,i))!=null&&ht.writable)&&(u=a(()=>X(void 0)),te(u,Ae(o)),n.set(i,u));else{v=u.v!==T;var V=a(()=>Ae(o));te(u,V)}var O=Reflect.getOwnPropertyDescriptor(l,i);if(O!=null&&O.set&&O.set.call(c,o),!v){if(r&&typeof i=="string"){var pt=n.get("length"),ze=Number(i);Number.isInteger(ze)&&ze>=pt.v&&te(pt,ze+1)}Xe(s)}return!0},ownKeys(l){Se(s);var i=Reflect.ownKeys(l).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[o,c]of n)c.v!==T&&!(o in l)&&i.push(o);return i},setPrototypeOf(){On()}})}function bt(e){try{if(e!==null&&typeof e=="object"&&ae in e)return e[ae]}catch{}return e}function zr(e,t){return Object.is(bt(e),bt(t))}var At,$n,Xt,$t;function Kr(){if(At===void 0){At=window,$n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=Re(t,"firstChild").get,$t=Re(t,"nextSibling").get,yt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),yt(n)&&(n.__t=void 0)}}function qe(e=""){return document.createTextNode(e)}function Ve(e){return Xt.call(e)}function ee(e){return $t.call(e)}function Xr(e,t){if(!J)return Ve(e);var n=Ve(m);if(n===null)n=m.appendChild(qe());else if(t&&n.nodeType!==Ue){var r=qe();return n==null||n.before(r),me(r),r}return t&&ct(n),me(n),n}function $r(e,t=!1){if(!J){var n=Ve(e);return n instanceof Comment&&n.data===""?ee(n):n}if(t){if((m==null?void 0:m.nodeType)!==Ue){var r=qe();return m==null||m.before(r),me(r),r}ct(m)}return m}function Zr(e,t=1,n=!1){let r=J?m:e;for(var s;t--;)s=r,r=ee(r);if(!J)return r;if(n){if((r==null?void 0:r.nodeType)!==Ue){var f=qe();return r===null?s==null||s.after(f):r.before(f),me(f),f}ct(r)}return me(r),r}function Zn(e){e.textContent=""}function Wr(){return!1}function Jr(e,t,n){return document.createElementNS(In,e,void 0)}function ct(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ue;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qr(e){J&&Ve(e)!==null&&Zn(e)}let St=!1;function Wn(){St||(St=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function _t(e){var t=_,n=w;Q(null),Te(null);try{return e()}finally{Q(t),Te(n)}}function es(e,t,n,r=n){e.addEventListener(t,()=>_t(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Wn()}function Zt(e){w===null&&(_===null&&An(),bn()),_e&&Tn()}function Jn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function q(e,t,n){var r=w;r!==null&&(r.f&j)!==0&&(e|=j);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{be(s)}catch(l){throw ce(s),l}else t!==null&&B(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Pe)===0&&(f=f.first,(e&G)!==0&&(e&je)!==0&&f!==null&&(f.f|=je)),f!==null&&(f.parent=r,r!==null&&Jn(f,r),_!==null&&(_.f&A)!==0&&(e&ve)===0)){var a=_;(a.effects??(a.effects=[])).push(f)}return s}function Wt(){return _!==null&&!L}function Qn(e){const t=q(Ie,null,!1);return E(t,g),t.teardown=e,t}function ts(e){Zt();var t=w.f,n=!_&&(t&H)!==0&&(t&oe)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return Jt(e)}function Jt(e){return q(De|Pt,e,!1)}function ns(e){return Zt(),q(Ie|Pt,e,!0)}function rs(e){ge.ensure();const t=q(ve|Pe,e,!0);return(n={})=>new Promise(r=>{n.outro?rr(t,()=>{ce(t),r(void 0)}):(ce(t),r(void 0))})}function ss(e){return q(De,e,!1)}function er(e){return q(st|Pe,e,!0)}function fs(e,t=0){return q(Ie|t,e,!0)}function is(e,t=[],n=[],r=[]){Hn(r,t,n,s=>{q(Ie,()=>e(...s.map(Se)),!0)})}function as(e,t=0){var n=q(G|t,e,!0);return n}function ls(e){return q(H|Pe,e,!0)}function Qt(e){var t=e.teardown;if(t!==null){const n=_e,r=_;Rt(!0),Q(null);try{t.call(null)}finally{Rt(n),Q(r)}}}function vt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&_t(()=>{s.abort(ne)});var r=n.next;(n.f&ve)!==0?n.parent=null:ce(n,t),n=r}}function tr(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&H)===0&&ce(t),t=n}}function ce(e,t=!0){var n=!1;(t||(e.f&It)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(nr(e.nodes.start,e.nodes.end),n=!0),vt(e,t&&!n),Ne(e,0),E(e,$);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Qt(e);var s=e.parent;s!==null&&s.first!==null&&en(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function nr(e,t){for(;e!==null;){var n=e===t?null:ee(e);e.remove(),e=n}}function en(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function rr(e,t,n=!0){var r=[];tn(e,r,!0);var s=()=>{n&&ce(e),t&&t()},f=r.length;if(f>0){var a=()=>--f||s();for(var l of r)l.out(a)}else s()}function tn(e,t,n){if((e.f&j)===0){e.f^=j;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,a=(s.f&je)!==0||(s.f&H)!==0&&(e.f&G)!==0;tn(s,t,a?n:!1),s=f}}}function os(e){nn(e,!0)}function nn(e,t){if((e.f&j)!==0){e.f^=j,(e.f&g)===0&&(E(e,R),B(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&je)!==0||(n.f&H)!==0;nn(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const a of f)(a.is_global||t)&&a.in()}}function us(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:ee(n);t.append(n),n=s}}let Le=!1,_e=!1;function Rt(e){_e=e}let _=null,L=!1;function Q(e){_=e}let w=null;function Te(e){w=e}let C=null;function rn(e){_!==null&&(C===null?C=[e]:C.push(e))}let k=null,x=0,I=null;function sr(e){I=e}let sn=1,se=0,le=se;function Ot(e){le=e}function fn(){return++sn}function Fe(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~ue),(t&Y)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function an(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&Ee.call(C,e)))for(var s=0;s{e.ac.abort(ne)}),e.ac=null);try{e.f|=$e;var c=e.fn,u=c();e.f|=oe;var v=e.deps,y=d==null?void 0:d.is_fork;if(k!==null){var h;if(y||Ne(e,x),v!==null&&x>0)for(v.length=x+k.length,h=0;h{if(!s){if(s=!0,r.hasAttribute("value")){var a=r.value;t(r,"value",null),r.value=a}if(r.hasAttribute("checked")){var o=r.checked;t(r,"checked",null),r.checked=o}}};r.__on_r=e,d(e),n()}}function t(r,s,e,a){var o=p(r);i&&(o[s]=r.getAttribute(s),s==="src"||s==="srcset"||s==="href"&&r.nodeName===l)||o[s]!==(o[s]=e)&&(s==="loading"&&(r[v]=e),e==null?r.removeAttribute(s):typeof e!="string"&&L(r).includes(s)?r[s]=e:r.setAttribute(s,e))}function p(r){return r.__attributes??(r.__attributes={[N]:r.nodeName.includes("-"),[T]:r.namespaceURI===u})}var c=new Map;function L(r){var s=r.getAttribute("is")||r.nodeName,e=c.get(s);if(e)return e;c.set(s,e=[]);for(var a,o=r,f=Element.prototype;f!==o;){a=A(o);for(var _ in a)a[_].set&&e.push(_);o=g(o)}return e}export{S as r,t as s}; +import{J as i,N as d,O as n,Q as v,q as u,R as h,T as g,U as A}from"./BBD-8XME.js";const N=Symbol("is custom element"),T=Symbol("is html"),l=n?"link":"LINK";function S(r){if(i){var s=!1,e=()=>{if(!s){if(s=!0,r.hasAttribute("value")){var a=r.value;t(r,"value",null),r.value=a}if(r.hasAttribute("checked")){var o=r.checked;t(r,"checked",null),r.checked=o}}};r.__on_r=e,u(e),h()}}function t(r,s,e,a){var o=p(r);i&&(o[s]=r.getAttribute(s),s==="src"||s==="srcset"||s==="href"&&r.nodeName===l)||o[s]!==(o[s]=e)&&(s==="loading"&&(r[g]=e),e==null?r.removeAttribute(s):typeof e!="string"&&L(r).includes(s)?r[s]=e:r.setAttribute(s,e))}function p(r){return r.__attributes??(r.__attributes={[N]:r.nodeName.includes("-"),[T]:r.namespaceURI===d})}var c=new Map;function L(r){var s=r.getAttribute("is")||r.nodeName,e=c.get(s);if(e)return e;c.set(s,e=[]);for(var a,o=r,f=Element.prototype;f!==o;){a=A(o);for(var _ in a)a[_].set&&e.push(_);o=v(o)}return e}export{S as r,t as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.br b/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.br new file mode 100644 index 0000000..fa8002a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.gz b/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.gz new file mode 100644 index 0000000..83e86b1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BVZqxpRe.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BcuCGYSa.js.gz b/apps/dashboard/build/_app/immutable/chunks/BcuCGYSa.js.gz index 54fb916..4a66d09 100644 Binary files a/apps/dashboard/build/_app/immutable/chunks/BcuCGYSa.js.gz and b/apps/dashboard/build/_app/immutable/chunks/BcuCGYSa.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js new file mode 100644 index 0000000..e64b77e --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js @@ -0,0 +1 @@ +var x=t=>{throw TypeError(t)};var B=(t,e,n)=>e.has(t)||x("Cannot "+n);var a=(t,e,n)=>(B(t,e,"read from private field"),n?n.call(t):e.get(t)),c=(t,e,n)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{o as I}from"./DUC-ssvh.js";import{s as u,g as f,h as d}from"./BBD-8XME.js";import{w as G}from"./Br8WXJxx.js";new URL("sveltekit-internal://");function ae(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function oe(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function le({href:t}){return t.split("#")[0]}function W(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=r.length;for(;s;)e=e*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function X(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&b.delete(U(t)),z(t,e));const b=new Map;function ce(t,e){const n=U(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:s,...l}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&b.set(n,{body:s,init:l,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(s=X(s)),Promise.resolve(new Response(s,l))}return window.fetch(t,e)}function ue(t,e,n){if(b.size>0){const r=U(t,n),s=b.get(r);if(s){if(performance.now()o)}function s(o){n=!1,e.set(o)}function l(o){let i;return e.subscribe(h=>{(i===void 0||n&&h!==i)&&o(i=h)})}return{notify:r,set:s,subscribe:l}}const D={v:()=>{}};function Re(){const{set:t,subscribe:e}=G(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${M}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const o=(await s.json()).version!==F;return o&&(t(!0),D.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Q(t,e,n){return t.origin!==Y||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Se(t){}const H=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...H];const Z=new Set([...H]);[...Z];let E,O,T;const ee=I.toString().includes("$$")||/function \w+\(\) \{\}/.test(I.toString());var _,m,w,p,v,y,A,R,C,S,P,k,V;ee?(E={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},O={current:null},T={current:!1}):(E=new(C=class{constructor(){c(this,_,u({}));c(this,m,u(null));c(this,w,u(null));c(this,p,u({}));c(this,v,u({id:null}));c(this,y,u({}));c(this,A,u(-1));c(this,R,u(new URL("https://example.com")))}get data(){return f(a(this,_))}set data(e){d(a(this,_),e)}get form(){return f(a(this,m))}set form(e){d(a(this,m),e)}get error(){return f(a(this,w))}set error(e){d(a(this,w),e)}get params(){return f(a(this,p))}set params(e){d(a(this,p),e)}get route(){return f(a(this,v))}set route(e){d(a(this,v),e)}get state(){return f(a(this,y))}set state(e){d(a(this,y),e)}get status(){return f(a(this,A))}set status(e){d(a(this,A),e)}get url(){return f(a(this,R))}set url(e){d(a(this,R),e)}},_=new WeakMap,m=new WeakMap,w=new WeakMap,p=new WeakMap,v=new WeakMap,y=new WeakMap,A=new WeakMap,R=new WeakMap,C),O=new(P=class{constructor(){c(this,S,u(null))}get current(){return f(a(this,S))}set current(e){d(a(this,S),e)}},S=new WeakMap,P),T=new(V=class{constructor(){c(this,k,u(!1))}get current(){return f(a(this,k))}set current(e){d(a(this,k),e)}},k=new WeakMap,V),D.v=()=>T.current=!0);function Ue(t){Object.assign(E,t)}export{be as H,_e as N,ge as P,he as S,ye as a,J as b,Re as c,le as d,ie as e,pe as f,ve as g,ae as h,Q as i,N as j,oe as k,fe as l,ue as m,O as n,Y as o,E as p,ce as q,me as r,we as s,de as t,Ae as u,Ue as v,Se as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.br b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.br new file mode 100644 index 0000000..73f5d6f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.gz b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.gz new file mode 100644 index 0000000..ad04a55 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BeSd-T80.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js similarity index 79% rename from apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js rename to apps/dashboard/build/_app/immutable/chunks/BexJutgU.js index 103d488..d76449b 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js +++ b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js @@ -1 +1 @@ -import{s as c,g as l}from"./DnKV7_Y9.js";import{V as o,W as a,X as b,g as p,h as d,Y as g}from"./C9Z4nxhR.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:b(void 0),unsubscribe:a});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=a;else{var t=!0;u.unsubscribe=c(e,f=>{t?u.source.v=f:d(u.source,f)}),t=!1}return e&&i in r?l(e):p(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();g(e,i,{enumerable:!1,value:!0})})}return[e,n]}function N(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,N as c,m as s}; +import{s as c,g as l}from"./Br8WXJxx.js";import{V as o,W as a,X as b,g as p,h as d,Y as g}from"./BBD-8XME.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:b(void 0),unsubscribe:a});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=a;else{var t=!0;u.unsubscribe=c(e,f=>{t?u.source.v=f:d(u.source,f)}),t=!1}return e&&i in r?l(e):p(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();g(e,i,{enumerable:!1,value:!0})})}return[e,n]}function N(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,N as c,m as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.br b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.br new file mode 100644 index 0000000..76f5426 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.gz b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.gz new file mode 100644 index 0000000..a1c063e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BexJutgU.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br deleted file mode 100644 index 86cbc00..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz b/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz deleted file mode 100644 index 51b71ac..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br deleted file mode 100644 index 7892120..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.br +++ /dev/null @@ -1,7 +0,0 @@ -@v<ᥱ ;fNҌUv@iZvv=IXfI jr@mIbyLFccKؚ~0̉5g(&J edDK)UO.5EeOn2C"DBڒ ']KG8úKU7u? -J+ -7o#Em'Kng ]2z^)U2sjx?GѨO[ ʘ ;+~ W٣?t5|̒ yeK - g6 T|A)UvmxLR. \Qc RtF#Yw)#hdS4Tm'QokM  sź#]mE:0 s, -]d.nq#:*.tBG6L&ʶƽ(dhVɜo®aI٤-5)t&X4$jD@8 -㩬8 뎺sB[]zL3fjmn4F@!OϬj$\TjCT|)ne=CjPy`aj 鶢ܙvkb1'Wʻe2zr - L1Uf \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz b/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz deleted file mode 100644 index d737d1c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js similarity index 94% rename from apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js rename to apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js index b9ec889..f5097b8 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js +++ b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js @@ -1 +1 @@ -import{W as a,m as w,am as q,ai as x}from"./C9Z4nxhR.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),a;const r=w(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=a){let n=null;const r=new Set;function i(u){if(q(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}function B(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=a;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);b?l(c):p=typeof c=="function"?c:a},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<{d|=1<t=n)(),t}export{B as d,E as g,_ as s,A as w}; +import{W as a,m as w,am as q,ai as x}from"./BBD-8XME.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),a;const r=w(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=a){let n=null;const r=new Set;function i(u){if(q(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}function B(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=a;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);b?l(c):p=typeof c=="function"?c:a},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<{d|=1<t=n)(),t}export{B as d,E as g,_ as s,A as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.br b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.br new file mode 100644 index 0000000..7ef5f6f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.gz b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.gz new file mode 100644 index 0000000..d2fcc24 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Br8WXJxx.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js similarity index 84% rename from apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js rename to apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js index 52b89bd..e56bc99 100644 --- a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js +++ b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js @@ -1 +1 @@ -import{H as m,I as _,m as b,l as i,J as y,K as v,M as h}from"./C9Z4nxhR.js";function E(e,l,u=l){var f=new WeakSet;m(e,"input",async r=>{var a=r?e.defaultValue:e.value;if(a=t(e)?o(a):a,u(a),v!==null&&f.add(v),await _(),a!==(a=l())){var d=e.selectionStart,s=e.selectionEnd,n=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;d===s&&s===n&&c>n?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=d,e.selectionEnd=Math.min(s,c))}}}),(y&&e.defaultValue!==e.value||b(l)==null&&e.value)&&(u(t(e)?o(e.value):e.value),v!==null&&f.add(v)),i(()=>{var r=l();if(e===document.activeElement){var a=h??v;if(f.has(a))return}t(e)&&r===o(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function t(e){var l=e.type;return l==="number"||l==="range"}function o(e){return e===""?null:+e}export{E as b}; +import{H as m,I as _,m as b,l as i,J as y,K as v,M as h}from"./BBD-8XME.js";function E(e,l,u=l){var f=new WeakSet;m(e,"input",async r=>{var a=r?e.defaultValue:e.value;if(a=t(e)?o(a):a,u(a),v!==null&&f.add(v),await _(),a!==(a=l())){var d=e.selectionStart,s=e.selectionEnd,n=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;d===s&&s===n&&c>n?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=d,e.selectionEnd=Math.min(s,c))}}}),(y&&e.defaultValue!==e.value||b(l)==null&&e.value)&&(u(t(e)?o(e.value):e.value),v!==null&&f.add(v)),i(()=>{var r=l();if(e===document.activeElement){var a=h??v;if(f.has(a))return}t(e)&&r===o(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function t(e){var l=e.type;return l==="number"||l==="range"}function o(e){return e===""?null:+e}export{E as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.br b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.br new file mode 100644 index 0000000..dfe66fb Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.gz b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.gz new file mode 100644 index 0000000..c05afcd Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BxfT1SOA.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bzak7iHL.js.gz b/apps/dashboard/build/_app/immutable/chunks/Bzak7iHL.js.gz index f429ed1..df094a8 100644 Binary files a/apps/dashboard/build/_app/immutable/chunks/Bzak7iHL.js.gz and b/apps/dashboard/build/_app/immutable/chunks/Bzak7iHL.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js similarity index 93% rename from apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js rename to apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js index 95bd407..6fb580c 100644 --- a/apps/dashboard/build/_app/immutable/chunks/-jeO_JOJ.js +++ b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js @@ -1 +1 @@ -import{H as s,k as o,V as c,Z as b,_ as m,$ as h,K as v,M as y}from"./C9Z4nxhR.js";function d(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{d(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function k(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var _=e.querySelector(l)??e.querySelector("option:not([disabled])");n=_&&i(_)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(d(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{k as b}; +import{H as s,k as o,V as c,Z as b,_ as m,$ as h,K as v,M as y}from"./BBD-8XME.js";function d(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{d(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function k(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var _=e.querySelector(l)??e.querySelector("option:not([disabled])");n=_&&i(_)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(d(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{k as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.br b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.br new file mode 100644 index 0000000..17877ab Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.gz b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.gz new file mode 100644 index 0000000..e8fab48 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C-QujEl6.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br deleted file mode 100644 index a1d46d5..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz b/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz deleted file mode 100644 index 80b6623..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js similarity index 98% rename from apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js rename to apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js index 4447ab5..512c677 100644 --- a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js +++ b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js @@ -1 +1 @@ -import{aa as F,b as fe,an as ne,J as D,a5 as q,ao as ie,a0 as le,g as Q,a1 as ue,a3 as se,a4 as W,a6 as L,ac as z,ap as oe,aq as te,ar as $,K as ve,as as C,ab as y,at as de,ae as ce,C as pe,Z as _e,au as X,av as he,aw as ge,X as Ee,ax as j,ay as me,a7 as re,a9 as ae,az as B,q as Ce,aA as Te,aB as Ae,aC as we,a8 as Se,aD as Ie}from"./C9Z4nxhR.js";function De(e,r){return r}function Ne(e,r,l){for(var t=[],g=r.length,s,u=r.length,c=0;c{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;V(X(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var i=t.length===0&&l!==null;if(i){var v=l,a=v.parentNode;we(a),a.append(v),e.items.clear()}V(r,!i)}else s={pending:new Set(r),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function V(e,r=!0){for(var l=0;l{var f=l();return _e(f)?f:f==null?[]:X(f)}),o,d=!0;function A(){n.fallback=a,xe(n,o,u,r,t),a!==null&&(o.length===0?(a.f&C)===0?re(a):(a.f^=C,M(a,null,u)):ae(a,()=>{a=null}))}var I=fe(()=>{o=Q(E);var f=o.length;let N=!1;if(D){var x=ue(u)===se;x!==(f===0)&&(u=W(),q(u),L(!1),N=!0)}for(var _=new Set,w=ve,b=ce(),p=0;ps(u)):(a=y(()=>s(ee??(ee=F()))),a.f|=C)),f>_.size&&de(),D&&f>0&&q(W()),!d)if(b){for(const[k,O]of c)_.has(k)||w.skip_effect(O.e);w.oncommit(A),w.ondiscard(()=>{})}else A();N&&L(!0),Q(E)}),n={effect:I,items:c,outrogroups:null,fallback:a};d=!1,D&&(u=z)}function H(e){for(;e!==null&&(e.f&Te)===0;)e=e.next;return e}function xe(e,r,l,t,g){var h,k,O,Y,J,K,U,Z,G;var s=(t&Ae)!==0,u=r.length,c=e.items,i=H(e.effect.first),v,a=null,E,o=[],d=[],A,I,n,f;if(s)for(f=0;f0){var R=(t&ne)!==0&&u===0?l:null;if(s){for(f=0;f{var m,P;if(E!==void 0)for(n of E)(P=(m=n.nodes)==null?void 0:m.a)==null||P.apply()})}function be(e,r,l,t,g,s,u,c){var i=(u&he)!==0?(u&ge)===0?Ee(l,!1,!1):j(l):null,v=(u&me)!==0?j(g):null;return{v:i,i:v,e:y(()=>(s(r,i??l,v??g,c),()=>{e.delete(t)}))}}function M(e,r,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=r&&(r.f&C)===0?r.nodes.start:l;t!==null;){var u=Ie(t);if(s.before(t),t===g)return;t=u}}function T(e,r,l){r===null?e.effect.first=l:r.next=l,l===null?e.effect.last=r:l.prev=r}function Me(e,r,l){var t=e==null?"":""+e;return t===""?null:t}function ke(e,r){return e==null?null:String(e)}export{ke as a,He as e,De as i,Me as t}; +import{aa as F,b as fe,an as ne,J as D,a5 as q,ao as ie,a0 as le,g as Q,a1 as ue,a3 as se,a4 as W,a6 as L,ac as z,ap as oe,aq as te,ar as $,K as ve,as as C,ab as y,at as de,ae as ce,C as pe,Z as _e,au as X,av as he,aw as ge,X as Ee,ax as j,ay as me,a7 as re,a9 as ae,az as B,q as Ce,aA as Te,aB as Ae,aC as we,a8 as Se,aD as Ie}from"./BBD-8XME.js";function De(e,r){return r}function Ne(e,r,l){for(var t=[],g=r.length,s,u=r.length,c=0;c{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;V(X(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var i=t.length===0&&l!==null;if(i){var v=l,a=v.parentNode;we(a),a.append(v),e.items.clear()}V(r,!i)}else s={pending:new Set(r),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function V(e,r=!0){for(var l=0;l{var f=l();return _e(f)?f:f==null?[]:X(f)}),o,d=!0;function A(){n.fallback=a,xe(n,o,u,r,t),a!==null&&(o.length===0?(a.f&C)===0?re(a):(a.f^=C,M(a,null,u)):ae(a,()=>{a=null}))}var I=fe(()=>{o=Q(E);var f=o.length;let N=!1;if(D){var x=ue(u)===se;x!==(f===0)&&(u=W(),q(u),L(!1),N=!0)}for(var _=new Set,w=ve,b=ce(),p=0;ps(u)):(a=y(()=>s(ee??(ee=F()))),a.f|=C)),f>_.size&&de(),D&&f>0&&q(W()),!d)if(b){for(const[k,O]of c)_.has(k)||w.skip_effect(O.e);w.oncommit(A),w.ondiscard(()=>{})}else A();N&&L(!0),Q(E)}),n={effect:I,items:c,outrogroups:null,fallback:a};d=!1,D&&(u=z)}function H(e){for(;e!==null&&(e.f&Te)===0;)e=e.next;return e}function xe(e,r,l,t,g){var h,k,O,Y,J,K,U,Z,G;var s=(t&Ae)!==0,u=r.length,c=e.items,i=H(e.effect.first),v,a=null,E,o=[],d=[],A,I,n,f;if(s)for(f=0;f0){var R=(t&ne)!==0&&u===0?l:null;if(s){for(f=0;f{var m,P;if(E!==void 0)for(n of E)(P=(m=n.nodes)==null?void 0:m.a)==null||P.apply()})}function be(e,r,l,t,g,s,u,c){var i=(u&he)!==0?(u&ge)===0?Ee(l,!1,!1):j(l):null,v=(u&me)!==0?j(g):null;return{v:i,i:v,e:y(()=>(s(r,i??l,v??g,c),()=>{e.delete(t)}))}}function M(e,r,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=r&&(r.f&C)===0?r.nodes.start:l;t!==null;){var u=Ie(t);if(s.before(t),t===g)return;t=u}}function T(e,r,l){r===null?e.effect.first=l:r.next=l,l===null?e.effect.last=r:l.prev=r}function Me(e,r,l){var t=e==null?"":""+e;return t===""?null:t}function ke(e,r){return e==null?null:String(e)}export{ke as a,He as e,De as i,Me as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.br b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.br new file mode 100644 index 0000000..ee69479 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.gz b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.gz new file mode 100644 index 0000000..fe9fcb7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C5a--lgk.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.br b/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.br deleted file mode 100644 index c6e6346..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.gz b/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.gz deleted file mode 100644 index c09c29b..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C9Z4nxhR.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js similarity index 76% rename from apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js rename to apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js index 532ec36..0a9ca52 100644 --- a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js +++ b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js @@ -1 +1 @@ -import{t as l}from"./kH-DTQyy.js";import{J as e}from"./C9Z4nxhR.js";function u(s,c,r,f,p,i){var a=s.__className;if(e||a!==r||a===void 0){var t=l(r);(!e||t!==s.getAttribute("class"))&&(t==null?s.removeAttribute("class"):s.className=t),s.__className=r}return i}export{u as s}; +import{t as l}from"./C5a--lgk.js";import{J as e}from"./BBD-8XME.js";function u(s,c,r,f,p,i){var a=s.__className;if(e||a!==r||a===void 0){var t=l(r);(!e||t!==s.getAttribute("class"))&&(t==null?s.removeAttribute("class"):s.className=t),s.__className=r}return i}export{u as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.br b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.br new file mode 100644 index 0000000..c2bbca9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.gz b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.gz new file mode 100644 index 0000000..a075113 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CBWLjDtu.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js similarity index 89% rename from apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js rename to apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js index a27f404..7d2ed73 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js +++ b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js @@ -1 +1 @@ -import{aE as h,aa as d,ao as l,aF as p,w as _,aG as E,aH as g,J as u,ac as s,aI as y,a0 as M,aJ as N,a5 as x,aK as A}from"./C9Z4nxhR.js";var f;const i=((f=globalThis==null?void 0:globalThis.window)==null?void 0:f.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return(i==null?void 0:i.createHTML(t))??t}function w(t){var r=h("template");return r.innerHTML=b(t.replaceAll("","")),r.content}function a(t,r){var e=_;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function H(t,r){var e=(r&E)!==0,c=(r&g)!==0,n,m=!t.startsWith("");return()=>{if(u)return a(s,null),s;n===void 0&&(n=w(m?t:""+t),e||(n=l(n)));var o=c||p?document.importNode(n,!0):n.cloneNode(!0);if(e){var v=l(o),T=o.lastChild;a(v,T)}else a(o,o);return o}}function O(t=""){if(!u){var r=d(t+"");return a(r,r),r}var e=s;return e.nodeType!==N?(e.before(e=d()),x(e)):A(e),a(e,e),e}function P(){if(u)return a(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),a(r,e),t}function R(t,r){if(u){var e=_;((e.f&y)===0||e.nodes.end===null)&&(e.nodes.end=s),M();return}t!==null&&t.before(r)}export{R as a,a as b,P as c,H as f,O as t}; +import{aE as h,aa as d,ao as l,aF as p,w as _,aG as E,aH as g,J as u,ac as s,aI as y,a0 as M,aJ as N,a5 as x,aK as A}from"./BBD-8XME.js";var f;const i=((f=globalThis==null?void 0:globalThis.window)==null?void 0:f.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return(i==null?void 0:i.createHTML(t))??t}function w(t){var r=h("template");return r.innerHTML=b(t.replaceAll("","")),r.content}function a(t,r){var e=_;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function H(t,r){var e=(r&E)!==0,c=(r&g)!==0,n,m=!t.startsWith("");return()=>{if(u)return a(s,null),s;n===void 0&&(n=w(m?t:""+t),e||(n=l(n)));var o=c||p?document.importNode(n,!0):n.cloneNode(!0);if(e){var v=l(o),T=o.lastChild;a(v,T)}else a(o,o);return o}}function O(t=""){if(!u){var r=d(t+"");return a(r,r),r}var e=s;return e.nodeType!==N?(e.before(e=d()),x(e)):A(e),a(e,e),e}function P(){if(u)return a(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),a(r,e),t}function R(t,r){if(u){var e=_;((e.f&y)===0||e.nodes.end===null)&&(e.nodes.end=s),M();return}t!==null&&t.before(r)}export{R as a,a as b,P as c,H as f,O as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.br b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.br new file mode 100644 index 0000000..b6e08e0 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.br @@ -0,0 +1,2 @@ +@dS,A\`ԗ)o9ZI9l<¶ +^UIB'1$L/eȘ`W?F .cx X a0Mx;x=4AQ鍳URG c6CJ,ұX,JM1XLtH͂A4c@q*LdOhO(&,iA5Ѓe[Z@D<> ]PѕH d1,gNCP#E!DH^3o0.RVsȒr$.J % )k͘Af )!A7{5T2gWtb'bmBVHpRnsLjMkbqHhj2EIfIz[,,x{T \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.gz b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.gz new file mode 100644 index 0000000..98846df Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CKcqngaU.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br deleted file mode 100644 index 9432dd8..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.br +++ /dev/null @@ -1 +0,0 @@ -7 ,o*̢踯hS+|hvyOߙ8;$z3 q lq*;m(V{K5TLyQ=NWe\)h Ndb (`/֬PM ɤXv$xNkdGsKo$Drqw`; \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz b/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz deleted file mode 100644 index 7d20542..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br deleted file mode 100644 index 77f7765..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz b/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz deleted file mode 100644 index 58fd1c4..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz index 6bc8ce3..0a36621 100644 Binary files a/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz and b/apps/dashboard/build/_app/immutable/chunks/CZ45jJaw.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br deleted file mode 100644 index d45b208..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz b/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz deleted file mode 100644 index f1fbfcc..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br deleted file mode 100644 index 3f77d57..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz b/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz deleted file mode 100644 index 6ae10db..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Co2v30Gm.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js similarity index 95% rename from apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js rename to apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js index f806b0e..6d8a62b 100644 --- a/apps/dashboard/build/_app/immutable/chunks/BmeMLq0p.js +++ b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js @@ -1 +1 @@ -import{d as l,w as S}from"./DnKV7_Y9.js";const y=200;function H(){const{subscribe:n,set:c,update:e}=S({connected:!1,events:[],lastHeartbeat:null,error:null});let t=null,a=null,d=0;function m(r){const u=r||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((t==null?void 0:t.readyState)!==WebSocket.OPEN)try{t=new WebSocket(u),t.onopen=()=>{d=0,e(o=>({...o,connected:!0,error:null}))},t.onmessage=o=>{try{const s=JSON.parse(o.data);e(b=>{if(s.type==="Heartbeat")return{...b,lastHeartbeat:s};const p=[s,...b.events].slice(0,y);return{...b,events:p}})}catch{}},t.onclose=()=>{e(o=>({...o,connected:!1})),f(u)},t.onerror=()=>{e(o=>({...o,error:"WebSocket connection failed"}))}}catch(o){e(s=>({...s,error:String(o)}))}}function f(r){a&&clearTimeout(a);const u=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(r),u)}function w(){a&&clearTimeout(a),t==null||t.close(),t=null,c({connected:!1,events:[],lastHeartbeat:null,error:null})}function v(){e(r=>({...r,events:[]}))}return{subscribe:n,connect:m,disconnect:w,clearEvents:v}}const i=H(),k=l(i,n=>n.connected),T=l(i,n=>n.events);l(i,n=>n.lastHeartbeat);const g=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.memory_count)??0}),E=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.avg_retention)??0});export{E as a,T as e,k as i,g as m,i as w}; +import{d as l,w as S}from"./Br8WXJxx.js";const y=200;function H(){const{subscribe:n,set:c,update:e}=S({connected:!1,events:[],lastHeartbeat:null,error:null});let t=null,a=null,d=0;function m(r){const u=r||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((t==null?void 0:t.readyState)!==WebSocket.OPEN)try{t=new WebSocket(u),t.onopen=()=>{d=0,e(o=>({...o,connected:!0,error:null}))},t.onmessage=o=>{try{const s=JSON.parse(o.data);e(b=>{if(s.type==="Heartbeat")return{...b,lastHeartbeat:s};const p=[s,...b.events].slice(0,y);return{...b,events:p}})}catch{}},t.onclose=()=>{e(o=>({...o,connected:!1})),f(u)},t.onerror=()=>{e(o=>({...o,error:"WebSocket connection failed"}))}}catch(o){e(s=>({...s,error:String(o)}))}}function f(r){a&&clearTimeout(a);const u=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(r),u)}function w(){a&&clearTimeout(a),t==null||t.close(),t=null,c({connected:!1,events:[],lastHeartbeat:null,error:null})}function v(){e(r=>({...r,events:[]}))}return{subscribe:n,connect:m,disconnect:w,clearEvents:v}}const i=H(),k=l(i,n=>n.connected),T=l(i,n=>n.events);l(i,n=>n.lastHeartbeat);const g=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.memory_count)??0}),E=l(i,n=>{var c,e;return((e=(c=n.lastHeartbeat)==null?void 0:c.data)==null?void 0:e.avg_retention)??0});export{E as a,T as e,k as i,g as m,i as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.br b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.br new file mode 100644 index 0000000..24c2b14 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.gz b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.gz new file mode 100644 index 0000000..41facb8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CruZBLYW.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js similarity index 93% rename from apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js rename to apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js index 3c92625..bca8b90 100644 --- a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js +++ b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js @@ -1 +1 @@ -import{n as L,o as D,P as T,g as P,c as B,h as b,v as Y,w as h,D as x,x as M,m as N,y as U,z as w,A as z,B as C,C as $,F as q,S as y,L as F}from"./C9Z4nxhR.js";import{c as G}from"./DWr9YED7.js";function H(r,a,t,s){var o;var f=!U||(t&w)!==0,v=(t&M)!==0,E=(t&q)!==0,n=s,c=!0,g=()=>(c&&(c=!1,n=E?N(s):s),n),u;if(v){var O=y in r||F in r;u=((o=L(r,a))==null?void 0:o.set)??(O&&a in r?e=>r[a]=e:void 0)}var _,I=!1;v?[_,I]=G(()=>r[a]):_=r[a],_===void 0&&s!==void 0&&(_=g(),u&&(f&&D(),u(_)));var i;if(f?i=()=>{var e=r[a];return e===void 0?g():(c=!0,e)}:i=()=>{var e=r[a];return e!==void 0&&(n=void 0),e===void 0?n:e},f&&(t&T)===0)return i;if(u){var R=r.$$legacy;return(function(e,S){return arguments.length>0?((!f||!S||R||I)&&u(S?i():e),e):i()})}var l=!1,d=((t&z)!==0?C:$)(()=>(l=!1,i()));v&&P(d);var m=h;return(function(e,S){if(arguments.length>0){const A=S?P(d):f&&v?B(e):e;return b(d,A),l=!0,n!==void 0&&(n=A),e}return Y&&l||(m.f&x)!==0?d.v:P(d)})}export{H as p}; +import{n as L,o as D,P as T,g as P,c as B,h as b,v as Y,w as h,D as x,x as M,m as N,y as U,z as w,A as z,B as C,C as $,F as q,S as y,L as F}from"./BBD-8XME.js";import{c as G}from"./BexJutgU.js";function H(r,a,t,s){var o;var f=!U||(t&w)!==0,v=(t&M)!==0,E=(t&q)!==0,n=s,c=!0,g=()=>(c&&(c=!1,n=E?N(s):s),n),u;if(v){var O=y in r||F in r;u=((o=L(r,a))==null?void 0:o.set)??(O&&a in r?e=>r[a]=e:void 0)}var _,I=!1;v?[_,I]=G(()=>r[a]):_=r[a],_===void 0&&s!==void 0&&(_=g(),u&&(f&&D(),u(_)));var i;if(f?i=()=>{var e=r[a];return e===void 0?g():(c=!0,e)}:i=()=>{var e=r[a];return e!==void 0&&(n=void 0),e===void 0?n:e},f&&(t&T)===0)return i;if(u){var R=r.$$legacy;return(function(e,S){return arguments.length>0?((!f||!S||R||I)&&u(S?i():e),e):i()})}var l=!1,d=((t&z)!==0?C:$)(()=>(l=!1,i()));v&&P(d);var m=h;return(function(e,S){if(arguments.length>0){const A=S?P(d):f&&v?B(e):e;return b(d,A),l=!0,n!==void 0&&(n=A),e}return Y&&l||(m.f&x)!==0?d.v:P(d)})}export{H as p}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.br b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.br new file mode 100644 index 0000000..712779c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.gz b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.gz new file mode 100644 index 0000000..1b84b06 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CzkEqL6J.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js deleted file mode 100644 index a2e2d55..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js +++ /dev/null @@ -1 +0,0 @@ -import{b as p,E as t}from"./C9Z4nxhR.js";import{B as c}from"./CY4crMrT.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br deleted file mode 100644 index c92f939..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz b/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz deleted file mode 100644 index 6918546..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D00YwZ1M.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js similarity index 87% rename from apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js rename to apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js index 03ef2ab..5cd86b3 100644 --- a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js +++ b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js @@ -1 +1 @@ -import{af as g,ag as d,ah as c,m,ai as i,aj as b,g as p,ak as h,B as k,al as v}from"./C9Z4nxhR.js";function x(t=!1){const a=g,e=a.l.u;if(!e)return;let o=()=>h(a.s);if(t){let n=0,s={};const _=k(()=>{let l=!1;const r=a.s;for(const f in r)r[f]!==s[f]&&(s[f]=r[f],l=!0);return l&&n++,n});o=()=>p(_)}e.b.length&&d(()=>{u(a,o),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,o),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}v();export{x as i}; +import{af as g,ag as d,ah as c,m,ai as i,aj as b,g as p,ak as h,B as k,al as v}from"./BBD-8XME.js";function x(t=!1){const a=g,e=a.l.u;if(!e)return;let o=()=>h(a.s);if(t){let n=0,s={};const _=k(()=>{let l=!1;const r=a.s;for(const f in r)r[f]!==s[f]&&(s[f]=r[f],l=!0);return l&&n++,n});o=()=>p(_)}e.b.length&&d(()=>{u(a,o),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,o),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}v();export{x as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.br b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.br new file mode 100644 index 0000000..f2a4f7b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.gz b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.gz new file mode 100644 index 0000000..4735b18 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D1BK9eoQ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js similarity index 74% rename from apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js rename to apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js index 7fa8036..0260b51 100644 --- a/apps/dashboard/build/_app/immutable/chunks/BkopTN9z.js +++ b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js @@ -1 +1 @@ -import{a as y}from"./kH-DTQyy.js";import{J as r}from"./C9Z4nxhR.js";function a(t,e,f,i){var l=t.__style;if(r||l!==e){var s=y(e);(!r||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}return i}export{a as s}; +import{a as y}from"./C5a--lgk.js";import{J as r}from"./BBD-8XME.js";function a(t,e,f,i){var l=t.__style;if(r||l!==e){var s=y(e);(!r||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}return i}export{a as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.br b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.br new file mode 100644 index 0000000..8351992 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.gz b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.gz new file mode 100644 index 0000000..d531b34 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DBfx-YTU.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js similarity index 98% rename from apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js rename to apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js index d057f57..7158e59 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js +++ b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js @@ -1,2 +1,2 @@ -var ke=Object.defineProperty;var ce=t=>{throw TypeError(t)};var Ie=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var $=(t,e,r)=>Ie(t,typeof e!="symbol"?e+"":e,r),re=(t,e,r)=>e.has(t)||ce("Cannot "+r);var s=(t,e,r)=>(re(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>e.has(t)?ce("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a=(t,e,r,n)=>(re(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),p=(t,e,r)=>(re(t,e,"access private method"),r);import{aL as Me,g as Ee,l as Ce,m as Pe,aM as ue,q as U,ax as Te,ac as k,J as I,w as q,aN as _e,b as Ve,a0 as qe,a3 as xe,aO as pe,ab as F,aa as we,aP as se,a9 as ie,ad as Be,aQ as ge,aR as He,aS as ve,aT as Le,aU as We,aV as X,aW as Z,aX as ye,aY as $e,aZ as Re,af as Se,ar as je,a8 as ae,a5 as K,G as ze,a4 as Je,a_ as j,E as Ue,a$ as Ge,b0 as Qe,b1 as Xe,Y as Ze,b2 as ne,ao as Ke,ap as De,a2 as et,aD as tt,b3 as fe,a6 as z,b4 as rt,aC as st,b5 as it,au as at,p as nt,aq as ft,b6 as ht,a as ot}from"./C9Z4nxhR.js";import{b as lt}from"./DPfxVJHQ.js";function dt(t){let e=0,r=Te(0),n;return()=>{Me()&&(Ee(r),Ce(()=>(e===0&&(n=Pe(()=>t(()=>ue(r)))),e+=1,()=>{U(()=>{e-=1,e===0&&(n==null||n(),n=void 0,ue(r))})})))}}var ct=Ue|Ge;function ut(t,e,r,n){new _t(t,e,r,n)}var m,W,w,C,g,R,E,T,S,P,A,x,B,H,D,ee,h,Ne,Ae,Oe,he,G,Q,oe;class _t{constructor(e,r,n,c){l(this,h);$(this,"parent");$(this,"is_pending",!1);$(this,"transform_error");l(this,m);l(this,W,I?k:null);l(this,w);l(this,C);l(this,g);l(this,R,null);l(this,E,null);l(this,T,null);l(this,S,null);l(this,P,0);l(this,A,0);l(this,x,!1);l(this,B,new Set);l(this,H,new Set);l(this,D,null);l(this,ee,dt(()=>(a(this,D,Te(s(this,P))),()=>{a(this,D,null)})));var i;a(this,m,e),a(this,w,r),a(this,C,f=>{var u=q;u.b=this,u.f|=_e,n(f)}),this.parent=q.b,this.transform_error=c??((i=this.parent)==null?void 0:i.transform_error)??(f=>f),a(this,g,Ve(()=>{if(I){const f=s(this,W);qe();const u=f.data===xe;if(f.data.startsWith(pe)){const d=JSON.parse(f.data.slice(pe.length));p(this,h,Ae).call(this,d)}else u?p(this,h,Oe).call(this):p(this,h,Ne).call(this)}else p(this,h,he).call(this)},ct)),I&&a(this,m,k)}defer_effect(e){We(e,s(this,B),s(this,H))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(this,w).pending}update_pending_count(e){p(this,h,oe).call(this,e),a(this,P,s(this,P)+e),!(!s(this,D)||s(this,x))&&(a(this,x,!0),U(()=>{a(this,x,!1),s(this,D)&&je(s(this,D),s(this,P))}))}get_effect_pending(){return s(this,ee).call(this),Ee(s(this,D))}error(e){var r=s(this,w).onerror;let n=s(this,w).failed;if(!r&&!n)throw e;s(this,R)&&(ae(s(this,R)),a(this,R,null)),s(this,E)&&(ae(s(this,E)),a(this,E,null)),s(this,T)&&(ae(s(this,T)),a(this,T,null)),I&&(K(s(this,W)),ze(),K(Je()));var c=!1,i=!1;const f=()=>{if(c){Xe();return}c=!0,i&&Qe(),s(this,T)!==null&&ie(s(this,T),()=>{a(this,T,null)}),p(this,h,Q).call(this,()=>{se.ensure(),p(this,h,he).call(this)})},u=o=>{try{i=!0,r==null||r(o,f),i=!1}catch(d){j(d,s(this,g)&&s(this,g).parent)}n&&a(this,T,p(this,h,Q).call(this,()=>{se.ensure();try{return F(()=>{var d=q;d.b=this,d.f|=_e,n(s(this,m),()=>o,()=>f)})}catch(d){return j(d,s(this,g).parent),null}}))};U(()=>{var o;try{o=this.transform_error(e)}catch(d){j(d,s(this,g)&&s(this,g).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,d=>j(d,s(this,g)&&s(this,g).parent)):u(o)})}}m=new WeakMap,W=new WeakMap,w=new WeakMap,C=new WeakMap,g=new WeakMap,R=new WeakMap,E=new WeakMap,T=new WeakMap,S=new WeakMap,P=new WeakMap,A=new WeakMap,x=new WeakMap,B=new WeakMap,H=new WeakMap,D=new WeakMap,ee=new WeakMap,h=new WeakSet,Ne=function(){try{a(this,R,F(()=>s(this,C).call(this,s(this,m))))}catch(e){this.error(e)}},Ae=function(e){const r=s(this,w).failed;r&&a(this,T,F(()=>{r(s(this,m),()=>e,()=>()=>{})}))},Oe=function(){const e=s(this,w).pending;e&&(this.is_pending=!0,a(this,E,F(()=>e(s(this,m)))),U(()=>{var r=a(this,S,document.createDocumentFragment()),n=we();r.append(n),a(this,R,p(this,h,Q).call(this,()=>(se.ensure(),F(()=>s(this,C).call(this,n))))),s(this,A)===0&&(s(this,m).before(r),a(this,S,null),ie(s(this,E),()=>{a(this,E,null)}),p(this,h,G).call(this))}))},he=function(){try{if(this.is_pending=this.has_pending_snippet(),a(this,A,0),a(this,P,0),a(this,R,F(()=>{s(this,C).call(this,s(this,m))})),s(this,A)>0){var e=a(this,S,document.createDocumentFragment());Be(s(this,R),e);const r=s(this,w).pending;a(this,E,F(()=>r(s(this,m))))}else p(this,h,G).call(this)}catch(r){this.error(r)}},G=function(){this.is_pending=!1;for(const e of s(this,B))ge(e,He),ve(e);for(const e of s(this,H))ge(e,Le),ve(e);s(this,B).clear(),s(this,H).clear()},Q=function(e){var r=q,n=Re,c=Se;X(s(this,g)),Z(s(this,g)),ye(s(this,g).ctx);try{return e()}catch(i){return $e(i),null}finally{X(r),Z(n),ye(c)}},oe=function(e){var r;if(!this.has_pending_snippet()){this.parent&&p(r=this.parent,h,oe).call(r,e);return}a(this,A,s(this,A)+e),s(this,A)===0&&(p(this,h,G).call(this),s(this,E)&&ie(s(this,E),()=>{a(this,E,null)}),s(this,S)&&(s(this,m).before(s(this,S)),a(this,S,null)))};const pt=["touchstart","touchmove"];function gt(t){return pt.includes(t)}const M=Symbol("events"),Ye=new Set,le=new Set;function Et(t,e,r){(e[M]??(e[M]={}))[t]=r}function Tt(t){for(var e=0;e{throw Y});throw N}}finally{t[M]=e,delete t.currentTarget,Z(V),X(L)}}}function wt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function vt(t,e){return Fe(t,e)}function Rt(t,e){ne(),e.intro=e.intro??!1;const r=e.target,n=I,c=k;try{for(var i=Ke(r);i&&(i.nodeType!==De||i.data!==et);)i=tt(i);if(!i)throw fe;z(!0),K(i);const f=Fe(t,{...e,anchor:i});return z(!1),f}catch(f){if(f instanceof Error&&f.message.split(` +var ke=Object.defineProperty;var ce=t=>{throw TypeError(t)};var Ie=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var $=(t,e,r)=>Ie(t,typeof e!="symbol"?e+"":e,r),re=(t,e,r)=>e.has(t)||ce("Cannot "+r);var s=(t,e,r)=>(re(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>e.has(t)?ce("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a=(t,e,r,n)=>(re(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),p=(t,e,r)=>(re(t,e,"access private method"),r);import{aL as Me,g as Ee,l as Ce,m as Pe,aM as ue,q as U,ax as Te,ac as k,J as I,w as q,aN as _e,b as Ve,a0 as qe,a3 as xe,aO as pe,ab as F,aa as we,aP as se,a9 as ie,ad as Be,aQ as ge,aR as He,aS as ve,aT as Le,aU as We,aV as X,aW as Z,aX as ye,aY as $e,aZ as Re,af as Se,ar as je,a8 as ae,a5 as K,G as ze,a4 as Je,a_ as j,E as Ue,a$ as Ge,b0 as Qe,b1 as Xe,Y as Ze,b2 as ne,ao as Ke,ap as De,a2 as et,aD as tt,b3 as fe,a6 as z,b4 as rt,aC as st,b5 as it,au as at,p as nt,aq as ft,b6 as ht,a as ot}from"./BBD-8XME.js";import{b as lt}from"./CKcqngaU.js";function dt(t){let e=0,r=Te(0),n;return()=>{Me()&&(Ee(r),Ce(()=>(e===0&&(n=Pe(()=>t(()=>ue(r)))),e+=1,()=>{U(()=>{e-=1,e===0&&(n==null||n(),n=void 0,ue(r))})})))}}var ct=Ue|Ge;function ut(t,e,r,n){new _t(t,e,r,n)}var m,W,w,C,g,R,E,T,S,P,A,x,B,H,D,ee,h,Ne,Ae,Oe,he,G,Q,oe;class _t{constructor(e,r,n,c){l(this,h);$(this,"parent");$(this,"is_pending",!1);$(this,"transform_error");l(this,m);l(this,W,I?k:null);l(this,w);l(this,C);l(this,g);l(this,R,null);l(this,E,null);l(this,T,null);l(this,S,null);l(this,P,0);l(this,A,0);l(this,x,!1);l(this,B,new Set);l(this,H,new Set);l(this,D,null);l(this,ee,dt(()=>(a(this,D,Te(s(this,P))),()=>{a(this,D,null)})));var i;a(this,m,e),a(this,w,r),a(this,C,f=>{var u=q;u.b=this,u.f|=_e,n(f)}),this.parent=q.b,this.transform_error=c??((i=this.parent)==null?void 0:i.transform_error)??(f=>f),a(this,g,Ve(()=>{if(I){const f=s(this,W);qe();const u=f.data===xe;if(f.data.startsWith(pe)){const d=JSON.parse(f.data.slice(pe.length));p(this,h,Ae).call(this,d)}else u?p(this,h,Oe).call(this):p(this,h,Ne).call(this)}else p(this,h,he).call(this)},ct)),I&&a(this,m,k)}defer_effect(e){We(e,s(this,B),s(this,H))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(this,w).pending}update_pending_count(e){p(this,h,oe).call(this,e),a(this,P,s(this,P)+e),!(!s(this,D)||s(this,x))&&(a(this,x,!0),U(()=>{a(this,x,!1),s(this,D)&&je(s(this,D),s(this,P))}))}get_effect_pending(){return s(this,ee).call(this),Ee(s(this,D))}error(e){var r=s(this,w).onerror;let n=s(this,w).failed;if(!r&&!n)throw e;s(this,R)&&(ae(s(this,R)),a(this,R,null)),s(this,E)&&(ae(s(this,E)),a(this,E,null)),s(this,T)&&(ae(s(this,T)),a(this,T,null)),I&&(K(s(this,W)),ze(),K(Je()));var c=!1,i=!1;const f=()=>{if(c){Xe();return}c=!0,i&&Qe(),s(this,T)!==null&&ie(s(this,T),()=>{a(this,T,null)}),p(this,h,Q).call(this,()=>{se.ensure(),p(this,h,he).call(this)})},u=o=>{try{i=!0,r==null||r(o,f),i=!1}catch(d){j(d,s(this,g)&&s(this,g).parent)}n&&a(this,T,p(this,h,Q).call(this,()=>{se.ensure();try{return F(()=>{var d=q;d.b=this,d.f|=_e,n(s(this,m),()=>o,()=>f)})}catch(d){return j(d,s(this,g).parent),null}}))};U(()=>{var o;try{o=this.transform_error(e)}catch(d){j(d,s(this,g)&&s(this,g).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,d=>j(d,s(this,g)&&s(this,g).parent)):u(o)})}}m=new WeakMap,W=new WeakMap,w=new WeakMap,C=new WeakMap,g=new WeakMap,R=new WeakMap,E=new WeakMap,T=new WeakMap,S=new WeakMap,P=new WeakMap,A=new WeakMap,x=new WeakMap,B=new WeakMap,H=new WeakMap,D=new WeakMap,ee=new WeakMap,h=new WeakSet,Ne=function(){try{a(this,R,F(()=>s(this,C).call(this,s(this,m))))}catch(e){this.error(e)}},Ae=function(e){const r=s(this,w).failed;r&&a(this,T,F(()=>{r(s(this,m),()=>e,()=>()=>{})}))},Oe=function(){const e=s(this,w).pending;e&&(this.is_pending=!0,a(this,E,F(()=>e(s(this,m)))),U(()=>{var r=a(this,S,document.createDocumentFragment()),n=we();r.append(n),a(this,R,p(this,h,Q).call(this,()=>(se.ensure(),F(()=>s(this,C).call(this,n))))),s(this,A)===0&&(s(this,m).before(r),a(this,S,null),ie(s(this,E),()=>{a(this,E,null)}),p(this,h,G).call(this))}))},he=function(){try{if(this.is_pending=this.has_pending_snippet(),a(this,A,0),a(this,P,0),a(this,R,F(()=>{s(this,C).call(this,s(this,m))})),s(this,A)>0){var e=a(this,S,document.createDocumentFragment());Be(s(this,R),e);const r=s(this,w).pending;a(this,E,F(()=>r(s(this,m))))}else p(this,h,G).call(this)}catch(r){this.error(r)}},G=function(){this.is_pending=!1;for(const e of s(this,B))ge(e,He),ve(e);for(const e of s(this,H))ge(e,Le),ve(e);s(this,B).clear(),s(this,H).clear()},Q=function(e){var r=q,n=Re,c=Se;X(s(this,g)),Z(s(this,g)),ye(s(this,g).ctx);try{return e()}catch(i){return $e(i),null}finally{X(r),Z(n),ye(c)}},oe=function(e){var r;if(!this.has_pending_snippet()){this.parent&&p(r=this.parent,h,oe).call(r,e);return}a(this,A,s(this,A)+e),s(this,A)===0&&(p(this,h,G).call(this),s(this,E)&&ie(s(this,E),()=>{a(this,E,null)}),s(this,S)&&(s(this,m).before(s(this,S)),a(this,S,null)))};const pt=["touchstart","touchmove"];function gt(t){return pt.includes(t)}const M=Symbol("events"),Ye=new Set,le=new Set;function Et(t,e,r){(e[M]??(e[M]={}))[t]=r}function Tt(t){for(var e=0;e{throw Y});throw N}}finally{t[M]=e,delete t.currentTarget,Z(V),X(L)}}}function wt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function vt(t,e){return Fe(t,e)}function Rt(t,e){ne(),e.intro=e.intro??!1;const r=e.target,n=I,c=k;try{for(var i=Ke(r);i&&(i.nodeType!==De||i.data!==et);)i=tt(i);if(!i)throw fe;z(!0),K(i);const f=Fe(t,{...e,anchor:i});return z(!1),f}catch(f){if(f instanceof Error&&f.message.split(` `).some(u=>u.startsWith("https://svelte.dev/e/")))throw f;return f!==fe&&console.warn("Failed to hydrate: ",f),e.recover===!1&&rt(),ne(),st(r),z(!1),vt(t,e)}finally{z(n),K(c)}}const J=new Map;function Fe(t,{target:e,anchor:r,props:n={},events:c,context:i,intro:f=!0,transformError:u}){ne();var o=void 0,d=it(()=>{var V=r??e.appendChild(we());ut(V,{pending:()=>{}},v=>{nt({});var _=Se;if(i&&(_.c=i),c&&(n.$$events=c),I&<(v,null),o=t(v,n)||{},I&&(q.nodes.end=k,k===null||k.nodeType!==De||k.data!==ft))throw ht(),fe;ot()},u);var L=new Set,N=v=>{for(var _=0;_{var O;for(var v of L)for(const b of[e,document]){var _=J.get(b),y=_.get(v);--y==0?(b.removeEventListener(v,me),_.delete(v),_.size===0&&J.delete(b)):_.set(v,y)}le.delete(N),V!==r&&((O=V.parentNode)==null||O.removeChild(V))}});return de.set(o,d),o}let de=new WeakMap;function St(t,e){const r=de.get(t);return r?(de.delete(t),r(e)):Promise.resolve()}export{Et as a,Tt as d,Rt as h,vt as m,wt as s,St as u}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.br b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.br new file mode 100644 index 0000000..6a034f7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.gz b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.gz new file mode 100644 index 0000000..b58a5b1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DNn3Nckx.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br deleted file mode 100644 index b9527e5..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz b/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz deleted file mode 100644 index 972b700..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DP9qWekZ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br deleted file mode 100644 index 647c6e3..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz b/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz deleted file mode 100644 index 3ee52cd..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DPfxVJHQ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js similarity index 83% rename from apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js rename to apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js index a873d0d..ae0844d 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CkyfbJUz.js +++ b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js @@ -1 +1 @@ -import{ah as a,af as t,y as u,m as o}from"./C9Z4nxhR.js";function c(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function l(e){t===null&&c(),u&&t.l!==null?f(t).m.push(e):a(()=>{const n=o(e);if(typeof n=="function")return n})}function s(e){t===null&&c(),l(()=>()=>o(e))}function f(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}export{s as a,l as o}; +import{ah as a,af as t,y as u,m as o}from"./BBD-8XME.js";function c(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function l(e){t===null&&c(),u&&t.l!==null?f(t).m.push(e):a(()=>{const n=o(e);if(typeof n=="function")return n})}function s(e){t===null&&c(),l(()=>()=>o(e))}function f(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}export{s as a,l as o}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.br b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.br new file mode 100644 index 0000000..9e56a49 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.gz b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.gz new file mode 100644 index 0000000..f18a8d7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DUC-ssvh.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br deleted file mode 100644 index 268d8ef..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.br +++ /dev/null @@ -1,2 +0,0 @@ -z`Vmwr}%&n9Es3+st׋։ E!M7Uۡe3Րt+xN㯗qw]$H~٬<̨zq(+no09G#ZvSSO WbIcjbIgoBpt lx]!L8P}4!Z.?ZsI@] \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz b/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz deleted file mode 100644 index 7555032..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DWr9YED7.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js new file mode 100644 index 0000000..9024538 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js @@ -0,0 +1 @@ +import{b as p,E as t}from"./BBD-8XME.js";import{B as c}from"./gqVpgJ8U.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.br b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.br new file mode 100644 index 0000000..f7a2906 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.gz b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.gz new file mode 100644 index 0000000..741bb0f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DZuEJlJ5.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br deleted file mode 100644 index 818be5e..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz b/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz deleted file mode 100644 index 6c1fdbe..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DnKV7_Y9.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br deleted file mode 100644 index 40fa331..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.br +++ /dev/null @@ -1,2 +0,0 @@ - ¶rYk$IteSޱPq?*J[,Tyo?p -/4cuRD"I2g3IyqvqFD!(rAg\RO 0#G !eT Ctftw{۬PbTV#m : vxZZ${D4,8C1P.N ]~Z*KH)IZlj}ر:܅rI,Wz9jt`,5=ZNno7jRu`=ǁ1fZ680%)NK #Uo ~ZIZ@ǎYFcR2 _epvLexkX3dF(2)͗lN qr㖂89iPJ$=|jPK+y%\a^9ihfu|ssZFp \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz b/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz deleted file mode 100644 index e29dd4d..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Do8TgQ-j.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js similarity index 79% rename from apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js rename to apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js index a7335f7..5063e44 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CR6HhlME.js +++ b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js @@ -1 +1 @@ -import{k as t,l as S,m as h,q,S as T}from"./C9Z4nxhR.js";function k(r,i){return r===i||(r==null?void 0:r[T])===i}function A(r={},i,a,c){return t(()=>{var f,s;return S(()=>{f=s,s=[],h(()=>{r!==a(...s)&&(i(r,...s),f&&k(a(...f),r)&&i(null,...f))})}),()=>{q(()=>{s&&k(a(...s),r)&&i(null,...s)})}}),r}export{A as b}; +import{k as t,l as S,m as h,q,S as T}from"./BBD-8XME.js";function k(r,i){return r===i||(r==null?void 0:r[T])===i}function A(r={},i,a,c){return t(()=>{var f,s;return S(()=>{f=s,s=[],h(()=>{r!==a(...s)&&(i(r,...s),f&&k(a(...f),r)&&i(null,...f))})}),()=>{q(()=>{s&&k(a(...s),r)&&i(null,...s)})}}),r}export{A as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.br b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.br new file mode 100644 index 0000000..6dbfbe3 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.br @@ -0,0 +1,2 @@ +7 ,o*̾XK*QIk8*oc}CK!4 -nhشۈU7խ׼F@ 3r6JAF͑Q-3,vaA߉ PYkV(Fئ~HyFI$hGD@Z6Hv4<FrZATN-z +: \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.gz b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.gz new file mode 100644 index 0000000..bc7dfd2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DtXypsxD.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js b/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js deleted file mode 100644 index f86de56..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js +++ /dev/null @@ -1 +0,0 @@ -var Xt=t=>{throw TypeError(t)};var Pe=(t,e,n)=>e.has(t)||Xt("Cannot "+n);var w=(t,e,n)=>(Pe(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>e.has(t)?Xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{s as T,g as I,h as P,I as pt,b8 as Oe}from"./C9Z4nxhR.js";import{w as jt}from"./DnKV7_Y9.js";import{o as Qt}from"./CkyfbJUz.js";class Nt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(e,n){this.status=e,this.location=n}}class Dt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function $e(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function Ce(t){return t.split("%25").map(decodeURI).join("%25")}function je(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function Lt({href:t}){return t.split("#")[0]}function Ne(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function qe(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&W.delete(Vt(t)),De(t,e));const W=new Map;function Ve(t,e){const n=Vt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&W.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=qe(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function ze(t,e,n){if(W.size>0){const r=Vt(t,n),a=W.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ut(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ut(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const d=Be.exec(l),[,u,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ut(l)}).join("")}).join("")}/?$`),params:e}}function Me(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Fe(t){return t.slice(1).split("/").filter(Me)}function Ge(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;id).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=e[i+1],u=a[i+1];d&&!d.rest&&d.optional&&u&&l.chained&&(o=0),!d&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function Ut(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function We({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[l,c,d]])=>{const{pattern:u,params:v}=Ke(i),f={id:i,exec:h=>{const _=u.exec(h);if(_)return Ge(_,v,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...c||[]].map(o),leaf:s(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(i){const l=i<0;return l&&(i=~i),[l,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function ue(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Zt(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var se;const U=((se=globalThis.__sveltekit_1bqbquz)==null?void 0:se.base)??"/dashboard";var ie;const Ye=((ie=globalThis.__sveltekit_1bqbquz)==null?void 0:ie.assets)??U??"",He="1772569216424",de="sveltekit:snapshot",he="sveltekit:scroll",pe="sveltekit:states",Je="sveltekit:pageurl",M="sveltekit:history",H="sveltekit:navigation",q={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Et=location.origin;function zt(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function V(){return{x:pageXOffset,y:pageYOffset}}function K(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const te={...q,"":q.hover};function ge(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function me(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=ge(t)}}function It(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||St(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Et&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function gt(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=K(i,"preload-code")),a===null&&(a=K(i,"preload-data")),e===null&&(e=K(i,"keepfocus")),n===null&&(n=K(i,"noscroll")),s===null&&(s=K(i,"reload")),o===null&&(o=K(i,"replacestate")),i=ge(i);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:te[r??"off"],preload_data:te[a??"off"],keepfocus:l(e),noscroll:l(n),reload:l(s),replace_state:l(o)}}function ee(t){const e=jt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(l=>{(i===void 0||n&&l!==i)&&o(i=l)})}return{notify:r,set:a,subscribe:s}}const _e={v:()=>{}};function Xe(){const{set:t,subscribe:e}=jt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ye}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==He;return o&&(t(!0),_e.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function St(t,e,n){return t.origin!==Et||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Ln(t){}const we=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...we];const Qe=new Set([...we]);[...Qe];function Ze(t){return t.filter(e=>e!=null)}function Bt(t){return t instanceof Nt||t instanceof Dt?t.status:500}function tn(t){return t instanceof Dt?t.text:"Internal Error"}let R,J,At;const en=Qt.toString().includes("$$")||/function \w+\(\) \{\}/.test(Qt.toString());var et,nt,at,rt,ot,st,it,lt,le,ct,ce,ft,fe;en?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},At={current:!1}):(R=new(le=class{constructor(){A(this,et,T({}));A(this,nt,T(null));A(this,at,T(null));A(this,rt,T({}));A(this,ot,T({id:null}));A(this,st,T({}));A(this,it,T(-1));A(this,lt,T(new URL("https://example.com")))}get data(){return I(w(this,et))}set data(e){P(w(this,et),e)}get form(){return I(w(this,nt))}set form(e){P(w(this,nt),e)}get error(){return I(w(this,at))}set error(e){P(w(this,at),e)}get params(){return I(w(this,rt))}set params(e){P(w(this,rt),e)}get route(){return I(w(this,ot))}set route(e){P(w(this,ot),e)}get state(){return I(w(this,st))}set state(e){P(w(this,st),e)}get status(){return I(w(this,it))}set status(e){P(w(this,it),e)}get url(){return I(w(this,lt))}set url(e){P(w(this,lt),e)}},et=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,lt=new WeakMap,le),J=new(ce=class{constructor(){A(this,ct,T(null))}get current(){return I(w(this,ct))}set current(e){P(w(this,ct),e)}},ct=new WeakMap,ce),At=new(fe=class{constructor(){A(this,ft,T(!1))}get current(){return I(w(this,ft))}set current(e){P(w(this,ft),e)}},ft=new WeakMap,fe),_e.v=()=>At.current=!0);function nn(t){Object.assign(R,t)}const an=new Set(["icon","shortcut icon","apple-touch-icon"]),j=ue(he)??{},X=ue(de)??{},C={url:ee({}),page:ee({}),navigating:jt(null),updated:Xe()};function Kt(t){j[t]=V()}function rn(t,e){let n=t+1;for(;j[n];)delete j[n],n+=1;for(n=e+1;X[n];)delete X[n],n+=1}function Q(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function ve(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function ne(){}let Mt,Pt,mt,O,Ot,E;const _t=[],wt=[];let y=null;function $t(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const ht=new Map,ye=new Set,on=new Set,Y=new Set;let m={branch:[],error:null,url:null},be=!1,vt=!1,ae=!0,Z=!1,G=!1,ke=!1,Ft=!1,Ee,k,L,D;const yt=new Set,re=new Map;async function In(t,e,n){var s,o,i,l,c;(s=globalThis.__sveltekit_1bqbquz)!=null&&s.data&&globalThis.__sveltekit_1bqbquz.data,document.URL!==location.href&&(location.href=location.href),E=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Mt=We(t),O=document.documentElement,Ot=e,Pt=t.nodes[0],mt=t.nodes[1],Pt(),mt(),k=(l=history.state)==null?void 0:l[M],L=(c=history.state)==null?void 0:c[H],k||(k=L=Date.now(),history.replaceState({...history.state,[M]:k,[H]:L},""));const r=j[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(Ot,n)):(await F({type:"enter",url:zt(E.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function sn(){_t.length=0,Ft=!1}function Se(t){wt.some(e=>e==null?void 0:e.snapshot)&&(X[t]=wt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Re(t){var e;(e=X[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=wt[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function oe(){Kt(k),Zt(he,j),Se(L),Zt(de,X)}async function xe(t,e,n,r){let a;e.invalidateAll&&$t(),await F({type:"goto",url:zt(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Ft=!0,a=[...re.keys()]),e.invalidate&&e.invalidate.forEach(_n)}}),e.invalidateAll&&pt().then(pt).then(()=>{re.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function ln(t){if(t.id!==(y==null?void 0:y.id)){$t();const e={};yt.add(e),y={id:t.id,token:e,promise:Ue({...t,preload:e}).then(n=>(yt.delete(e),n.type==="loaded"&&n.state.error&&$t(),n)),fork:null}}return y.promise}async function Tt(t){var n;const e=(n=await Rt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].filter(Boolean).map(r=>r[1]()))}async function Le(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Ee=new E.root({target:e,props:{...t.props,stores:C,components:wt},hydrate:n,sync:!1}),await Promise.resolve(),Re(L),n){const s={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href),scroll:j[k]??V()},willUnload:!1,type:"enter",complete:Promise.resolve()};Y.forEach(o=>o(s))}vt=!0}function bt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(U&&(t.pathname===U||t.pathname===U+"/"))i="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=$e(t.pathname,i),t.search=t.search;const l={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:Ze(n).map(f=>f.node.component),page:Jt(R)}};o!==void 0&&(l.props.form=o);let c={},d=!R,u=0;for(let f=0;fi(new URL(o))))return!0;return!1}function Wt(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function un(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function dn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Jt(R),constructors:[]}}}async function Ue({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((y==null?void 0:y.id)===t)return yt.delete(y.token),y.promise;const{errors:o,layouts:i,leaf:l}=a,c=[...i,l];o.forEach(g=>g==null?void 0:g().catch(()=>{})),c.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==kt(m.url):!1,u=m.route?a.id!==m.route.id:!1,v=un(m.url,n);let f=!1;const h=c.map(async(g,p)=>{var $;if(!g)return;const b=m.branch[p];return g[1]===(b==null?void 0:b.loader)&&!fn(f,u,d,v,($=b.universal)==null?void 0:$.uses,r)?b:(f=!0,Gt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var ut;const N={};for(let z=0;z{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:Wt(s)}),i={node:await mt(),loader:mt,universal:null,server:null,data:null};return bt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof qt)return xe(new URL(o.location,location.href),{},0);throw o}}async function pn(t){const e=t.href;if(ht.has(e))return ht.get(e);let n;try{const r=(async()=>{let a=await E.hooks.reroute({url:new URL(t),fetch:async(s,o)=>cn(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);E.hash?s.hash=a:s.pathname=a,a=s}return a})();ht.set(e,r),n=await r}catch{ht.delete(e);return}return n}async function Rt(t,e){if(t&&!St(t,U,E.hash)){const n=await pn(t);if(!n)return;const r=gn(n);for(const a of Mt){const s=a.exec(r);if(s)return{id:kt(t),invalidating:e,route:a,params:je(s),url:t}}}}function gn(t){return Ce(E.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function kt(t){return(E.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Ae({url:t,type:e,intent:n,delta:r,event:a,scroll:s}){let o=!1;const i=Ht(m,n,t,e,s??null);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const l={...i.navigation,cancel:()=>{o=!0,i.reject(new Error("navigation cancelled"))}};return Z||ye.forEach(c=>c(l)),o?null:i}async function F({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:l={},accept:c=ne,block:d=ne,event:u}){var z;const v=D;D=l;const f=await Rt(e,!1),h=t==="enter"?Ht(m,f,e,t):Ae({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,scroll:n==null?void 0:n.scroll,event:u});if(!h){d(),D===l&&(D=v);return}const _=k,g=L;c(),Z=!0,vt&&h.navigation.type!=="enter"&&C.navigating.set(J.current=h.navigation);let p=f&&await Ue(f);if(!p){if(St(e,U,E.hash))return await Q(e,s);p=await Te(e,{id:null},await tt(new Dt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(f==null?void 0:f.url)||e,D!==l)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await F({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:l}),h.fulfil(void 0);return}p=await Yt({status:500,error:await tt(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await C.updated.check()&&(await ve(),await Q(e,s));if(sn(),Kt(_),Se(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const S=s?0:1,dt={[M]:k+=S,[H]:L+=S,[pe]:o};(s?history.replaceState:history.pushState).call(history,dt,"",e),s||rn(k,L)}const b=f&&(y==null?void 0:y.id)===f.id?y.fork:null;y=null,p.props.page.state=o;let x;if(vt){const S=(await Promise.all(Array.from(on,B=>B(h.navigation)))).filter(B=>typeof B=="function");if(S.length>0){let B=function(){S.forEach(xt=>{Y.delete(xt)})};S.push(B),S.forEach(xt=>{Y.add(xt)})}m=p.state,p.props.page&&(p.props.page.url=e);const dt=b&&await b;dt?x=dt.commit():(Ee.$set(p.props),nn(p.props.page),x=(z=Oe)==null?void 0:z()),ke=!0}else await Le(p,Ot,!1);const{activeElement:$}=document;await x,await pt(),await pt();let N=null;if(ae){const S=n?n.scroll:a?V():null;S?scrollTo(S.x,S.y):(N=e.hash&&document.getElementById(Ie(e)))?N.scrollIntoView():scrollTo(0,0)}const ut=document.activeElement!==$&&document.activeElement!==document.body;!r&&!ut&&bn(e,!N),ae=!0,p.props.page&&Object.assign(R,p.props.page),Z=!1,t==="popstate"&&Re(L),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=V()),Y.forEach(S=>S(h.navigation)),C.navigating.set(J.current=null)}async function Te(t,e,n,r,a){return t.origin===Et&&t.pathname===location.pathname&&!be?await Yt({status:r,error:n,url:t,route:e}):await Q(t,a)}function mn(){let t,e={element:void 0,href:void 0},n;O.addEventListener("mousemove",i=>{const l=i.target;clearTimeout(t),t=setTimeout(()=>{s(l,q.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],q.tap)}O.addEventListener("mousedown",r),O.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const l of i)l.isIntersecting&&(Tt(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function s(i,l){const c=me(i,O),d=c===e.element&&(c==null?void 0:c.href)===e.href&&l>=n;if(!c||d)return;const{url:u,external:v,download:f}=It(c,U,E.hash);if(v||f)return;const h=gt(c),_=u&&kt(m.url)===kt(u);if(!(h.reload||_))if(l<=h.preload_data){e={element:c,href:c.href},n=q.tap;const g=await Rt(u,!1);if(!g)return;ln(g)}else l<=h.preload_code&&(e={element:c,href:c.href},n=l,Tt(u))}function o(){a.disconnect();for(const i of O.querySelectorAll("a")){const{url:l,external:c,download:d}=It(i,U,E.hash);if(c||d)continue;const u=gt(i);u.reload||(u.preload_code===q.viewport&&a.observe(i),u.preload_code===q.eager&&Tt(l))}}Y.add(o),o()}function tt(t,e){if(t instanceof Nt)return t.body;const n=Bt(t),r=tn(t);return E.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function Pn(t,e={}){return t=new URL(zt(t)),t.origin!==Et?Promise.reject(new Error("goto: invalid URL")):xe(t,e,0)}function _n(t){if(typeof t=="function")_t.push(t);else{const{href:e}=new URL(t,location.href);_t.push(n=>n.href===e)}}function wn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(oe(),!Z){const a=Ht(m,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};ye.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&oe()}),(e=navigator.connection)!=null&&e.saveData||mn(),O.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=me(n.composedPath()[0],O);if(!r)return;const{url:a,external:s,target:o,download:i}=It(r,U,E.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const l=gt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[d,u]=(E.hash?a.hash.replace(/^#/,""):a.href).split("#"),v=d===Lt(location);if(s||l.reload&&(!v||!u)){Ae({url:a,type:"link",event:n})?Z=!0:n.preventDefault();return}if(u!==void 0&&v){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(G=!0,Kt(k),t(a),!l.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:a,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??a.href===location.href,event:n})}),O.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(St(i,U,!1))return;const l=n.target,c=gt(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,a);i.search=new URLSearchParams(d).toString(),F({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ct){if((r=n.state)!=null&&r[M]){const a=n.state[M];if(D={},a===k)return;const s=j[a],o=n.state[pe]??{},i=new URL(n.state[Je]??location.href),l=n.state[H],c=m.url?Lt(location)===Lt(m.url):!1;if(l===L&&(ke||c)){o!==R.state&&(R.state=o),t(i),j[k]=V(),s&&scrollTo(s.x,s.y),k=a;return}const u=a-k;await F({type:"popstate",url:i,popped:{state:o,scroll:s,delta:u},accept:()=>{k=a,L=l},block:()=>{history.go(-u)},nav_token:D,event:n})}else if(!G){const a=new URL(location.href);t(a),E.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[M]:++k,[H]:L},"",location.href))});for(const n of document.querySelectorAll("link"))an.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(J.current=null)});function t(n){m.url=R.url=n,C.page.set(Jt(R)),C.page.notify()}}async function vn(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:l}){be=!0;const c=new URL(location.href);let d;({params:a={},route:s={id:null}}=await Rt(c,!1)||{}),d=Mt.find(({id:f})=>f===s.id);let u,v=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=yn(p.uses)),Gt({loader:E.nodes[_],url:c,params:a,route:s,parent:async()=>{const b={};for(let x=0;x{const i=history.state;Ct=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),e&&scrollTo(s,o),Ct=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o{if(a.rangeCount===s.length){for(let o=0;o{s=u,o=v});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url,scroll:V()},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((d=e==null?void 0:e.route)==null?void 0:d.id)??null},url:n,scroll:a},willUnload:!e,type:r,complete:i},fulfil:s,reject:o}}function Jt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function kn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Ie(t){let e;if(E.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{In as a,U as b,Pn as g,Ln as l,R as p,C as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.br b/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.br deleted file mode 100644 index 2eab214..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.gz b/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.gz deleted file mode 100644 index 8720c68..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DunNqS1N.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br deleted file mode 100644 index 4ab9609..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz b/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz deleted file mode 100644 index 90c838c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/P9ZHwQBL.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js similarity index 70% rename from apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js rename to apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js index 658f7b1..7cac585 100644 --- a/apps/dashboard/build/_app/immutable/chunks/C2oj68pw.js +++ b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js @@ -1 +1 @@ -import{b as T,J as o,a0 as b,E as h,a1 as p,a2 as A,a3 as E,a4 as R,a5 as g,a6 as l}from"./C9Z4nxhR.js";import{B as v}from"./CY4crMrT.js";function S(t,u,_=!1){o&&b();var n=new v(t),c=_?h:0;function i(a,r){if(o){const e=p(t);var s;if(e===A?s=0:e===E?s=!1:s=parseInt(e.substring(1)),a!==s){var f=R();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;u((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; +import{b as T,J as o,a0 as b,E as h,a1 as p,a2 as A,a3 as E,a4 as R,a5 as g,a6 as l}from"./BBD-8XME.js";import{B as v}from"./gqVpgJ8U.js";function S(t,u,_=!1){o&&b();var n=new v(t),c=_?h:0;function i(a,r){if(o){const e=p(t);var s;if(e===A?s=0:e===E?s=!1:s=parseInt(e.substring(1)),a!==s){var f=R();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;u((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.br b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.br new file mode 100644 index 0000000..3beee39 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.gz b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.gz new file mode 100644 index 0000000..51ba4d8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/RaRNNC-y.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br deleted file mode 100644 index d37a483..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.br +++ /dev/null @@ -1,2 +0,0 @@ -@VU\6u639TiܥX*;U7͡bV+y@k>S(Ԝ w[V?O`K5|MMrZ>/_Wl"?"_+*mk:ȼ +C5sm?BC9òx&y I vt\gνu}!x*j斨L5M!eSO1*HJo$VߛJ H)i',W8\YEt7rDLp<>-, Ekx@쪹I -7Qh>i'T$iJӜ8,\Z?B-쐌;Mu@PhH}n#*COROdJbϹ,"Dɢ6/zdZ(B5@M#[ O/s噬S,^޲/^XV"JFHIf%m2[~9 \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz b/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz deleted file mode 100644 index 30a5772..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/ZesQ8l8p.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br deleted file mode 100644 index 09e4908..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.br +++ /dev/null @@ -1,2 +0,0 @@ -@X:tw.I?cY$_49ǟ{};ьU42T=%\O]$U2$(&f;`퇇 zD- ^vpkwB.H8P^N \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz b/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz deleted file mode 100644 index 9e03ee6..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/_Va07L2l.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js new file mode 100644 index 0000000..cbeecd4 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js @@ -0,0 +1 @@ +import{I as J,b8 as ee}from"./BBD-8XME.js";import{w as ae}from"./Br8WXJxx.js";import{c as ne,H as N,N as B,r as gt,i as _t,b as L,s as j,p as x,n as ft,f as $t,g as ut,a as X,d as it,S as Nt,P as re,e as oe,h as se,o as Dt,j as q,k as ie,l as qt,m as ce,q as le,t as Kt,u as Pt,v as fe}from"./BeSd-T80.js";class wt{constructor(a,e){this.status=a,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${a}`}}toString(){return JSON.stringify(this.body)}}class vt{constructor(a,e){this.status=a,this.location=e}}class yt extends Error{constructor(a,e,r){super(r),this.status=a,this.text=e}}const ue=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function he(t){const a=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${pe(t).map(r=>{const n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(n)return a.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return a.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ct(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ct(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const h=ue.exec(c),[,u,w,f,d]=h;return a.push({name:f,matcher:d,optional:!!u,rest:!!w,chained:w?l===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return ct(c)}).join("")}).join("")}/?$`),params:a}}function de(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function pe(t){return t.slice(1).split("/").filter(de)}function me(t,a,e){const r={},n=t.slice(1),o=n.filter(i=>i!==void 0);let s=0;for(let i=0;ih).join("/"),s=0),l===void 0)if(c.rest)l="";else continue;if(!c.matcher||e[c.matcher](l)){r[c.name]=l;const h=a[i+1],u=n[i+1];h&&!h.rest&&h.optional&&u&&c.chained&&(s=0),!h&&!u&&Object.keys(r).length===o.length&&(s=0);continue}if(c.optional&&c.chained){s++;continue}return}if(!s)return r}function ct(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function ge({nodes:t,server_loads:a,dictionary:e,matchers:r}){const n=new Set(a);return Object.entries(e).map(([i,[c,l,h]])=>{const{pattern:u,params:w}=he(i),f={id:i,exec:d=>{const _=u.exec(d);if(_)return me(_,w,r)},errors:[1,...h||[]].map(d=>t[d]),layouts:[0,...l||[]].map(s),leaf:o(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function s(i){return i===void 0?i:[n.has(i),t[i]]}}function Ft(t,a=JSON.parse){try{return a(sessionStorage[t])}catch{}}function It(t,a,e=JSON.stringify){const r=e(a);try{sessionStorage[t]=r}catch{}}function _e(t){return t.filter(a=>a!=null)}function Et(t){return t instanceof wt||t instanceof yt?t.status:500}function we(t){return t instanceof yt?t.text:"Internal Error"}const ve=new Set(["icon","shortcut icon","apple-touch-icon"]),I=Ft(Kt)??{},M=Ft(qt)??{},P={url:Pt({}),page:Pt({}),navigating:ae(null),updated:ne()};function bt(t){I[t]=j()}function ye(t,a){let e=t+1;for(;I[e];)delete I[e],e+=1;for(e=a+1;M[e];)delete M[e],e+=1}function V(t,a=!1){return a?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Bt(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(L||"/");t&&await t.update()}}function Tt(){}let kt,ht,Q,U,dt,b;const Z=[],tt=[];let v=null;function pt(){var t;(t=v==null?void 0:v.fork)==null||t.then(a=>a==null?void 0:a.discard()),v=null}const G=new Map,Mt=new Set,Ee=new Set,F=new Set;let g={branch:[],error:null,url:null},Vt=!1,et=!1,Ot=!0,H=!1,K=!1,Ht=!1,St=!1,Yt,E,R,O;const at=new Set,jt=new Map;async function Fe(t,a,e){var o,s,i,c,l;(o=globalThis.__sveltekit_6jo0pm)!=null&&o.data&&globalThis.__sveltekit_6jo0pm.data,document.URL!==location.href&&(location.href=location.href),b=t,await((i=(s=t.hooks).init)==null?void 0:i.call(s)),kt=ge(t),U=document.documentElement,dt=a,ht=t.nodes[0],Q=t.nodes[1],ht(),Q(),E=(c=history.state)==null?void 0:c[N],R=(l=history.state)==null?void 0:l[B],E||(E=R=Date.now(),history.replaceState({...history.state,[N]:E,[B]:R},""));const r=I[E];function n(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}e?(n(),await je(dt,e)):(await D({type:"enter",url:gt(b.hash?Ne(new URL(location.href)):location.href),replace_state:!0}),n()),Oe()}function be(){Z.length=0,St=!1}function zt(t){tt.some(a=>a==null?void 0:a.snapshot)&&(M[t]=tt.map(a=>{var e;return(e=a==null?void 0:a.snapshot)==null?void 0:e.capture()}))}function Wt(t){var a;(a=M[t])==null||a.forEach((e,r)=>{var n,o;(o=(n=tt[r])==null?void 0:n.snapshot)==null||o.restore(e)})}function Ct(){bt(E),It(Kt,I),zt(R),It(qt,M)}async function Gt(t,a,e,r){let n;a.invalidateAll&&pt(),await D({type:"goto",url:gt(t),keepfocus:a.keepFocus,noscroll:a.noScroll,replace_state:a.replaceState,state:a.state,redirect_count:e,nav_token:r,accept:()=>{a.invalidateAll&&(St=!0,n=[...jt.keys()]),a.invalidate&&a.invalidate.forEach(Te)}}),a.invalidateAll&&J().then(J).then(()=>{jt.forEach(({resource:o},s)=>{var i;n!=null&&n.includes(s)&&((i=o.refresh)==null||i.call(o))})})}async function ke(t){if(t.id!==(v==null?void 0:v.id)){pt();const a={};at.add(a),v={id:t.id,token:a,promise:Xt({...t,preload:a}).then(e=>(at.delete(a),e.type==="loaded"&&e.state.error&&pt(),e)),fork:null}}return v.promise}async function lt(t){var e;const a=(e=await ot(t,!1))==null?void 0:e.route;a&&await Promise.all([...a.layouts,a.leaf].filter(Boolean).map(r=>r[1]()))}async function Jt(t,a,e){var n;g=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(x,t.props.page),Yt=new b.root({target:a,props:{...t.props,stores:P,components:tt},hydrate:e,sync:!1}),await Promise.resolve(),Wt(R),e){const o={from:null,to:{params:g.params,route:{id:((n=g.route)==null?void 0:n.id)??null},url:new URL(location.href),scroll:I[E]??j()},willUnload:!1,type:"enter",complete:Promise.resolve()};F.forEach(s=>s(o))}et=!0}function nt({url:t,params:a,branch:e,status:r,error:n,route:o,form:s}){let i="never";if(L&&(t.pathname===L||t.pathname===L+"/"))i="always";else for(const f of e)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=se(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:a,branch:e,error:n,route:o},props:{constructors:_e(e).map(f=>f.node.component),page:At(x)}};s!==void 0&&(c.props.form=s);let l={},h=!x,u=0;for(let f=0;fi(new URL(s))))return!0;return!1}function xt(t,a){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?a??null:null}function xe(t,a){if(!t)return new Set(a.searchParams.keys());const e=new Set([...t.searchParams.keys(),...a.searchParams.keys()]);for(const r of e){const n=t.searchParams.getAll(r),o=a.searchParams.getAll(r);n.every(s=>o.includes(s))&&o.every(s=>n.includes(s))&&e.delete(r)}return e}function Le({error:t,url:a,route:e,params:r}){return{type:"loaded",state:{error:t,url:a,route:e,params:r,branch:[]},props:{page:At(x),constructors:[]}}}async function Xt({id:t,invalidating:a,url:e,params:r,route:n,preload:o}){if((v==null?void 0:v.id)===t)return at.delete(v.token),v.promise;const{errors:s,layouts:i,leaf:c}=n,l=[...i,c];s.forEach(m=>m==null?void 0:m().catch(()=>{})),l.forEach(m=>m==null?void 0:m[1]().catch(()=>{}));const h=g.url?t!==rt(g.url):!1,u=g.route?n.id!==g.route.id:!1,w=xe(g.url,e);let f=!1;const d=l.map(async(m,p)=>{var A;if(!m)return;const y=g.branch[p];return m[1]===(y==null?void 0:y.loader)&&!Re(f,u,h,w,(A=y.universal)==null?void 0:A.uses,r)?y:(f=!0,Rt({loader:m[1],url:e,params:r,route:n,parent:async()=>{var z;const T={};for(let C=0;C{});const _=[];for(let m=0;mPromise.resolve({}),server_data_node:xt(o)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return nt({url:e,params:n,branch:[s,i],status:t,error:a,route:null})}catch(s){if(s instanceof vt)return Gt(new URL(s.location,location.href),{},0);throw s}}async function Ae(t){const a=t.href;if(G.has(a))return G.get(a);let e;try{const r=(async()=>{let n=await b.hooks.reroute({url:new URL(t),fetch:async(o,s)=>Se(o,s,t).promise})??t;if(typeof n=="string"){const o=new URL(t);b.hash?o.hash=n:o.pathname=n,n=o}return n})();G.set(a,r),e=await r}catch{G.delete(a);return}return e}async function ot(t,a){if(t&&!_t(t,L,b.hash)){const e=await Ae(t);if(!e)return;const r=Pe(e);for(const n of kt){const o=n.exec(r);if(o)return{id:rt(t),invalidating:a,route:n,params:oe(o),url:t}}}}function Pe(t){return ie(b.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(L.length))||"/"}function rt(t){return(b.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Qt({url:t,type:a,intent:e,delta:r,event:n,scroll:o}){let s=!1;const i=Ut(g,e,t,a,o??null);r!==void 0&&(i.navigation.delta=r),n!==void 0&&(i.navigation.event=n);const c={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return H||Mt.forEach(l=>l(c)),s?null:i}async function D({type:t,url:a,popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s={},redirect_count:i=0,nav_token:c={},accept:l=Tt,block:h=Tt,event:u}){var C;const w=O;O=c;const f=await ot(a,!1),d=t==="enter"?Ut(g,f,a,t):Qt({url:a,type:t,delta:e==null?void 0:e.delta,intent:f,scroll:e==null?void 0:e.scroll,event:u});if(!d){h(),O===c&&(O=w);return}const _=E,m=R;l(),H=!0,et&&d.navigation.type!=="enter"&&P.navigating.set(ft.current=d.navigation);let p=f&&await Xt(f);if(!p){if(_t(a,L,b.hash))return await V(a,o);p=await Zt(a,{id:null},await Y(new yt(404,"Not Found",`Not found: ${a.pathname}`),{url:a,params:{},route:{id:null}}),404,o)}if(a=(f==null?void 0:f.url)||a,O!==c)return d.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await D({type:t,url:new URL(p.location,a),popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s,redirect_count:i+1,nav_token:c}),d.fulfil(void 0);return}p=await Lt({status:500,error:await Y(new Error("Redirect loop"),{url:a,params:{},route:{id:null}}),url:a,route:{id:null}})}else p.props.page.status>=400&&await P.updated.check()&&(await Bt(),await V(a,o));if(be(),bt(_),zt(m),p.props.page.url.pathname!==a.pathname&&(a.pathname=p.props.page.url.pathname),s=e?e.state:s,!e){const k=o?0:1,W={[N]:E+=k,[B]:R+=k,[Nt]:s};(o?history.replaceState:history.pushState).call(history,W,"",a),o||ye(E,R)}const y=f&&(v==null?void 0:v.id)===f.id?v.fork:null;v=null,p.props.page.state=s;let S;if(et){const k=(await Promise.all(Array.from(Ee,$=>$(d.navigation)))).filter($=>typeof $=="function");if(k.length>0){let $=function(){k.forEach(st=>{F.delete(st)})};k.push($),k.forEach(st=>{F.add(st)})}g=p.state,p.props.page&&(p.props.page.url=a);const W=y&&await y;W?S=W.commit():(Yt.$set(p.props),fe(p.props.page),S=(C=ee)==null?void 0:C()),Ht=!0}else await Jt(p,dt,!1);const{activeElement:A}=document;await S,await J(),await J();let T=null;if(Ot){const k=e?e.scroll:n?j():null;k?scrollTo(k.x,k.y):(T=a.hash&&document.getElementById(te(a)))?T.scrollIntoView():scrollTo(0,0)}const z=document.activeElement!==A&&document.activeElement!==document.body;!r&&!z&&$e(a,!T),Ot=!0,p.props.page&&Object.assign(x,p.props.page),H=!1,t==="popstate"&&Wt(R),d.fulfil(void 0),d.navigation.to&&(d.navigation.to.scroll=j()),F.forEach(k=>k(d.navigation)),P.navigating.set(ft.current=null)}async function Zt(t,a,e,r,n){return t.origin===Dt&&t.pathname===location.pathname&&!Vt?await Lt({status:r,error:e,url:t,route:a}):await V(t,n)}function Ie(){let t,a={element:void 0,href:void 0},e;U.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{o(c,q.hover)},20)});function r(i){i.defaultPrevented||o(i.composedPath()[0],q.tap)}U.addEventListener("mousedown",r),U.addEventListener("touchstart",r,{passive:!0});const n=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(lt(new URL(c.target.href)),n.unobserve(c.target))},{threshold:0});async function o(i,c){const l=$t(i,U),h=l===a.element&&(l==null?void 0:l.href)===a.href&&c>=e;if(!l||h)return;const{url:u,external:w,download:f}=ut(l,L,b.hash);if(w||f)return;const d=X(l),_=u&&rt(g.url)===rt(u);if(!(d.reload||_))if(c<=d.preload_data){a={element:l,href:l.href},e=q.tap;const m=await ot(u,!1);if(!m)return;ke(m)}else c<=d.preload_code&&(a={element:l,href:l.href},e=c,lt(u))}function s(){n.disconnect();for(const i of U.querySelectorAll("a")){const{url:c,external:l,download:h}=ut(i,L,b.hash);if(l||h)continue;const u=X(i);u.reload||(u.preload_code===q.viewport&&n.observe(i),u.preload_code===q.eager&<(c))}}F.add(s),s()}function Y(t,a){if(t instanceof wt)return t.body;const e=Et(t),r=we(t);return b.hooks.handleError({error:t,event:a,status:e,message:r})??{message:r}}function Be(t,a={}){return t=new URL(gt(t)),t.origin!==Dt?Promise.reject(new Error("goto: invalid URL")):Gt(t,a,0)}function Te(t){if(typeof t=="function")Z.push(t);else{const{href:a}=new URL(t,location.href);Z.push(e=>e.href===a)}}function Oe(){var a;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Ct(),!H){const n=Ut(g,void 0,null,"leave"),o={...n.navigation,cancel:()=>{r=!0,n.reject(new Error("navigation cancelled"))}};Mt.forEach(s=>s(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ct()}),(a=navigator.connection)!=null&&a.saveData||Ie(),U.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=$t(e.composedPath()[0],U);if(!r)return;const{url:n,external:o,target:s,download:i}=ut(r,L,b.hash);if(!n)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=X(r);if(!(r instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[h,u]=(b.hash?n.hash.replace(/^#/,""):n.href).split("#"),w=h===it(location);if(o||c.reload&&(!w||!u)){Qt({url:n,type:"link",event:e})?H=!0:e.preventDefault();return}if(u!==void 0&&w){const[,f]=g.url.href.split("#");if(f===u){if(e.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(K=!0,bt(E),t(n),!c.replace_state)return;K=!1}e.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await D({type:"link",url:n,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??n.href===location.href,event:e})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if(((n==null?void 0:n.formTarget)||r.target)==="_blank"||((n==null?void 0:n.formMethod)||r.method)!=="get")return;const i=new URL((n==null?void 0:n.hasAttribute("formaction"))&&(n==null?void 0:n.formAction)||r.action);if(_t(i,L,!1))return;const c=e.target,l=X(c);if(l.reload)return;e.preventDefault(),e.stopPropagation();const h=new FormData(c,n);i.search=new URLSearchParams(h).toString(),D({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:e})}),addEventListener("popstate",async e=>{var r;if(!mt){if((r=e.state)!=null&&r[N]){const n=e.state[N];if(O={},n===E)return;const o=I[n],s=e.state[Nt]??{},i=new URL(e.state[re]??location.href),c=e.state[B],l=g.url?it(location)===it(g.url):!1;if(c===R&&(Ht||l)){s!==x.state&&(x.state=s),t(i),I[E]=j(),o&&scrollTo(o.x,o.y),E=n;return}const u=n-E;await D({type:"popstate",url:i,popped:{state:s,scroll:o,delta:u},accept:()=>{E=n,R=c},block:()=>{history.go(-u)},nav_token:O,event:e})}else if(!K){const n=new URL(location.href);t(n),b.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[N]:++E,[B]:R},"",location.href))});for(const e of document.querySelectorAll("link"))ve.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&P.navigating.set(ft.current=null)});function t(e){g.url=x.url=e,P.page.set(At(x)),P.page.notify()}}async function je(t,{status:a=200,error:e,node_ids:r,params:n,route:o,server_route:s,data:i,form:c}){Vt=!0;const l=new URL(location.href);let h;({params:n={},route:o={id:null}}=await ot(l,!1)||{}),h=kt.find(({id:f})=>f===o.id);let u,w=!0;try{const f=r.map(async(_,m)=>{const p=i[m];return p!=null&&p.uses&&(p.uses=Ce(p.uses)),Rt({loader:b.nodes[_],url:l,params:n,route:o,parent:async()=>{const y={};for(let S=0;S{const i=history.state;mt=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),a&&scrollTo(o,s),mt=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const n=getSelection();if(n&&n.type!=="None"){const o=[];for(let s=0;s{if(n.rangeCount===o.length){for(let s=0;s{o=u,s=w});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url,scroll:j()},to:e&&{params:(a==null?void 0:a.params)??null,route:{id:((h=a==null?void 0:a.route)==null?void 0:h.id)??null},url:e,scroll:n},willUnload:!a,type:r,complete:i},fulfil:o,reject:s}}function At(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Ne(t){const a=new URL(t);return a.hash=decodeURIComponent(t.hash),a}function te(t){let a;if(b.hash){const[,,e]=t.hash.split("#",3);a=e??""}else a=t.hash.slice(1);return decodeURIComponent(a)}export{Fe as a,Be as g,P as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.br b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.br new file mode 100644 index 0000000..a4b3fb9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.gz b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.gz new file mode 100644 index 0000000..d5427a2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/cIQD_rb4.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js similarity index 97% rename from apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js rename to apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js index 1d1d6f4..76395b7 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CY4crMrT.js +++ b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js @@ -1 +1 @@ -var D=Object.defineProperty;var g=a=>{throw TypeError(a)};var F=(a,e,s)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var w=(a,e,s)=>F(a,typeof e!="symbol"?e+"":e,s),y=(a,e,s)=>e.has(a)||g("Cannot "+s);var t=(a,e,s)=>(y(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>e.has(a)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,s),M=(a,e,s,i)=>(y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);import{K as x,a7 as C,a8 as k,a9 as J,aa as A,ab as B,J as K,ac as S,ad as j,ae as q}from"./C9Z4nxhR.js";var r,n,h,u,p,_,v;class G{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),i=t(this,n).get(s);if(i)C(i),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),i=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();j(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!i?(t(this,u).add(f),J(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[i,c]of t(this,h))s.includes(i)||(k(c.effect),t(this,h).delete(i))});this.anchor=e,M(this,p,s)}ensure(e,s){var i=x,c=q();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(i,e),c){for(const[d,m]of t(this,n))d===e?i.unskip_effect(m):i.skip_effect(m);for(const[d,m]of t(this,h))d===e?i.unskip_effect(m.effect):i.skip_effect(m.effect);i.oncommit(t(this,_)),i.ondiscard(t(this,v))}else K&&(this.anchor=S),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{G as B}; +var D=Object.defineProperty;var g=a=>{throw TypeError(a)};var F=(a,e,s)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var w=(a,e,s)=>F(a,typeof e!="symbol"?e+"":e,s),y=(a,e,s)=>e.has(a)||g("Cannot "+s);var t=(a,e,s)=>(y(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>e.has(a)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,s),M=(a,e,s,i)=>(y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);import{K as x,a7 as C,a8 as k,a9 as J,aa as A,ab as B,J as K,ac as S,ad as j,ae as q}from"./BBD-8XME.js";var r,n,h,u,p,_,v;class G{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),i=t(this,n).get(s);if(i)C(i),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),i=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();j(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!i?(t(this,u).add(f),J(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[i,c]of t(this,h))s.includes(i)||(k(c.effect),t(this,h).delete(i))});this.anchor=e,M(this,p,s)}ensure(e,s){var i=x,c=q();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(i,e),c){for(const[d,m]of t(this,n))d===e?i.unskip_effect(m):i.skip_effect(m);for(const[d,m]of t(this,h))d===e?i.unskip_effect(m.effect):i.skip_effect(m.effect);i.oncommit(t(this,_)),i.ondiscard(t(this,v))}else K&&(this.anchor=S),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{G as B}; diff --git a/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.br b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.br new file mode 100644 index 0000000..33b0414 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.gz b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.gz new file mode 100644 index 0000000..d30defe Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/gqVpgJ8U.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br deleted file mode 100644 index 09fc4f1..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz b/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz deleted file mode 100644 index 7de25f7..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/kH-DTQyy.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js similarity index 61% rename from apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js rename to apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js index 427a1ea..d5aa667 100644 --- a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js +++ b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.ChrQNylP.js","../chunks/Bzak7iHL.js","../chunks/CkyfbJUz.js","../chunks/C9Z4nxhR.js","../chunks/DP9qWekZ.js","../chunks/DPfxVJHQ.js","../chunks/C2oj68pw.js","../chunks/CY4crMrT.js","../chunks/kH-DTQyy.js","../chunks/D00YwZ1M.js","../chunks/ZesQ8l8p.js","../chunks/Co2v30Gm.js","../chunks/P9ZHwQBL.js","../chunks/CR6HhlME.js","../chunks/DWr9YED7.js","../chunks/DnKV7_Y9.js","../chunks/DunNqS1N.js","../chunks/BmeMLq0p.js","../assets/0.BChctYiF.css","../nodes/1.CUEJZ2Iu.js","../chunks/_Va07L2l.js","../nodes/2.Bv9w28KX.js","../nodes/3.D_o4dH3z.js","../nodes/4.CeoFmj14.js","../chunks/BkopTN9z.js","../chunks/BcuCGYSa.js","../nodes/5.CgbdGsQS.js","../chunks/CZ45jJaw.js","../chunks/Do8TgQ-j.js","../assets/5.BBx09UGv.css","../nodes/6.DXXEUSu1.js","../chunks/-jeO_JOJ.js","../nodes/7.BI22Pt_j.js","../nodes/8.Cq7jwWnG.js","../nodes/9.19crbYuZ.js","../nodes/10.CsJcFbdU.js","../nodes/11.C5VMEnLV.js"])))=>i.map(i=>d[i]); -var M=r=>{throw TypeError(r)};var Q=(r,t,e)=>t.has(r)||M("Cannot "+e);var m=(r,t,e)=>(Q(r,t,"read from private field"),e?e.call(r):t.get(r)),H=(r,t,e)=>t.has(r)?M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),J=(r,t,e,n)=>(Q(r,t,"write to private field"),n?n.call(r,e):t.set(r,e),e);import{J as Z,a0 as ut,b as lt,E as mt,a1 as _t,a4 as dt,a5 as ft,a6 as $,a2 as ht,ac as vt,h as q,L as gt,g as v,b7 as Et,Y as yt,X as pt,p as Pt,ag as Rt,ah as bt,I as Ot,f as L,d as At,a as Tt,s as W,e as Lt,r as wt,t as It,u as V}from"../chunks/C9Z4nxhR.js";import{h as kt,m as Dt,u as xt,s as Vt}from"../chunks/DP9qWekZ.js";import"../chunks/Bzak7iHL.js";import{o as St}from"../chunks/CkyfbJUz.js";import{i as B}from"../chunks/C2oj68pw.js";import{a as y,c as k,f as et,t as jt}from"../chunks/DPfxVJHQ.js";import{B as Ct}from"../chunks/CY4crMrT.js";import{b as S}from"../chunks/CR6HhlME.js";import{p as Y}from"../chunks/Do8TgQ-j.js";function j(r,t,e){var n;Z&&(n=vt,ut());var o=new Ct(r);lt(()=>{var l=t()??null;if(Z){var s=_t(n),a=s===ht,i=l!==null;if(a!==i){var P=dt();ft(P),o.anchor=P,$(!1),o.ensure(l,l&&(c=>e(c,l))),$(!0);return}}o.ensure(l,l&&(c=>e(c,l)))},mt)}function Bt(r){return class extends Yt{constructor(t){super({component:r,...t})}}}var p,d;class Yt{constructor(t){H(this,p);H(this,d);var l;var e=new Map,n=(s,a)=>{var i=pt(a,!1,!1);return e.set(s,i),i};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return v(e.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===gt?!0:(v(e.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,i){return q(e.get(a)??n(a,i),i),Reflect.set(s,a,i)}});J(this,d,(t.hydrate?kt:Dt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&Et(),J(this,p,o.$$events);for(const s of Object.keys(m(this,d)))s==="$set"||s==="$destroy"||s==="$on"||yt(this,s,{get(){return m(this,d)[s]},set(a){m(this,d)[s]=a},enumerable:!0});m(this,d).$set=s=>{Object.assign(o,s)},m(this,d).$destroy=()=>{xt(m(this,d))}}$set(t){m(this,d).$set(t)}$on(t,e){m(this,p)[t]=m(this,p)[t]||[];const n=(...o)=>e.call(this,...o);return m(this,p)[t].push(n),()=>{m(this,p)[t]=m(this,p)[t].filter(o=>o!==n)}}$destroy(){m(this,d).$destroy()}}p=new WeakMap,d=new WeakMap;const qt="modulepreload",Ft=function(r,t){return new URL(r,t).href},tt={},_=function(t,e,n){let o=Promise.resolve();if(e&&e.length>0){let s=function(c){return Promise.all(c.map(g=>Promise.resolve(g).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const a=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),P=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=s(e.map(c=>{if(c=Ft(c,n),c in tt)return;tt[c]=!0;const g=c.endsWith(".css"),R=g?'[rel="stylesheet"]':"";if(!!n)for(let b=a.length-1;b>=0;b--){const u=a[b];if(u.href===c&&(!g||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${R}`))return;const E=document.createElement("link");if(E.rel=g?"stylesheet":qt,g||(E.as="script"),E.crossOrigin="",E.href=c,P&&E.setAttribute("nonce",P),document.head.appendChild(E),g)return new Promise((b,u)=>{E.addEventListener("load",b),E.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})},ae={};var Nt=et('
'),Ut=et(" ",1);function Gt(r,t){Pt(t,!0);let e=Y(t,"components",23,()=>[]),n=Y(t,"data_0",3,null),o=Y(t,"data_1",3,null),l=Y(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),bt(()=>{t.stores,t.page,t.constructors,e(),t.form,n(),o(),l(),t.stores.page.notify()});let s=W(!1),a=W(!1),i=W(null);St(()=>{const u=t.stores.page.subscribe(()=>{v(s)&&(q(a,!0),Ot().then(()=>{q(i,document.title||"untitled page",!0)}))});return q(s,!0),u});const P=V(()=>t.constructors[2]);var c=Ut(),g=L(c);{var R=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(f,Jt)=>{var z=k(),at=L(z);{var st=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params},children:(h,Wt)=>{var K=k(),ot=L(K);j(ot,()=>v(P),(it,ct)=>{S(ct(it,{get data(){return l()},get form(){return t.form},get params(){return t.page.params}}),C=>e()[2]=C,()=>{var C;return(C=e())==null?void 0:C[2]})}),y(h,K)},$$slots:{default:!0}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)},nt=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)};B(at,I=>{t.constructors[2]?I(st):I(nt,!1)})}y(f,z)},$$slots:{default:!0}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)},X=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)};B(g,u=>{t.constructors[1]?u(R):u(X,!1)})}var E=At(g,2);{var b=u=>{var O=Nt(),A=Lt(O);{var D=T=>{var w=jt();It(()=>Vt(w,v(i))),y(T,w)};B(A,T=>{v(a)&&T(D)})}wt(O),y(u,O)};B(E,u=>{v(s)&&u(b)})}y(r,c),Tt()}const se=Bt(Gt),ne=[()=>_(()=>import("../nodes/0.ChrQNylP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),()=>_(()=>import("../nodes/1.CUEJZ2Iu.js"),__vite__mapDeps([19,1,20,3,4,5,16,15,2]),import.meta.url),()=>_(()=>import("../nodes/2.Bv9w28KX.js"),__vite__mapDeps([21,1,3,5,9,7]),import.meta.url),()=>_(()=>import("../nodes/3.D_o4dH3z.js"),__vite__mapDeps([22,1,20,3,2,16,15]),import.meta.url),()=>_(()=>import("../nodes/4.CeoFmj14.js"),__vite__mapDeps([23,1,3,4,5,6,7,8,10,11,24,12,25]),import.meta.url),()=>_(()=>import("../nodes/5.CgbdGsQS.js"),__vite__mapDeps([26,1,20,3,4,5,6,7,8,24,14,15,17,27,10,11,28,29]),import.meta.url),()=>_(()=>import("../nodes/6.DXXEUSu1.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,10,11,24,12,31,14,15,13,28,27,25,17]),import.meta.url),()=>_(()=>import("../nodes/7.BI22Pt_j.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,11,25]),import.meta.url),()=>_(()=>import("../nodes/8.Cq7jwWnG.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,10,11,24,12,31,25,27]),import.meta.url),()=>_(()=>import("../nodes/9.19crbYuZ.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,11,24,14,15,25,17]),import.meta.url),()=>_(()=>import("../nodes/10.CsJcFbdU.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,8,24,25]),import.meta.url),()=>_(()=>import("../nodes/11.C5VMEnLV.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,24,31,25,27]),import.meta.url)],oe=[],ie={"/":[3],"/(app)/explore":[4,[2]],"/(app)/feed":[5,[2]],"/(app)/graph":[6,[2]],"/(app)/intentions":[7,[2]],"/(app)/memories":[8,[2]],"/(app)/settings":[9,[2]],"/(app)/stats":[10,[2]],"/(app)/timeline":[11,[2]]},rt={handleError:(({error:r})=>{console.error(r)}),reroute:(()=>{}),transport:{}},Ht=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.decode])),ce=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.encode])),ue=!1,le=(r,t)=>Ht[r](t);export{le as decode,Ht as decoders,ie as dictionary,ce as encoders,ue as hash,rt as hooks,ae as matchers,ne as nodes,se as root,oe as server_loads}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.tUYz2cuZ.js","../chunks/Bzak7iHL.js","../chunks/DUC-ssvh.js","../chunks/BBD-8XME.js","../chunks/DNn3Nckx.js","../chunks/CKcqngaU.js","../chunks/RaRNNC-y.js","../chunks/gqVpgJ8U.js","../chunks/C5a--lgk.js","../chunks/DZuEJlJ5.js","../chunks/BVZqxpRe.js","../chunks/CBWLjDtu.js","../chunks/BxfT1SOA.js","../chunks/DtXypsxD.js","../chunks/BexJutgU.js","../chunks/Br8WXJxx.js","../chunks/cIQD_rb4.js","../chunks/BeSd-T80.js","../chunks/CruZBLYW.js","../assets/0.BChctYiF.css","../nodes/1.CssKLfNx.js","../chunks/D1BK9eoQ.js","../nodes/2.1GJQ3fqu.js","../nodes/3.qBGkDYYb.js","../nodes/4.BYgf5djd.js","../chunks/DBfx-YTU.js","../chunks/BcuCGYSa.js","../nodes/5.DVWNDcwc.js","../chunks/CZ45jJaw.js","../chunks/CzkEqL6J.js","../assets/5.BBx09UGv.css","../nodes/6.CBsTT29y.js","../chunks/C-QujEl6.js","../nodes/7.UPq6Ja2I.js","../nodes/8.B2QXJFjO.js","../nodes/9.B4Pp7ME7.js","../nodes/10.evd80og6.js","../nodes/11.gY7s4Ta3.js"])))=>i.map(i=>d[i]); +var M=r=>{throw TypeError(r)};var Q=(r,t,e)=>t.has(r)||M("Cannot "+e);var m=(r,t,e)=>(Q(r,t,"read from private field"),e?e.call(r):t.get(r)),H=(r,t,e)=>t.has(r)?M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),J=(r,t,e,n)=>(Q(r,t,"write to private field"),n?n.call(r,e):t.set(r,e),e);import{J as Z,a0 as ut,b as lt,E as mt,a1 as _t,a4 as dt,a5 as ft,a6 as $,a2 as ht,ac as vt,h as q,L as gt,g as v,b7 as Et,Y as yt,X as pt,p as Pt,ag as Rt,ah as bt,I as Ot,f as L,d as At,a as Tt,s as W,e as Lt,r as wt,t as It,u as V}from"../chunks/BBD-8XME.js";import{h as kt,m as Dt,u as xt,s as Vt}from"../chunks/DNn3Nckx.js";import"../chunks/Bzak7iHL.js";import{o as St}from"../chunks/DUC-ssvh.js";import{i as B}from"../chunks/RaRNNC-y.js";import{a as y,c as k,f as et,t as jt}from"../chunks/CKcqngaU.js";import{B as Ct}from"../chunks/gqVpgJ8U.js";import{b as S}from"../chunks/DtXypsxD.js";import{p as Y}from"../chunks/CzkEqL6J.js";function j(r,t,e){var n;Z&&(n=vt,ut());var o=new Ct(r);lt(()=>{var l=t()??null;if(Z){var s=_t(n),a=s===ht,i=l!==null;if(a!==i){var P=dt();ft(P),o.anchor=P,$(!1),o.ensure(l,l&&(c=>e(c,l))),$(!0);return}}o.ensure(l,l&&(c=>e(c,l)))},mt)}function Bt(r){return class extends Yt{constructor(t){super({component:r,...t})}}}var p,d;class Yt{constructor(t){H(this,p);H(this,d);var l;var e=new Map,n=(s,a)=>{var i=pt(a,!1,!1);return e.set(s,i),i};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return v(e.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===gt?!0:(v(e.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,i){return q(e.get(a)??n(a,i),i),Reflect.set(s,a,i)}});J(this,d,(t.hydrate?kt:Dt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&Et(),J(this,p,o.$$events);for(const s of Object.keys(m(this,d)))s==="$set"||s==="$destroy"||s==="$on"||yt(this,s,{get(){return m(this,d)[s]},set(a){m(this,d)[s]=a},enumerable:!0});m(this,d).$set=s=>{Object.assign(o,s)},m(this,d).$destroy=()=>{xt(m(this,d))}}$set(t){m(this,d).$set(t)}$on(t,e){m(this,p)[t]=m(this,p)[t]||[];const n=(...o)=>e.call(this,...o);return m(this,p)[t].push(n),()=>{m(this,p)[t]=m(this,p)[t].filter(o=>o!==n)}}$destroy(){m(this,d).$destroy()}}p=new WeakMap,d=new WeakMap;const qt="modulepreload",Ft=function(r,t){return new URL(r,t).href},tt={},_=function(t,e,n){let o=Promise.resolve();if(e&&e.length>0){let s=function(c){return Promise.all(c.map(g=>Promise.resolve(g).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};const a=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),P=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=s(e.map(c=>{if(c=Ft(c,n),c in tt)return;tt[c]=!0;const g=c.endsWith(".css"),R=g?'[rel="stylesheet"]':"";if(!!n)for(let b=a.length-1;b>=0;b--){const u=a[b];if(u.href===c&&(!g||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${R}`))return;const E=document.createElement("link");if(E.rel=g?"stylesheet":qt,g||(E.as="script"),E.crossOrigin="",E.href=c,P&&E.setAttribute("nonce",P),document.head.appendChild(E),g)return new Promise((b,u)=>{E.addEventListener("load",b),E.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})},ae={};var Nt=et('
'),Ut=et(" ",1);function Gt(r,t){Pt(t,!0);let e=Y(t,"components",23,()=>[]),n=Y(t,"data_0",3,null),o=Y(t,"data_1",3,null),l=Y(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),bt(()=>{t.stores,t.page,t.constructors,e(),t.form,n(),o(),l(),t.stores.page.notify()});let s=W(!1),a=W(!1),i=W(null);St(()=>{const u=t.stores.page.subscribe(()=>{v(s)&&(q(a,!0),Ot().then(()=>{q(i,document.title||"untitled page",!0)}))});return q(s,!0),u});const P=V(()=>t.constructors[2]);var c=Ut(),g=L(c);{var R=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(f,Jt)=>{var z=k(),at=L(z);{var st=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params},children:(h,Wt)=>{var K=k(),ot=L(K);j(ot,()=>v(P),(it,ct)=>{S(ct(it,{get data(){return l()},get form(){return t.form},get params(){return t.page.params}}),C=>e()[2]=C,()=>{var C;return(C=e())==null?void 0:C[2]})}),y(h,K)},$$slots:{default:!0}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)},nt=I=>{const F=V(()=>t.constructors[1]);var x=k(),N=L(x);j(N,()=>v(F),(U,G)=>{S(G(U,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),h=>e()[1]=h,()=>{var h;return(h=e())==null?void 0:h[1]})}),y(I,x)};B(at,I=>{t.constructors[2]?I(st):I(nt,!1)})}y(f,z)},$$slots:{default:!0}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)},X=u=>{const O=V(()=>t.constructors[0]);var A=k(),D=L(A);j(D,()=>v(O),(T,w)=>{S(w(T,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),f=>e()[0]=f,()=>{var f;return(f=e())==null?void 0:f[0]})}),y(u,A)};B(g,u=>{t.constructors[1]?u(R):u(X,!1)})}var E=At(g,2);{var b=u=>{var O=Nt(),A=Lt(O);{var D=T=>{var w=jt();It(()=>Vt(w,v(i))),y(T,w)};B(A,T=>{v(a)&&T(D)})}wt(O),y(u,O)};B(E,u=>{v(s)&&u(b)})}y(r,c),Tt()}const se=Bt(Gt),ne=[()=>_(()=>import("../nodes/0.tUYz2cuZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),()=>_(()=>import("../nodes/1.CssKLfNx.js"),__vite__mapDeps([20,1,21,3,4,5,17,2,15,16]),import.meta.url),()=>_(()=>import("../nodes/2.1GJQ3fqu.js"),__vite__mapDeps([22,1,3,5,9,7]),import.meta.url),()=>_(()=>import("../nodes/3.qBGkDYYb.js"),__vite__mapDeps([23,1,21,3,2,16,15,17]),import.meta.url),()=>_(()=>import("../nodes/4.BYgf5djd.js"),__vite__mapDeps([24,1,3,4,5,6,7,8,10,11,25,12,26]),import.meta.url),()=>_(()=>import("../nodes/5.DVWNDcwc.js"),__vite__mapDeps([27,1,21,3,4,5,6,7,8,25,14,15,18,28,10,11,29,30]),import.meta.url),()=>_(()=>import("../nodes/6.CBsTT29y.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,10,11,25,12,32,14,15,17,13,29,28,26,18]),import.meta.url),()=>_(()=>import("../nodes/7.UPq6Ja2I.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,11,26]),import.meta.url),()=>_(()=>import("../nodes/8.B2QXJFjO.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,10,11,25,12,32,26,28]),import.meta.url),()=>_(()=>import("../nodes/9.B4Pp7ME7.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,8,11,25,14,15,26,18]),import.meta.url),()=>_(()=>import("../nodes/10.evd80og6.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,25,26]),import.meta.url),()=>_(()=>import("../nodes/11.gY7s4Ta3.js"),__vite__mapDeps([37,1,2,3,4,5,6,7,8,25,32,26,28]),import.meta.url)],oe=[],ie={"/":[3],"/(app)/explore":[4,[2]],"/(app)/feed":[5,[2]],"/(app)/graph":[6,[2]],"/(app)/intentions":[7,[2]],"/(app)/memories":[8,[2]],"/(app)/settings":[9,[2]],"/(app)/stats":[10,[2]],"/(app)/timeline":[11,[2]]},rt={handleError:(({error:r})=>{console.error(r)}),reroute:(()=>{}),transport:{}},Ht=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.decode])),ce=Object.fromEntries(Object.entries(rt.transport).map(([r,t])=>[r,t.encode])),ue=!1,le=(r,t)=>Ht[r](t);export{le as decode,Ht as decoders,ie as dictionary,ce as encoders,ue as hash,rt as hooks,ae as matchers,ne as nodes,se as root,oe as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.br b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.br new file mode 100644 index 0000000..441bb9a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.gz b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.gz new file mode 100644 index 0000000..48cb52d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.C8-C7f17.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.br b/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.br deleted file mode 100644 index 5578e84..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.gz b/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.gz deleted file mode 100644 index ef27d06..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Cznegg3r.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js b/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js deleted file mode 100644 index 8c063a8..0000000 --- a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js +++ /dev/null @@ -1 +0,0 @@ -import{l as o,a as r}from"../chunks/DunNqS1N.js";export{o as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.br b/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.br deleted file mode 100644 index 0f16ff4..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.gz b/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.gz deleted file mode 100644 index c824cea..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/start.B2d_kw0s.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js new file mode 100644 index 0000000..aa1cf87 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js @@ -0,0 +1 @@ +import{a as r}from"../chunks/cIQD_rb4.js";import{w as t}from"../chunks/BeSd-T80.js";export{t as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.br b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.br new file mode 100644 index 0000000..a38b9d4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.gz b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.gz new file mode 100644 index 0000000..44f8437 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/start.DA6kJu-O.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js b/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js deleted file mode 100644 index e9e07cd..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js +++ /dev/null @@ -1,3 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as Ee}from"../chunks/CkyfbJUz.js";import{p as Me,d as o,f as Ke,t as K,a as Le,h as d,g as t,e as s,r as a,s as z,u as R,G as Te}from"../chunks/C9Z4nxhR.js";import{d as qe,a as h,s as v}from"../chunks/DP9qWekZ.js";import{i as ie}from"../chunks/C2oj68pw.js";import{e as H,i as V}from"../chunks/kH-DTQyy.js";import{a as g,f as _}from"../chunks/DPfxVJHQ.js";import{s as Fe}from"../chunks/D00YwZ1M.js";import{s as le,r as Se}from"../chunks/ZesQ8l8p.js";import{s as W}from"../chunks/Co2v30Gm.js";import{b as Ae}from"../chunks/P9ZHwQBL.js";import{b as Ne}from"../chunks/CR6HhlME.js";import{s as De,a as L}from"../chunks/DWr9YED7.js";import{s as Ge,g as de,b as O}from"../chunks/DunNqS1N.js";import{w as ce,a as Ie,i as je,m as ze}from"../chunks/BmeMLq0p.js";const Re=()=>{const x=Ge;return{page:{subscribe:x.page.subscribe},navigating:{subscribe:x.navigating.subscribe},updated:x.updated}},He={subscribe(x){return Re().page.subscribe(x)}};var Ve=_(' '),We=_(' '),Oe=_(''),Qe=_('
No matches
'),Be=_('
esc
'),Je=_('
',1);function ct(x,T){Me(T,!0);const Q=()=>L(He,"$page",k),B=()=>L(je,"$isConnected",k),pe=()=>L(ze,"$memoryCount",k),ve=()=>L(Ie,"$avgRetention",k),[k,me]=De();let c=z(!1),f=z(""),y=z(void 0);Ee(()=>{ce.connect();function r(e){if((e.metaKey||e.ctrlKey)&&e.key==="k"){e.preventDefault(),d(c,!t(c)),d(f,""),t(c)&&requestAnimationFrame(()=>{var n;return(n=t(y))==null?void 0:n.focus()});return}if(e.key==="Escape"&&t(c)){d(c,!1);return}if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if(e.key==="/"){e.preventDefault();const n=document.querySelector('input[type="text"]');n==null||n.focus();return}const i={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats"}[e.key.toLowerCase()];i&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),de(`${O}${i}`))}return window.addEventListener("keydown",r),()=>{ce.disconnect(),window.removeEventListener("keydown",r)}});const $=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],fe=$.slice(0,5);function J(r,e){const p=e.startsWith(O)?e.slice(O.length)||"/":e;return r==="/graph"?p==="/"||p==="/graph":p.startsWith(r)}let C=R(()=>t(f)?$.filter(r=>r.label.toLowerCase().includes(t(f).toLowerCase())):$);function U(r){d(c,!1),d(f,""),de(r)}var X=Je(),q=o(Ke(X),6),F=s(q),S=o(s(F),2);H(S,21,()=>$,V,(r,e)=>{const p=R(()=>J(t(e).href,Q().url.pathname));var i=Ve(),n=s(i),u=s(n,!0);a(n);var m=o(n,2),w=s(m,!0);a(m);var E=o(m,2),l=s(E,!0);a(E),a(i),K(()=>{le(i,"href",t(e).href),W(i,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm - ${t(p)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`),v(u,t(e).icon),v(w,t(e).label),v(l,t(e).shortcut)}),g(r,i)}),a(S);var A=o(S,2),xe=s(A);a(A);var Y=o(A,2),N=s(Y),Z=s(N),P=o(Z,2),ue=s(P,!0);a(P),a(N);var ee=o(N,2),D=s(ee),be=s(D);a(D);var te=o(D,2),he=s(te);a(te),a(ee),a(Y),a(F);var G=o(F,2),ae=s(G),ge=s(ae);Fe(ge,()=>T.children),a(ae),a(G);var se=o(G,2),re=s(se),ne=s(re);H(ne,17,()=>fe,V,(r,e)=>{const p=R(()=>J(t(e).href,Q().url.pathname));var i=We(),n=s(i),u=s(n,!0);a(n);var m=o(n,2),w=s(m,!0);a(m),a(i),K(()=>{le(i,"href",t(e).href),W(i,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] - ${t(p)?"text-synapse-glow":"text-muted"}`),v(u,t(e).icon),v(w,t(e).label)}),g(r,i)});var _e=o(ne,2);a(re),a(se),a(q);var ye=o(q,2);{var we=r=>{var e=Be(),p=s(e),i=s(p),n=o(s(i),2);Se(n),Ne(n,l=>d(y,l),()=>t(y)),Te(2),a(i);var u=o(i,2),m=s(u);H(m,17,()=>t(C),V,(l,b)=>{var M=Oe(),I=s(M),ke=s(I,!0);a(I);var j=o(I,2),$e=s(j,!0);a(j);var oe=o(j,2),Ce=s(oe,!0);a(oe),a(M),K(()=>{v(ke,t(b).icon),v($e,t(b).label),v(Ce,t(b).shortcut)}),h("click",M,()=>U(t(b).href)),g(l,M)});var w=o(m,2);{var E=l=>{var b=Qe();g(l,b)};ie(w,l=>{t(C).length===0&&l(E)})}a(u),a(p),a(e),h("keydown",e,l=>{l.key==="Escape"&&d(c,!1)}),h("click",e,l=>{l.target===l.currentTarget&&d(c,!1)}),h("keydown",n,l=>{l.key==="Enter"&&t(C).length>0&&U(t(C)[0].href)}),Ae(n,()=>t(f),l=>d(f,l)),g(r,e)};ie(ye,r=>{t(c)&&r(we)})}K(r=>{W(Z,1,`w-2 h-2 rounded-full ${B()?"bg-recall animate-pulse-glow":"bg-decay"}`),v(ue,B()?"Connected":"Offline"),v(be,`${pe()??""} memories`),v(he,`${r??""}% retention`)},[()=>(ve()*100).toFixed(0)]),h("click",xe,()=>{d(c,!0),d(f,""),requestAnimationFrame(()=>{var r;return(r=t(y))==null?void 0:r.focus()})}),h("click",_e,()=>{d(c,!0),d(f,""),requestAnimationFrame(()=>{var r;return(r=t(y))==null?void 0:r.focus()})}),g(x,X),Le(),me()}qe(["click","keydown"]);export{ct as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.br b/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.br deleted file mode 100644 index a2d870e..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.gz deleted file mode 100644 index 24f058a..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.ChrQNylP.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js new file mode 100644 index 0000000..e4ec539 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js @@ -0,0 +1,3 @@ +import"../chunks/Bzak7iHL.js";import{o as Me}from"../chunks/DUC-ssvh.js";import{p as Ke,d as o,f as Le,t as L,a as Te,h as d,g as t,e as s,r as a,s as R,u as H,G as qe}from"../chunks/BBD-8XME.js";import{d as Fe,a as g,s as v}from"../chunks/DNn3Nckx.js";import{i as de}from"../chunks/RaRNNC-y.js";import{e as V,i as W}from"../chunks/C5a--lgk.js";import{a as _,f as y}from"../chunks/CKcqngaU.js";import{s as Se}from"../chunks/DZuEJlJ5.js";import{s as O,r as Ae}from"../chunks/BVZqxpRe.js";import{s as Q}from"../chunks/CBWLjDtu.js";import{b as Ne}from"../chunks/BxfT1SOA.js";import{b as De}from"../chunks/DtXypsxD.js";import{s as Ge,a as T}from"../chunks/BexJutgU.js";import{s as Ie,g as ce}from"../chunks/cIQD_rb4.js";import{b as u}from"../chunks/BeSd-T80.js";import{w as pe,a as je,i as ze,m as Re}from"../chunks/CruZBLYW.js";const He=()=>{const x=Ie;return{page:{subscribe:x.page.subscribe},navigating:{subscribe:x.navigating.subscribe},updated:x.updated}},Ve={subscribe(x){return He().page.subscribe(x)}};var We=y(' '),Oe=y(' '),Qe=y(''),Be=y('
No matches
'),Je=y('
esc
'),Ue=y('
',1);function vt(x,q){Ke(q,!0);const B=()=>T(Ve,"$page",$),J=()=>T(ze,"$isConnected",$),ve=()=>T(Re,"$memoryCount",$),me=()=>T(je,"$avgRetention",$),[$,fe]=Ge();let c=R(!1),f=R(""),w=R(void 0);Me(()=>{pe.connect();function r(e){if((e.metaKey||e.ctrlKey)&&e.key==="k"){e.preventDefault(),d(c,!t(c)),d(f,""),t(c)&&requestAnimationFrame(()=>{var n;return(n=t(w))==null?void 0:n.focus()});return}if(e.key==="Escape"&&t(c)){d(c,!1);return}if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if(e.key==="/"){e.preventDefault();const n=document.querySelector('input[type="text"]');n==null||n.focus();return}const i={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats"}[e.key.toLowerCase()];i&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),ce(`${u}${i}`))}return window.addEventListener("keydown",r),()=>{pe.disconnect(),window.removeEventListener("keydown",r)}});const C=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],xe=C.slice(0,5);function U(r,e){const p=e.startsWith(u)?e.slice(u.length)||"/":e;return r==="/graph"?p==="/"||p==="/graph":p.startsWith(r)}let E=H(()=>t(f)?C.filter(r=>r.label.toLowerCase().includes(t(f).toLowerCase())):C);function X(r){d(c,!1),d(f,""),ce(`${u}${r}`)}var Y=Ue(),F=o(Le(Y),6),S=s(F),Z=s(S),A=o(Z,2);V(A,21,()=>C,W,(r,e)=>{const p=H(()=>U(t(e).href,B().url.pathname));var i=We(),n=s(i),b=s(n,!0);a(n);var m=o(n,2),k=s(m,!0);a(m);var M=o(m,2),l=s(M,!0);a(M),a(i),L(()=>{O(i,"href",`${u??""}${t(e).href??""}`),Q(i,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm + ${t(p)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`),v(b,t(e).icon),v(k,t(e).label),v(l,t(e).shortcut)}),_(r,i)}),a(A);var N=o(A,2),ue=s(N);a(N);var P=o(N,2),D=s(P),ee=s(D),te=o(ee,2),be=s(te,!0);a(te),a(D);var ae=o(D,2),G=s(ae),he=s(G);a(G);var se=o(G,2),ge=s(se);a(se),a(ae),a(P),a(S);var I=o(S,2),re=s(I),_e=s(re);Se(_e,()=>q.children),a(re),a(I);var ne=o(I,2),oe=s(ne),ie=s(oe);V(ie,17,()=>xe,W,(r,e)=>{const p=H(()=>U(t(e).href,B().url.pathname));var i=Oe(),n=s(i),b=s(n,!0);a(n);var m=o(n,2),k=s(m,!0);a(m),a(i),L(()=>{O(i,"href",`${u??""}${t(e).href??""}`),Q(i,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] + ${t(p)?"text-synapse-glow":"text-muted"}`),v(b,t(e).icon),v(k,t(e).label)}),_(r,i)});var ye=o(ie,2);a(oe),a(ne),a(F);var we=o(F,2);{var ke=r=>{var e=Je(),p=s(e),i=s(p),n=o(s(i),2);Ae(n),De(n,l=>d(w,l),()=>t(w)),qe(2),a(i);var b=o(i,2),m=s(b);V(m,17,()=>t(E),W,(l,h)=>{var K=Qe(),j=s(K),$e=s(j,!0);a(j);var z=o(j,2),Ce=s(z,!0);a(z);var le=o(z,2),Ee=s(le,!0);a(le),a(K),L(()=>{v($e,t(h).icon),v(Ce,t(h).label),v(Ee,t(h).shortcut)}),g("click",K,()=>X(t(h).href)),_(l,K)});var k=o(m,2);{var M=l=>{var h=Be();_(l,h)};de(k,l=>{t(E).length===0&&l(M)})}a(b),a(p),a(e),g("keydown",e,l=>{l.key==="Escape"&&d(c,!1)}),g("click",e,l=>{l.target===l.currentTarget&&d(c,!1)}),g("keydown",n,l=>{l.key==="Enter"&&t(E).length>0&&X(t(E)[0].href)}),Ne(n,()=>t(f),l=>d(f,l)),_(r,e)};de(we,r=>{t(c)&&r(ke)})}L(r=>{O(Z,"href",`${u??""}/graph`),Q(ee,1,`w-2 h-2 rounded-full ${J()?"bg-recall animate-pulse-glow":"bg-decay"}`),v(be,J()?"Connected":"Offline"),v(he,`${ve()??""} memories`),v(ge,`${r??""}% retention`)},[()=>(me()*100).toFixed(0)]),g("click",ue,()=>{d(c,!0),d(f,""),requestAnimationFrame(()=>{var r;return(r=t(w))==null?void 0:r.focus()})}),g("click",ye,()=>{d(c,!0),d(f,""),requestAnimationFrame(()=>{var r;return(r=t(w))==null?void 0:r.focus()})}),_(x,Y),Te(),fe()}Fe(["click","keydown"]);export{vt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.br b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.br new file mode 100644 index 0000000..15022a7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.gz new file mode 100644 index 0000000..adf1ff8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.tUYz2cuZ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js b/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js deleted file mode 100644 index 76ea0a9..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as h}from"../chunks/_Va07L2l.js";import{p as g,f as d,t as l,a as v,d as _,e as s,r as o}from"../chunks/C9Z4nxhR.js";import{s as p}from"../chunks/DP9qWekZ.js";import{a as x,f as $}from"../chunks/DPfxVJHQ.js";import{s as k,p as m}from"../chunks/DunNqS1N.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=$("

",1);function B(f,n){g(n,!1),h();var t=E(),r=d(t),c=s(r,!0);o(r);var a=_(r,2),u=s(a,!0);o(a),l(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),x(f,t),v()}export{B as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.br b/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.br deleted file mode 100644 index 2c9624f..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.br +++ /dev/null @@ -1 +0,0 @@ -f`dͦ{))ڒCx;@hbߺ.*[qRi~ӭ!Hk^_׊`͍12BgQ߫0_ld&R("72xSOB6fpE>Lix>>nҔ[r:=Sɤi ^Ei`pE\q7`;}dCk4D.uH:d1?#I<:dh)a @[D~ (8F/s ǃ R6JnXP+ܰ \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.gz deleted file mode 100644 index 0c40894..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/1.CUEJZ2Iu.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js new file mode 100644 index 0000000..abeb820 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as h}from"../chunks/D1BK9eoQ.js";import{p as g,f as d,t as l,a as v,d as _,e as s,r as o}from"../chunks/BBD-8XME.js";import{s as p}from"../chunks/DNn3Nckx.js";import{a as x,f as $}from"../chunks/CKcqngaU.js";import{p as m}from"../chunks/BeSd-T80.js";import{s as k}from"../chunks/cIQD_rb4.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=$("

",1);function C(f,n){g(n,!1),h();var t=E(),r=d(t),c=s(r,!0);o(r);var a=_(r,2),u=s(a,!0);o(a),l(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),x(f,t),v()}export{C as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.br b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.br new file mode 100644 index 0000000..2342405 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.gz new file mode 100644 index 0000000..925ef2a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/1.CssKLfNx.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br deleted file mode 100644 index dceb4a1..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz deleted file mode 100644 index ba54cb3..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js similarity index 92% rename from apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js rename to apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js index 2ac1492..a26e1cd 100644 --- a/apps/dashboard/build/_app/immutable/nodes/10.CsJcFbdU.js +++ b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{o as Ft}from"../chunks/CkyfbJUz.js";import{p as $t,a as Ct,d as s,e,j as W,h as y,g as t,r as a,s as E,f as dt,G as P,t as B,u as G}from"../chunks/C9Z4nxhR.js";import{d as Rt,s as i,a as At}from"../chunks/DP9qWekZ.js";import{i as X}from"../chunks/C2oj68pw.js";import{e as O,i as U}from"../chunks/kH-DTQyy.js";import{a as p,f as u}from"../chunks/DPfxVJHQ.js";import{s as A}from"../chunks/BkopTN9z.js";import{a as w}from"../chunks/BcuCGYSa.js";var Dt=u('
'),Mt=u('
'),kt=u('
'),Bt=u('
'),St=u('
'),Tt=u('

'),jt=u('

Retention Distribution

Memory Types

',1),Et=u('
Total Memories
Avg Retention
Due for Review
Embedding Coverage
',1),Pt=u('

System Stats

');function Lt(ot,vt){$t(vt,!0);let n=E(null),m=E(null),l=E(null),Y=E(!0);Ft(async()=>{try{await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}finally{y(Y,!1)}});function q(d){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[d]||"#6b7280"}async function nt(){try{await w.consolidate(),await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}}var z=Pt(),lt=s(e(z),2);{var ct=d=>{var r=Mt();O(r,20,()=>Array(8),U,(F,H)=>{var $=Dt();p(F,$)}),a(r),p(d,r)},xt=d=>{var r=Et(),F=dt(r),H=e(F),$=s(H,2),pt=e($,!0);a($);var Z=s($,2),ut=e(Z);a(Z),a(F);var I=s(F,2),J=e(I),tt=e(J),mt=e(tt,!0);a(tt),P(2),a(J);var K=s(J,2),L=e(K),gt=e(L);a(L),P(2),a(K);var N=s(K,2),at=e(N),_t=e(at,!0);a(at),P(2),a(N);var et=s(N,2),st=e(et),ft=e(st);a(st),P(2),a(et),a(I);var rt=s(I,2);{var bt=D=>{var S=jt(),M=dt(S),T=s(e(M),2);O(T,21,()=>t(l).distribution,U,(g,c,v)=>{const C=G(()=>Math.max(...t(l).distribution.map(V=>V.count),1)),R=G(()=>t(c).count/t(C)*100),_=G(()=>v<3?"#ef4444":v<5?"#f59e0b":v<7?"#10b981":"#6366f1");var x=kt(),o=e(x),f=e(o,!0);a(o);var b=s(o,2),h=s(b,2),Q=e(h,!0);a(h),a(x),B(()=>{i(f,t(c).count),A(b,`height: ${t(R)??""}%; background: ${t(_)??""}; opacity: 0.7; min-height: 2px`),i(Q,t(c).range)}),p(g,x)}),a(T),a(M);var k=s(M,2),j=s(e(k),2);O(j,21,()=>Object.entries(t(l).byType),U,(g,c)=>{var v=G(()=>W(t(c),2));let C=()=>t(v)[0],R=()=>t(v)[1];var _=Bt(),x=e(_),o=s(x,2),f=e(o,!0);a(o);var b=s(o,2),h=e(b,!0);a(b),a(_),B(()=>{A(x,`background: ${({fact:"#00A8FF",concept:"#9D00FF",event:"#FFB800",person:"#00FFD1",note:"#8B95A5",pattern:"#FF3CAC",decision:"#FF4757"}[C()]||"#8B95A5")??""}`),i(f,C()),i(h,R())}),p(g,_)}),a(j),a(k);var yt=s(k,2);{var wt=g=>{var c=Tt(),v=e(c),C=e(v);a(v);var R=s(v,2);O(R,21,()=>t(l).endangered.slice(0,20),U,(_,x)=>{var o=St(),f=e(o),b=e(f);a(f);var h=s(f,2),Q=e(h,!0);a(h),a(o),B(V=>{i(b,`${V??""}%`),i(Q,t(x).content)},[()=>(t(x).retentionStrength*100).toFixed(0)]),p(_,o)}),a(R),a(c),B(()=>i(C,`Endangered Memories (${t(l).endangered.length??""})`)),p(g,c)};X(yt,g=>{t(l).endangered.length>0&&g(wt)})}p(D,S)};X(rt,D=>{t(l)&&D(bt)})}var it=s(rt,2),ht=e(it);a(it),B((D,S,M,T,k,j)=>{A(F,`border-color: ${D??""}30`),A(H,`background: ${S??""}`),A($,`color: ${M??""}`),i(pt,T),i(ut,`v${t(m).version??""}`),i(mt,t(n).totalMemories),A(L,`color: ${t(n).averageRetention>.7?"#10b981":t(n).averageRetention>.4?"#f59e0b":"#ef4444"}`),i(gt,`${k??""}%`),i(_t,t(n).dueForReview),i(ft,`${j??""}%`)},[()=>q(t(m).status),()=>q(t(m).status),()=>q(t(m).status),()=>t(m).status.toUpperCase(),()=>(t(n).averageRetention*100).toFixed(1),()=>t(n).embeddingCoverage.toFixed(0)]),At("click",ht,nt),p(d,r)};X(lt,d=>{t(Y)?d(ct):t(n)&&t(m)&&d(xt,1)})}a(z),p(ot,z),Ct()}Rt(["click"]);export{Lt as component}; +import"../chunks/Bzak7iHL.js";import{o as Ft}from"../chunks/DUC-ssvh.js";import{p as $t,a as Ct,d as s,e,j as W,h as y,g as t,r as a,s as E,f as dt,G as P,t as B,u as G}from"../chunks/BBD-8XME.js";import{d as Rt,s as i,a as At}from"../chunks/DNn3Nckx.js";import{i as X}from"../chunks/RaRNNC-y.js";import{e as O,i as U}from"../chunks/C5a--lgk.js";import{a as p,f as u}from"../chunks/CKcqngaU.js";import{s as A}from"../chunks/DBfx-YTU.js";import{a as w}from"../chunks/BcuCGYSa.js";var Dt=u('
'),Mt=u('
'),kt=u('
'),Bt=u('
'),St=u('
'),Tt=u('

'),jt=u('

Retention Distribution

Memory Types

',1),Et=u('
Total Memories
Avg Retention
Due for Review
Embedding Coverage
',1),Pt=u('

System Stats

');function Lt(ot,vt){$t(vt,!0);let n=E(null),m=E(null),l=E(null),Y=E(!0);Ft(async()=>{try{await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}finally{y(Y,!1)}});function q(d){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[d]||"#6b7280"}async function nt(){try{await w.consolidate(),await(async d=>{var r=W(d,3);y(n,r[0],!0),y(m,r[1],!0),y(l,r[2],!0)})(await Promise.all([w.stats(),w.health(),w.retentionDistribution()]))}catch{}}var z=Pt(),lt=s(e(z),2);{var ct=d=>{var r=Mt();O(r,20,()=>Array(8),U,(F,H)=>{var $=Dt();p(F,$)}),a(r),p(d,r)},xt=d=>{var r=Et(),F=dt(r),H=e(F),$=s(H,2),pt=e($,!0);a($);var Z=s($,2),ut=e(Z);a(Z),a(F);var I=s(F,2),J=e(I),tt=e(J),mt=e(tt,!0);a(tt),P(2),a(J);var K=s(J,2),L=e(K),gt=e(L);a(L),P(2),a(K);var N=s(K,2),at=e(N),_t=e(at,!0);a(at),P(2),a(N);var et=s(N,2),st=e(et),ft=e(st);a(st),P(2),a(et),a(I);var rt=s(I,2);{var bt=D=>{var S=jt(),M=dt(S),T=s(e(M),2);O(T,21,()=>t(l).distribution,U,(g,c,v)=>{const C=G(()=>Math.max(...t(l).distribution.map(V=>V.count),1)),R=G(()=>t(c).count/t(C)*100),_=G(()=>v<3?"#ef4444":v<5?"#f59e0b":v<7?"#10b981":"#6366f1");var x=kt(),o=e(x),f=e(o,!0);a(o);var b=s(o,2),h=s(b,2),Q=e(h,!0);a(h),a(x),B(()=>{i(f,t(c).count),A(b,`height: ${t(R)??""}%; background: ${t(_)??""}; opacity: 0.7; min-height: 2px`),i(Q,t(c).range)}),p(g,x)}),a(T),a(M);var k=s(M,2),j=s(e(k),2);O(j,21,()=>Object.entries(t(l).byType),U,(g,c)=>{var v=G(()=>W(t(c),2));let C=()=>t(v)[0],R=()=>t(v)[1];var _=Bt(),x=e(_),o=s(x,2),f=e(o,!0);a(o);var b=s(o,2),h=e(b,!0);a(b),a(_),B(()=>{A(x,`background: ${({fact:"#00A8FF",concept:"#9D00FF",event:"#FFB800",person:"#00FFD1",note:"#8B95A5",pattern:"#FF3CAC",decision:"#FF4757"}[C()]||"#8B95A5")??""}`),i(f,C()),i(h,R())}),p(g,_)}),a(j),a(k);var yt=s(k,2);{var wt=g=>{var c=Tt(),v=e(c),C=e(v);a(v);var R=s(v,2);O(R,21,()=>t(l).endangered.slice(0,20),U,(_,x)=>{var o=St(),f=e(o),b=e(f);a(f);var h=s(f,2),Q=e(h,!0);a(h),a(o),B(V=>{i(b,`${V??""}%`),i(Q,t(x).content)},[()=>(t(x).retentionStrength*100).toFixed(0)]),p(_,o)}),a(R),a(c),B(()=>i(C,`Endangered Memories (${t(l).endangered.length??""})`)),p(g,c)};X(yt,g=>{t(l).endangered.length>0&&g(wt)})}p(D,S)};X(rt,D=>{t(l)&&D(bt)})}var it=s(rt,2),ht=e(it);a(it),B((D,S,M,T,k,j)=>{A(F,`border-color: ${D??""}30`),A(H,`background: ${S??""}`),A($,`color: ${M??""}`),i(pt,T),i(ut,`v${t(m).version??""}`),i(mt,t(n).totalMemories),A(L,`color: ${t(n).averageRetention>.7?"#10b981":t(n).averageRetention>.4?"#f59e0b":"#ef4444"}`),i(gt,`${k??""}%`),i(_t,t(n).dueForReview),i(ft,`${j??""}%`)},[()=>q(t(m).status),()=>q(t(m).status),()=>q(t(m).status),()=>t(m).status.toUpperCase(),()=>(t(n).averageRetention*100).toFixed(1),()=>t(n).embeddingCoverage.toFixed(0)]),At("click",ht,nt),p(d,r)};X(lt,d=>{t(Y)?d(ct):t(n)&&t(m)&&d(xt,1)})}a(z),p(ot,z),Ct()}Rt(["click"]);export{Lt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.br b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.br new file mode 100644 index 0000000..59b2c4c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.gz new file mode 100644 index 0000000..146020c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.evd80og6.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br deleted file mode 100644 index 59f4ea4..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz deleted file mode 100644 index 67aa5a4..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js similarity index 86% rename from apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js rename to apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js index 5fb29ba..99225ce 100644 --- a/apps/dashboard/build/_app/immutable/nodes/11.C5VMEnLV.js +++ b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/CkyfbJUz.js";import{p as ce,s as b,c as me,g as e,a as _e,d as i,e as a,h as c,r as t,t as g}from"../chunks/C9Z4nxhR.js";import{d as ue,a as K,s as m}from"../chunks/DP9qWekZ.js";import{i as M}from"../chunks/C2oj68pw.js";import{e as h,i as P}from"../chunks/kH-DTQyy.js";import{a as l,f as v}from"../chunks/DPfxVJHQ.js";import{s as Q}from"../chunks/BkopTN9z.js";import{b as xe}from"../chunks/-jeO_JOJ.js";import{a as fe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/CZ45jJaw.js";var be=v('
'),ge=v('
'),he=v('

No memories in the selected time range.

'),ye=v('
'),we=v(' '),ke=v('
'),Te=v('
'),je=v('
'),Ae=v('
'),Ne=v('

Timeline

');function Re(V,W){ce(W,!0);let _=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>R());async function R(){c(y,!0);try{const s=await fe.timeline(e(w),500);c(_,s.timeline,!0)}catch{c(_,[],!0)}finally{c(y,!1)}}var T=Ne(),j=a(T),u=i(a(j),2),A=a(u);A.value=A.__value=7;var N=i(A);N.value=N.__value=14;var O=i(N);O.value=O.__value=30;var Y=i(O);Y.value=Y.__value=90,t(u),t(j);var X=i(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),P,(x,f)=>{var r=be();l(x,r)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ae(),x=i(a(d),2);h(x,21,()=>e(_),f=>f.date,(f,r)=>{var S=je(),B=i(a(S),2),D=a(B),E=a(D),$=a(E),ae=a($,!0);t($);var q=i($,2),se=a(q);t(q),t(E);var z=i(E,2),G=a(z);h(G,17,()=>e(r).memories.slice(0,10),P,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var ie=i(G,2);{var re=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(r).memories.length-10}`)),l(n,o)};M(ie,n=>{e(r).memories.length>10&&n(re)})}t(z),t(D);var oe=i(D,2);{var le=n=>{var o=Te();h(o,21,()=>e(r).memories,P,(p,C)=>{var F=ke(),H=a(F),L=i(H,2),I=a(L),ve=a(I,!0);t(I),t(L);var J=i(L,2),de=a(J);t(J),t(F),g(ne=>{Q(H,`background: ${(U[e(C).nodeType]||"#8B95A5")??""}`),m(ve,e(C).content),m(de,`${ne??""}%`)},[()=>(e(C).retentionStrength*100).toFixed(0)]),l(p,F)}),t(o),l(n,o)};M(oe,n=>{e(k)===e(r).date&&n(le)})}t(B),t(S),g(()=>{m(ae,e(r).date),m(se,`${e(r).count??""} memories`)}),K("click",B,()=>c(k,e(k)===e(r).date?null:e(r).date,!0)),l(f,S)}),t(x),t(d),l(s,d)};M(X,s=>{e(y)?s(Z):e(_).length===0?s(ee,1):s(te,!1)})}t(T),K("change",u,R),xe(u,()=>e(w),s=>c(w,s)),l(V,T),_e()}ue(["change","click"]);export{Re as component}; +import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/DUC-ssvh.js";import{p as ce,s as b,c as me,g as e,a as _e,d as i,e as a,h as c,r as t,t as g}from"../chunks/BBD-8XME.js";import{d as ue,a as K,s as m}from"../chunks/DNn3Nckx.js";import{i as M}from"../chunks/RaRNNC-y.js";import{e as h,i as P}from"../chunks/C5a--lgk.js";import{a as l,f as v}from"../chunks/CKcqngaU.js";import{s as Q}from"../chunks/DBfx-YTU.js";import{b as xe}from"../chunks/C-QujEl6.js";import{a as fe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/CZ45jJaw.js";var be=v('
'),ge=v('
'),he=v('

No memories in the selected time range.

'),ye=v('
'),we=v(' '),ke=v('
'),Te=v('
'),je=v('
'),Ae=v('
'),Ne=v('

Timeline

');function Re(V,W){ce(W,!0);let _=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>R());async function R(){c(y,!0);try{const s=await fe.timeline(e(w),500);c(_,s.timeline,!0)}catch{c(_,[],!0)}finally{c(y,!1)}}var T=Ne(),j=a(T),u=i(a(j),2),A=a(u);A.value=A.__value=7;var N=i(A);N.value=N.__value=14;var O=i(N);O.value=O.__value=30;var Y=i(O);Y.value=Y.__value=90,t(u),t(j);var X=i(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),P,(x,f)=>{var r=be();l(x,r)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ae(),x=i(a(d),2);h(x,21,()=>e(_),f=>f.date,(f,r)=>{var S=je(),B=i(a(S),2),D=a(B),E=a(D),$=a(E),ae=a($,!0);t($);var q=i($,2),se=a(q);t(q),t(E);var z=i(E,2),G=a(z);h(G,17,()=>e(r).memories.slice(0,10),P,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var ie=i(G,2);{var re=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(r).memories.length-10}`)),l(n,o)};M(ie,n=>{e(r).memories.length>10&&n(re)})}t(z),t(D);var oe=i(D,2);{var le=n=>{var o=Te();h(o,21,()=>e(r).memories,P,(p,C)=>{var F=ke(),H=a(F),L=i(H,2),I=a(L),ve=a(I,!0);t(I),t(L);var J=i(L,2),de=a(J);t(J),t(F),g(ne=>{Q(H,`background: ${(U[e(C).nodeType]||"#8B95A5")??""}`),m(ve,e(C).content),m(de,`${ne??""}%`)},[()=>(e(C).retentionStrength*100).toFixed(0)]),l(p,F)}),t(o),l(n,o)};M(oe,n=>{e(k)===e(r).date&&n(le)})}t(B),t(S),g(()=>{m(ae,e(r).date),m(se,`${e(r).count??""} memories`)}),K("click",B,()=>c(k,e(k)===e(r).date?null:e(r).date,!0)),l(f,S)}),t(x),t(d),l(s,d)};M(X,s=>{e(y)?s(Z):e(_).length===0?s(ee,1):s(te,!1)})}t(T),K("change",u,R),xe(u,()=>e(w),s=>c(w,s)),l(V,T),_e()}ue(["change","click"]);export{Re as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.br b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.br new file mode 100644 index 0000000..bd79ebe Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.gz new file mode 100644 index 0000000..c6a73fb Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.gY7s4Ta3.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js new file mode 100644 index 0000000..0c29b80 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/BBD-8XME.js";import{c as n,a as p}from"../chunks/CKcqngaU.js";import{s as i}from"../chunks/DZuEJlJ5.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.br b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.br new file mode 100644 index 0000000..e3f8b90 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.gz new file mode 100644 index 0000000..c2a5e41 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.1GJQ3fqu.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js deleted file mode 100644 index 5c688d6..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/C9Z4nxhR.js";import{c as n,a as p}from"../chunks/DPfxVJHQ.js";import{s as i}from"../chunks/D00YwZ1M.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br deleted file mode 100644 index f91da89..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz deleted file mode 100644 index 912d0d0..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.Bv9w28KX.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js b/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js deleted file mode 100644 index dfff3ad..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/_Va07L2l.js";import{o as r}from"../chunks/CkyfbJUz.js";import{p as t,a}from"../chunks/C9Z4nxhR.js";import{g as m}from"../chunks/DunNqS1N.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.br b/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.br deleted file mode 100644 index 7b4aa5b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.gz deleted file mode 100644 index 212c83f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.D_o4dH3z.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js new file mode 100644 index 0000000..321be3f --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/D1BK9eoQ.js";import{o as r}from"../chunks/DUC-ssvh.js";import{p as t,a}from"../chunks/BBD-8XME.js";import{g as m}from"../chunks/cIQD_rb4.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.br b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.br new file mode 100644 index 0000000..6b4d86c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.gz new file mode 100644 index 0000000..b979fdd Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.qBGkDYYb.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js similarity index 95% rename from apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js rename to apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js index b6f1009..2b88bad 100644 --- a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js +++ b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{p as ze,s as I,c as Ae,g as e,a as Pe,d as a,e as r,h as b,r as t,i as Qe,t as y,f as ge,u as se,j as qe}from"../chunks/C9Z4nxhR.js";import{d as Be,a as q,s as o}from"../chunks/DP9qWekZ.js";import{a as c,f as m,c as De}from"../chunks/DPfxVJHQ.js";import{i as k}from"../chunks/C2oj68pw.js";import{e as ie,i as ne}from"../chunks/kH-DTQyy.js";import{r as ye}from"../chunks/ZesQ8l8p.js";import{s as oe}from"../chunks/Co2v30Gm.js";import{s as Ke}from"../chunks/BkopTN9z.js";import{b as de}from"../chunks/P9ZHwQBL.js";import{a as X}from"../chunks/BcuCGYSa.js";var Re=m(''),Ue=m('
Source

'),Ve=m('
Target

'),Ge=m(`
Target Memory
'),Ue=m('
Source

'),Ve=m('
Target

'),Ge=m(`
Target Memory
`,1),He=m('

'),Je=m(' '),Le=m(" "),We=m(" "),Xe=m(" "),Ye=m(' '),Ze=m('

'),et=m('

'),tt=m('

No connections found for this query.

'),rt=m('
'),at=m('
'),st=m('
'),it=m(`

Explore Connections

Source Memory

Importance Scorer

4-channel neuroscience scoring: novelty, arousal, reward, attention

`);function ft(he,we){ze(we,!0);let V=I(""),G=I(""),F=I(null),C=I(null),B=I(Ae([])),$=I("associations"),O=I(!1),H=I(""),D=I(null);const le={associations:{icon:"◎",desc:"Spreading activation — find related memories via graph traversal"},chains:{icon:"⟿",desc:"Build reasoning path from source to target memory"},bridges:{icon:"⬡",desc:"Find connecting memories between two concepts"}};async function ve(){if(e(V).trim()){b(O,!0);try{const s=await X.search(e(V),1);s.results.length>0&&(b(F,s.results[0],!0),await Y())}catch{}finally{b(O,!1)}}}async function pe(){if(e(G).trim()){b(O,!0);try{const s=await X.search(e(G),1);s.results.length>0&&(b(C,s.results[0],!0),e(F)&&await Y())}catch{}finally{b(O,!1)}}}async function Y(){if(e(F)){b(O,!0);try{const s=(e($)==="chains"||e($)==="bridges")&&e(C)?e(C).id:void 0,i=await X.explore(e(F).id,e($),s);b(B,i.results||i.nodes||i.chain||i.bridges||[],!0)}catch{b(B,[],!0)}finally{b(O,!1)}}}async function ke(){e(H).trim()&&b(D,await X.importance(e(H)),!0)}function Se(s){b($,s,!0),e(F)&&Y()}var Z=it(),ee=a(r(Z),2);ie(ee,20,()=>["associations","chains","bridges"],ne,(s,i)=>{var d=Re(),_=r(d),h=r(_,!0);t(_);var f=a(_,2),p=r(f,!0);t(f);var n=a(f,2),g=r(n,!0);t(n),t(d),y(w=>{oe(d,1,`flex flex-col items-center gap-1 p-3 rounded-xl text-sm transition diff --git a/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.br b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.br new file mode 100644 index 0000000..908dfaf Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.gz b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.gz new file mode 100644 index 0000000..627cb49 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/4.BYgf5djd.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br deleted file mode 100644 index 5673275..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz b/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz deleted file mode 100644 index 12ccefb..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.CeoFmj14.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br deleted file mode 100644 index 6266711..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz b/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz deleted file mode 100644 index e00d286..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js similarity index 90% rename from apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js rename to apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js index b7cd273..9aec708 100644 --- a/apps/dashboard/build/_app/immutable/nodes/5.CgbdGsQS.js +++ b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{i as oe}from"../chunks/_Va07L2l.js";import{p as ee,ah as ie,g as e,h as M,e as o,d,r as s,f as ne,t as $,a as te,s as K,u as X,C as Z}from"../chunks/C9Z4nxhR.js";import{s as x,d as de,a as ce}from"../chunks/DP9qWekZ.js";import{a as l,f as m}from"../chunks/DPfxVJHQ.js";import{i as w}from"../chunks/C2oj68pw.js";import{e as re,i as ae}from"../chunks/kH-DTQyy.js";import{s as C}from"../chunks/BkopTN9z.js";import{s as le,a as me}from"../chunks/DWr9YED7.js";import{w as ve,e as ue}from"../chunks/BmeMLq0p.js";import{E as O}from"../chunks/CZ45jJaw.js";import{s as pe}from"../chunks/ZesQ8l8p.js";import{s as fe}from"../chunks/Co2v30Gm.js";import{p as Q}from"../chunks/Do8TgQ-j.js";var xe=m(' '),_e=m('
'),ge=m('
',1),he=m('
'),ye=m('
'),$e=m('
Cognitive Search Pipeline
');function be(q,F){ee(F,!0);let S=Q(F,"resultCount",3,0),j=Q(F,"durationMs",3,0),I=Q(F,"active",3,!1);const p=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let _=K(-1),g=K(!1),u=K(!1);ie(()=>{I()&&!e(g)&&P()});function P(){M(g,!0),M(_,-1),M(u,!1);const t=Math.max(1500,(j()||50)*2),a=t/(p.length+1);p.forEach((i,v)=>{setTimeout(()=>{M(_,v,!0)},a*(v+1))}),setTimeout(()=>{M(u,!0),M(g,!1)},t)}var D=$e(),b=o(D),L=d(o(b),2);{var V=t=>{var a=xe(),i=o(a);s(a),$(()=>x(i,`${S()??""} results in ${j()??""}ms`)),l(t,a)};w(L,t=>{e(u)&&t(V)})}s(b);var A=d(b,2);re(A,21,()=>p,ae,(t,a,i)=>{const v=X(()=>i<=e(_)),E=X(()=>i===e(_)&&e(g));var k=ge(),h=ne(k),y=o(h),J=o(y,!0);s(y);var R=d(y,2),T=o(R,!0);s(R),s(h);var U=d(h,2);{var W=B=>{var c=_e();$(()=>C(c,`background: ${i{i{fe(y,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300 +import"../chunks/Bzak7iHL.js";import{i as oe}from"../chunks/D1BK9eoQ.js";import{p as ee,ah as ie,g as e,h as M,e as o,d,r as s,f as ne,t as $,a as te,s as K,u as X,C as Z}from"../chunks/BBD-8XME.js";import{s as x,d as de,a as ce}from"../chunks/DNn3Nckx.js";import{a as l,f as m}from"../chunks/CKcqngaU.js";import{i as w}from"../chunks/RaRNNC-y.js";import{e as re,i as ae}from"../chunks/C5a--lgk.js";import{s as C}from"../chunks/DBfx-YTU.js";import{s as le,a as me}from"../chunks/BexJutgU.js";import{w as ve,e as ue}from"../chunks/CruZBLYW.js";import{E as O}from"../chunks/CZ45jJaw.js";import{s as pe}from"../chunks/BVZqxpRe.js";import{s as fe}from"../chunks/CBWLjDtu.js";import{p as Q}from"../chunks/CzkEqL6J.js";var xe=m(' '),_e=m('
'),ge=m('
',1),he=m('
'),ye=m('
'),$e=m('
Cognitive Search Pipeline
');function be(q,F){ee(F,!0);let S=Q(F,"resultCount",3,0),j=Q(F,"durationMs",3,0),I=Q(F,"active",3,!1);const p=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let _=K(-1),g=K(!1),u=K(!1);ie(()=>{I()&&!e(g)&&P()});function P(){M(g,!0),M(_,-1),M(u,!1);const t=Math.max(1500,(j()||50)*2),a=t/(p.length+1);p.forEach((i,v)=>{setTimeout(()=>{M(_,v,!0)},a*(v+1))}),setTimeout(()=>{M(u,!0),M(g,!1)},t)}var D=$e(),b=o(D),L=d(o(b),2);{var V=t=>{var a=xe(),i=o(a);s(a),$(()=>x(i,`${S()??""} results in ${j()??""}ms`)),l(t,a)};w(L,t=>{e(u)&&t(V)})}s(b);var A=d(b,2);re(A,21,()=>p,ae,(t,a,i)=>{const v=X(()=>i<=e(_)),E=X(()=>i===e(_)&&e(g));var k=ge(),h=ne(k),y=o(h),J=o(y,!0);s(y);var R=d(y,2),T=o(R,!0);s(R),s(h);var U=d(h,2);{var W=B=>{var c=_e();$(()=>C(c,`background: ${i{i{fe(y,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300 ${e(E)?"scale-125":""}`),C(y,`background: ${e(v)?e(a).color+"25":"rgba(255,255,255,0.03)"}; border: 1.5px solid ${(e(v)?e(a).color:"rgba(255,255,255,0.06)")??""}; color: ${(e(v)?e(a).color:"#4a4a7a")??""}; diff --git a/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.br b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.br new file mode 100644 index 0000000..4c0992f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.gz b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.gz new file mode 100644 index 0000000..6e8301c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.DVWNDcwc.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js similarity index 85% rename from apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js rename to apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js index 2126237..77c057c 100644 --- a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js +++ b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js @@ -1,12 +1,12 @@ -var Tc=Object.defineProperty;var wc=(i,t,e)=>t in i?Tc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Wt=(i,t,e)=>wc(i,typeof t!="symbol"?t+"":t,e);import"../chunks/Bzak7iHL.js";import{o as Al,a as Rl}from"../chunks/CkyfbJUz.js";import{p as lr,a as cr,e as Dt,d as Bt,G as Cl,r as Rt,t as ln,g as q,u as ti,f as Pl,s as Ie,h as se,c as Ac}from"../chunks/C9Z4nxhR.js";import{s as _e,d as Dl,a as $e}from"../chunks/DP9qWekZ.js";import{i as wi}from"../chunks/C2oj68pw.js";import{e as $r,i as Jr}from"../chunks/kH-DTQyy.js";import{a as Be,f as qe,c as Rc}from"../chunks/DPfxVJHQ.js";import{s as Ve,r as Ll}from"../chunks/ZesQ8l8p.js";import{s as Cc}from"../chunks/Co2v30Gm.js";import{s as Ul}from"../chunks/BkopTN9z.js";import{b as Il}from"../chunks/P9ZHwQBL.js";import{b as Nl}from"../chunks/-jeO_JOJ.js";import{s as Pc,a as Dc}from"../chunks/DWr9YED7.js";import{b as Lc}from"../chunks/CR6HhlME.js";import{p as Qs}from"../chunks/Do8TgQ-j.js";import{N as Fl}from"../chunks/CZ45jJaw.js";import{a as Yi}from"../chunks/BcuCGYSa.js";import{e as Uc}from"../chunks/BmeMLq0p.js";/** +var bc=Object.defineProperty;var Tc=(i,t,e)=>t in i?bc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Wt=(i,t,e)=>Tc(i,typeof t!="symbol"?t+"":t,e);import"../chunks/Bzak7iHL.js";import{o as Al,a as Rl}from"../chunks/DUC-ssvh.js";import{p as lr,a as cr,e as Dt,d as Ot,G as wc,r as Rt,t as ln,g as j,u as ti,f as Cl,s as Ie,h as se,c as Ac}from"../chunks/BBD-8XME.js";import{s as _e,d as Pl,a as Je}from"../chunks/DNn3Nckx.js";import{i as wi}from"../chunks/RaRNNC-y.js";import{e as $r,i as Jr}from"../chunks/C5a--lgk.js";import{a as ze,f as je,c as Rc}from"../chunks/CKcqngaU.js";import{s as Be,r as Dl}from"../chunks/BVZqxpRe.js";import{s as Cc}from"../chunks/CBWLjDtu.js";import{s as Ll}from"../chunks/DBfx-YTU.js";import{b as Ul}from"../chunks/BxfT1SOA.js";import{b as Il}from"../chunks/C-QujEl6.js";import{s as Pc,a as Dc}from"../chunks/BexJutgU.js";import{b as Lc}from"../chunks/BeSd-T80.js";import{b as Uc}from"../chunks/DtXypsxD.js";import{p as Qs}from"../chunks/CzkEqL6J.js";import{N as Nl}from"../chunks/CZ45jJaw.js";import{a as Yi}from"../chunks/BcuCGYSa.js";import{e as Ic}from"../chunks/CruZBLYW.js";/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const Xa="172",Di={ROTATE:0,DOLLY:1,PAN:2},Ri={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ic=0,uo=1,Nc=2,Ol=1,Fc=2,yn=3,zn=0,He=1,hn=2,bn=0,Li=1,ze=2,fo=3,po=4,Oc=5,Kn=100,Bc=101,zc=102,Hc=103,kc=104,Vc=200,Gc=201,Wc=202,Xc=203,Qr=204,ta=205,Yc=206,qc=207,jc=208,Zc=209,Kc=210,$c=211,Jc=212,Qc=213,th=214,ea=0,na=1,ia=2,Fi=3,sa=4,ra=5,aa=6,oa=7,Bl=0,eh=1,nh=2,On=0,ih=1,sh=2,rh=3,zl=4,ah=5,oh=6,lh=7,Hl=300,Oi=301,Bi=302,la=303,ca=304,hr=306,ha=1e3,Jn=1001,ua=1002,Ye=1003,ch=1004,ms=1005,dn=1006,gr=1007,Qn=1008,An=1009,kl=1010,Vl=1011,os=1012,Ya=1013,ei=1014,fn=1015,Tn=1016,qa=1017,ja=1018,zi=1020,Gl=35902,Wl=1021,Xl=1022,an=1023,Yl=1024,ql=1025,Ui=1026,Hi=1027,Za=1028,Ka=1029,jl=1030,$a=1031,Ja=1033,Xs=33776,Ys=33777,qs=33778,js=33779,da=35840,fa=35841,pa=35842,ma=35843,ga=36196,_a=37492,va=37496,xa=37808,Ma=37809,Sa=37810,ya=37811,Ea=37812,ba=37813,Ta=37814,wa=37815,Aa=37816,Ra=37817,Ca=37818,Pa=37819,Da=37820,La=37821,Zs=36492,Ua=36494,Ia=36495,Zl=36283,Na=36284,Fa=36285,Oa=36286,hh=3200,uh=3201,Kl=0,dh=1,Fn="",Je="srgb",ki="srgb-linear",tr="linear",re="srgb",oi=7680,mo=519,fh=512,ph=513,mh=514,$l=515,gh=516,_h=517,vh=518,xh=519,Ba=35044,go="300 es",En=2e3,er=2001;class ii{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const s=n.slice(0);for(let r=0,a=s.length;r>8&255]+Ae[i>>16&255]+Ae[i>>24&255]+"-"+Ae[t&255]+Ae[t>>8&255]+"-"+Ae[t>>16&15|64]+Ae[t>>24&255]+"-"+Ae[e&63|128]+Ae[e>>8&255]+"-"+Ae[e>>16&255]+Ae[e>>24&255]+Ae[n&255]+Ae[n>>8&255]+Ae[n>>16&255]+Ae[n>>24&255]).toLowerCase()}function qt(i,t,e){return Math.max(t,Math.min(e,i))}function Mh(i,t){return(i%t+t)%t}function _r(i,t,e){return(1-e)*i+e*t}function un(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function ae(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Sh={DEG2RAD:Ks};class vt{constructor(t=0,e=0){vt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=qt(this.x,t.x,e.x),this.y=qt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=qt(this.x,t,e),this.y=qt(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(qt(n,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(qt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ht{constructor(t,e,n,s,r,a,o,l,c){Ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c)}set(t,e,n,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],f=n[2],p=n[5],g=n[8],v=s[0],m=s[3],u=s[6],T=s[1],b=s[4],y=s[7],L=s[2],R=s[5],A=s[8];return r[0]=a*v+o*T+l*L,r[3]=a*m+o*b+l*R,r[6]=a*u+o*y+l*A,r[1]=c*v+h*T+d*L,r[4]=c*m+h*b+d*R,r[7]=c*u+h*y+d*A,r[2]=f*v+p*T+g*L,r[5]=f*m+p*b+g*R,r[8]=f*u+p*y+g*A,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*r*h+n*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=h*a-o*c,f=o*l-h*r,p=c*r-a*l,g=e*d+n*f+s*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return t[0]=d*v,t[1]=(s*c-h*n)*v,t[2]=(o*n-s*a)*v,t[3]=f*v,t[4]=(h*e-s*l)*v,t[5]=(s*r-o*e)*v,t[6]=p*v,t[7]=(n*l-c*e)*v,t[8]=(a*e-n*r)*v,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(vr.makeScale(t,e)),this}rotate(t){return this.premultiply(vr.makeRotation(-t)),this}translate(t,e){return this.premultiply(vr.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const vr=new Ht;function Jl(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function nr(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function yh(){const i=nr("canvas");return i.style.display="block",i}const _o={};function Ai(i){i in _o||(_o[i]=!0,console.warn(i))}function Eh(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function bh(i){const t=i.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Th(i){const t=i.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const vo=new Ht().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xo=new Ht().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function wh(){const i={enabled:!0,workingColorSpace:ki,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===re&&(s.r=wn(s.r),s.g=wn(s.g),s.b=wn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===re&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Fn?tr:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[ki]:{primaries:t,whitePoint:n,transfer:tr,toXYZ:vo,fromXYZ:xo,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Je},outputColorSpaceConfig:{drawingBufferColorSpace:Je}},[Je]:{primaries:t,whitePoint:n,transfer:re,toXYZ:vo,fromXYZ:xo,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Je}}}),i}const Jt=wh();function wn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let li;class Ah{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{li===void 0&&(li=nr("canvas")),li.width=t.width,li.height=t.height;const n=li.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=li}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=nr("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Hl)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ha:t.x=t.x-Math.floor(t.x);break;case Jn:t.x=t.x<0?0:1;break;case ua:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ha:t.y=t.y-Math.floor(t.y);break;case Jn:t.y=t.y<0?0:1;break;case ua:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ce.DEFAULT_IMAGE=null;Ce.DEFAULT_MAPPING=Hl;Ce.DEFAULT_ANISOTROPY=1;class le{constructor(t=0,e=0,n=0,s=1){le.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r;const l=t.elements,c=l[0],h=l[4],d=l[8],f=l[1],p=l[5],g=l[9],v=l[2],m=l[6],u=l[10];if(Math.abs(h-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+p+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,y=(p+1)/2,L=(u+1)/2,R=(h+f)/4,A=(d+v)/4,U=(g+m)/4;return b>y&&b>L?b<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(b),s=R/n,r=A/n):y>L?y<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(y),n=R/s,r=U/s):L<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(L),n=A/r,s=U/r),this.set(n,s,r,e),this}let T=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-h)*(f-h));return Math.abs(T)<.001&&(T=1),this.x=(m-g)/T,this.y=(d-v)/T,this.z=(f-h)/T,this.w=Math.acos((c+p+u-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=qt(this.x,t.x,e.x),this.y=qt(this.y,t.y,e.y),this.z=qt(this.z,t.z,e.z),this.w=qt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=qt(this.x,t,e),this.y=qt(this.y,t,e),this.z=qt(this.z,t,e),this.w=qt(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(qt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ph extends ii{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);const s={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ce(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,b=1-u*u;if(b>Number.EPSILON){const L=Math.sqrt(b),R=Math.atan2(L,u*T);m=Math.sin(m*R)/L,o=Math.sin(o*R)/L}const y=o*T;if(l=l*m+f*y,c=c*m+p*y,h=h*m+g*y,d=d*m+v*y,m===1-o){const L=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=L,c*=L,h*=L,d*=L}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],h=n[s+3],d=r[a],f=r[a+1],p=r[a+2],g=r[a+3];return t[e]=o*g+h*d+l*p-c*f,t[e+1]=l*g+h*f+c*d-o*p,t[e+2]=c*g+h*p+o*f-l*d,t[e+3]=h*g-o*d-l*f-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(s/2),d=o(r/2),f=l(n/2),p=l(s/2),g=l(r/2);switch(a){case"XYZ":this._x=f*h*d+c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d-f*p*g;break;case"YXZ":this._x=f*h*d+c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d+f*p*g;break;case"ZXY":this._x=f*h*d-c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d-f*p*g;break;case"ZYX":this._x=f*h*d-c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d+f*p*g;break;case"YZX":this._x=f*h*d+c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d-f*p*g;break;case"XZY":this._x=f*h*d-c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d+f*p*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-l)*p,this._y=(r-c)*p,this._z=(a-s)*p}else if(n>o&&n>d){const p=2*Math.sqrt(1+n-o-d);this._w=(h-l)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+c)/p}else if(o>d){const p=2*Math.sqrt(1+o-n-d);this._w=(r-c)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+d-n-o);this._w=(a-s)/p,this._x=(r+c)/p,this._y=(l+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(qt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-s*o,this._w=a*h-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(t=0,e=0,n=0){P.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Mo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Mo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+l*c+a*d-o*h,this.y=n+l*h+o*c-r*d,this.z=s+l*d+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=qt(this.x,t.x,e.x),this.y=qt(this.y,t.y,e.y),this.z=qt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=qt(this.x,t,e),this.y=qt(this.y,t,e),this.z=qt(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(qt(n,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Mr.copy(this).projectOnVector(t),this.sub(Mr)}reflect(t){return this.sub(Mr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(qt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Mr=new P,Mo=new ni;class si{constructor(t=new P(1/0,1/0,1/0),e=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,nn),nn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(qi),_s.subVectors(this.max,qi),ci.subVectors(t.a,qi),hi.subVectors(t.b,qi),ui.subVectors(t.c,qi),Rn.subVectors(hi,ci),Cn.subVectors(ui,hi),Gn.subVectors(ci,ui);let e=[0,-Rn.z,Rn.y,0,-Cn.z,Cn.y,0,-Gn.z,Gn.y,Rn.z,0,-Rn.x,Cn.z,0,-Cn.x,Gn.z,0,-Gn.x,-Rn.y,Rn.x,0,-Cn.y,Cn.x,0,-Gn.y,Gn.x,0];return!Sr(e,ci,hi,ui,_s)||(e=[1,0,0,0,1,0,0,0,1],!Sr(e,ci,hi,ui,_s))?!1:(vs.crossVectors(Rn,Cn),e=[vs.x,vs.y,vs.z],Sr(e,ci,hi,ui,_s))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,nn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(nn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(gn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gn=[new P,new P,new P,new P,new P,new P,new P,new P],nn=new P,gs=new si,ci=new P,hi=new P,ui=new P,Rn=new P,Cn=new P,Gn=new P,qi=new P,_s=new P,vs=new P,Wn=new P;function Sr(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){Wn.fromArray(i,r);const o=s.x*Math.abs(Wn.x)+s.y*Math.abs(Wn.y)+s.z*Math.abs(Wn.z),l=t.dot(Wn),c=e.dot(Wn),h=n.dot(Wn);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Lh=new si,ji=new P,yr=new P;class ri{constructor(t=new P,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Lh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ji.subVectors(t,this.center);const e=ji.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(ji,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(yr.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ji.copy(t.center).add(yr)),this.expandByPoint(ji.copy(t.center).sub(yr))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _n=new P,Er=new P,xs=new P,Pn=new P,br=new P,Ms=new P,Tr=new P;class cs{constructor(t=new P,e=new P(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,_n)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=_n.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(_n.copy(this.origin).addScaledVector(this.direction,e),_n.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){Er.copy(t).add(e).multiplyScalar(.5),xs.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(Er);const r=t.distanceTo(e)*.5,a=-this.direction.dot(xs),o=Pn.dot(this.direction),l=-Pn.dot(xs),c=Pn.lengthSq(),h=Math.abs(1-a*a);let d,f,p,g;if(h>0)if(d=a*l-o,f=a*o-l,g=r*h,d>=0)if(f>=-g)if(f<=g){const v=1/h;d*=v,f*=v,p=d*(d+a*f+2*o)+f*(a*d+f+2*l)+c}else f=r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;else f=-r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-l),r),p=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-r,-l),r),p=f*(f+2*l)+c):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-l),r),p=-d*d+f*(f+2*l)+c);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(Er).addScaledVector(xs,f),p}intersectSphere(t,e){_n.subVectors(t.center,this.origin);const n=_n.dot(this.direction),s=_n.dot(_n)-n*n,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,s=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,s=(t.min.x-f.x)*c),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,l=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,l=(t.min.z-f.z)*d),n>l||o>s)||((o>n||n!==n)&&(n=o),(l=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,_n)!==null}intersectTriangle(t,e,n,s,r){br.subVectors(e,t),Ms.subVectors(n,t),Tr.crossVectors(br,Ms);let a=this.direction.dot(Tr),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);const l=o*this.direction.dot(Ms.crossVectors(Pn,Ms));if(l<0)return null;const c=o*this.direction.dot(br.cross(Pn));if(c<0||l+c>a)return null;const h=-o*Pn.dot(Tr);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ne{constructor(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m){ne.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m)}set(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m){const u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=l,u[2]=c,u[6]=h,u[10]=d,u[14]=f,u[3]=p,u[7]=g,u[11]=v,u[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 ne().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,s=1/di.setFromMatrixColumn(t,0).length(),r=1/di.setFromMatrixColumn(t,1).length(),a=1/di.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){const f=a*h,p=a*d,g=o*h,v=o*d;e[0]=l*h,e[4]=-l*d,e[8]=c,e[1]=p+g*c,e[5]=f-v*c,e[9]=-o*l,e[2]=v-f*c,e[6]=g+p*c,e[10]=a*l}else if(t.order==="YXZ"){const f=l*h,p=l*d,g=c*h,v=c*d;e[0]=f+v*o,e[4]=g*o-p,e[8]=a*c,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=p*o-g,e[6]=v+f*o,e[10]=a*l}else if(t.order==="ZXY"){const f=l*h,p=l*d,g=c*h,v=c*d;e[0]=f-v*o,e[4]=-a*d,e[8]=g+p*o,e[1]=p+g*o,e[5]=a*h,e[9]=v-f*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const f=a*h,p=a*d,g=o*h,v=o*d;e[0]=l*h,e[4]=g*c-p,e[8]=f*c+v,e[1]=l*d,e[5]=v*c+f,e[9]=p*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const f=a*l,p=a*c,g=o*l,v=o*c;e[0]=l*h,e[4]=v-f*d,e[8]=g*d+p,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=p*d+g,e[10]=f-v*d}else if(t.order==="XZY"){const f=a*l,p=a*c,g=o*l,v=o*c;e[0]=l*h,e[4]=-d,e[8]=c*h,e[1]=f*d+v,e[5]=a*h,e[9]=p*d-g,e[2]=g*d-p,e[6]=o*h,e[10]=v*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Uh,t,Ih)}lookAt(t,e,n){const s=this.elements;return Ge.subVectors(t,e),Ge.lengthSq()===0&&(Ge.z=1),Ge.normalize(),Dn.crossVectors(n,Ge),Dn.lengthSq()===0&&(Math.abs(n.z)===1?Ge.x+=1e-4:Ge.z+=1e-4,Ge.normalize(),Dn.crossVectors(n,Ge)),Dn.normalize(),Ss.crossVectors(Ge,Dn),s[0]=Dn.x,s[4]=Ss.x,s[8]=Ge.x,s[1]=Dn.y,s[5]=Ss.y,s[9]=Ge.y,s[2]=Dn.z,s[6]=Ss.z,s[10]=Ge.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],f=n[9],p=n[13],g=n[2],v=n[6],m=n[10],u=n[14],T=n[3],b=n[7],y=n[11],L=n[15],R=s[0],A=s[4],U=s[8],S=s[12],M=s[1],D=s[5],W=s[9],z=s[13],V=s[2],$=s[6],G=s[10],J=s[14],k=s[3],it=s[7],ut=s[11],yt=s[15];return r[0]=a*R+o*M+l*V+c*k,r[4]=a*A+o*D+l*$+c*it,r[8]=a*U+o*W+l*G+c*ut,r[12]=a*S+o*z+l*J+c*yt,r[1]=h*R+d*M+f*V+p*k,r[5]=h*A+d*D+f*$+p*it,r[9]=h*U+d*W+f*G+p*ut,r[13]=h*S+d*z+f*J+p*yt,r[2]=g*R+v*M+m*V+u*k,r[6]=g*A+v*D+m*$+u*it,r[10]=g*U+v*W+m*G+u*ut,r[14]=g*S+v*z+m*J+u*yt,r[3]=T*R+b*M+y*V+L*k,r[7]=T*A+b*D+y*$+L*it,r[11]=T*U+b*W+y*G+L*ut,r[15]=T*S+b*z+y*J+L*yt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],d=t[6],f=t[10],p=t[14],g=t[3],v=t[7],m=t[11],u=t[15];return g*(+r*l*d-s*c*d-r*o*f+n*c*f+s*o*p-n*l*p)+v*(+e*l*p-e*c*f+r*a*f-s*a*p+s*c*h-r*l*h)+m*(+e*c*d-e*o*p-r*a*d+n*a*p+r*o*h-n*c*h)+u*(-s*o*h-e*l*d+e*o*f+s*a*d-n*a*f+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],g=t[12],v=t[13],m=t[14],u=t[15],T=d*m*c-v*f*c+v*l*p-o*m*p-d*l*u+o*f*u,b=g*f*c-h*m*c-g*l*p+a*m*p+h*l*u-a*f*u,y=h*v*c-g*d*c+g*o*p-a*v*p-h*o*u+a*d*u,L=g*d*l-h*v*l-g*o*f+a*v*f+h*o*m-a*d*m,R=e*T+n*b+s*y+r*L;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/R;return t[0]=T*A,t[1]=(v*f*r-d*m*r-v*s*p+n*m*p+d*s*u-n*f*u)*A,t[2]=(o*m*r-v*l*r+v*s*c-n*m*c-o*s*u+n*l*u)*A,t[3]=(d*l*r-o*f*r-d*s*c+n*f*c+o*s*p-n*l*p)*A,t[4]=b*A,t[5]=(h*m*r-g*f*r+g*s*p-e*m*p-h*s*u+e*f*u)*A,t[6]=(g*l*r-a*m*r-g*s*c+e*m*c+a*s*u-e*l*u)*A,t[7]=(a*f*r-h*l*r+h*s*c-e*f*c-a*s*p+e*l*p)*A,t[8]=y*A,t[9]=(g*d*r-h*v*r-g*n*p+e*v*p+h*n*u-e*d*u)*A,t[10]=(a*v*r-g*o*r+g*n*c-e*v*c-a*n*u+e*o*u)*A,t[11]=(h*o*r-a*d*r-h*n*c+e*d*c+a*n*p-e*o*p)*A,t[12]=L*A,t[13]=(h*v*s-g*d*s+g*n*f-e*v*f-h*n*m+e*d*m)*A,t[14]=(g*o*s-a*v*s-g*n*l+e*v*l+a*n*m-e*o*m)*A,t[15]=(a*d*s-h*o*s+h*n*l-e*d*l-a*n*f+e*o*f)*A,this}scale(t){const e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+n,h*l-s*a,0,c*l-s*o,h*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,d=o+o,f=r*c,p=r*h,g=r*d,v=a*h,m=a*d,u=o*d,T=l*c,b=l*h,y=l*d,L=n.x,R=n.y,A=n.z;return s[0]=(1-(v+u))*L,s[1]=(p+y)*L,s[2]=(g-b)*L,s[3]=0,s[4]=(p-y)*R,s[5]=(1-(f+u))*R,s[6]=(m+T)*R,s[7]=0,s[8]=(g+b)*A,s[9]=(m-T)*A,s[10]=(1-(f+v))*A,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){const s=this.elements;let r=di.set(s[0],s[1],s[2]).length();const a=di.set(s[4],s[5],s[6]).length(),o=di.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],sn.copy(this);const c=1/r,h=1/a,d=1/o;return sn.elements[0]*=c,sn.elements[1]*=c,sn.elements[2]*=c,sn.elements[4]*=h,sn.elements[5]*=h,sn.elements[6]*=h,sn.elements[8]*=d,sn.elements[9]*=d,sn.elements[10]*=d,e.setFromRotationMatrix(sn),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=En){const l=this.elements,c=2*r/(e-t),h=2*r/(n-s),d=(e+t)/(e-t),f=(n+s)/(n-s);let p,g;if(o===En)p=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===er)p=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=En){const l=this.elements,c=1/(e-t),h=1/(n-s),d=1/(a-r),f=(e+t)*c,p=(n+s)*h;let g,v;if(o===En)g=(a+r)*d,v=-2*d;else if(o===er)g=r*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const di=new P,sn=new ne,Uh=new P(0,0,0),Ih=new P(1,1,1),Dn=new P,Ss=new P,Ge=new P,So=new ne,yo=new ni;class pn{constructor(t=0,e=0,n=0,s=pn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],d=s[2],f=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(qt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-qt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(qt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-qt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(qt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-qt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return So.makeRotationFromQuaternion(t),this.setFromRotationMatrix(So,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return yo.setFromEuler(this),this.setFromQuaternion(yo,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pn.DEFAULT_ORDER="XYZ";class Qa{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),g.length>0&&(n.nodes=g)}return n.object=s,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){rn.subVectors(s,e),xn.subVectors(n,e),Ar.subVectors(t,e);const a=rn.dot(rn),o=rn.dot(xn),l=rn.dot(Ar),c=xn.dot(xn),h=xn.dot(Ar),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const f=1/d,p=(c*l-o*h)*f,g=(a*h-o*l)*f;return r.set(1-p-g,g,p)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,Mn)===null?!1:Mn.x>=0&&Mn.y>=0&&Mn.x+Mn.y<=1}static getInterpolation(t,e,n,s,r,a,o,l){return this.getBarycoord(t,e,n,s,Mn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Mn.x),l.addScaledVector(a,Mn.y),l.addScaledVector(o,Mn.z),l)}static getInterpolatedAttribute(t,e,n,s,r,a){return Dr.setScalar(0),Lr.setScalar(0),Ur.setScalar(0),Dr.fromBufferAttribute(t,e),Lr.fromBufferAttribute(t,n),Ur.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Dr,r.x),a.addScaledVector(Lr,r.y),a.addScaledVector(Ur,r.z),a}static isFrontFacing(t,e,n,s){return rn.subVectors(n,e),xn.subVectors(t,e),rn.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return rn.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),rn.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Qe.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Qe.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return Qe.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return Qe.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Qe.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,s=this.b,r=this.c;let a,o;mi.subVectors(s,n),gi.subVectors(r,n),Rr.subVectors(t,n);const l=mi.dot(Rr),c=gi.dot(Rr);if(l<=0&&c<=0)return e.copy(n);Cr.subVectors(t,s);const h=mi.dot(Cr),d=gi.dot(Cr);if(h>=0&&d<=h)return e.copy(s);const f=l*d-h*c;if(f<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(mi,a);Pr.subVectors(t,r);const p=mi.dot(Pr),g=gi.dot(Pr);if(g>=0&&p<=g)return e.copy(r);const v=p*c-l*g;if(v<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(n).addScaledVector(gi,o);const m=h*g-p*d;if(m<=0&&d-h>=0&&p-g>=0)return Ro.subVectors(r,s),o=(d-h)/(d-h+(p-g)),e.copy(s).addScaledVector(Ro,o);const u=1/(m+v+f);return a=v*u,o=f*u,e.copy(n).addScaledVector(mi,a).addScaledVector(gi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const ec={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ln={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Ir(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class pt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Je){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Jt.toWorkingColorSpace(this,e),this}setRGB(t,e,n,s=Jt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Jt.toWorkingColorSpace(this,s),this}setHSL(t,e,n,s=Jt.workingColorSpace){if(t=Mh(t,1),e=qt(e,0,1),n=qt(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ir(a,r,t+1/3),this.g=Ir(a,r,t),this.b=Ir(a,r,t-1/3)}return Jt.toWorkingColorSpace(this,s),this}setStyle(t,e=Je){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Je){const n=ec[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=wn(t.r),this.g=wn(t.g),this.b=wn(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Je){return Jt.fromWorkingColorSpace(Re.copy(this),t),Math.round(qt(Re.r*255,0,255))*65536+Math.round(qt(Re.g*255,0,255))*256+Math.round(qt(Re.b*255,0,255))}getHexString(t=Je){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Jt.workingColorSpace){Jt.fromWorkingColorSpace(Re.copy(this),e);const n=Re.r,s=Re.g,r=Re.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Li&&(n.blending=this.blending),this.side!==zn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Qr&&(n.blendSrc=this.blendSrc),this.blendDst!==ta&&(n.blendDst=this.blendDst),this.blendEquation!==Kn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Fi&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mo&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==oi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==oi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==oi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class ls extends Hn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pn,this.combine=Bl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const ge=new P,bs=new vt;class de{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Ba,this.updateRanges=[],this.gpuType=fn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new si);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,f=c.length;d0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],d=r[c];for(let f=0,p=d.length;f0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(Co.copy(r).invert(),Xn.copy(t.ray).applyMatrix4(Co),!(n.boundingBox!==null&&Xn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Xn)))}_computeIntersections(t,e,n){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,v=f.length;ge.far?null:{distance:c,point:Ps.clone(),object:i}}function Ds(i,t,e,n,s,r,a,o,l,c){i.getVertexPosition(o,ws),i.getVertexPosition(l,As),i.getVertexPosition(c,Rs);const h=kh(i,t,e,n,ws,As,Rs,Do);if(h){const d=new P;Qe.getBarycoord(Do,ws,As,Rs,d),s&&(h.uv=Qe.getInterpolatedAttribute(s,o,l,c,d,new vt)),r&&(h.uv1=Qe.getInterpolatedAttribute(r,o,l,c,d,new vt)),a&&(h.normal=Qe.getInterpolatedAttribute(a,o,l,c,d,new P),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new P,materialIndex:0};Qe.getNormal(ws,As,Rs,f.normal),h.face=f,h.barycoord=d}return h}class hs extends pe{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let f=0,p=0;g("z","y","x",-1,-1,n,e,t,a,r,0),g("z","y","x",1,-1,n,e,-t,a,r,1),g("x","z","y",1,1,t,n,e,s,a,2),g("x","z","y",1,-1,t,n,-e,s,a,3),g("x","y","z",1,-1,t,e,n,s,r,4),g("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(l),this.setAttribute("position",new Pe(c,3)),this.setAttribute("normal",new Pe(h,3)),this.setAttribute("uv",new Pe(d,2));function g(v,m,u,T,b,y,L,R,A,U,S){const M=y/A,D=L/U,W=y/2,z=L/2,V=R/2,$=A+1,G=U+1;let J=0,k=0;const it=new P;for(let ut=0;ut0?1:-1,h.push(it.x,it.y,it.z),d.push(Lt/A),d.push(1-ut/U),J+=1}}for(let ut=0;ut>8&255]+Ae[i>>16&255]+Ae[i>>24&255]+"-"+Ae[t&255]+Ae[t>>8&255]+"-"+Ae[t>>16&15|64]+Ae[t>>24&255]+"-"+Ae[e&63|128]+Ae[e>>8&255]+"-"+Ae[e>>16&255]+Ae[e>>24&255]+Ae[n&255]+Ae[n>>8&255]+Ae[n>>16&255]+Ae[n>>24&255]).toLowerCase()}function Yt(i,t,e){return Math.max(t,Math.min(e,i))}function Sh(i,t){return(i%t+t)%t}function _r(i,t,e){return(1-e)*i+e*t}function un(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function ae(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const yh={DEG2RAD:Ks};class vt{constructor(t=0,e=0){vt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Yt(this.x,t.x,e.x),this.y=Yt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Yt(this.x,t,e),this.y=Yt(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Yt(n,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Yt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ht{constructor(t,e,n,s,r,a,o,l,c){Ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c)}set(t,e,n,s,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],f=n[2],p=n[5],g=n[8],v=s[0],m=s[3],u=s[6],T=s[1],b=s[4],y=s[7],L=s[2],R=s[5],A=s[8];return r[0]=a*v+o*T+l*L,r[3]=a*m+o*b+l*R,r[6]=a*u+o*y+l*A,r[1]=c*v+h*T+d*L,r[4]=c*m+h*b+d*R,r[7]=c*u+h*y+d*A,r[2]=f*v+p*T+g*L,r[5]=f*m+p*b+g*R,r[8]=f*u+p*y+g*A,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*r*h+n*o*l+s*r*c-s*a*l}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=h*a-o*c,f=o*l-h*r,p=c*r-a*l,g=e*d+n*f+s*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return t[0]=d*v,t[1]=(s*c-h*n)*v,t[2]=(o*n-s*a)*v,t[3]=f*v,t[4]=(h*e-s*l)*v,t[5]=(s*r-o*e)*v,t[6]=p*v,t[7]=(n*l-c*e)*v,t[8]=(a*e-n*r)*v,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-s*c,s*l,-s*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(vr.makeScale(t,e)),this}rotate(t){return this.premultiply(vr.makeRotation(-t)),this}translate(t,e){return this.premultiply(vr.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const vr=new Ht;function $l(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function nr(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Eh(){const i=nr("canvas");return i.style.display="block",i}const _o={};function Ai(i){i in _o||(_o[i]=!0,console.warn(i))}function bh(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function Th(i){const t=i.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function wh(i){const t=i.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const vo=new Ht().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xo=new Ht().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Ah(){const i={enabled:!0,workingColorSpace:ki,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===re&&(s.r=wn(s.r),s.g=wn(s.g),s.b=wn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===re&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Fn?tr:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[ki]:{primaries:t,whitePoint:n,transfer:tr,toXYZ:vo,fromXYZ:xo,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Qe},outputColorSpaceConfig:{drawingBufferColorSpace:Qe}},[Qe]:{primaries:t,whitePoint:n,transfer:re,toXYZ:vo,fromXYZ:xo,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Qe}}}),i}const $t=Ah();function wn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let li;class Rh{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{li===void 0&&(li=nr("canvas")),li.width=t.width,li.height=t.height;const n=li.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=li}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=nr("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==zl)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ha:t.x=t.x-Math.floor(t.x);break;case Jn:t.x=t.x<0?0:1;break;case ua:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ha:t.y=t.y-Math.floor(t.y);break;case Jn:t.y=t.y<0?0:1;break;case ua:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ce.DEFAULT_IMAGE=null;Ce.DEFAULT_MAPPING=zl;Ce.DEFAULT_ANISOTROPY=1;class le{constructor(t=0,e=0,n=0,s=1){le.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r;const l=t.elements,c=l[0],h=l[4],d=l[8],f=l[1],p=l[5],g=l[9],v=l[2],m=l[6],u=l[10];if(Math.abs(h-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+p+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,y=(p+1)/2,L=(u+1)/2,R=(h+f)/4,A=(d+v)/4,U=(g+m)/4;return b>y&&b>L?b<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(b),s=R/n,r=A/n):y>L?y<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(y),n=R/s,r=U/s):L<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(L),n=A/r,s=U/r),this.set(n,s,r,e),this}let T=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-h)*(f-h));return Math.abs(T)<.001&&(T=1),this.x=(m-g)/T,this.y=(d-v)/T,this.z=(f-h)/T,this.w=Math.acos((c+p+u-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Yt(this.x,t.x,e.x),this.y=Yt(this.y,t.y,e.y),this.z=Yt(this.z,t.z,e.z),this.w=Yt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Yt(this.x,t,e),this.y=Yt(this.y,t,e),this.z=Yt(this.z,t,e),this.w=Yt(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Yt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Dh extends ii{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);const s={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ce(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,b=1-u*u;if(b>Number.EPSILON){const L=Math.sqrt(b),R=Math.atan2(L,u*T);m=Math.sin(m*R)/L,o=Math.sin(o*R)/L}const y=o*T;if(l=l*m+f*y,c=c*m+p*y,h=h*m+g*y,d=d*m+v*y,m===1-o){const L=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=L,c*=L,h*=L,d*=L}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],h=n[s+3],d=r[a],f=r[a+1],p=r[a+2],g=r[a+3];return t[e]=o*g+h*d+l*p-c*f,t[e+1]=l*g+h*f+c*d-o*p,t[e+2]=c*g+h*p+o*f-l*d,t[e+3]=h*g-o*d-l*f-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(s/2),d=o(r/2),f=l(n/2),p=l(s/2),g=l(r/2);switch(a){case"XYZ":this._x=f*h*d+c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d-f*p*g;break;case"YXZ":this._x=f*h*d+c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d+f*p*g;break;case"ZXY":this._x=f*h*d-c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d-f*p*g;break;case"ZYX":this._x=f*h*d-c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d+f*p*g;break;case"YZX":this._x=f*h*d+c*p*g,this._y=c*p*d+f*h*g,this._z=c*h*g-f*p*d,this._w=c*h*d-f*p*g;break;case"XZY":this._x=f*h*d-c*p*g,this._y=c*p*d-f*h*g,this._z=c*h*g+f*p*d,this._w=c*h*d+f*p*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-l)*p,this._y=(r-c)*p,this._z=(a-s)*p}else if(n>o&&n>d){const p=2*Math.sqrt(1+n-o-d);this._w=(h-l)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+c)/p}else if(o>d){const p=2*Math.sqrt(1+o-n-d);this._w=(r-c)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+d-n-o);this._w=(a-s)/p,this._x=(r+c)/p,this._y=(l+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Yt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+s*c-r*l,this._y=s*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-s*o,this._w=a*h-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(t=0,e=0,n=0){P.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Mo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Mo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+l*c+a*d-o*h,this.y=n+l*h+o*c-r*d,this.z=s+l*d+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Yt(this.x,t.x,e.x),this.y=Yt(this.y,t.y,e.y),this.z=Yt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Yt(this.x,t,e),this.y=Yt(this.y,t,e),this.z=Yt(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Yt(n,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Mr.copy(this).projectOnVector(t),this.sub(Mr)}reflect(t){return this.sub(Mr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Yt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Mr=new P,Mo=new ni;class si{constructor(t=new P(1/0,1/0,1/0),e=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,nn),nn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(qi),_s.subVectors(this.max,qi),ci.subVectors(t.a,qi),hi.subVectors(t.b,qi),ui.subVectors(t.c,qi),Rn.subVectors(hi,ci),Cn.subVectors(ui,hi),Gn.subVectors(ci,ui);let e=[0,-Rn.z,Rn.y,0,-Cn.z,Cn.y,0,-Gn.z,Gn.y,Rn.z,0,-Rn.x,Cn.z,0,-Cn.x,Gn.z,0,-Gn.x,-Rn.y,Rn.x,0,-Cn.y,Cn.x,0,-Gn.y,Gn.x,0];return!Sr(e,ci,hi,ui,_s)||(e=[1,0,0,0,1,0,0,0,1],!Sr(e,ci,hi,ui,_s))?!1:(vs.crossVectors(Rn,Cn),e=[vs.x,vs.y,vs.z],Sr(e,ci,hi,ui,_s))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,nn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(nn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(gn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gn=[new P,new P,new P,new P,new P,new P,new P,new P],nn=new P,gs=new si,ci=new P,hi=new P,ui=new P,Rn=new P,Cn=new P,Gn=new P,qi=new P,_s=new P,vs=new P,Wn=new P;function Sr(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){Wn.fromArray(i,r);const o=s.x*Math.abs(Wn.x)+s.y*Math.abs(Wn.y)+s.z*Math.abs(Wn.z),l=t.dot(Wn),c=e.dot(Wn),h=n.dot(Wn);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Uh=new si,ji=new P,yr=new P;class ri{constructor(t=new P,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Uh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ji.subVectors(t,this.center);const e=ji.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(ji,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(yr.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ji.copy(t.center).add(yr)),this.expandByPoint(ji.copy(t.center).sub(yr))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _n=new P,Er=new P,xs=new P,Pn=new P,br=new P,Ms=new P,Tr=new P;class cs{constructor(t=new P,e=new P(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,_n)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=_n.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(_n.copy(this.origin).addScaledVector(this.direction,e),_n.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){Er.copy(t).add(e).multiplyScalar(.5),xs.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(Er);const r=t.distanceTo(e)*.5,a=-this.direction.dot(xs),o=Pn.dot(this.direction),l=-Pn.dot(xs),c=Pn.lengthSq(),h=Math.abs(1-a*a);let d,f,p,g;if(h>0)if(d=a*l-o,f=a*o-l,g=r*h,d>=0)if(f>=-g)if(f<=g){const v=1/h;d*=v,f*=v,p=d*(d+a*f+2*o)+f*(a*d+f+2*l)+c}else f=r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;else f=-r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-l),r),p=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-r,-l),r),p=f*(f+2*l)+c):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-l),r),p=-d*d+f*(f+2*l)+c);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(Er).addScaledVector(xs,f),p}intersectSphere(t,e){_n.subVectors(t.center,this.origin);const n=_n.dot(this.direction),s=_n.dot(_n)-n*n,r=t.radius*t.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,s=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,s=(t.min.x-f.x)*c),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,l=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,l=(t.min.z-f.z)*d),n>l||o>s)||((o>n||n!==n)&&(n=o),(l=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,_n)!==null}intersectTriangle(t,e,n,s,r){br.subVectors(e,t),Ms.subVectors(n,t),Tr.crossVectors(br,Ms);let a=this.direction.dot(Tr),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);const l=o*this.direction.dot(Ms.crossVectors(Pn,Ms));if(l<0)return null;const c=o*this.direction.dot(br.cross(Pn));if(c<0||l+c>a)return null;const h=-o*Pn.dot(Tr);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ee{constructor(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m){ee.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m)}set(t,e,n,s,r,a,o,l,c,h,d,f,p,g,v,m){const u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=l,u[2]=c,u[6]=h,u[10]=d,u[14]=f,u[3]=p,u[7]=g,u[11]=v,u[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 ee().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,s=1/di.setFromMatrixColumn(t,0).length(),r=1/di.setFromMatrixColumn(t,1).length(),a=1/di.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){const f=a*h,p=a*d,g=o*h,v=o*d;e[0]=l*h,e[4]=-l*d,e[8]=c,e[1]=p+g*c,e[5]=f-v*c,e[9]=-o*l,e[2]=v-f*c,e[6]=g+p*c,e[10]=a*l}else if(t.order==="YXZ"){const f=l*h,p=l*d,g=c*h,v=c*d;e[0]=f+v*o,e[4]=g*o-p,e[8]=a*c,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=p*o-g,e[6]=v+f*o,e[10]=a*l}else if(t.order==="ZXY"){const f=l*h,p=l*d,g=c*h,v=c*d;e[0]=f-v*o,e[4]=-a*d,e[8]=g+p*o,e[1]=p+g*o,e[5]=a*h,e[9]=v-f*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const f=a*h,p=a*d,g=o*h,v=o*d;e[0]=l*h,e[4]=g*c-p,e[8]=f*c+v,e[1]=l*d,e[5]=v*c+f,e[9]=p*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const f=a*l,p=a*c,g=o*l,v=o*c;e[0]=l*h,e[4]=v-f*d,e[8]=g*d+p,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=p*d+g,e[10]=f-v*d}else if(t.order==="XZY"){const f=a*l,p=a*c,g=o*l,v=o*c;e[0]=l*h,e[4]=-d,e[8]=c*h,e[1]=f*d+v,e[5]=a*h,e[9]=p*d-g,e[2]=g*d-p,e[6]=o*h,e[10]=v*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Ih,t,Nh)}lookAt(t,e,n){const s=this.elements;return We.subVectors(t,e),We.lengthSq()===0&&(We.z=1),We.normalize(),Dn.crossVectors(n,We),Dn.lengthSq()===0&&(Math.abs(n.z)===1?We.x+=1e-4:We.z+=1e-4,We.normalize(),Dn.crossVectors(n,We)),Dn.normalize(),Ss.crossVectors(We,Dn),s[0]=Dn.x,s[4]=Ss.x,s[8]=We.x,s[1]=Dn.y,s[5]=Ss.y,s[9]=We.y,s[2]=Dn.z,s[6]=Ss.z,s[10]=We.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],f=n[9],p=n[13],g=n[2],v=n[6],m=n[10],u=n[14],T=n[3],b=n[7],y=n[11],L=n[15],R=s[0],A=s[4],U=s[8],S=s[12],M=s[1],D=s[5],W=s[9],z=s[13],V=s[2],$=s[6],G=s[10],J=s[14],k=s[3],it=s[7],ut=s[11],yt=s[15];return r[0]=a*R+o*M+l*V+c*k,r[4]=a*A+o*D+l*$+c*it,r[8]=a*U+o*W+l*G+c*ut,r[12]=a*S+o*z+l*J+c*yt,r[1]=h*R+d*M+f*V+p*k,r[5]=h*A+d*D+f*$+p*it,r[9]=h*U+d*W+f*G+p*ut,r[13]=h*S+d*z+f*J+p*yt,r[2]=g*R+v*M+m*V+u*k,r[6]=g*A+v*D+m*$+u*it,r[10]=g*U+v*W+m*G+u*ut,r[14]=g*S+v*z+m*J+u*yt,r[3]=T*R+b*M+y*V+L*k,r[7]=T*A+b*D+y*$+L*it,r[11]=T*U+b*W+y*G+L*ut,r[15]=T*S+b*z+y*J+L*yt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],d=t[6],f=t[10],p=t[14],g=t[3],v=t[7],m=t[11],u=t[15];return g*(+r*l*d-s*c*d-r*o*f+n*c*f+s*o*p-n*l*p)+v*(+e*l*p-e*c*f+r*a*f-s*a*p+s*c*h-r*l*h)+m*(+e*c*d-e*o*p-r*a*d+n*a*p+r*o*h-n*c*h)+u*(-s*o*h-e*l*d+e*o*f+s*a*d-n*a*f+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],g=t[12],v=t[13],m=t[14],u=t[15],T=d*m*c-v*f*c+v*l*p-o*m*p-d*l*u+o*f*u,b=g*f*c-h*m*c-g*l*p+a*m*p+h*l*u-a*f*u,y=h*v*c-g*d*c+g*o*p-a*v*p-h*o*u+a*d*u,L=g*d*l-h*v*l-g*o*f+a*v*f+h*o*m-a*d*m,R=e*T+n*b+s*y+r*L;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/R;return t[0]=T*A,t[1]=(v*f*r-d*m*r-v*s*p+n*m*p+d*s*u-n*f*u)*A,t[2]=(o*m*r-v*l*r+v*s*c-n*m*c-o*s*u+n*l*u)*A,t[3]=(d*l*r-o*f*r-d*s*c+n*f*c+o*s*p-n*l*p)*A,t[4]=b*A,t[5]=(h*m*r-g*f*r+g*s*p-e*m*p-h*s*u+e*f*u)*A,t[6]=(g*l*r-a*m*r-g*s*c+e*m*c+a*s*u-e*l*u)*A,t[7]=(a*f*r-h*l*r+h*s*c-e*f*c-a*s*p+e*l*p)*A,t[8]=y*A,t[9]=(g*d*r-h*v*r-g*n*p+e*v*p+h*n*u-e*d*u)*A,t[10]=(a*v*r-g*o*r+g*n*c-e*v*c-a*n*u+e*o*u)*A,t[11]=(h*o*r-a*d*r-h*n*c+e*d*c+a*n*p-e*o*p)*A,t[12]=L*A,t[13]=(h*v*s-g*d*s+g*n*f-e*v*f-h*n*m+e*d*m)*A,t[14]=(g*o*s-a*v*s-g*n*l+e*v*l+a*n*m-e*o*m)*A,t[15]=(a*d*s-h*o*s+h*n*l-e*d*l-a*n*f+e*o*f)*A,this}scale(t){const e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,h*o+n,h*l-s*a,0,c*l-s*o,h*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){const s=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,d=o+o,f=r*c,p=r*h,g=r*d,v=a*h,m=a*d,u=o*d,T=l*c,b=l*h,y=l*d,L=n.x,R=n.y,A=n.z;return s[0]=(1-(v+u))*L,s[1]=(p+y)*L,s[2]=(g-b)*L,s[3]=0,s[4]=(p-y)*R,s[5]=(1-(f+u))*R,s[6]=(m+T)*R,s[7]=0,s[8]=(g+b)*A,s[9]=(m-T)*A,s[10]=(1-(f+v))*A,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){const s=this.elements;let r=di.set(s[0],s[1],s[2]).length();const a=di.set(s[4],s[5],s[6]).length(),o=di.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],sn.copy(this);const c=1/r,h=1/a,d=1/o;return sn.elements[0]*=c,sn.elements[1]*=c,sn.elements[2]*=c,sn.elements[4]*=h,sn.elements[5]*=h,sn.elements[6]*=h,sn.elements[8]*=d,sn.elements[9]*=d,sn.elements[10]*=d,e.setFromRotationMatrix(sn),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=En){const l=this.elements,c=2*r/(e-t),h=2*r/(n-s),d=(e+t)/(e-t),f=(n+s)/(n-s);let p,g;if(o===En)p=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===er)p=-a/(a-r),g=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=En){const l=this.elements,c=1/(e-t),h=1/(n-s),d=1/(a-r),f=(e+t)*c,p=(n+s)*h;let g,v;if(o===En)g=(a+r)*d,v=-2*d;else if(o===er)g=r*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const di=new P,sn=new ee,Ih=new P(0,0,0),Nh=new P(1,1,1),Dn=new P,Ss=new P,We=new P,So=new ee,yo=new ni;class pn{constructor(t=0,e=0,n=0,s=pn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const s=t.elements,r=s[0],a=s[4],o=s[8],l=s[1],c=s[5],h=s[9],d=s[2],f=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(Yt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Yt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(Yt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Yt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Yt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-Yt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return So.makeRotationFromQuaternion(t),this.setFromRotationMatrix(So,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return yo.setFromEuler(this),this.setFromQuaternion(yo,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pn.DEFAULT_ORDER="XYZ";class Qa{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),g.length>0&&(n.nodes=g)}return n.object=s,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){rn.subVectors(s,e),xn.subVectors(n,e),Ar.subVectors(t,e);const a=rn.dot(rn),o=rn.dot(xn),l=rn.dot(Ar),c=xn.dot(xn),h=xn.dot(Ar),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const f=1/d,p=(c*l-o*h)*f,g=(a*h-o*l)*f;return r.set(1-p-g,g,p)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,Mn)===null?!1:Mn.x>=0&&Mn.y>=0&&Mn.x+Mn.y<=1}static getInterpolation(t,e,n,s,r,a,o,l){return this.getBarycoord(t,e,n,s,Mn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Mn.x),l.addScaledVector(a,Mn.y),l.addScaledVector(o,Mn.z),l)}static getInterpolatedAttribute(t,e,n,s,r,a){return Dr.setScalar(0),Lr.setScalar(0),Ur.setScalar(0),Dr.fromBufferAttribute(t,e),Lr.fromBufferAttribute(t,n),Ur.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Dr,r.x),a.addScaledVector(Lr,r.y),a.addScaledVector(Ur,r.z),a}static isFrontFacing(t,e,n,s){return rn.subVectors(n,e),xn.subVectors(t,e),rn.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return rn.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),rn.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return tn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return tn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return tn.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return tn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return tn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,s=this.b,r=this.c;let a,o;mi.subVectors(s,n),gi.subVectors(r,n),Rr.subVectors(t,n);const l=mi.dot(Rr),c=gi.dot(Rr);if(l<=0&&c<=0)return e.copy(n);Cr.subVectors(t,s);const h=mi.dot(Cr),d=gi.dot(Cr);if(h>=0&&d<=h)return e.copy(s);const f=l*d-h*c;if(f<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(mi,a);Pr.subVectors(t,r);const p=mi.dot(Pr),g=gi.dot(Pr);if(g>=0&&p<=g)return e.copy(r);const v=p*c-l*g;if(v<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(n).addScaledVector(gi,o);const m=h*g-p*d;if(m<=0&&d-h>=0&&p-g>=0)return Ro.subVectors(r,s),o=(d-h)/(d-h+(p-g)),e.copy(s).addScaledVector(Ro,o);const u=1/(m+v+f);return a=v*u,o=f*u,e.copy(n).addScaledVector(mi,a).addScaledVector(gi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const tc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ln={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Ir(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class pt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Qe){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,$t.toWorkingColorSpace(this,e),this}setRGB(t,e,n,s=$t.workingColorSpace){return this.r=t,this.g=e,this.b=n,$t.toWorkingColorSpace(this,s),this}setHSL(t,e,n,s=$t.workingColorSpace){if(t=Sh(t,1),e=Yt(e,0,1),n=Yt(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ir(a,r,t+1/3),this.g=Ir(a,r,t),this.b=Ir(a,r,t-1/3)}return $t.toWorkingColorSpace(this,s),this}setStyle(t,e=Qe){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Qe){const n=tc[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=wn(t.r),this.g=wn(t.g),this.b=wn(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Qe){return $t.fromWorkingColorSpace(Re.copy(this),t),Math.round(Yt(Re.r*255,0,255))*65536+Math.round(Yt(Re.g*255,0,255))*256+Math.round(Yt(Re.b*255,0,255))}getHexString(t=Qe){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$t.workingColorSpace){$t.fromWorkingColorSpace(Re.copy(this),e);const n=Re.r,s=Re.g,r=Re.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Li&&(n.blending=this.blending),this.side!==zn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Qr&&(n.blendSrc=this.blendSrc),this.blendDst!==ta&&(n.blendDst=this.blendDst),this.blendEquation!==Kn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Fi&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mo&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==oi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==oi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==oi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class ls extends Hn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pn,this.combine=Ol,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const ge=new P,bs=new vt;class de{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Ba,this.updateRanges=[],this.gpuType=fn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new si);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,f=c.length;d0&&(s[l]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const s=t.attributes;for(const c in s){const h=s[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],d=r[c];for(let f=0,p=d.length;f0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(Co.copy(r).invert(),Xn.copy(t.ray).applyMatrix4(Co),!(n.boundingBox!==null&&Xn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Xn)))}_computeIntersections(t,e,n){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,v=f.length;ge.far?null:{distance:c,point:Ps.clone(),object:i}}function Ds(i,t,e,n,s,r,a,o,l,c){i.getVertexPosition(o,ws),i.getVertexPosition(l,As),i.getVertexPosition(c,Rs);const h=Vh(i,t,e,n,ws,As,Rs,Do);if(h){const d=new P;tn.getBarycoord(Do,ws,As,Rs,d),s&&(h.uv=tn.getInterpolatedAttribute(s,o,l,c,d,new vt)),r&&(h.uv1=tn.getInterpolatedAttribute(r,o,l,c,d,new vt)),a&&(h.normal=tn.getInterpolatedAttribute(a,o,l,c,d,new P),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new P,materialIndex:0};tn.getNormal(ws,As,Rs,f.normal),h.face=f,h.barycoord=d}return h}class hs extends pe{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let f=0,p=0;g("z","y","x",-1,-1,n,e,t,a,r,0),g("z","y","x",1,-1,n,e,-t,a,r,1),g("x","z","y",1,1,t,n,e,s,a,2),g("x","z","y",1,-1,t,n,-e,s,a,3),g("x","y","z",1,-1,t,e,n,s,r,4),g("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(l),this.setAttribute("position",new Pe(c,3)),this.setAttribute("normal",new Pe(h,3)),this.setAttribute("uv",new Pe(d,2));function g(v,m,u,T,b,y,L,R,A,U,S){const M=y/A,D=L/U,W=y/2,z=L/2,V=R/2,$=A+1,G=U+1;let J=0,k=0;const it=new P;for(let ut=0;ut0?1:-1,h.push(it.x,it.y,it.z),d.push(Lt/A),d.push(1-ut/U),J+=1}}for(let ut=0;ut0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class rc extends we{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ne,this.projectionMatrix=new ne,this.projectionMatrixInverse=new ne,this.coordinateSystem=En}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Un=new P,Lo=new vt,Uo=new vt;class Xe extends rc{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=za*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Ks*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return za*2*Math.atan(Math.tan(Ks*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Lo,Uo),e.subVectors(Uo,Lo)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Ks*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*n/c,s*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const vi=-90,xi=1;class Xh extends we{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Xe(vi,xi,t,e);s.layers=this.layers,this.add(s);const r=new Xe(vi,xi,t,e);r.layers=this.layers,this.add(r);const a=new Xe(vi,xi,t,e);a.layers=this.layers,this.add(a);const o=new Xe(vi,xi,t,e);o.layers=this.layers,this.add(o);const l=new Xe(vi,xi,t,e);l.layers=this.layers,this.add(l);const c=new Xe(vi,xi,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===En)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===er)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const v=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,l),t.setRenderTarget(n,4,s),t.render(e,c),n.texture.generateMipmaps=v,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,p),t.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class ac extends Ce{constructor(t,e,n,s,r,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Oi,super(t,e,n,s,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Yh extends on{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new ac(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:dn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Ne extends Hn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Wh,this.fragmentShader=Xh,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Vi(t.uniforms),this.uniformsGroups=Gh(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const s in this.uniforms){const a=this.uniforms[s].value;a&&a.isTexture?e.uniforms[s]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[s]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[s]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[s]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[s]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[s]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[s]={type:"m4",value:a.toArray()}:e.uniforms[s]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class sc extends we{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ee,this.projectionMatrix=new ee,this.projectionMatrixInverse=new ee,this.coordinateSystem=En}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Un=new P,Lo=new vt,Uo=new vt;class Ye extends sc{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=za*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Ks*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return za*2*Math.atan(Math.tan(Ks*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Lo,Uo),e.subVectors(Uo,Lo)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Ks*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,e-=a.offsetY*n/c,s*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const vi=-90,xi=1;class Yh extends we{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Ye(vi,xi,t,e);s.layers=this.layers,this.add(s);const r=new Ye(vi,xi,t,e);r.layers=this.layers,this.add(r);const a=new Ye(vi,xi,t,e);a.layers=this.layers,this.add(a);const o=new Ye(vi,xi,t,e);o.layers=this.layers,this.add(o);const l=new Ye(vi,xi,t,e);l.layers=this.layers,this.add(l);const c=new Ye(vi,xi,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===En)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===er)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const v=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,l),t.setRenderTarget(n,4,s),t.render(e,c),n.texture.generateMipmaps=v,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,p),t.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class rc extends Ce{constructor(t,e,n,s,r,a,o,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Oi,super(t,e,n,s,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class qh extends on{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new rc(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:dn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -41,13 +41,13 @@ var Tc=Object.defineProperty;var wc=(i,t,e)=>t in i?Tc(i,t,{enumerable:!0,config gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new hs(5,5,5),r=new Ne({name:"CubemapFromEquirect",uniforms:Vi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:He,blending:bn});r.uniforms.tEquirect.value=e;const a=new Me(s,r),o=e.minFilter;return e.minFilter===Qn&&(e.minFilter=dn),new Xh(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,s){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}}class ur{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new pt(t),this.density=e}clone(){return new ur(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class qh extends we{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pn,this.environmentIntensity=1,this.environmentRotation=new pn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class jh{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ba,this.updateRanges=[],this.version=0,this.uuid=Bn()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:$i.clone(),uv:Qe.getInterpolation($i,Ls,Qi,Us,Io,Or,No,new vt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Is(i,t,e,n,s,r){Ei.subVectors(i,e).addScalar(.5).multiply(n),s!==void 0?(Ji.x=r*Ei.x-s*Ei.y,Ji.y=s*Ei.x+r*Ei.y):Ji.copy(Ei),i.copy(t),i.x+=Ji.x,i.y+=Ji.y,i.applyMatrix4(oc)}class Zh extends Ce{constructor(t=null,e=1,n=1,s,r,a,o,l,c=Ye,h=Ye,d,f){super(null,a,o,l,c,h,s,r,d,f),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Fo extends de{constructor(t,e,n,s=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const bi=new ne,Oo=new ne,Ns=[],Bo=new si,Kh=new ne,ts=new Me,es=new ri;class $h extends Me{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Fo(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Qh.getNormalMatrix(t),s=this.coplanarPoint(zr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yn=new ri,Fs=new P;class to{constructor(t=new Nn,e=new Nn,n=new Nn,s=new Nn,r=new Nn,a=new Nn){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=En){const n=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],h=s[5],d=s[6],f=s[7],p=s[8],g=s[9],v=s[10],m=s[11],u=s[12],T=s[13],b=s[14],y=s[15];if(n[0].setComponents(l-r,f-c,m-p,y-u).normalize(),n[1].setComponents(l+r,f+c,m+p,y+u).normalize(),n[2].setComponents(l+a,f+h,m+g,y+T).normalize(),n[3].setComponents(l-a,f-h,m-g,y-T).normalize(),n[4].setComponents(l-o,f-d,m-v,y-b).normalize(),e===En)n[5].setComponents(l+o,f+d,m+v,y+b).normalize();else if(e===er)n[5].setComponents(o,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Yn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Yn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Yn)}intersectsSprite(t){return Yn.center.set(0,0,0),Yn.radius=.7071067811865476,Yn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Yn)}intersectsSphere(t){const e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Fs.y=s.normal.y>0?t.max.y:t.min.y,Fs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Fs)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class rr extends Hn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new pt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ar=new P,or=new P,zo=new ne,ns=new cs,Os=new ri,Hr=new P,Ho=new P;class ka extends we{constructor(t=new pe,e=new rr){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;Hr.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(Hr);if(!(lt.far))return{distance:l,point:Ho.clone().applyMatrix4(i.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:i}}class Ni extends Hn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new pt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const ko=new ne,Va=new cs,zs=new ri,Hs=new P;class rs extends we{constructor(t=new pe,e=new Ni){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,s=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),zs.copy(n.boundingSphere),zs.applyMatrix4(s),zs.radius+=r,t.ray.intersectsSphere(zs)===!1)return;ko.copy(s).invert(),Va.copy(t.ray).applyMatrix4(ko);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let g=f,v=p;g0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Ci extends we{constructor(){super(),this.isGroup=!0,this.type="Group"}}class tu extends Ce{constructor(t,e,n,s,r,a,o,l,c){super(t,e,n,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class lc extends Ce{constructor(t,e,n,s,r,a,o,l,c,h=Ui){if(h!==Ui&&h!==Hi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ui&&(n=ei),n===void 0&&h===Hi&&(n=zi),super(null,s,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:Ye,this.minFilter=l!==void 0?l:Ye,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class us extends pe{constructor(t=1,e=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:s};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(s),c=o+1,h=l+1,d=t/o,f=e/l,p=[],g=[],v=[],m=[];for(let u=0;u0)&&p.push(b,y,R),(u!==n-1||l0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Zh{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ba,this.updateRanges=[],this.version=0,this.uuid=Bn()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:l,point:$i.clone(),uv:tn.getInterpolation($i,Ls,Qi,Us,Io,Or,No,new vt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Is(i,t,e,n,s,r){Ei.subVectors(i,e).addScalar(.5).multiply(n),s!==void 0?(Ji.x=r*Ei.x-s*Ei.y,Ji.y=s*Ei.x+r*Ei.y):Ji.copy(Ei),i.copy(t),i.x+=Ji.x,i.y+=Ji.y,i.applyMatrix4(ac)}class Kh extends Ce{constructor(t=null,e=1,n=1,s,r,a,o,l,c=qe,h=qe,d,f){super(null,a,o,l,c,h,s,r,d,f),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Fo extends de{constructor(t,e,n,s=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const bi=new ee,Oo=new ee,Ns=[],Bo=new si,$h=new ee,ts=new Se,es=new ri;class Jh extends Se{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Fo(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||tu.getNormalMatrix(t),s=this.coplanarPoint(zr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yn=new ri,Fs=new P;class to{constructor(t=new Nn,e=new Nn,n=new Nn,s=new Nn,r=new Nn,a=new Nn){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=En){const n=this.planes,s=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],h=s[5],d=s[6],f=s[7],p=s[8],g=s[9],v=s[10],m=s[11],u=s[12],T=s[13],b=s[14],y=s[15];if(n[0].setComponents(l-r,f-c,m-p,y-u).normalize(),n[1].setComponents(l+r,f+c,m+p,y+u).normalize(),n[2].setComponents(l+a,f+h,m+g,y+T).normalize(),n[3].setComponents(l-a,f-h,m-g,y-T).normalize(),n[4].setComponents(l-o,f-d,m-v,y-b).normalize(),e===En)n[5].setComponents(l+o,f+d,m+v,y+b).normalize();else if(e===er)n[5].setComponents(o,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Yn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Yn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Yn)}intersectsSprite(t){return Yn.center.set(0,0,0),Yn.radius=.7071067811865476,Yn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Yn)}intersectsSphere(t){const e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Fs.y=s.normal.y>0?t.max.y:t.min.y,Fs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Fs)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class rr extends Hn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new pt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ar=new P,or=new P,zo=new ee,ns=new cs,Os=new ri,Hr=new P,Ho=new P;class ka extends we{constructor(t=new pe,e=new rr){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;Hr.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(Hr);if(!(lt.far))return{distance:l,point:Ho.clone().applyMatrix4(i.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:i}}class Ni extends Hn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new pt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const ko=new ee,Va=new cs,zs=new ri,Hs=new P;class rs extends we{constructor(t=new pe,e=new Ni){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,s=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),zs.copy(n.boundingSphere),zs.applyMatrix4(s),zs.radius+=r,t.ray.intersectsSphere(zs)===!1)return;ko.copy(s).invert(),Va.copy(t.ray).applyMatrix4(ko);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let g=f,v=p;g0){const s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Ci extends we{constructor(){super(),this.isGroup=!0,this.type="Group"}}class eu extends Ce{constructor(t,e,n,s,r,a,o,l,c){super(t,e,n,s,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class oc extends Ce{constructor(t,e,n,s,r,a,o,l,c,h=Ui){if(h!==Ui&&h!==Hi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ui&&(n=ei),n===void 0&&h===Hi&&(n=zi),super(null,s,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:qe,this.minFilter=l!==void 0?l:qe,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class us extends pe{constructor(t=1,e=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:s};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(s),c=o+1,h=l+1,d=t/o,f=e/l,p=[],g=[],v=[],m=[];for(let u=0;u0)&&p.push(b,y,R),(u!==n-1||lp.start-g.start);let f=0;for(let p=1;pp.start-g.start);let f=0;for(let p=1;pt in i?Tc(i,t,{enumerable:!0,config : cases.z; return clamp( threshold , 1.0e-6, 1.0 ); } -#endif`,mu=`#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; #endif`,gu=`#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; +#endif`,_u=`#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,_u=`#ifdef USE_ALPHATEST +#endif`,vu=`#ifdef USE_ALPHATEST #ifdef ALPHA_TO_COVERAGE diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); if ( diffuseColor.a == 0.0 ) discard; #else if ( diffuseColor.a < alphaTest ) discard; #endif -#endif`,vu=`#ifdef USE_ALPHATEST +#endif`,xu=`#ifdef USE_ALPHATEST uniform float alphaTest; -#endif`,xu=`#ifdef USE_AOMAP +#endif`,Mu=`#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) @@ -108,10 +108,10 @@ var Tc=Object.defineProperty;var wc=(i,t,e)=>t in i?Tc(i,t,{enumerable:!0,config float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); #endif -#endif`,Mu=`#ifdef USE_AOMAP +#endif`,Su=`#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; -#endif`,Su=`#ifdef USE_BATCHING +#endif`,yu=`#ifdef USE_BATCHING #if ! defined( GL_ANGLE_multi_draw ) #define gl_DrawID _gl_DrawID uniform int _gl_DrawID; @@ -145,15 +145,15 @@ var Tc=Object.defineProperty;var wc=(i,t,e)=>t in i?Tc(i,t,{enumerable:!0,config int y = j / size; return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; } -#endif`,yu=`#ifdef USE_BATCHING +#endif`,Eu=`#ifdef USE_BATCHING mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); -#endif`,Eu=`vec3 transformed = vec3( position ); +#endif`,bu=`vec3 transformed = vec3( position ); #ifdef USE_ALPHAHASH vPosition = vec3( position ); -#endif`,bu=`vec3 objectNormal = vec3( normal ); +#endif`,Tu=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); -#endif`,Tu=`float G_BlinnPhong_Implicit( ) { +#endif`,wu=`float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { @@ -167,7 +167,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); -} // validated`,wu=`#ifdef USE_IRIDESCENCE +} // validated`,Au=`#ifdef USE_IRIDESCENCE const mat3 XYZ_TO_REC709 = mat3( 3.2404542, -0.9692660, 0.0556434, -1.5371385, 1.8760108, -0.2040259, @@ -230,7 +230,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve } return max( I, vec3( 0.0 ) ); } -#endif`,Au=`#ifdef USE_BUMPMAP +#endif`,Ru=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -251,7 +251,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } -#endif`,Ru=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Cu=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -297,26 +297,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,Cu=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,Pu=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,Du=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Lu=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Lu=`#if defined( USE_COLOR_ALPHA ) +#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) +#endif`,Iu=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Iu=`#if defined( USE_COLOR_ALPHA ) +#endif`,Nu=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,Nu=`#if defined( USE_COLOR_ALPHA ) +#endif`,Fu=`#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 ); @@ -330,7 +330,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,Fu=`#define PI 3.141592653589793 +#endif`,Ou=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -404,7 +404,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 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`,Ou=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,Bu=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -497,7 +497,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Bu=`vec3 transformedNormal = objectNormal; +#endif`,zu=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -526,21 +526,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,zu=`#ifdef USE_DISPLACEMENTMAP +#endif`,Hu=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Hu=`#ifdef USE_DISPLACEMENTMAP +#endif`,ku=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,ku=`#ifdef USE_EMISSIVEMAP +#endif`,Vu=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Vu=`#ifdef USE_EMISSIVEMAP +#endif`,Gu=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,Gu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Wu=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,Wu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xu=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -548,7 +548,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } 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 ); -}`,Xu=`#ifdef USE_ENVMAP +}`,Yu=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -577,7 +577,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,Yu=`#ifdef USE_ENVMAP +#endif`,qu=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -587,7 +587,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,qu=`#ifdef USE_ENVMAP +#endif`,ju=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -598,7 +598,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,ju=`#ifdef USE_ENVMAP +#endif`,Zu=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -609,7 +609,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Zu=`#ifdef USE_ENVMAP +#endif`,Ku=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -626,18 +626,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Ku=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; #endif`,$u=`#ifdef USE_FOG - varying float vFogDepth; + vFogDepth = - mvPosition.z; #endif`,Ju=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Qu=`#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`,Qu=`#ifdef USE_FOG +#endif`,td=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -646,7 +646,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,td=`#ifdef USE_GRADIENTMAP +#endif`,ed=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -658,12 +658,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 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 -}`,ed=`#ifdef USE_LIGHTMAP +}`,nd=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,nd=`LambertMaterial material; +#endif`,id=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,id=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,sd=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -677,7 +677,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,sd=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,rd=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -793,7 +793,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,rd=`#ifdef USE_ENVMAP +#endif`,ad=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -826,8 +826,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,ad=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,od=`varying vec3 vViewPosition; +#endif`,od=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ld=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -839,11 +839,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,ld=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cd=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,cd=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,hd=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -860,7 +860,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,hd=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,ud=`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 ); @@ -946,7 +946,7 @@ material.roughness = min( material.roughness, 1.0 ); 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`,ud=`struct PhysicalMaterial { +#endif`,dd=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1247,7 +1247,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #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 ); -}`,dd=` +}`,fd=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1362,7 +1362,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,fd=`#if defined( RE_IndirectDiffuse ) +#endif`,pd=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1381,32 +1381,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,pd=`#if defined( RE_IndirectDiffuse ) +#endif`,md=`#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`,md=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,gd=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,_d=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,_d=`#ifdef USE_LOGDEPTHBUF +#endif`,vd=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,vd=`#ifdef USE_LOGDEPTHBUF +#endif`,xd=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,xd=`#ifdef USE_MAP +#endif`,Md=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Md=`#ifdef USE_MAP +#endif`,Sd=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Sd=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,yd=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1418,7 +1418,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,yd=`#if defined( USE_POINTS_UV ) +#endif`,Ed=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1430,19 +1430,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Ed=`float metalnessFactor = metalness; +#endif`,bd=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,bd=`#ifdef USE_METALNESSMAP +#endif`,Td=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Td=`#ifdef USE_INSTANCING_MORPH +#endif`,wd=`#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`,wd=`#if defined( USE_MORPHCOLORS ) +#endif`,Ad=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1451,12 +1451,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Ad=`#ifdef USE_MORPHNORMALS +#endif`,Rd=`#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`,Rd=`#ifdef USE_MORPHTARGETS +#endif`,Cd=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1470,12 +1470,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,Cd=`#ifdef USE_MORPHTARGETS +#endif`,Pd=`#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`,Pd=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Dd=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1516,7 +1516,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,Ld=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1531,12 +1531,6 @@ vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,Ld=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,Ud=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT @@ -1544,12 +1538,18 @@ vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE varying vec3 vBitangent; #endif #endif`,Id=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Nd=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,Nd=`#ifdef USE_NORMALMAP +#endif`,Fd=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1571,13 +1571,13 @@ vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,Fd=`#ifdef USE_CLEARCOAT +#endif`,Od=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,Od=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Bd=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Bd=`#ifdef USE_CLEARCOATMAP +#endif`,zd=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1586,18 +1586,18 @@ vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,zd=`#ifdef USE_IRIDESCENCEMAP +#endif`,Hd=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Hd=`#ifdef OPAQUE +#endif`,kd=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kd=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Vd=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1666,9 +1666,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Vd=`#ifdef PREMULTIPLIED_ALPHA +}`,Gd=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Gd=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,Wd=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1676,22 +1676,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,Xd=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Xd=`#ifdef DITHERING +#endif`,Yd=`#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`,Yd=`float roughnessFactor = roughness; +#endif`,qd=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,qd=`#ifdef USE_ROUGHNESSMAP +#endif`,jd=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,jd=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Zd=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1877,7 +1877,7 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,Zd=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Kd=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1918,7 +1918,7 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,Kd=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,$d=`#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 @@ -1950,7 +1950,7 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,$d=`float getShadowMask() { +#endif`,Jd=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -1982,12 +1982,12 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING #endif #endif return shadow; -}`,Jd=`#ifdef USE_SKINNING +}`,Qd=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Qd=`#ifdef USE_SKINNING +#endif`,tf=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2002,7 +2002,7 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,tf=`#ifdef USE_SKINNING +#endif`,ef=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2010,7 +2010,7 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,ef=`#ifdef USE_SKINNING +#endif`,nf=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2021,17 +2021,17 @@ gl_Position = projectionMatrix * mvPosition;`,Wd=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,nf=`float specularStrength; +#endif`,sf=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,sf=`#ifdef USE_SPECULARMAP +#endif`,rf=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,rf=`#if defined( TONE_MAPPING ) +#endif`,af=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,af=`#ifndef saturate +#endif`,of=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2128,7 +2128,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,lf=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2149,7 +2149,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,lf=`#ifdef USE_TRANSMISSION +#endif`,cf=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2275,7 +2275,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,cf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,hf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2345,7 +2345,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,hf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,uf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2439,7 +2439,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,uf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,df=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2510,7 +2510,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,df=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,ff=`#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; @@ -2519,12 +2519,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,of=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const ff=`varying vec2 vUv; +#endif`;const pf=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,pf=`uniform sampler2D t2D; +}`,mf=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2536,14 +2536,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,mf=`varying vec3 vWorldDirection; +}`,gf=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,gf=`#ifdef ENVMAP_TYPE_CUBE +}`,_f=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2566,14 +2566,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,_f=`varying vec3 vWorldDirection; +}`,vf=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,vf=`uniform samplerCube tCube; +}`,xf=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2583,7 +2583,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,xf=`#include +}`,Mf=`#include #include #include #include @@ -2610,7 +2610,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,Mf=`#if DEPTH_PACKING == 3200 +}`,Sf=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2644,7 +2644,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,Sf=`#define DISTANCE +}`,yf=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2671,7 +2671,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,yf=`#define DISTANCE +}`,Ef=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2695,13 +2695,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Ef=`varying vec3 vWorldDirection; +}`,bf=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,bf=`uniform sampler2D tEquirect; +}`,Tf=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2710,7 +2710,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Tf=`uniform float scale; +}`,wf=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2732,7 +2732,7 @@ void main() { #include #include #include -}`,wf=`uniform vec3 diffuse; +}`,Af=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2760,7 +2760,7 @@ void main() { #include #include #include -}`,Af=`#include +}`,Rf=`#include #include #include #include @@ -2792,7 +2792,7 @@ void main() { #include #include #include -}`,Rf=`uniform vec3 diffuse; +}`,Cf=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2840,7 +2840,7 @@ void main() { #include #include #include -}`,Cf=`#define LAMBERT +}`,Pf=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2879,7 +2879,7 @@ void main() { #include #include #include -}`,Pf=`#define LAMBERT +}`,Df=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2936,7 +2936,7 @@ void main() { #include #include #include -}`,Df=`#define MATCAP +}`,Lf=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2970,7 +2970,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Lf=`#define MATCAP +}`,Uf=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3016,7 +3016,7 @@ void main() { #include #include #include -}`,Uf=`#define NORMAL +}`,If=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3049,7 +3049,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,If=`#define NORMAL +}`,Nf=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3071,7 +3071,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,Nf=`#define PHONG +}`,Ff=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3110,7 +3110,7 @@ void main() { #include #include #include -}`,Ff=`#define PHONG +}`,Of=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3169,7 +3169,7 @@ void main() { #include #include #include -}`,Of=`#define STANDARD +}`,Bf=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3212,7 +3212,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,Bf=`#define STANDARD +}`,zf=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3337,7 +3337,7 @@ void main() { #include #include #include -}`,zf=`#define TOON +}`,Hf=`#define TOON varying vec3 vViewPosition; #include #include @@ -3374,7 +3374,7 @@ void main() { #include #include #include -}`,Hf=`#define TOON +}`,kf=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3427,7 +3427,7 @@ void main() { #include #include #include -}`,kf=`uniform float size; +}`,Vf=`uniform float size; uniform float scale; #include #include @@ -3458,7 +3458,7 @@ void main() { #include #include #include -}`,Vf=`uniform vec3 diffuse; +}`,Gf=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3483,7 +3483,7 @@ void main() { #include #include #include -}`,Gf=`#include +}`,Wf=`#include #include #include #include @@ -3506,7 +3506,7 @@ void main() { #include #include #include -}`,Wf=`uniform vec3 color; +}`,Xf=`uniform vec3 color; uniform float opacity; #include #include @@ -3522,7 +3522,7 @@ void main() { #include #include #include -}`,Xf=`uniform float rotation; +}`,Yf=`uniform float rotation; uniform vec2 center; #include #include @@ -3546,7 +3546,7 @@ void main() { #include #include #include -}`,Yf=`uniform vec3 diffuse; +}`,qf=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3571,7 +3571,7 @@ void main() { #include #include #include -}`,Vt={alphahash_fragment:fu,alphahash_pars_fragment:pu,alphamap_fragment:mu,alphamap_pars_fragment:gu,alphatest_fragment:_u,alphatest_pars_fragment:vu,aomap_fragment:xu,aomap_pars_fragment:Mu,batching_pars_vertex:Su,batching_vertex:yu,begin_vertex:Eu,beginnormal_vertex:bu,bsdfs:Tu,iridescence_fragment:wu,bumpmap_pars_fragment:Au,clipping_planes_fragment:Ru,clipping_planes_pars_fragment:Cu,clipping_planes_pars_vertex:Pu,clipping_planes_vertex:Du,color_fragment:Lu,color_pars_fragment:Uu,color_pars_vertex:Iu,color_vertex:Nu,common:Fu,cube_uv_reflection_fragment:Ou,defaultnormal_vertex:Bu,displacementmap_pars_vertex:zu,displacementmap_vertex:Hu,emissivemap_fragment:ku,emissivemap_pars_fragment:Vu,colorspace_fragment:Gu,colorspace_pars_fragment:Wu,envmap_fragment:Xu,envmap_common_pars_fragment:Yu,envmap_pars_fragment:qu,envmap_pars_vertex:ju,envmap_physical_pars_fragment:rd,envmap_vertex:Zu,fog_vertex:Ku,fog_pars_vertex:$u,fog_fragment:Ju,fog_pars_fragment:Qu,gradientmap_pars_fragment:td,lightmap_pars_fragment:ed,lights_lambert_fragment:nd,lights_lambert_pars_fragment:id,lights_pars_begin:sd,lights_toon_fragment:ad,lights_toon_pars_fragment:od,lights_phong_fragment:ld,lights_phong_pars_fragment:cd,lights_physical_fragment:hd,lights_physical_pars_fragment:ud,lights_fragment_begin:dd,lights_fragment_maps:fd,lights_fragment_end:pd,logdepthbuf_fragment:md,logdepthbuf_pars_fragment:gd,logdepthbuf_pars_vertex:_d,logdepthbuf_vertex:vd,map_fragment:xd,map_pars_fragment:Md,map_particle_fragment:Sd,map_particle_pars_fragment:yd,metalnessmap_fragment:Ed,metalnessmap_pars_fragment:bd,morphinstance_vertex:Td,morphcolor_vertex:wd,morphnormal_vertex:Ad,morphtarget_pars_vertex:Rd,morphtarget_vertex:Cd,normal_fragment_begin:Pd,normal_fragment_maps:Dd,normal_pars_fragment:Ld,normal_pars_vertex:Ud,normal_vertex:Id,normalmap_pars_fragment:Nd,clearcoat_normal_fragment_begin:Fd,clearcoat_normal_fragment_maps:Od,clearcoat_pars_fragment:Bd,iridescence_pars_fragment:zd,opaque_fragment:Hd,packing:kd,premultiplied_alpha_fragment:Vd,project_vertex:Gd,dithering_fragment:Wd,dithering_pars_fragment:Xd,roughnessmap_fragment:Yd,roughnessmap_pars_fragment:qd,shadowmap_pars_fragment:jd,shadowmap_pars_vertex:Zd,shadowmap_vertex:Kd,shadowmask_pars_fragment:$d,skinbase_vertex:Jd,skinning_pars_vertex:Qd,skinning_vertex:tf,skinnormal_vertex:ef,specularmap_fragment:nf,specularmap_pars_fragment:sf,tonemapping_fragment:rf,tonemapping_pars_fragment:af,transmission_fragment:of,transmission_pars_fragment:lf,uv_pars_fragment:cf,uv_pars_vertex:hf,uv_vertex:uf,worldpos_vertex:df,background_vert:ff,background_frag:pf,backgroundCube_vert:mf,backgroundCube_frag:gf,cube_vert:_f,cube_frag:vf,depth_vert:xf,depth_frag:Mf,distanceRGBA_vert:Sf,distanceRGBA_frag:yf,equirect_vert:Ef,equirect_frag:bf,linedashed_vert:Tf,linedashed_frag:wf,meshbasic_vert:Af,meshbasic_frag:Rf,meshlambert_vert:Cf,meshlambert_frag:Pf,meshmatcap_vert:Df,meshmatcap_frag:Lf,meshnormal_vert:Uf,meshnormal_frag:If,meshphong_vert:Nf,meshphong_frag:Ff,meshphysical_vert:Of,meshphysical_frag:Bf,meshtoon_vert:zf,meshtoon_frag:Hf,points_vert:kf,points_frag:Vf,shadow_vert:Gf,shadow_frag:Wf,sprite_vert:Xf,sprite_frag:Yf},st={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ht}},envmap:{envMap:{value:null},envMapRotation:{value:new Ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ht},normalScale:{value:new vt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(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 pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0},uvTransform:{value:new Ht}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new vt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}}},cn={basic:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Vt.meshbasic_vert,fragmentShader:Vt.meshbasic_frag},lambert:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new pt(0)}}]),vertexShader:Vt.meshlambert_vert,fragmentShader:Vt.meshlambert_frag},phong:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30}}]),vertexShader:Vt.meshphong_vert,fragmentShader:Vt.meshphong_frag},standard:{uniforms:Ue([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag},toon:{uniforms:Ue([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new pt(0)}}]),vertexShader:Vt.meshtoon_vert,fragmentShader:Vt.meshtoon_frag},matcap:{uniforms:Ue([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matcap:{value:null}}]),vertexShader:Vt.meshmatcap_vert,fragmentShader:Vt.meshmatcap_frag},points:{uniforms:Ue([st.points,st.fog]),vertexShader:Vt.points_vert,fragmentShader:Vt.points_frag},dashed:{uniforms:Ue([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vt.linedashed_vert,fragmentShader:Vt.linedashed_frag},depth:{uniforms:Ue([st.common,st.displacementmap]),vertexShader:Vt.depth_vert,fragmentShader:Vt.depth_frag},normal:{uniforms:Ue([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Vt.meshnormal_vert,fragmentShader:Vt.meshnormal_frag},sprite:{uniforms:Ue([st.sprite,st.fog]),vertexShader:Vt.sprite_vert,fragmentShader:Vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Vt.background_vert,fragmentShader:Vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ht}},vertexShader:Vt.backgroundCube_vert,fragmentShader:Vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Vt.cube_vert,fragmentShader:Vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Vt.equirect_vert,fragmentShader:Vt.equirect_frag},distanceRGBA:{uniforms:Ue([st.common,st.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Vt.distanceRGBA_vert,fragmentShader:Vt.distanceRGBA_frag},shadow:{uniforms:Ue([st.lights,st.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:Vt.shadow_vert,fragmentShader:Vt.shadow_frag}};cn.physical={uniforms:Ue([cn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ht},clearcoatNormalScale:{value:new vt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ht},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ht},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ht},transmissionSamplerSize:{value:new vt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ht},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ht},anisotropyVector:{value:new vt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ht}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag};const ks={r:0,b:0,g:0},qn=new pn,qf=new ne;function jf(i,t,e,n,s,r,a){const o=new pt(0);let l=r===!0?0:1,c,h,d=null,f=0,p=null;function g(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?e:t).get(y)),y}function v(b){let y=!1;const L=g(b);L===null?u(o,l):L&&L.isColor&&(u(L,1),y=!0);const R=i.xr.getEnvironmentBlendMode();R==="additive"?n.buffers.color.setClear(0,0,0,1,a):R==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||y)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(b,y){const L=g(y);L&&(L.isCubeTexture||L.mapping===hr)?(h===void 0&&(h=new Me(new hs(1,1,1),new Ne({name:"BackgroundCubeMaterial",uniforms:Vi(cn.backgroundCube.uniforms),vertexShader:cn.backgroundCube.vertexShader,fragmentShader:cn.backgroundCube.fragmentShader,side:He,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,A,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),qn.copy(y.backgroundRotation),qn.x*=-1,qn.y*=-1,qn.z*=-1,L.isCubeTexture&&L.isRenderTargetTexture===!1&&(qn.y*=-1,qn.z*=-1),h.material.uniforms.envMap.value=L,h.material.uniforms.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(qf.makeRotationFromEuler(qn)),h.material.toneMapped=Jt.getTransfer(L.colorSpace)!==re,(d!==L||f!==L.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=L,f=L.version,p=i.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):L&&L.isTexture&&(c===void 0&&(c=new Me(new us(2,2),new Ne({name:"BackgroundMaterial",uniforms:Vi(cn.background.uniforms),vertexShader:cn.background.vertexShader,fragmentShader:cn.background.fragmentShader,side:zn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=L,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=Jt.getTransfer(L.colorSpace)!==re,L.matrixAutoUpdate===!0&&L.updateMatrix(),c.material.uniforms.uvTransform.value.copy(L.matrix),(d!==L||f!==L.version||p!==i.toneMapping)&&(c.material.needsUpdate=!0,d=L,f=L.version,p=i.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function u(b,y){b.getRGB(ks,sc(i)),n.buffers.color.setClear(ks.r,ks.g,ks.b,y,a)}function T(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(b,y=1){o.set(b),l=y,u(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,u(o,l)},render:v,addToRenderList:m,dispose:T}}function Zf(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null);let r=s,a=!1;function o(M,D,W,z,V){let $=!1;const G=d(z,W,D);r!==G&&(r=G,c(r.object)),$=p(M,z,W,V),$&&g(M,z,W,V),V!==null&&t.update(V,i.ELEMENT_ARRAY_BUFFER),($||a)&&(a=!1,y(M,D,W,z),V!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return i.createVertexArray()}function c(M){return i.bindVertexArray(M)}function h(M){return i.deleteVertexArray(M)}function d(M,D,W){const z=W.wireframe===!0;let V=n[M.id];V===void 0&&(V={},n[M.id]=V);let $=V[D.id];$===void 0&&($={},V[D.id]=$);let G=$[z];return G===void 0&&(G=f(l()),$[z]=G),G}function f(M){const D=[],W=[],z=[];for(let V=0;V=0){const ut=V[k];let yt=$[k];if(yt===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(yt=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(yt=M.instanceColor)),ut===void 0||ut.attribute!==yt||yt&&ut.data!==yt.data)return!0;G++}return r.attributesNum!==G||r.index!==z}function g(M,D,W,z){const V={},$=D.attributes;let G=0;const J=W.getAttributes();for(const k in J)if(J[k].location>=0){let ut=$[k];ut===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(ut=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(ut=M.instanceColor));const yt={};yt.attribute=ut,ut&&ut.data&&(yt.data=ut.data),V[k]=yt,G++}r.attributes=V,r.attributesNum=G,r.index=z}function v(){const M=r.newAttributes;for(let D=0,W=M.length;D=0){let it=V[J];if(it===void 0&&(J==="instanceMatrix"&&M.instanceMatrix&&(it=M.instanceMatrix),J==="instanceColor"&&M.instanceColor&&(it=M.instanceColor)),it!==void 0){const ut=it.normalized,yt=it.itemSize,Lt=t.get(it);if(Lt===void 0)continue;const jt=Lt.buffer,Y=Lt.type,et=Lt.bytesPerElement,xt=Y===i.INT||Y===i.UNSIGNED_INT||it.gpuType===Ya;if(it.isInterleavedBufferAttribute){const at=it.data,wt=at.stride,Ut=it.offset;if(at.isInstancedInterleavedBuffer){for(let Gt=0;Gt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const d=e.logarithmicDepthBuffer===!0,f=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),T=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),y=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),L=g>0,R=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:u,maxVertexUniforms:T,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:L,maxSamples:R}}function Jf(i){const t=this;let e=null,n=0,s=!1,r=!1;const a=new Nn,o=new Ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||n!==0||s;return s=f,n=d.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,p){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,u=i.get(d);if(!s||g===null||g.length===0||r&&!m)r?h(null):c();else{const T=r?0:n,b=T*4;let y=u.clippingState||null;l.value=y,y=h(g,f,b,p);for(let L=0;L!==b;++L)y[L]=e[L];u.clippingState=y,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=T}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,p,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const u=p+v*4,T=f.matrixWorldInverse;o.getNormalMatrix(T),(m===null||m.length0){const c=new Yh(l.height);return c.fromEquirectangularTexture(i,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const Pi=4,Jo=[.125,.215,.35,.446,.526,.582],$n=20,Gr=new hc,Qo=new pt;let Wr=null,Xr=0,Yr=0,qr=!1;const Zn=(1+Math.sqrt(5))/2,Ti=1/Zn,tl=[new P(-Zn,Ti,0),new P(Zn,Ti,0),new P(-Ti,0,Zn),new P(Ti,0,Zn),new P(0,Zn,-Ti),new P(0,Zn,Ti),new P(-1,1,-1),new P(1,1,-1),new P(-1,1,1),new P(1,1,1)];class el{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100){Wr=this._renderer.getRenderTarget(),Xr=this._renderer.getActiveCubeFace(),Yr=this._renderer.getActiveMipmapLevel(),qr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sl(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=il(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),h.setRenderTarget(s),v&&h.render(g,o),h.render(t,o)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=f,h.autoClear=d,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,s=t.mapping===Oi||t.mapping===Bi;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=sl()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=il());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Me(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Vs(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,Gr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;r$n&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${$n}`);const u=[];let T=0;for(let A=0;A<$n;++A){const U=A/v,S=Math.exp(-U*U/2);u.push(S),A===0?T+=S:Ab-Pi?s-b+Pi:0),R=4*(this._cubeSize-y);Vs(e,L,R,3*y,2*y),l.setRenderTarget(e),l.render(d,Gr)}}function tp(i){const t=[],e=[],n=[];let s=i;const r=i-Pi+1+Jo.length;for(let a=0;ai-Pi?l=Jo[a-i+Pi-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,d=1+c,f=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,g=6,v=3,m=2,u=1,T=new Float32Array(v*g*p),b=new Float32Array(m*g*p),y=new Float32Array(u*g*p);for(let R=0;R2?0:-1,S=[A,U,0,A+2/3,U,0,A+2/3,U+1,0,A,U,0,A+2/3,U+1,0,A,U+1,0];T.set(S,v*g*R),b.set(f,m*g*R);const M=[R,R,R,R,R,R];y.set(M,u*g*R)}const L=new pe;L.setAttribute("position",new de(T,v)),L.setAttribute("uv",new de(b,m)),L.setAttribute("faceIndex",new de(y,u)),t.push(L),s>Pi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function nl(i,t,e){const n=new on(i,t,e);return n.texture.mapping=hr,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Vs(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function ep(i,t,e){const n=new Float32Array($n),s=new P(0,1,0);return new Ne({name:"SphericalGaussianBlur",defines:{n:$n,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:no(),fragmentShader:` +}`,Vt={alphahash_fragment:pu,alphahash_pars_fragment:mu,alphamap_fragment:gu,alphamap_pars_fragment:_u,alphatest_fragment:vu,alphatest_pars_fragment:xu,aomap_fragment:Mu,aomap_pars_fragment:Su,batching_pars_vertex:yu,batching_vertex:Eu,begin_vertex:bu,beginnormal_vertex:Tu,bsdfs:wu,iridescence_fragment:Au,bumpmap_pars_fragment:Ru,clipping_planes_fragment:Cu,clipping_planes_pars_fragment:Pu,clipping_planes_pars_vertex:Du,clipping_planes_vertex:Lu,color_fragment:Uu,color_pars_fragment:Iu,color_pars_vertex:Nu,color_vertex:Fu,common:Ou,cube_uv_reflection_fragment:Bu,defaultnormal_vertex:zu,displacementmap_pars_vertex:Hu,displacementmap_vertex:ku,emissivemap_fragment:Vu,emissivemap_pars_fragment:Gu,colorspace_fragment:Wu,colorspace_pars_fragment:Xu,envmap_fragment:Yu,envmap_common_pars_fragment:qu,envmap_pars_fragment:ju,envmap_pars_vertex:Zu,envmap_physical_pars_fragment:ad,envmap_vertex:Ku,fog_vertex:$u,fog_pars_vertex:Ju,fog_fragment:Qu,fog_pars_fragment:td,gradientmap_pars_fragment:ed,lightmap_pars_fragment:nd,lights_lambert_fragment:id,lights_lambert_pars_fragment:sd,lights_pars_begin:rd,lights_toon_fragment:od,lights_toon_pars_fragment:ld,lights_phong_fragment:cd,lights_phong_pars_fragment:hd,lights_physical_fragment:ud,lights_physical_pars_fragment:dd,lights_fragment_begin:fd,lights_fragment_maps:pd,lights_fragment_end:md,logdepthbuf_fragment:gd,logdepthbuf_pars_fragment:_d,logdepthbuf_pars_vertex:vd,logdepthbuf_vertex:xd,map_fragment:Md,map_pars_fragment:Sd,map_particle_fragment:yd,map_particle_pars_fragment:Ed,metalnessmap_fragment:bd,metalnessmap_pars_fragment:Td,morphinstance_vertex:wd,morphcolor_vertex:Ad,morphnormal_vertex:Rd,morphtarget_pars_vertex:Cd,morphtarget_vertex:Pd,normal_fragment_begin:Dd,normal_fragment_maps:Ld,normal_pars_fragment:Ud,normal_pars_vertex:Id,normal_vertex:Nd,normalmap_pars_fragment:Fd,clearcoat_normal_fragment_begin:Od,clearcoat_normal_fragment_maps:Bd,clearcoat_pars_fragment:zd,iridescence_pars_fragment:Hd,opaque_fragment:kd,packing:Vd,premultiplied_alpha_fragment:Gd,project_vertex:Wd,dithering_fragment:Xd,dithering_pars_fragment:Yd,roughnessmap_fragment:qd,roughnessmap_pars_fragment:jd,shadowmap_pars_fragment:Zd,shadowmap_pars_vertex:Kd,shadowmap_vertex:$d,shadowmask_pars_fragment:Jd,skinbase_vertex:Qd,skinning_pars_vertex:tf,skinning_vertex:ef,skinnormal_vertex:nf,specularmap_fragment:sf,specularmap_pars_fragment:rf,tonemapping_fragment:af,tonemapping_pars_fragment:of,transmission_fragment:lf,transmission_pars_fragment:cf,uv_pars_fragment:hf,uv_pars_vertex:uf,uv_vertex:df,worldpos_vertex:ff,background_vert:pf,background_frag:mf,backgroundCube_vert:gf,backgroundCube_frag:_f,cube_vert:vf,cube_frag:xf,depth_vert:Mf,depth_frag:Sf,distanceRGBA_vert:yf,distanceRGBA_frag:Ef,equirect_vert:bf,equirect_frag:Tf,linedashed_vert:wf,linedashed_frag:Af,meshbasic_vert:Rf,meshbasic_frag:Cf,meshlambert_vert:Pf,meshlambert_frag:Df,meshmatcap_vert:Lf,meshmatcap_frag:Uf,meshnormal_vert:If,meshnormal_frag:Nf,meshphong_vert:Ff,meshphong_frag:Of,meshphysical_vert:Bf,meshphysical_frag:zf,meshtoon_vert:Hf,meshtoon_frag:kf,points_vert:Vf,points_frag:Gf,shadow_vert:Wf,shadow_frag:Xf,sprite_vert:Yf,sprite_frag:qf},st={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ht}},envmap:{envMap:{value:null},envMapRotation:{value:new Ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ht},normalScale:{value:new vt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(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 pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0},uvTransform:{value:new Ht}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new vt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}}},cn={basic:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Vt.meshbasic_vert,fragmentShader:Vt.meshbasic_frag},lambert:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new pt(0)}}]),vertexShader:Vt.meshlambert_vert,fragmentShader:Vt.meshlambert_frag},phong:{uniforms:Ue([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30}}]),vertexShader:Vt.meshphong_vert,fragmentShader:Vt.meshphong_frag},standard:{uniforms:Ue([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag},toon:{uniforms:Ue([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new pt(0)}}]),vertexShader:Vt.meshtoon_vert,fragmentShader:Vt.meshtoon_frag},matcap:{uniforms:Ue([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matcap:{value:null}}]),vertexShader:Vt.meshmatcap_vert,fragmentShader:Vt.meshmatcap_frag},points:{uniforms:Ue([st.points,st.fog]),vertexShader:Vt.points_vert,fragmentShader:Vt.points_frag},dashed:{uniforms:Ue([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vt.linedashed_vert,fragmentShader:Vt.linedashed_frag},depth:{uniforms:Ue([st.common,st.displacementmap]),vertexShader:Vt.depth_vert,fragmentShader:Vt.depth_frag},normal:{uniforms:Ue([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Vt.meshnormal_vert,fragmentShader:Vt.meshnormal_frag},sprite:{uniforms:Ue([st.sprite,st.fog]),vertexShader:Vt.sprite_vert,fragmentShader:Vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Vt.background_vert,fragmentShader:Vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ht}},vertexShader:Vt.backgroundCube_vert,fragmentShader:Vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Vt.cube_vert,fragmentShader:Vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Vt.equirect_vert,fragmentShader:Vt.equirect_frag},distanceRGBA:{uniforms:Ue([st.common,st.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Vt.distanceRGBA_vert,fragmentShader:Vt.distanceRGBA_frag},shadow:{uniforms:Ue([st.lights,st.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:Vt.shadow_vert,fragmentShader:Vt.shadow_frag}};cn.physical={uniforms:Ue([cn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ht},clearcoatNormalScale:{value:new vt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ht},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ht},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ht},transmissionSamplerSize:{value:new vt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ht},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ht},anisotropyVector:{value:new vt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ht}}]),vertexShader:Vt.meshphysical_vert,fragmentShader:Vt.meshphysical_frag};const ks={r:0,b:0,g:0},qn=new pn,jf=new ee;function Zf(i,t,e,n,s,r,a){const o=new pt(0);let l=r===!0?0:1,c,h,d=null,f=0,p=null;function g(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?e:t).get(y)),y}function v(b){let y=!1;const L=g(b);L===null?u(o,l):L&&L.isColor&&(u(L,1),y=!0);const R=i.xr.getEnvironmentBlendMode();R==="additive"?n.buffers.color.setClear(0,0,0,1,a):R==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||y)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(b,y){const L=g(y);L&&(L.isCubeTexture||L.mapping===hr)?(h===void 0&&(h=new Se(new hs(1,1,1),new Ne({name:"BackgroundCubeMaterial",uniforms:Vi(cn.backgroundCube.uniforms),vertexShader:cn.backgroundCube.vertexShader,fragmentShader:cn.backgroundCube.fragmentShader,side:ke,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,A,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),qn.copy(y.backgroundRotation),qn.x*=-1,qn.y*=-1,qn.z*=-1,L.isCubeTexture&&L.isRenderTargetTexture===!1&&(qn.y*=-1,qn.z*=-1),h.material.uniforms.envMap.value=L,h.material.uniforms.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(jf.makeRotationFromEuler(qn)),h.material.toneMapped=$t.getTransfer(L.colorSpace)!==re,(d!==L||f!==L.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=L,f=L.version,p=i.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):L&&L.isTexture&&(c===void 0&&(c=new Se(new us(2,2),new Ne({name:"BackgroundMaterial",uniforms:Vi(cn.background.uniforms),vertexShader:cn.background.vertexShader,fragmentShader:cn.background.fragmentShader,side:zn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=L,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=$t.getTransfer(L.colorSpace)!==re,L.matrixAutoUpdate===!0&&L.updateMatrix(),c.material.uniforms.uvTransform.value.copy(L.matrix),(d!==L||f!==L.version||p!==i.toneMapping)&&(c.material.needsUpdate=!0,d=L,f=L.version,p=i.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function u(b,y){b.getRGB(ks,ic(i)),n.buffers.color.setClear(ks.r,ks.g,ks.b,y,a)}function T(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(b,y=1){o.set(b),l=y,u(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,u(o,l)},render:v,addToRenderList:m,dispose:T}}function Kf(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null);let r=s,a=!1;function o(M,D,W,z,V){let $=!1;const G=d(z,W,D);r!==G&&(r=G,c(r.object)),$=p(M,z,W,V),$&&g(M,z,W,V),V!==null&&t.update(V,i.ELEMENT_ARRAY_BUFFER),($||a)&&(a=!1,y(M,D,W,z),V!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return i.createVertexArray()}function c(M){return i.bindVertexArray(M)}function h(M){return i.deleteVertexArray(M)}function d(M,D,W){const z=W.wireframe===!0;let V=n[M.id];V===void 0&&(V={},n[M.id]=V);let $=V[D.id];$===void 0&&($={},V[D.id]=$);let G=$[z];return G===void 0&&(G=f(l()),$[z]=G),G}function f(M){const D=[],W=[],z=[];for(let V=0;V=0){const ut=V[k];let yt=$[k];if(yt===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(yt=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(yt=M.instanceColor)),ut===void 0||ut.attribute!==yt||yt&&ut.data!==yt.data)return!0;G++}return r.attributesNum!==G||r.index!==z}function g(M,D,W,z){const V={},$=D.attributes;let G=0;const J=W.getAttributes();for(const k in J)if(J[k].location>=0){let ut=$[k];ut===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(ut=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(ut=M.instanceColor));const yt={};yt.attribute=ut,ut&&ut.data&&(yt.data=ut.data),V[k]=yt,G++}r.attributes=V,r.attributesNum=G,r.index=z}function v(){const M=r.newAttributes;for(let D=0,W=M.length;D=0){let it=V[J];if(it===void 0&&(J==="instanceMatrix"&&M.instanceMatrix&&(it=M.instanceMatrix),J==="instanceColor"&&M.instanceColor&&(it=M.instanceColor)),it!==void 0){const ut=it.normalized,yt=it.itemSize,Lt=t.get(it);if(Lt===void 0)continue;const qt=Lt.buffer,Y=Lt.type,nt=Lt.bytesPerElement,xt=Y===i.INT||Y===i.UNSIGNED_INT||it.gpuType===Ya;if(it.isInterleavedBufferAttribute){const at=it.data,wt=at.stride,Ut=it.offset;if(at.isInstancedInterleavedBuffer){for(let Gt=0;Gt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const d=e.logarithmicDepthBuffer===!0,f=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),T=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),y=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),L=g>0,R=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:u,maxVertexUniforms:T,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:L,maxSamples:R}}function Qf(i){const t=this;let e=null,n=0,s=!1,r=!1;const a=new Nn,o=new Ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||n!==0||s;return s=f,n=d.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,p){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,u=i.get(d);if(!s||g===null||g.length===0||r&&!m)r?h(null):c();else{const T=r?0:n,b=T*4;let y=u.clippingState||null;l.value=y,y=h(g,f,b,p);for(let L=0;L!==b;++L)y[L]=e[L];u.clippingState=y,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=T}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,p,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const u=p+v*4,T=f.matrixWorldInverse;o.getNormalMatrix(T),(m===null||m.length0){const c=new qh(l.height);return c.fromEquirectangularTexture(i,a),t.set(a,c),a.addEventListener("dispose",s),e(c.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const Pi=4,Jo=[.125,.215,.35,.446,.526,.582],$n=20,Gr=new cc,Qo=new pt;let Wr=null,Xr=0,Yr=0,qr=!1;const Zn=(1+Math.sqrt(5))/2,Ti=1/Zn,tl=[new P(-Zn,Ti,0),new P(Zn,Ti,0),new P(-Ti,0,Zn),new P(Ti,0,Zn),new P(0,Zn,-Ti),new P(0,Zn,Ti),new P(-1,1,-1),new P(1,1,-1),new P(-1,1,1),new P(1,1,1)];class el{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100){Wr=this._renderer.getRenderTarget(),Xr=this._renderer.getActiveCubeFace(),Yr=this._renderer.getActiveMipmapLevel(),qr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,s,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sl(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=il(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),h.setRenderTarget(s),v&&h.render(g,o),h.render(t,o)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=f,h.autoClear=d,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,s=t.mapping===Oi||t.mapping===Bi;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=sl()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=il());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Se(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Vs(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,Gr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;r$n&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${$n}`);const u=[];let T=0;for(let A=0;A<$n;++A){const U=A/v,S=Math.exp(-U*U/2);u.push(S),A===0?T+=S:Ab-Pi?s-b+Pi:0),R=4*(this._cubeSize-y);Vs(e,L,R,3*y,2*y),l.setRenderTarget(e),l.render(d,Gr)}}function ep(i){const t=[],e=[],n=[];let s=i;const r=i-Pi+1+Jo.length;for(let a=0;ai-Pi?l=Jo[a-i+Pi-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,d=1+c,f=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,g=6,v=3,m=2,u=1,T=new Float32Array(v*g*p),b=new Float32Array(m*g*p),y=new Float32Array(u*g*p);for(let R=0;R2?0:-1,S=[A,U,0,A+2/3,U,0,A+2/3,U+1,0,A,U,0,A+2/3,U+1,0,A,U+1,0];T.set(S,v*g*R),b.set(f,m*g*R);const M=[R,R,R,R,R,R];y.set(M,u*g*R)}const L=new pe;L.setAttribute("position",new de(T,v)),L.setAttribute("uv",new de(b,m)),L.setAttribute("faceIndex",new de(y,u)),t.push(L),s>Pi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function nl(i,t,e){const n=new on(i,t,e);return n.texture.mapping=hr,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Vs(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function np(i,t,e){const n=new Float32Array($n),s=new P(0,1,0);return new Ne({name:"SphericalGaussianBlur",defines:{n:$n,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:no(),fragmentShader:` precision mediump float; precision mediump int; @@ -3721,17 +3721,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function np(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===la||l===ca,h=l===Oi||l===Bi;if(c||h){let d=t.get(o);const f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new el(i)),d=c?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{const p=o.image;return c&&p&&p.height>0||h&&p&&s(p)?(e===null&&(e=new el(i)),d=c?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(L=Math.ceil(y/t.maxTextureSize),y=t.maxTextureSize);const R=new Float32Array(y*L*4*d),A=new tc(R,y,L,d);A.type=fn,A.needsUpdate=!0;const U=b*4;for(let M=0;M0)return i;const s=t*e;let r=al[s];if(r===void 0&&(r=new Float32Array(s),al[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function Se(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e0||h&&p&&s(p)?(e===null&&(e=new el(i)),d=c?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(L=Math.ceil(y/t.maxTextureSize),y=t.maxTextureSize);const R=new Float32Array(y*L*4*d),A=new Ql(R,y,L,d);A.type=fn,A.needsUpdate=!0;const U=b*4;for(let M=0;M0)return i;const s=t*e;let r=al[s];if(r===void 0&&(r=new Float32Array(s),al[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function ye(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` -`)}const fl=new Ht;function nm(i){Jt._getMatrix(fl,Jt.workingColorSpace,i);const t=`mat3( ${fl.elements.map(e=>e.toFixed(4))} )`;switch(Jt.getTransfer(i)){case tr:return[t,"LinearTransferOETF"];case re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function pl(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),s=i.getShaderInfoLog(t).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` +`)}const fl=new Ht;function im(i){$t._getMatrix(fl,$t.workingColorSpace,i);const t=`mat3( ${fl.elements.map(e=>e.toFixed(4))} )`;switch($t.getTransfer(i)){case tr:return[t,"LinearTransferOETF"];case re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function pl(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),s=i.getShaderInfoLog(t).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return e.toUpperCase()+` `+s+` -`+em(i.getShaderSource(t),a)}else return s}function im(i,t){const e=nm(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` -`)}function sm(i,t){let e;switch(t){case ih:e="Linear";break;case sh:e="Reinhard";break;case rh:e="Cineon";break;case zl:e="ACESFilmic";break;case oh:e="AgX";break;case lh:e="Neutral";break;case ah:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Gs=new P;function rm(){Jt.getLuminanceCoefficients(Gs);const i=Gs.x.toFixed(4),t=Gs.y.toFixed(4),e=Gs.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` -`)}function am(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(ss).join(` -`)}function om(i){const t=[];for(const e in i){const n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` -`)}function lm(i,t){const e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Wa(i){return i.replace(cm,um)}const hm=new Map;function um(i,t){let e=Vt[t];if(e===void 0){const n=hm.get(t);if(n!==void 0)e=Vt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Wa(e)}const dm=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function _l(i){return i.replace(dm,fm)}function fm(i,t,e,n){let s="";for(let r=parseInt(t);r/gm;function Wa(i){return i.replace(hm,dm)}const um=new Map;function dm(i,t){let e=Vt[t];if(e===void 0){const n=um.get(t);if(n!==void 0)e=Vt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Wa(e)}const fm=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function _l(i){return i.replace(fm,pm)}function pm(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(m+=` `),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g].filter(ss).join(` `),u.length>0&&(u+=` `)):(m=[vl(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(ss).join(` -`),u=[vl(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==On?"#define TONE_MAPPING":"",e.toneMapping!==On?Vt.tonemapping_pars_fragment:"",e.toneMapping!==On?sm("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Vt.colorspace_pars_fragment,im("linearToOutputTexel",e.outputColorSpace),rm(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`),u=[vl(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,g,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==On?"#define TONE_MAPPING":"",e.toneMapping!==On?Vt.tonemapping_pars_fragment:"",e.toneMapping!==On?rm("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Vt.colorspace_pars_fragment,sm("linearToOutputTexel",e.outputColorSpace),am(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` `].filter(ss).join(` `)),a=Wa(a),a=ml(a,e),a=gl(a,e),o=Wa(o),o=ml(o,e),o=gl(o,e),a=_l(a),o=_l(o),e.isRawShaderMaterial!==!0&&(T=`#version 300 es `,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3772,9 +3772,9 @@ Material Type: `+D.type+` Program Info Log: `+W+` `+J+` -`+k)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(z===""||V==="")&&(G=!1);G&&(D.diagnostics={runnable:$,programLog:W,vertexShader:{log:z,prefix:m},fragmentShader:{log:V,prefix:u}})}s.deleteShader(L),s.deleteShader(R),U=new $s(s,v),S=lm(s,v)}let U;this.getUniforms=function(){return U===void 0&&A(this),U};let S;this.getAttributes=function(){return S===void 0&&A(this),S};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(v,Qp)),M},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=tm++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=L,this.fragmentShader=R,this}let Mm=0;class Sm{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new ym(t),e.set(t,n)),n}}class ym{constructor(t){this.id=Mm++,this.code=t,this.usedTimes=0}}function Em(i,t,e,n,s,r,a){const o=new Qa,l=new Sm,c=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures;let p=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return c.add(S),S===0?"uv":`uv${S}`}function m(S,M,D,W,z){const V=W.fog,$=z.geometry,G=S.isMeshStandardMaterial?W.environment:null,J=(S.isMeshStandardMaterial?e:t).get(S.envMap||G),k=J&&J.mapping===hr?J.image.height:null,it=g[S.type];S.precision!==null&&(p=s.getMaxPrecision(S.precision),p!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",p,"instead."));const ut=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,yt=ut!==void 0?ut.length:0;let Lt=0;$.morphAttributes.position!==void 0&&(Lt=1),$.morphAttributes.normal!==void 0&&(Lt=2),$.morphAttributes.color!==void 0&&(Lt=3);let jt,Y,et,xt;if(it){const Qt=cn[it];jt=Qt.vertexShader,Y=Qt.fragmentShader}else jt=S.vertexShader,Y=S.fragmentShader,l.update(S),et=l.getVertexShaderID(S),xt=l.getFragmentShaderID(S);const at=i.getRenderTarget(),wt=i.state.buffers.depth.getReversed(),Ut=z.isInstancedMesh===!0,Gt=z.isBatchedMesh===!0,ce=!!S.map,rt=!!S.matcap,Ct=!!J,w=!!S.aoMap,ve=!!S.lightMap,Ft=!!S.bumpMap,kt=!!S.normalMap,Mt=!!S.displacementMap,ie=!!S.emissiveMap,Et=!!S.metalnessMap,E=!!S.roughnessMap,_=S.anisotropy>0,F=S.clearcoat>0,j=S.dispersion>0,K=S.iridescence>0,X=S.sheen>0,St=S.transmission>0,ot=_&&!!S.anisotropyMap,dt=F&&!!S.clearcoatMap,Zt=F&&!!S.clearcoatNormalMap,tt=F&&!!S.clearcoatRoughnessMap,mt=K&&!!S.iridescenceMap,bt=K&&!!S.iridescenceThicknessMap,Pt=X&&!!S.sheenColorMap,ft=X&&!!S.sheenRoughnessMap,Yt=!!S.specularMap,zt=!!S.specularColorMap,Xt=!!S.specularIntensityMap,C=St&&!!S.transmissionMap,nt=St&&!!S.thicknessMap,H=!!S.gradientMap,Z=!!S.alphaMap,ht=S.alphaTest>0,lt=!!S.alphaHash,Ot=!!S.extensions;let he=On;S.toneMapped&&(at===null||at.isXRRenderTarget===!0)&&(he=i.toneMapping);const Ee={shaderID:it,shaderType:S.type,shaderName:S.name,vertexShader:jt,fragmentShader:Y,defines:S.defines,customVertexShaderID:et,customFragmentShaderID:xt,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:p,batching:Gt,batchingColor:Gt&&z._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&z.instanceColor!==null,instancingMorph:Ut&&z.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:at===null?i.outputColorSpace:at.isXRRenderTarget===!0?at.texture.colorSpace:ki,alphaToCoverage:!!S.alphaToCoverage,map:ce,matcap:rt,envMap:Ct,envMapMode:Ct&&J.mapping,envMapCubeUVHeight:k,aoMap:w,lightMap:ve,bumpMap:Ft,normalMap:kt,displacementMap:f&&Mt,emissiveMap:ie,normalMapObjectSpace:kt&&S.normalMapType===dh,normalMapTangentSpace:kt&&S.normalMapType===Kl,metalnessMap:Et,roughnessMap:E,anisotropy:_,anisotropyMap:ot,clearcoat:F,clearcoatMap:dt,clearcoatNormalMap:Zt,clearcoatRoughnessMap:tt,dispersion:j,iridescence:K,iridescenceMap:mt,iridescenceThicknessMap:bt,sheen:X,sheenColorMap:Pt,sheenRoughnessMap:ft,specularMap:Yt,specularColorMap:zt,specularIntensityMap:Xt,transmission:St,transmissionMap:C,thicknessMap:nt,gradientMap:H,opaque:S.transparent===!1&&S.blending===Li&&S.alphaToCoverage===!1,alphaMap:Z,alphaTest:ht,alphaHash:lt,combine:S.combine,mapUv:ce&&v(S.map.channel),aoMapUv:w&&v(S.aoMap.channel),lightMapUv:ve&&v(S.lightMap.channel),bumpMapUv:Ft&&v(S.bumpMap.channel),normalMapUv:kt&&v(S.normalMap.channel),displacementMapUv:Mt&&v(S.displacementMap.channel),emissiveMapUv:ie&&v(S.emissiveMap.channel),metalnessMapUv:Et&&v(S.metalnessMap.channel),roughnessMapUv:E&&v(S.roughnessMap.channel),anisotropyMapUv:ot&&v(S.anisotropyMap.channel),clearcoatMapUv:dt&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:Zt&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:mt&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:bt&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:Pt&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:ft&&v(S.sheenRoughnessMap.channel),specularMapUv:Yt&&v(S.specularMap.channel),specularColorMapUv:zt&&v(S.specularColorMap.channel),specularIntensityMapUv:Xt&&v(S.specularIntensityMap.channel),transmissionMapUv:C&&v(S.transmissionMap.channel),thicknessMapUv:nt&&v(S.thicknessMap.channel),alphaMapUv:Z&&v(S.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(kt||_),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!$.attributes.uv&&(ce||Z),fog:!!V,useFog:S.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:wt,skinning:z.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:yt,morphTextureStride:Lt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:i.shadowMap.enabled&&D.length>0,shadowMapType:i.shadowMap.type,toneMapping:he,decodeVideoTexture:ce&&S.map.isVideoTexture===!0&&Jt.getTransfer(S.map.colorSpace)===re,decodeVideoTextureEmissive:ie&&S.emissiveMap.isVideoTexture===!0&&Jt.getTransfer(S.emissiveMap.colorSpace)===re,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===hn,flipSided:S.side===He,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ot&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ot&&S.extensions.multiDraw===!0||Gt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return Ee.vertexUv1s=c.has(1),Ee.vertexUv2s=c.has(2),Ee.vertexUv3s=c.has(3),c.clear(),Ee}function u(S){const M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(const D in S.defines)M.push(D),M.push(S.defines[D]);return S.isRawShaderMaterial===!1&&(T(M,S),b(M,S),M.push(i.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function T(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function b(S,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),S.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),S.push(o.mask)}function y(S){const M=g[S.type];let D;if(M){const W=cn[M];D=ir.clone(W.uniforms)}else D=S.uniforms;return D}function L(S,M){let D;for(let W=0,z=h.length;W0?n.push(u):p.transparent===!0?s.push(u):e.push(u)}function l(d,f,p,g,v,m){const u=a(d,f,p,g,v,m);p.transmission>0?n.unshift(u):p.transparent===!0?s.unshift(u):e.unshift(u)}function c(d,f){e.length>1&&e.sort(d||Tm),n.length>1&&n.sort(f||xl),s.length>1&&s.sort(f||xl)}function h(){for(let d=t,f=i.length;d=r.length?(a=new Ml,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function Am(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new P,color:new pt};break;case"SpotLight":e={position:new P,direction:new P,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new P,color:new pt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new P,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":e={color:new pt,position:new P,halfWidth:new P,halfHeight:new P};break}return i[t.id]=e,e}}}function Rm(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let Cm=0;function Pm(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Dm(i){const t=new Am,e=Rm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new P);const s=new P,r=new ne,a=new ne;function o(c){let h=0,d=0,f=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let p=0,g=0,v=0,m=0,u=0,T=0,b=0,y=0,L=0,R=0,A=0;c.sort(Pm);for(let S=0,M=c.length;S0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;const U=n.hash;(U.directionalLength!==p||U.pointLength!==g||U.spotLength!==v||U.rectAreaLength!==m||U.hemiLength!==u||U.numDirectionalShadows!==T||U.numPointShadows!==b||U.numSpotShadows!==y||U.numSpotMaps!==L||U.numLightProbes!==A)&&(n.directional.length=p,n.spot.length=v,n.rectArea.length=m,n.point.length=g,n.hemi.length=u,n.directionalShadow.length=T,n.directionalShadowMap.length=T,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=T,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=y+L-R,n.spotLightMap.length=L,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=A,U.directionalLength=p,U.pointLength=g,U.spotLength=v,U.rectAreaLength=m,U.hemiLength=u,U.numDirectionalShadows=T,U.numPointShadows=b,U.numSpotShadows=y,U.numSpotMaps=L,U.numLightProbes=A,n.version=Cm++)}function l(c,h){let d=0,f=0,p=0,g=0,v=0;const m=h.matrixWorldInverse;for(let u=0,T=c.length;u=a.length?(o=new Sl(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const Um=`void main() { +`+k)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(z===""||V==="")&&(G=!1);G&&(D.diagnostics={runnable:$,programLog:W,vertexShader:{log:z,prefix:m},fragmentShader:{log:V,prefix:u}})}s.deleteShader(L),s.deleteShader(R),U=new $s(s,v),S=cm(s,v)}let U;this.getUniforms=function(){return U===void 0&&A(this),U};let S;this.getAttributes=function(){return S===void 0&&A(this),S};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(v,tm)),M},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=em++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=L,this.fragmentShader=R,this}let Sm=0;class ym{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new Em(t),e.set(t,n)),n}}class Em{constructor(t){this.id=Sm++,this.code=t,this.usedTimes=0}}function bm(i,t,e,n,s,r,a){const o=new Qa,l=new ym,c=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures;let p=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return c.add(S),S===0?"uv":`uv${S}`}function m(S,M,D,W,z){const V=W.fog,$=z.geometry,G=S.isMeshStandardMaterial?W.environment:null,J=(S.isMeshStandardMaterial?e:t).get(S.envMap||G),k=J&&J.mapping===hr?J.image.height:null,it=g[S.type];S.precision!==null&&(p=s.getMaxPrecision(S.precision),p!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",p,"instead."));const ut=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,yt=ut!==void 0?ut.length:0;let Lt=0;$.morphAttributes.position!==void 0&&(Lt=1),$.morphAttributes.normal!==void 0&&(Lt=2),$.morphAttributes.color!==void 0&&(Lt=3);let qt,Y,nt,xt;if(it){const Jt=cn[it];qt=Jt.vertexShader,Y=Jt.fragmentShader}else qt=S.vertexShader,Y=S.fragmentShader,l.update(S),nt=l.getVertexShaderID(S),xt=l.getFragmentShaderID(S);const at=i.getRenderTarget(),wt=i.state.buffers.depth.getReversed(),Ut=z.isInstancedMesh===!0,Gt=z.isBatchedMesh===!0,ce=!!S.map,rt=!!S.matcap,Ct=!!J,w=!!S.aoMap,ve=!!S.lightMap,Bt=!!S.bumpMap,kt=!!S.normalMap,Mt=!!S.displacementMap,ne=!!S.emissiveMap,Et=!!S.metalnessMap,E=!!S.roughnessMap,_=S.anisotropy>0,F=S.clearcoat>0,Z=S.dispersion>0,K=S.iridescence>0,X=S.sheen>0,St=S.transmission>0,ot=_&&!!S.anisotropyMap,dt=F&&!!S.clearcoatMap,jt=F&&!!S.clearcoatNormalMap,tt=F&&!!S.clearcoatRoughnessMap,mt=K&&!!S.iridescenceMap,bt=K&&!!S.iridescenceThicknessMap,Pt=X&&!!S.sheenColorMap,ft=X&&!!S.sheenRoughnessMap,Xt=!!S.specularMap,zt=!!S.specularColorMap,ie=!!S.specularIntensityMap,C=St&&!!S.transmissionMap,et=St&&!!S.thicknessMap,H=!!S.gradientMap,q=!!S.alphaMap,lt=S.alphaTest>0,ct=!!S.alphaHash,Nt=!!S.extensions;let he=On;S.toneMapped&&(at===null||at.isXRRenderTarget===!0)&&(he=i.toneMapping);const xe={shaderID:it,shaderType:S.type,shaderName:S.name,vertexShader:qt,fragmentShader:Y,defines:S.defines,customVertexShaderID:nt,customFragmentShaderID:xt,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:p,batching:Gt,batchingColor:Gt&&z._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&z.instanceColor!==null,instancingMorph:Ut&&z.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:at===null?i.outputColorSpace:at.isXRRenderTarget===!0?at.texture.colorSpace:ki,alphaToCoverage:!!S.alphaToCoverage,map:ce,matcap:rt,envMap:Ct,envMapMode:Ct&&J.mapping,envMapCubeUVHeight:k,aoMap:w,lightMap:ve,bumpMap:Bt,normalMap:kt,displacementMap:f&&Mt,emissiveMap:ne,normalMapObjectSpace:kt&&S.normalMapType===fh,normalMapTangentSpace:kt&&S.normalMapType===Zl,metalnessMap:Et,roughnessMap:E,anisotropy:_,anisotropyMap:ot,clearcoat:F,clearcoatMap:dt,clearcoatNormalMap:jt,clearcoatRoughnessMap:tt,dispersion:Z,iridescence:K,iridescenceMap:mt,iridescenceThicknessMap:bt,sheen:X,sheenColorMap:Pt,sheenRoughnessMap:ft,specularMap:Xt,specularColorMap:zt,specularIntensityMap:ie,transmission:St,transmissionMap:C,thicknessMap:et,gradientMap:H,opaque:S.transparent===!1&&S.blending===Li&&S.alphaToCoverage===!1,alphaMap:q,alphaTest:lt,alphaHash:ct,combine:S.combine,mapUv:ce&&v(S.map.channel),aoMapUv:w&&v(S.aoMap.channel),lightMapUv:ve&&v(S.lightMap.channel),bumpMapUv:Bt&&v(S.bumpMap.channel),normalMapUv:kt&&v(S.normalMap.channel),displacementMapUv:Mt&&v(S.displacementMap.channel),emissiveMapUv:ne&&v(S.emissiveMap.channel),metalnessMapUv:Et&&v(S.metalnessMap.channel),roughnessMapUv:E&&v(S.roughnessMap.channel),anisotropyMapUv:ot&&v(S.anisotropyMap.channel),clearcoatMapUv:dt&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:jt&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:mt&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:bt&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:Pt&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:ft&&v(S.sheenRoughnessMap.channel),specularMapUv:Xt&&v(S.specularMap.channel),specularColorMapUv:zt&&v(S.specularColorMap.channel),specularIntensityMapUv:ie&&v(S.specularIntensityMap.channel),transmissionMapUv:C&&v(S.transmissionMap.channel),thicknessMapUv:et&&v(S.thicknessMap.channel),alphaMapUv:q&&v(S.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(kt||_),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!$.attributes.uv&&(ce||q),fog:!!V,useFog:S.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:wt,skinning:z.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:yt,morphTextureStride:Lt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:i.shadowMap.enabled&&D.length>0,shadowMapType:i.shadowMap.type,toneMapping:he,decodeVideoTexture:ce&&S.map.isVideoTexture===!0&&$t.getTransfer(S.map.colorSpace)===re,decodeVideoTextureEmissive:ne&&S.emissiveMap.isVideoTexture===!0&&$t.getTransfer(S.emissiveMap.colorSpace)===re,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===hn,flipSided:S.side===ke,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Nt&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Nt&&S.extensions.multiDraw===!0||Gt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return xe.vertexUv1s=c.has(1),xe.vertexUv2s=c.has(2),xe.vertexUv3s=c.has(3),c.clear(),xe}function u(S){const M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(const D in S.defines)M.push(D),M.push(S.defines[D]);return S.isRawShaderMaterial===!1&&(T(M,S),b(M,S),M.push(i.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function T(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function b(S,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),S.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),S.push(o.mask)}function y(S){const M=g[S.type];let D;if(M){const W=cn[M];D=ir.clone(W.uniforms)}else D=S.uniforms;return D}function L(S,M){let D;for(let W=0,z=h.length;W0?n.push(u):p.transparent===!0?s.push(u):e.push(u)}function l(d,f,p,g,v,m){const u=a(d,f,p,g,v,m);p.transmission>0?n.unshift(u):p.transparent===!0?s.unshift(u):e.unshift(u)}function c(d,f){e.length>1&&e.sort(d||wm),n.length>1&&n.sort(f||xl),s.length>1&&s.sort(f||xl)}function h(){for(let d=t,f=i.length;d=r.length?(a=new Ml,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function Rm(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new P,color:new pt};break;case"SpotLight":e={position:new P,direction:new P,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new P,color:new pt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new P,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":e={color:new pt,position:new P,halfWidth:new P,halfHeight:new P};break}return i[t.id]=e,e}}}function Cm(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let Pm=0;function Dm(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Lm(i){const t=new Rm,e=Cm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new P);const s=new P,r=new ee,a=new ee;function o(c){let h=0,d=0,f=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let p=0,g=0,v=0,m=0,u=0,T=0,b=0,y=0,L=0,R=0,A=0;c.sort(Dm);for(let S=0,M=c.length;S0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;const U=n.hash;(U.directionalLength!==p||U.pointLength!==g||U.spotLength!==v||U.rectAreaLength!==m||U.hemiLength!==u||U.numDirectionalShadows!==T||U.numPointShadows!==b||U.numSpotShadows!==y||U.numSpotMaps!==L||U.numLightProbes!==A)&&(n.directional.length=p,n.spot.length=v,n.rectArea.length=m,n.point.length=g,n.hemi.length=u,n.directionalShadow.length=T,n.directionalShadowMap.length=T,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=T,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=y+L-R,n.spotLightMap.length=L,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=A,U.directionalLength=p,U.pointLength=g,U.spotLength=v,U.rectAreaLength=m,U.hemiLength=u,U.numDirectionalShadows=T,U.numPointShadows=b,U.numSpotShadows=y,U.numSpotMaps=L,U.numLightProbes=A,n.version=Pm++)}function l(c,h){let d=0,f=0,p=0,g=0,v=0;const m=h.matrixWorldInverse;for(let u=0,T=c.length;u=a.length?(o=new Sl(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const Im=`void main() { gl_Position = vec4( position, 1.0 ); -}`,Im=`uniform sampler2D shadow_pass; +}`,Nm=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3800,12 +3800,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Nm(i,t,e){let n=new to;const s=new vt,r=new vt,a=new le,o=new nu({depthPacking:uh}),l=new iu,c={},h=e.maxTextureSize,d={[zn]:He,[He]:zn,[hn]:hn},f=new Ne({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new vt},radius:{value:4}},vertexShader:Um,fragmentShader:Im}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new pe;g.setAttribute("position",new de(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Me(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ol;let u=this.type;this.render=function(R,A,U){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||R.length===0)return;const S=i.getRenderTarget(),M=i.getActiveCubeFace(),D=i.getActiveMipmapLevel(),W=i.state;W.setBlending(bn),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const z=u!==yn&&this.type===yn,V=u===yn&&this.type!==yn;for(let $=0,G=R.length;$h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/it.x),s.x=r.x*it.x,k.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/it.y),s.y=r.y*it.y,k.mapSize.y=r.y)),k.map===null||z===!0||V===!0){const yt=this.type!==yn?{minFilter:Ye,magFilter:Ye}:{};k.map!==null&&k.map.dispose(),k.map=new on(s.x,s.y,yt),k.map.texture.name=J.name+".shadowMap",k.camera.updateProjectionMatrix()}i.setRenderTarget(k.map),i.clear();const ut=k.getViewportCount();for(let yt=0;yt0||A.map&&A.alphaTest>0){const W=M.uuid,z=A.uuid;let V=c[W];V===void 0&&(V={},c[W]=V);let $=V[z];$===void 0&&($=M.clone(),V[z]=$,A.addEventListener("dispose",L)),M=$}if(M.visible=A.visible,M.wireframe=A.wireframe,S===yn?M.side=A.shadowSide!==null?A.shadowSide:A.side:M.side=A.shadowSide!==null?A.shadowSide:d[A.side],M.alphaMap=A.alphaMap,M.alphaTest=A.alphaTest,M.map=A.map,M.clipShadows=A.clipShadows,M.clippingPlanes=A.clippingPlanes,M.clipIntersection=A.clipIntersection,M.displacementMap=A.displacementMap,M.displacementScale=A.displacementScale,M.displacementBias=A.displacementBias,M.wireframeLinewidth=A.wireframeLinewidth,M.linewidth=A.linewidth,U.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const W=i.properties.get(M);W.light=U}return M}function y(R,A,U,S,M){if(R.visible===!1)return;if(R.layers.test(A.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&M===yn)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,R.matrixWorld);const z=t.update(R),V=R.material;if(Array.isArray(V)){const $=z.groups;for(let G=0,J=$.length;G=1):k.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),G=J>=2);let it=null,ut={};const yt=i.getParameter(i.SCISSOR_BOX),Lt=i.getParameter(i.VIEWPORT),jt=new le().fromArray(yt),Y=new le().fromArray(Lt);function et(C,nt,H,Z){const ht=new Uint8Array(4),lt=i.createTexture();i.bindTexture(C,lt),i.texParameteri(C,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(C,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let Ot=0;Ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new vt,h=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(E,_){return p?new OffscreenCanvas(E,_):nr("canvas")}function v(E,_,F){let j=1;const K=Et(E);if((K.width>F||K.height>F)&&(j=F/Math.max(K.width,K.height)),j<1)if(typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&E instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&E instanceof ImageBitmap||typeof VideoFrame<"u"&&E instanceof VideoFrame){const X=Math.floor(j*K.width),St=Math.floor(j*K.height);d===void 0&&(d=g(X,St));const ot=_?g(X,St):d;return ot.width=X,ot.height=St,ot.getContext("2d").drawImage(E,0,0,X,St),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+X+"x"+St+")."),ot}else return"data"in E&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),E;return E}function m(E){return E.generateMipmaps}function u(E){i.generateMipmap(E)}function T(E){return E.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:E.isWebGL3DRenderTarget?i.TEXTURE_3D:E.isWebGLArrayRenderTarget||E.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function b(E,_,F,j,K=!1){if(E!==null){if(i[E]!==void 0)return i[E];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+E+"'")}let X=_;if(_===i.RED&&(F===i.FLOAT&&(X=i.R32F),F===i.HALF_FLOAT&&(X=i.R16F),F===i.UNSIGNED_BYTE&&(X=i.R8)),_===i.RED_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.R8UI),F===i.UNSIGNED_SHORT&&(X=i.R16UI),F===i.UNSIGNED_INT&&(X=i.R32UI),F===i.BYTE&&(X=i.R8I),F===i.SHORT&&(X=i.R16I),F===i.INT&&(X=i.R32I)),_===i.RG&&(F===i.FLOAT&&(X=i.RG32F),F===i.HALF_FLOAT&&(X=i.RG16F),F===i.UNSIGNED_BYTE&&(X=i.RG8)),_===i.RG_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RG8UI),F===i.UNSIGNED_SHORT&&(X=i.RG16UI),F===i.UNSIGNED_INT&&(X=i.RG32UI),F===i.BYTE&&(X=i.RG8I),F===i.SHORT&&(X=i.RG16I),F===i.INT&&(X=i.RG32I)),_===i.RGB_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGB8UI),F===i.UNSIGNED_SHORT&&(X=i.RGB16UI),F===i.UNSIGNED_INT&&(X=i.RGB32UI),F===i.BYTE&&(X=i.RGB8I),F===i.SHORT&&(X=i.RGB16I),F===i.INT&&(X=i.RGB32I)),_===i.RGBA_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGBA8UI),F===i.UNSIGNED_SHORT&&(X=i.RGBA16UI),F===i.UNSIGNED_INT&&(X=i.RGBA32UI),F===i.BYTE&&(X=i.RGBA8I),F===i.SHORT&&(X=i.RGBA16I),F===i.INT&&(X=i.RGBA32I)),_===i.RGB&&F===i.UNSIGNED_INT_5_9_9_9_REV&&(X=i.RGB9_E5),_===i.RGBA){const St=K?tr:Jt.getTransfer(j);F===i.FLOAT&&(X=i.RGBA32F),F===i.HALF_FLOAT&&(X=i.RGBA16F),F===i.UNSIGNED_BYTE&&(X=St===re?i.SRGB8_ALPHA8:i.RGBA8),F===i.UNSIGNED_SHORT_4_4_4_4&&(X=i.RGBA4),F===i.UNSIGNED_SHORT_5_5_5_1&&(X=i.RGB5_A1)}return(X===i.R16F||X===i.R32F||X===i.RG16F||X===i.RG32F||X===i.RGBA16F||X===i.RGBA32F)&&t.get("EXT_color_buffer_float"),X}function y(E,_){let F;return E?_===null||_===ei||_===zi?F=i.DEPTH24_STENCIL8:_===fn?F=i.DEPTH32F_STENCIL8:_===os&&(F=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):_===null||_===ei||_===zi?F=i.DEPTH_COMPONENT24:_===fn?F=i.DEPTH_COMPONENT32F:_===os&&(F=i.DEPTH_COMPONENT16),F}function L(E,_){return m(E)===!0||E.isFramebufferTexture&&E.minFilter!==Ye&&E.minFilter!==dn?Math.log2(Math.max(_.width,_.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?_.mipmaps.length:1}function R(E){const _=E.target;_.removeEventListener("dispose",R),U(_),_.isVideoTexture&&h.delete(_)}function A(E){const _=E.target;_.removeEventListener("dispose",A),M(_)}function U(E){const _=n.get(E);if(_.__webglInit===void 0)return;const F=E.source,j=f.get(F);if(j){const K=j[_.__cacheKey];K.usedTimes--,K.usedTimes===0&&S(E),Object.keys(j).length===0&&f.delete(F)}n.remove(E)}function S(E){const _=n.get(E);i.deleteTexture(_.__webglTexture);const F=E.source,j=f.get(F);delete j[_.__cacheKey],a.memory.textures--}function M(E){const _=n.get(E);if(E.depthTexture&&(E.depthTexture.dispose(),n.remove(E.depthTexture)),E.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(_.__webglFramebuffer[j]))for(let K=0;K<_.__webglFramebuffer[j].length;K++)i.deleteFramebuffer(_.__webglFramebuffer[j][K]);else i.deleteFramebuffer(_.__webglFramebuffer[j]);_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer[j])}else{if(Array.isArray(_.__webglFramebuffer))for(let j=0;j<_.__webglFramebuffer.length;j++)i.deleteFramebuffer(_.__webglFramebuffer[j]);else i.deleteFramebuffer(_.__webglFramebuffer);if(_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer),_.__webglMultisampledFramebuffer&&i.deleteFramebuffer(_.__webglMultisampledFramebuffer),_.__webglColorRenderbuffer)for(let j=0;j<_.__webglColorRenderbuffer.length;j++)_.__webglColorRenderbuffer[j]&&i.deleteRenderbuffer(_.__webglColorRenderbuffer[j]);_.__webglDepthRenderbuffer&&i.deleteRenderbuffer(_.__webglDepthRenderbuffer)}const F=E.textures;for(let j=0,K=F.length;j=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+s.maxTextures),D+=1,E}function V(E){const _=[];return _.push(E.wrapS),_.push(E.wrapT),_.push(E.wrapR||0),_.push(E.magFilter),_.push(E.minFilter),_.push(E.anisotropy),_.push(E.internalFormat),_.push(E.format),_.push(E.type),_.push(E.generateMipmaps),_.push(E.premultiplyAlpha),_.push(E.flipY),_.push(E.unpackAlignment),_.push(E.colorSpace),_.join()}function $(E,_){const F=n.get(E);if(E.isVideoTexture&&Mt(E),E.isRenderTargetTexture===!1&&E.version>0&&F.__version!==E.version){const j=E.image;if(j===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(j.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(F,E,_);return}}e.bindTexture(i.TEXTURE_2D,F.__webglTexture,i.TEXTURE0+_)}function G(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){Y(F,E,_);return}e.bindTexture(i.TEXTURE_2D_ARRAY,F.__webglTexture,i.TEXTURE0+_)}function J(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){Y(F,E,_);return}e.bindTexture(i.TEXTURE_3D,F.__webglTexture,i.TEXTURE0+_)}function k(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){et(F,E,_);return}e.bindTexture(i.TEXTURE_CUBE_MAP,F.__webglTexture,i.TEXTURE0+_)}const it={[ha]:i.REPEAT,[Jn]:i.CLAMP_TO_EDGE,[ua]:i.MIRRORED_REPEAT},ut={[Ye]:i.NEAREST,[ch]:i.NEAREST_MIPMAP_NEAREST,[ms]:i.NEAREST_MIPMAP_LINEAR,[dn]:i.LINEAR,[gr]:i.LINEAR_MIPMAP_NEAREST,[Qn]:i.LINEAR_MIPMAP_LINEAR},yt={[fh]:i.NEVER,[xh]:i.ALWAYS,[ph]:i.LESS,[$l]:i.LEQUAL,[mh]:i.EQUAL,[vh]:i.GEQUAL,[gh]:i.GREATER,[_h]:i.NOTEQUAL};function Lt(E,_){if(_.type===fn&&t.has("OES_texture_float_linear")===!1&&(_.magFilter===dn||_.magFilter===gr||_.magFilter===ms||_.magFilter===Qn||_.minFilter===dn||_.minFilter===gr||_.minFilter===ms||_.minFilter===Qn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(E,i.TEXTURE_WRAP_S,it[_.wrapS]),i.texParameteri(E,i.TEXTURE_WRAP_T,it[_.wrapT]),(E===i.TEXTURE_3D||E===i.TEXTURE_2D_ARRAY)&&i.texParameteri(E,i.TEXTURE_WRAP_R,it[_.wrapR]),i.texParameteri(E,i.TEXTURE_MAG_FILTER,ut[_.magFilter]),i.texParameteri(E,i.TEXTURE_MIN_FILTER,ut[_.minFilter]),_.compareFunction&&(i.texParameteri(E,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(E,i.TEXTURE_COMPARE_FUNC,yt[_.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(_.magFilter===Ye||_.minFilter!==ms&&_.minFilter!==Qn||_.type===fn&&t.has("OES_texture_float_linear")===!1)return;if(_.anisotropy>1||n.get(_).__currentAnisotropy){const F=t.get("EXT_texture_filter_anisotropic");i.texParameterf(E,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,s.getMaxAnisotropy())),n.get(_).__currentAnisotropy=_.anisotropy}}}function jt(E,_){let F=!1;E.__webglInit===void 0&&(E.__webglInit=!0,_.addEventListener("dispose",R));const j=_.source;let K=f.get(j);K===void 0&&(K={},f.set(j,K));const X=V(_);if(X!==E.__cacheKey){K[X]===void 0&&(K[X]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,F=!0),K[X].usedTimes++;const St=K[E.__cacheKey];St!==void 0&&(K[E.__cacheKey].usedTimes--,St.usedTimes===0&&S(_)),E.__cacheKey=X,E.__webglTexture=K[X].texture}return F}function Y(E,_,F){let j=i.TEXTURE_2D;(_.isDataArrayTexture||_.isCompressedArrayTexture)&&(j=i.TEXTURE_2D_ARRAY),_.isData3DTexture&&(j=i.TEXTURE_3D);const K=jt(E,_),X=_.source;e.bindTexture(j,E.__webglTexture,i.TEXTURE0+F);const St=n.get(X);if(X.version!==St.__version||K===!0){e.activeTexture(i.TEXTURE0+F);const ot=Jt.getPrimaries(Jt.workingColorSpace),dt=_.colorSpace===Fn?null:Jt.getPrimaries(_.colorSpace),Zt=_.colorSpace===Fn||ot===dt?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,_.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,_.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Zt);let tt=v(_.image,!1,s.maxTextureSize);tt=ie(_,tt);const mt=r.convert(_.format,_.colorSpace),bt=r.convert(_.type);let Pt=b(_.internalFormat,mt,bt,_.colorSpace,_.isVideoTexture);Lt(j,_);let ft;const Yt=_.mipmaps,zt=_.isVideoTexture!==!0,Xt=St.__version===void 0||K===!0,C=X.dataReady,nt=L(_,tt);if(_.isDepthTexture)Pt=y(_.format===Hi,_.type),Xt&&(zt?e.texStorage2D(i.TEXTURE_2D,1,Pt,tt.width,tt.height):e.texImage2D(i.TEXTURE_2D,0,Pt,tt.width,tt.height,0,mt,bt,null));else if(_.isDataTexture)if(Yt.length>0){zt&&Xt&&e.texStorage2D(i.TEXTURE_2D,nt,Pt,Yt[0].width,Yt[0].height);for(let H=0,Z=Yt.length;H0){const ht=$o(ft.width,ft.height,_.format,_.type);for(const lt of _.layerUpdates){const Ot=ft.data.subarray(lt*ht/ft.data.BYTES_PER_ELEMENT,(lt+1)*ht/ft.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,lt,ft.width,ft.height,1,mt,Ot)}_.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,0,ft.width,ft.height,tt.depth,mt,ft.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,H,Pt,ft.width,ft.height,tt.depth,0,ft.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else zt?C&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,0,ft.width,ft.height,tt.depth,mt,bt,ft.data):e.texImage3D(i.TEXTURE_2D_ARRAY,H,Pt,ft.width,ft.height,tt.depth,0,mt,bt,ft.data)}else{zt&&Xt&&e.texStorage2D(i.TEXTURE_2D,nt,Pt,Yt[0].width,Yt[0].height);for(let H=0,Z=Yt.length;H0){const H=$o(tt.width,tt.height,_.format,_.type);for(const Z of _.layerUpdates){const ht=tt.data.subarray(Z*H/tt.data.BYTES_PER_ELEMENT,(Z+1)*H/tt.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Z,tt.width,tt.height,1,mt,bt,ht)}_.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,tt.width,tt.height,tt.depth,mt,bt,tt.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,Pt,tt.width,tt.height,tt.depth,0,mt,bt,tt.data);else if(_.isData3DTexture)zt?(Xt&&e.texStorage3D(i.TEXTURE_3D,nt,Pt,tt.width,tt.height,tt.depth),C&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,tt.width,tt.height,tt.depth,mt,bt,tt.data)):e.texImage3D(i.TEXTURE_3D,0,Pt,tt.width,tt.height,tt.depth,0,mt,bt,tt.data);else if(_.isFramebufferTexture){if(Xt)if(zt)e.texStorage2D(i.TEXTURE_2D,nt,Pt,tt.width,tt.height);else{let H=tt.width,Z=tt.height;for(let ht=0;ht>=1,Z>>=1}}else if(Yt.length>0){if(zt&&Xt){const H=Et(Yt[0]);e.texStorage2D(i.TEXTURE_2D,nt,Pt,H.width,H.height)}for(let H=0,Z=Yt.length;H0&&nt++;const Z=Et(mt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,nt,Yt,Z.width,Z.height)}for(let Z=0;Z<6;Z++)if(tt){zt?C&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,0,0,mt[Z].width,mt[Z].height,Pt,ft,mt[Z].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,Yt,mt[Z].width,mt[Z].height,0,Pt,ft,mt[Z].data);for(let ht=0;ht>X),bt=Math.max(1,_.height>>X);K===i.TEXTURE_3D||K===i.TEXTURE_2D_ARRAY?e.texImage3D(K,X,dt,mt,bt,_.depth,0,St,ot,null):e.texImage2D(K,X,dt,mt,bt,0,St,ot,null)}e.bindFramebuffer(i.FRAMEBUFFER,E),kt(_)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,j,K,tt.__webglTexture,0,Ft(_)):(K===i.TEXTURE_2D||K>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,j,K,tt.__webglTexture,X),e.bindFramebuffer(i.FRAMEBUFFER,null)}function at(E,_,F){if(i.bindRenderbuffer(i.RENDERBUFFER,E),_.depthBuffer){const j=_.depthTexture,K=j&&j.isDepthTexture?j.type:null,X=y(_.stencilBuffer,K),St=_.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ot=Ft(_);kt(_)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ot,X,_.width,_.height):F?i.renderbufferStorageMultisample(i.RENDERBUFFER,ot,X,_.width,_.height):i.renderbufferStorage(i.RENDERBUFFER,X,_.width,_.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,St,i.RENDERBUFFER,E)}else{const j=_.textures;for(let K=0;K{delete _.__boundDepthTexture,delete _.__depthDisposeCallback,j.removeEventListener("dispose",K)};j.addEventListener("dispose",K),_.__depthDisposeCallback=K}_.__boundDepthTexture=j}if(E.depthTexture&&!_.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");wt(_.__webglFramebuffer,E)}else if(F){_.__webglDepthbuffer=[];for(let j=0;j<6;j++)if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer[j]),_.__webglDepthbuffer[j]===void 0)_.__webglDepthbuffer[j]=i.createRenderbuffer(),at(_.__webglDepthbuffer[j],E,!1);else{const K=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,X=_.__webglDepthbuffer[j];i.bindRenderbuffer(i.RENDERBUFFER,X),i.framebufferRenderbuffer(i.FRAMEBUFFER,K,i.RENDERBUFFER,X)}}else if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer),_.__webglDepthbuffer===void 0)_.__webglDepthbuffer=i.createRenderbuffer(),at(_.__webglDepthbuffer,E,!1);else{const j=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=_.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,j,i.RENDERBUFFER,K)}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Gt(E,_,F){const j=n.get(E);_!==void 0&&xt(j.__webglFramebuffer,E,E.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),F!==void 0&&Ut(E)}function ce(E){const _=E.texture,F=n.get(E),j=n.get(_);E.addEventListener("dispose",A);const K=E.textures,X=E.isWebGLCubeRenderTarget===!0,St=K.length>1;if(St||(j.__webglTexture===void 0&&(j.__webglTexture=i.createTexture()),j.__version=_.version,a.memory.textures++),X){F.__webglFramebuffer=[];for(let ot=0;ot<6;ot++)if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer[ot]=[];for(let dt=0;dt<_.mipmaps.length;dt++)F.__webglFramebuffer[ot][dt]=i.createFramebuffer()}else F.__webglFramebuffer[ot]=i.createFramebuffer()}else{if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer=[];for(let ot=0;ot<_.mipmaps.length;ot++)F.__webglFramebuffer[ot]=i.createFramebuffer()}else F.__webglFramebuffer=i.createFramebuffer();if(St)for(let ot=0,dt=K.length;ot0&&kt(E)===!1){F.__webglMultisampledFramebuffer=i.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ot=0;ot0)for(let dt=0;dt<_.mipmaps.length;dt++)xt(F.__webglFramebuffer[ot][dt],E,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ot,dt);else xt(F.__webglFramebuffer[ot],E,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ot,0);m(_)&&u(i.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(St){for(let ot=0,dt=K.length;ot0)for(let dt=0;dt<_.mipmaps.length;dt++)xt(F.__webglFramebuffer[dt],E,_,i.COLOR_ATTACHMENT0,ot,dt);else xt(F.__webglFramebuffer,E,_,i.COLOR_ATTACHMENT0,ot,0);m(_)&&u(ot),e.unbindTexture()}E.depthBuffer&&Ut(E)}function rt(E){const _=E.textures;for(let F=0,j=_.length;F0){if(kt(E)===!1){const _=E.textures,F=E.width,j=E.height;let K=i.COLOR_BUFFER_BIT;const X=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,St=n.get(E),ot=_.length>1;if(ot)for(let dt=0;dt<_.length;dt++)e.bindFramebuffer(i.FRAMEBUFFER,St.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.RENDERBUFFER,null),e.bindFramebuffer(i.FRAMEBUFFER,St.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.TEXTURE_2D,null,0);e.bindFramebuffer(i.READ_FRAMEBUFFER,St.__webglMultisampledFramebuffer),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,St.__webglFramebuffer);for(let dt=0;dt<_.length;dt++){if(E.resolveDepthBuffer&&(E.depthBuffer&&(K|=i.DEPTH_BUFFER_BIT),E.stencilBuffer&&E.resolveStencilBuffer&&(K|=i.STENCIL_BUFFER_BIT)),ot){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,St.__webglColorRenderbuffer[dt]);const Zt=n.get(_[dt]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Zt,0)}i.blitFramebuffer(0,0,F,j,0,0,F,j,K,i.NEAREST),l===!0&&(Ct.length=0,w.length=0,Ct.push(i.COLOR_ATTACHMENT0+dt),E.depthBuffer&&E.resolveDepthBuffer===!1&&(Ct.push(X),w.push(X),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,w)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Ct))}if(e.bindFramebuffer(i.READ_FRAMEBUFFER,null),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),ot)for(let dt=0;dt<_.length;dt++){e.bindFramebuffer(i.FRAMEBUFFER,St.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.RENDERBUFFER,St.__webglColorRenderbuffer[dt]);const Zt=n.get(_[dt]).__webglTexture;e.bindFramebuffer(i.FRAMEBUFFER,St.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.TEXTURE_2D,Zt,0)}e.bindFramebuffer(i.DRAW_FRAMEBUFFER,St.__webglMultisampledFramebuffer)}else if(E.depthBuffer&&E.resolveDepthBuffer===!1&&l){const _=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[_])}}}function Ft(E){return Math.min(s.maxSamples,E.samples)}function kt(E){const _=n.get(E);return E.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function Mt(E){const _=a.render.frame;h.get(E)!==_&&(h.set(E,_),E.update())}function ie(E,_){const F=E.colorSpace,j=E.format,K=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||F!==ki&&F!==Fn&&(Jt.getTransfer(F)===re?(j!==an||K!==An)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),_}function Et(E){return typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(c.width=E.naturalWidth||E.width,c.height=E.naturalHeight||E.height):typeof VideoFrame<"u"&&E instanceof VideoFrame?(c.width=E.displayWidth,c.height=E.displayHeight):(c.width=E.width,c.height=E.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=W,this.setTexture2D=$,this.setTexture2DArray=G,this.setTexture3D=J,this.setTextureCube=k,this.rebindTextures=Gt,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=rt,this.updateMultisampleRenderTarget=ve,this.setupDepthRenderbuffer=Ut,this.setupFrameBufferTexture=xt,this.useMultisampledRTT=kt}function zm(i,t){function e(n,s=Fn){let r;const a=Jt.getTransfer(s);if(n===An)return i.UNSIGNED_BYTE;if(n===qa)return i.UNSIGNED_SHORT_4_4_4_4;if(n===ja)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Gl)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===kl)return i.BYTE;if(n===Vl)return i.SHORT;if(n===os)return i.UNSIGNED_SHORT;if(n===Ya)return i.INT;if(n===ei)return i.UNSIGNED_INT;if(n===fn)return i.FLOAT;if(n===Tn)return i.HALF_FLOAT;if(n===Wl)return i.ALPHA;if(n===Xl)return i.RGB;if(n===an)return i.RGBA;if(n===Yl)return i.LUMINANCE;if(n===ql)return i.LUMINANCE_ALPHA;if(n===Ui)return i.DEPTH_COMPONENT;if(n===Hi)return i.DEPTH_STENCIL;if(n===Za)return i.RED;if(n===Ka)return i.RED_INTEGER;if(n===jl)return i.RG;if(n===$a)return i.RG_INTEGER;if(n===Ja)return i.RGBA_INTEGER;if(n===Xs||n===Ys||n===qs||n===js)if(a===re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Xs)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ys)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===qs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===js)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Xs)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ys)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===qs)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===js)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===da||n===fa||n===pa||n===ma)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===da)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===fa)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===pa)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ma)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===ga||n===_a||n===va)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===ga||n===_a)return a===re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===va)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===xa||n===Ma||n===Sa||n===ya||n===Ea||n===ba||n===Ta||n===wa||n===Aa||n===Ra||n===Ca||n===Pa||n===Da||n===La)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===xa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ma)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Sa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ya)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ea)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ba)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ta)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===wa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Aa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ra)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Ca)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Pa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Da)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===La)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Zs||n===Ua||n===Ia)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===Zs)return a===re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Ua)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ia)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Zl||n===Na||n===Fa||n===Oa)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===Zs)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Na)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Fa)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Oa)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===zi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}const Hm={type:"move"};class Zr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ci,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ci,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ci,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const v of t.hand.values()){const m=e.getJointPose(v,n),u=this._getHandJoint(c,v);m!==null&&(u.matrix.fromArray(m.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=m.radius),u.visible=m!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=h.position.distanceTo(d.position),p=.02,g=.005;c.inputState.pinching&&f>p+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hm)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Ci;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const km=` +}`;function Fm(i,t,e){let n=new to;const s=new vt,r=new vt,a=new le,o=new iu({depthPacking:dh}),l=new su,c={},h=e.maxTextureSize,d={[zn]:ke,[ke]:zn,[hn]:hn},f=new Ne({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new vt},radius:{value:4}},vertexShader:Im,fragmentShader:Nm}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new pe;g.setAttribute("position",new de(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Se(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Fl;let u=this.type;this.render=function(R,A,U){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||R.length===0)return;const S=i.getRenderTarget(),M=i.getActiveCubeFace(),D=i.getActiveMipmapLevel(),W=i.state;W.setBlending(bn),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const z=u!==yn&&this.type===yn,V=u===yn&&this.type!==yn;for(let $=0,G=R.length;$h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/it.x),s.x=r.x*it.x,k.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/it.y),s.y=r.y*it.y,k.mapSize.y=r.y)),k.map===null||z===!0||V===!0){const yt=this.type!==yn?{minFilter:qe,magFilter:qe}:{};k.map!==null&&k.map.dispose(),k.map=new on(s.x,s.y,yt),k.map.texture.name=J.name+".shadowMap",k.camera.updateProjectionMatrix()}i.setRenderTarget(k.map),i.clear();const ut=k.getViewportCount();for(let yt=0;yt0||A.map&&A.alphaTest>0){const W=M.uuid,z=A.uuid;let V=c[W];V===void 0&&(V={},c[W]=V);let $=V[z];$===void 0&&($=M.clone(),V[z]=$,A.addEventListener("dispose",L)),M=$}if(M.visible=A.visible,M.wireframe=A.wireframe,S===yn?M.side=A.shadowSide!==null?A.shadowSide:A.side:M.side=A.shadowSide!==null?A.shadowSide:d[A.side],M.alphaMap=A.alphaMap,M.alphaTest=A.alphaTest,M.map=A.map,M.clipShadows=A.clipShadows,M.clippingPlanes=A.clippingPlanes,M.clipIntersection=A.clipIntersection,M.displacementMap=A.displacementMap,M.displacementScale=A.displacementScale,M.displacementBias=A.displacementBias,M.wireframeLinewidth=A.wireframeLinewidth,M.linewidth=A.linewidth,U.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const W=i.properties.get(M);W.light=U}return M}function y(R,A,U,S,M){if(R.visible===!1)return;if(R.layers.test(A.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&M===yn)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,R.matrixWorld);const z=t.update(R),V=R.material;if(Array.isArray(V)){const $=z.groups;for(let G=0,J=$.length;G=1):k.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),G=J>=2);let it=null,ut={};const yt=i.getParameter(i.SCISSOR_BOX),Lt=i.getParameter(i.VIEWPORT),qt=new le().fromArray(yt),Y=new le().fromArray(Lt);function nt(C,et,H,q){const lt=new Uint8Array(4),ct=i.createTexture();i.bindTexture(C,ct),i.texParameteri(C,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(C,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let Nt=0;Nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new vt,h=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(E,_){return p?new OffscreenCanvas(E,_):nr("canvas")}function v(E,_,F){let Z=1;const K=Et(E);if((K.width>F||K.height>F)&&(Z=F/Math.max(K.width,K.height)),Z<1)if(typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&E instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&E instanceof ImageBitmap||typeof VideoFrame<"u"&&E instanceof VideoFrame){const X=Math.floor(Z*K.width),St=Math.floor(Z*K.height);d===void 0&&(d=g(X,St));const ot=_?g(X,St):d;return ot.width=X,ot.height=St,ot.getContext("2d").drawImage(E,0,0,X,St),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+X+"x"+St+")."),ot}else return"data"in E&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),E;return E}function m(E){return E.generateMipmaps}function u(E){i.generateMipmap(E)}function T(E){return E.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:E.isWebGL3DRenderTarget?i.TEXTURE_3D:E.isWebGLArrayRenderTarget||E.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function b(E,_,F,Z,K=!1){if(E!==null){if(i[E]!==void 0)return i[E];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+E+"'")}let X=_;if(_===i.RED&&(F===i.FLOAT&&(X=i.R32F),F===i.HALF_FLOAT&&(X=i.R16F),F===i.UNSIGNED_BYTE&&(X=i.R8)),_===i.RED_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.R8UI),F===i.UNSIGNED_SHORT&&(X=i.R16UI),F===i.UNSIGNED_INT&&(X=i.R32UI),F===i.BYTE&&(X=i.R8I),F===i.SHORT&&(X=i.R16I),F===i.INT&&(X=i.R32I)),_===i.RG&&(F===i.FLOAT&&(X=i.RG32F),F===i.HALF_FLOAT&&(X=i.RG16F),F===i.UNSIGNED_BYTE&&(X=i.RG8)),_===i.RG_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RG8UI),F===i.UNSIGNED_SHORT&&(X=i.RG16UI),F===i.UNSIGNED_INT&&(X=i.RG32UI),F===i.BYTE&&(X=i.RG8I),F===i.SHORT&&(X=i.RG16I),F===i.INT&&(X=i.RG32I)),_===i.RGB_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGB8UI),F===i.UNSIGNED_SHORT&&(X=i.RGB16UI),F===i.UNSIGNED_INT&&(X=i.RGB32UI),F===i.BYTE&&(X=i.RGB8I),F===i.SHORT&&(X=i.RGB16I),F===i.INT&&(X=i.RGB32I)),_===i.RGBA_INTEGER&&(F===i.UNSIGNED_BYTE&&(X=i.RGBA8UI),F===i.UNSIGNED_SHORT&&(X=i.RGBA16UI),F===i.UNSIGNED_INT&&(X=i.RGBA32UI),F===i.BYTE&&(X=i.RGBA8I),F===i.SHORT&&(X=i.RGBA16I),F===i.INT&&(X=i.RGBA32I)),_===i.RGB&&F===i.UNSIGNED_INT_5_9_9_9_REV&&(X=i.RGB9_E5),_===i.RGBA){const St=K?tr:$t.getTransfer(Z);F===i.FLOAT&&(X=i.RGBA32F),F===i.HALF_FLOAT&&(X=i.RGBA16F),F===i.UNSIGNED_BYTE&&(X=St===re?i.SRGB8_ALPHA8:i.RGBA8),F===i.UNSIGNED_SHORT_4_4_4_4&&(X=i.RGBA4),F===i.UNSIGNED_SHORT_5_5_5_1&&(X=i.RGB5_A1)}return(X===i.R16F||X===i.R32F||X===i.RG16F||X===i.RG32F||X===i.RGBA16F||X===i.RGBA32F)&&t.get("EXT_color_buffer_float"),X}function y(E,_){let F;return E?_===null||_===ei||_===zi?F=i.DEPTH24_STENCIL8:_===fn?F=i.DEPTH32F_STENCIL8:_===os&&(F=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):_===null||_===ei||_===zi?F=i.DEPTH_COMPONENT24:_===fn?F=i.DEPTH_COMPONENT32F:_===os&&(F=i.DEPTH_COMPONENT16),F}function L(E,_){return m(E)===!0||E.isFramebufferTexture&&E.minFilter!==qe&&E.minFilter!==dn?Math.log2(Math.max(_.width,_.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?_.mipmaps.length:1}function R(E){const _=E.target;_.removeEventListener("dispose",R),U(_),_.isVideoTexture&&h.delete(_)}function A(E){const _=E.target;_.removeEventListener("dispose",A),M(_)}function U(E){const _=n.get(E);if(_.__webglInit===void 0)return;const F=E.source,Z=f.get(F);if(Z){const K=Z[_.__cacheKey];K.usedTimes--,K.usedTimes===0&&S(E),Object.keys(Z).length===0&&f.delete(F)}n.remove(E)}function S(E){const _=n.get(E);i.deleteTexture(_.__webglTexture);const F=E.source,Z=f.get(F);delete Z[_.__cacheKey],a.memory.textures--}function M(E){const _=n.get(E);if(E.depthTexture&&(E.depthTexture.dispose(),n.remove(E.depthTexture)),E.isWebGLCubeRenderTarget)for(let Z=0;Z<6;Z++){if(Array.isArray(_.__webglFramebuffer[Z]))for(let K=0;K<_.__webglFramebuffer[Z].length;K++)i.deleteFramebuffer(_.__webglFramebuffer[Z][K]);else i.deleteFramebuffer(_.__webglFramebuffer[Z]);_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer[Z])}else{if(Array.isArray(_.__webglFramebuffer))for(let Z=0;Z<_.__webglFramebuffer.length;Z++)i.deleteFramebuffer(_.__webglFramebuffer[Z]);else i.deleteFramebuffer(_.__webglFramebuffer);if(_.__webglDepthbuffer&&i.deleteRenderbuffer(_.__webglDepthbuffer),_.__webglMultisampledFramebuffer&&i.deleteFramebuffer(_.__webglMultisampledFramebuffer),_.__webglColorRenderbuffer)for(let Z=0;Z<_.__webglColorRenderbuffer.length;Z++)_.__webglColorRenderbuffer[Z]&&i.deleteRenderbuffer(_.__webglColorRenderbuffer[Z]);_.__webglDepthRenderbuffer&&i.deleteRenderbuffer(_.__webglDepthRenderbuffer)}const F=E.textures;for(let Z=0,K=F.length;Z=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+s.maxTextures),D+=1,E}function V(E){const _=[];return _.push(E.wrapS),_.push(E.wrapT),_.push(E.wrapR||0),_.push(E.magFilter),_.push(E.minFilter),_.push(E.anisotropy),_.push(E.internalFormat),_.push(E.format),_.push(E.type),_.push(E.generateMipmaps),_.push(E.premultiplyAlpha),_.push(E.flipY),_.push(E.unpackAlignment),_.push(E.colorSpace),_.join()}function $(E,_){const F=n.get(E);if(E.isVideoTexture&&Mt(E),E.isRenderTargetTexture===!1&&E.version>0&&F.__version!==E.version){const Z=E.image;if(Z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(F,E,_);return}}e.bindTexture(i.TEXTURE_2D,F.__webglTexture,i.TEXTURE0+_)}function G(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){Y(F,E,_);return}e.bindTexture(i.TEXTURE_2D_ARRAY,F.__webglTexture,i.TEXTURE0+_)}function J(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){Y(F,E,_);return}e.bindTexture(i.TEXTURE_3D,F.__webglTexture,i.TEXTURE0+_)}function k(E,_){const F=n.get(E);if(E.version>0&&F.__version!==E.version){nt(F,E,_);return}e.bindTexture(i.TEXTURE_CUBE_MAP,F.__webglTexture,i.TEXTURE0+_)}const it={[ha]:i.REPEAT,[Jn]:i.CLAMP_TO_EDGE,[ua]:i.MIRRORED_REPEAT},ut={[qe]:i.NEAREST,[hh]:i.NEAREST_MIPMAP_NEAREST,[ms]:i.NEAREST_MIPMAP_LINEAR,[dn]:i.LINEAR,[gr]:i.LINEAR_MIPMAP_NEAREST,[Qn]:i.LINEAR_MIPMAP_LINEAR},yt={[ph]:i.NEVER,[Mh]:i.ALWAYS,[mh]:i.LESS,[Kl]:i.LEQUAL,[gh]:i.EQUAL,[xh]:i.GEQUAL,[_h]:i.GREATER,[vh]:i.NOTEQUAL};function Lt(E,_){if(_.type===fn&&t.has("OES_texture_float_linear")===!1&&(_.magFilter===dn||_.magFilter===gr||_.magFilter===ms||_.magFilter===Qn||_.minFilter===dn||_.minFilter===gr||_.minFilter===ms||_.minFilter===Qn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(E,i.TEXTURE_WRAP_S,it[_.wrapS]),i.texParameteri(E,i.TEXTURE_WRAP_T,it[_.wrapT]),(E===i.TEXTURE_3D||E===i.TEXTURE_2D_ARRAY)&&i.texParameteri(E,i.TEXTURE_WRAP_R,it[_.wrapR]),i.texParameteri(E,i.TEXTURE_MAG_FILTER,ut[_.magFilter]),i.texParameteri(E,i.TEXTURE_MIN_FILTER,ut[_.minFilter]),_.compareFunction&&(i.texParameteri(E,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(E,i.TEXTURE_COMPARE_FUNC,yt[_.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(_.magFilter===qe||_.minFilter!==ms&&_.minFilter!==Qn||_.type===fn&&t.has("OES_texture_float_linear")===!1)return;if(_.anisotropy>1||n.get(_).__currentAnisotropy){const F=t.get("EXT_texture_filter_anisotropic");i.texParameterf(E,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,s.getMaxAnisotropy())),n.get(_).__currentAnisotropy=_.anisotropy}}}function qt(E,_){let F=!1;E.__webglInit===void 0&&(E.__webglInit=!0,_.addEventListener("dispose",R));const Z=_.source;let K=f.get(Z);K===void 0&&(K={},f.set(Z,K));const X=V(_);if(X!==E.__cacheKey){K[X]===void 0&&(K[X]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,F=!0),K[X].usedTimes++;const St=K[E.__cacheKey];St!==void 0&&(K[E.__cacheKey].usedTimes--,St.usedTimes===0&&S(_)),E.__cacheKey=X,E.__webglTexture=K[X].texture}return F}function Y(E,_,F){let Z=i.TEXTURE_2D;(_.isDataArrayTexture||_.isCompressedArrayTexture)&&(Z=i.TEXTURE_2D_ARRAY),_.isData3DTexture&&(Z=i.TEXTURE_3D);const K=qt(E,_),X=_.source;e.bindTexture(Z,E.__webglTexture,i.TEXTURE0+F);const St=n.get(X);if(X.version!==St.__version||K===!0){e.activeTexture(i.TEXTURE0+F);const ot=$t.getPrimaries($t.workingColorSpace),dt=_.colorSpace===Fn?null:$t.getPrimaries(_.colorSpace),jt=_.colorSpace===Fn||ot===dt?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,_.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,_.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,jt);let tt=v(_.image,!1,s.maxTextureSize);tt=ne(_,tt);const mt=r.convert(_.format,_.colorSpace),bt=r.convert(_.type);let Pt=b(_.internalFormat,mt,bt,_.colorSpace,_.isVideoTexture);Lt(Z,_);let ft;const Xt=_.mipmaps,zt=_.isVideoTexture!==!0,ie=St.__version===void 0||K===!0,C=X.dataReady,et=L(_,tt);if(_.isDepthTexture)Pt=y(_.format===Hi,_.type),ie&&(zt?e.texStorage2D(i.TEXTURE_2D,1,Pt,tt.width,tt.height):e.texImage2D(i.TEXTURE_2D,0,Pt,tt.width,tt.height,0,mt,bt,null));else if(_.isDataTexture)if(Xt.length>0){zt&&ie&&e.texStorage2D(i.TEXTURE_2D,et,Pt,Xt[0].width,Xt[0].height);for(let H=0,q=Xt.length;H0){const lt=$o(ft.width,ft.height,_.format,_.type);for(const ct of _.layerUpdates){const Nt=ft.data.subarray(ct*lt/ft.data.BYTES_PER_ELEMENT,(ct+1)*lt/ft.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,ct,ft.width,ft.height,1,mt,Nt)}_.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,0,ft.width,ft.height,tt.depth,mt,ft.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,H,Pt,ft.width,ft.height,tt.depth,0,ft.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else zt?C&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,H,0,0,0,ft.width,ft.height,tt.depth,mt,bt,ft.data):e.texImage3D(i.TEXTURE_2D_ARRAY,H,Pt,ft.width,ft.height,tt.depth,0,mt,bt,ft.data)}else{zt&&ie&&e.texStorage2D(i.TEXTURE_2D,et,Pt,Xt[0].width,Xt[0].height);for(let H=0,q=Xt.length;H0){const H=$o(tt.width,tt.height,_.format,_.type);for(const q of _.layerUpdates){const lt=tt.data.subarray(q*H/tt.data.BYTES_PER_ELEMENT,(q+1)*H/tt.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,q,tt.width,tt.height,1,mt,bt,lt)}_.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,tt.width,tt.height,tt.depth,mt,bt,tt.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,Pt,tt.width,tt.height,tt.depth,0,mt,bt,tt.data);else if(_.isData3DTexture)zt?(ie&&e.texStorage3D(i.TEXTURE_3D,et,Pt,tt.width,tt.height,tt.depth),C&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,tt.width,tt.height,tt.depth,mt,bt,tt.data)):e.texImage3D(i.TEXTURE_3D,0,Pt,tt.width,tt.height,tt.depth,0,mt,bt,tt.data);else if(_.isFramebufferTexture){if(ie)if(zt)e.texStorage2D(i.TEXTURE_2D,et,Pt,tt.width,tt.height);else{let H=tt.width,q=tt.height;for(let lt=0;lt>=1,q>>=1}}else if(Xt.length>0){if(zt&&ie){const H=Et(Xt[0]);e.texStorage2D(i.TEXTURE_2D,et,Pt,H.width,H.height)}for(let H=0,q=Xt.length;H0&&et++;const q=Et(mt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,et,Xt,q.width,q.height)}for(let q=0;q<6;q++)if(tt){zt?C&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+q,0,0,0,mt[q].width,mt[q].height,Pt,ft,mt[q].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+q,0,Xt,mt[q].width,mt[q].height,0,Pt,ft,mt[q].data);for(let lt=0;lt>X),bt=Math.max(1,_.height>>X);K===i.TEXTURE_3D||K===i.TEXTURE_2D_ARRAY?e.texImage3D(K,X,dt,mt,bt,_.depth,0,St,ot,null):e.texImage2D(K,X,dt,mt,bt,0,St,ot,null)}e.bindFramebuffer(i.FRAMEBUFFER,E),kt(_)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Z,K,tt.__webglTexture,0,Bt(_)):(K===i.TEXTURE_2D||K>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Z,K,tt.__webglTexture,X),e.bindFramebuffer(i.FRAMEBUFFER,null)}function at(E,_,F){if(i.bindRenderbuffer(i.RENDERBUFFER,E),_.depthBuffer){const Z=_.depthTexture,K=Z&&Z.isDepthTexture?Z.type:null,X=y(_.stencilBuffer,K),St=_.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ot=Bt(_);kt(_)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ot,X,_.width,_.height):F?i.renderbufferStorageMultisample(i.RENDERBUFFER,ot,X,_.width,_.height):i.renderbufferStorage(i.RENDERBUFFER,X,_.width,_.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,St,i.RENDERBUFFER,E)}else{const Z=_.textures;for(let K=0;K{delete _.__boundDepthTexture,delete _.__depthDisposeCallback,Z.removeEventListener("dispose",K)};Z.addEventListener("dispose",K),_.__depthDisposeCallback=K}_.__boundDepthTexture=Z}if(E.depthTexture&&!_.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");wt(_.__webglFramebuffer,E)}else if(F){_.__webglDepthbuffer=[];for(let Z=0;Z<6;Z++)if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer[Z]),_.__webglDepthbuffer[Z]===void 0)_.__webglDepthbuffer[Z]=i.createRenderbuffer(),at(_.__webglDepthbuffer[Z],E,!1);else{const K=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,X=_.__webglDepthbuffer[Z];i.bindRenderbuffer(i.RENDERBUFFER,X),i.framebufferRenderbuffer(i.FRAMEBUFFER,K,i.RENDERBUFFER,X)}}else if(e.bindFramebuffer(i.FRAMEBUFFER,_.__webglFramebuffer),_.__webglDepthbuffer===void 0)_.__webglDepthbuffer=i.createRenderbuffer(),at(_.__webglDepthbuffer,E,!1);else{const Z=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=_.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,Z,i.RENDERBUFFER,K)}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Gt(E,_,F){const Z=n.get(E);_!==void 0&&xt(Z.__webglFramebuffer,E,E.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),F!==void 0&&Ut(E)}function ce(E){const _=E.texture,F=n.get(E),Z=n.get(_);E.addEventListener("dispose",A);const K=E.textures,X=E.isWebGLCubeRenderTarget===!0,St=K.length>1;if(St||(Z.__webglTexture===void 0&&(Z.__webglTexture=i.createTexture()),Z.__version=_.version,a.memory.textures++),X){F.__webglFramebuffer=[];for(let ot=0;ot<6;ot++)if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer[ot]=[];for(let dt=0;dt<_.mipmaps.length;dt++)F.__webglFramebuffer[ot][dt]=i.createFramebuffer()}else F.__webglFramebuffer[ot]=i.createFramebuffer()}else{if(_.mipmaps&&_.mipmaps.length>0){F.__webglFramebuffer=[];for(let ot=0;ot<_.mipmaps.length;ot++)F.__webglFramebuffer[ot]=i.createFramebuffer()}else F.__webglFramebuffer=i.createFramebuffer();if(St)for(let ot=0,dt=K.length;ot0&&kt(E)===!1){F.__webglMultisampledFramebuffer=i.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ot=0;ot0)for(let dt=0;dt<_.mipmaps.length;dt++)xt(F.__webglFramebuffer[ot][dt],E,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ot,dt);else xt(F.__webglFramebuffer[ot],E,_,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ot,0);m(_)&&u(i.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(St){for(let ot=0,dt=K.length;ot0)for(let dt=0;dt<_.mipmaps.length;dt++)xt(F.__webglFramebuffer[dt],E,_,i.COLOR_ATTACHMENT0,ot,dt);else xt(F.__webglFramebuffer,E,_,i.COLOR_ATTACHMENT0,ot,0);m(_)&&u(ot),e.unbindTexture()}E.depthBuffer&&Ut(E)}function rt(E){const _=E.textures;for(let F=0,Z=_.length;F0){if(kt(E)===!1){const _=E.textures,F=E.width,Z=E.height;let K=i.COLOR_BUFFER_BIT;const X=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,St=n.get(E),ot=_.length>1;if(ot)for(let dt=0;dt<_.length;dt++)e.bindFramebuffer(i.FRAMEBUFFER,St.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.RENDERBUFFER,null),e.bindFramebuffer(i.FRAMEBUFFER,St.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.TEXTURE_2D,null,0);e.bindFramebuffer(i.READ_FRAMEBUFFER,St.__webglMultisampledFramebuffer),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,St.__webglFramebuffer);for(let dt=0;dt<_.length;dt++){if(E.resolveDepthBuffer&&(E.depthBuffer&&(K|=i.DEPTH_BUFFER_BIT),E.stencilBuffer&&E.resolveStencilBuffer&&(K|=i.STENCIL_BUFFER_BIT)),ot){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,St.__webglColorRenderbuffer[dt]);const jt=n.get(_[dt]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,jt,0)}i.blitFramebuffer(0,0,F,Z,0,0,F,Z,K,i.NEAREST),l===!0&&(Ct.length=0,w.length=0,Ct.push(i.COLOR_ATTACHMENT0+dt),E.depthBuffer&&E.resolveDepthBuffer===!1&&(Ct.push(X),w.push(X),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,w)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Ct))}if(e.bindFramebuffer(i.READ_FRAMEBUFFER,null),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),ot)for(let dt=0;dt<_.length;dt++){e.bindFramebuffer(i.FRAMEBUFFER,St.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.RENDERBUFFER,St.__webglColorRenderbuffer[dt]);const jt=n.get(_[dt]).__webglTexture;e.bindFramebuffer(i.FRAMEBUFFER,St.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+dt,i.TEXTURE_2D,jt,0)}e.bindFramebuffer(i.DRAW_FRAMEBUFFER,St.__webglMultisampledFramebuffer)}else if(E.depthBuffer&&E.resolveDepthBuffer===!1&&l){const _=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[_])}}}function Bt(E){return Math.min(s.maxSamples,E.samples)}function kt(E){const _=n.get(E);return E.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function Mt(E){const _=a.render.frame;h.get(E)!==_&&(h.set(E,_),E.update())}function ne(E,_){const F=E.colorSpace,Z=E.format,K=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||F!==ki&&F!==Fn&&($t.getTransfer(F)===re?(Z!==an||K!==An)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),_}function Et(E){return typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(c.width=E.naturalWidth||E.width,c.height=E.naturalHeight||E.height):typeof VideoFrame<"u"&&E instanceof VideoFrame?(c.width=E.displayWidth,c.height=E.displayHeight):(c.width=E.width,c.height=E.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=W,this.setTexture2D=$,this.setTexture2DArray=G,this.setTexture3D=J,this.setTextureCube=k,this.rebindTextures=Gt,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=rt,this.updateMultisampleRenderTarget=ve,this.setupDepthRenderbuffer=Ut,this.setupFrameBufferTexture=xt,this.useMultisampledRTT=kt}function Hm(i,t){function e(n,s=Fn){let r;const a=$t.getTransfer(s);if(n===An)return i.UNSIGNED_BYTE;if(n===qa)return i.UNSIGNED_SHORT_4_4_4_4;if(n===ja)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Vl)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Hl)return i.BYTE;if(n===kl)return i.SHORT;if(n===os)return i.UNSIGNED_SHORT;if(n===Ya)return i.INT;if(n===ei)return i.UNSIGNED_INT;if(n===fn)return i.FLOAT;if(n===Tn)return i.HALF_FLOAT;if(n===Gl)return i.ALPHA;if(n===Wl)return i.RGB;if(n===an)return i.RGBA;if(n===Xl)return i.LUMINANCE;if(n===Yl)return i.LUMINANCE_ALPHA;if(n===Ui)return i.DEPTH_COMPONENT;if(n===Hi)return i.DEPTH_STENCIL;if(n===Za)return i.RED;if(n===Ka)return i.RED_INTEGER;if(n===ql)return i.RG;if(n===$a)return i.RG_INTEGER;if(n===Ja)return i.RGBA_INTEGER;if(n===Xs||n===Ys||n===qs||n===js)if(a===re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Xs)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ys)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===qs)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===js)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Xs)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ys)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===qs)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===js)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===da||n===fa||n===pa||n===ma)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===da)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===fa)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===pa)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ma)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===ga||n===_a||n===va)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===ga||n===_a)return a===re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===va)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===xa||n===Ma||n===Sa||n===ya||n===Ea||n===ba||n===Ta||n===wa||n===Aa||n===Ra||n===Ca||n===Pa||n===Da||n===La)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===xa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ma)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Sa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ya)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ea)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ba)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ta)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===wa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Aa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ra)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Ca)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Pa)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Da)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===La)return a===re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Zs||n===Ua||n===Ia)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===Zs)return a===re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Ua)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ia)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===jl||n===Na||n===Fa||n===Oa)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===Zs)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Na)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Fa)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Oa)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===zi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}const km={type:"move"};class Zr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ci,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ci,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ci,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const v of t.hand.values()){const m=e.getJointPose(v,n),u=this._getHandJoint(c,v);m!==null&&(u.matrix.fromArray(m.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=m.radius),u.visible=m!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=h.position.distanceTo(d.position),p=.02,g=.005;c.inputState.pinching&&f>p+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(km)))}return o!==null&&(o.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Ci;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const Vm=` void main() { gl_Position = vec4( position, 1.0 ); -}`,Vm=` +}`,Gm=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3824,7 +3824,7 @@ void main() { } -}`;class Gm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const s=new Ce,r=t.properties.get(s);r.__webglTexture=e.texture,(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new Ne({vertexShader:km,fragmentShader:Vm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Me(new us(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Wm extends ii{constructor(t,e){super();const n=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,d=null,f=null,p=null,g=null;const v=new Gm,m=e.getContextAttributes();let u=null,T=null;const b=[],y=[],L=new vt;let R=null;const A=new Xe;A.viewport=new le;const U=new Xe;U.viewport=new le;const S=[A,U],M=new ou;let D=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let et=b[Y];return et===void 0&&(et=new Zr,b[Y]=et),et.getTargetRaySpace()},this.getControllerGrip=function(Y){let et=b[Y];return et===void 0&&(et=new Zr,b[Y]=et),et.getGripSpace()},this.getHand=function(Y){let et=b[Y];return et===void 0&&(et=new Zr,b[Y]=et),et.getHandSpace()};function z(Y){const et=y.indexOf(Y.inputSource);if(et===-1)return;const xt=b[et];xt!==void 0&&(xt.update(Y.inputSource,Y.frame,c||a),xt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",z),s.removeEventListener("selectstart",z),s.removeEventListener("selectend",z),s.removeEventListener("squeeze",z),s.removeEventListener("squeezestart",z),s.removeEventListener("squeezeend",z),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",$);for(let Y=0;Y=0&&(y[at]=null,b[at].disconnect(xt))}for(let et=0;et=y.length){y.push(xt),at=Ut;break}else if(y[Ut]===null){y[Ut]=xt,at=Ut;break}if(at===-1)break}const wt=b[at];wt&&wt.connect(xt)}}const G=new P,J=new P;function k(Y,et,xt){G.setFromMatrixPosition(et.matrixWorld),J.setFromMatrixPosition(xt.matrixWorld);const at=G.distanceTo(J),wt=et.projectionMatrix.elements,Ut=xt.projectionMatrix.elements,Gt=wt[14]/(wt[10]-1),ce=wt[14]/(wt[10]+1),rt=(wt[9]+1)/wt[5],Ct=(wt[9]-1)/wt[5],w=(wt[8]-1)/wt[0],ve=(Ut[8]+1)/Ut[0],Ft=Gt*w,kt=Gt*ve,Mt=at/(-w+ve),ie=Mt*-w;if(et.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(ie),Y.translateZ(Mt),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),wt[10]===-1)Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse);else{const Et=Gt+Mt,E=ce+Mt,_=Ft-ie,F=kt+(at-ie),j=rt*ce/E*Et,K=Ct*ce/E*Et;Y.projectionMatrix.makePerspective(_,F,j,K,Et,E),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function it(Y,et){et===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(et.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let et=Y.near,xt=Y.far;v.texture!==null&&(v.depthNear>0&&(et=v.depthNear),v.depthFar>0&&(xt=v.depthFar)),M.near=U.near=A.near=et,M.far=U.far=A.far=xt,(D!==M.near||W!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),D=M.near,W=M.far),A.layers.mask=Y.layers.mask|2,U.layers.mask=Y.layers.mask|4,M.layers.mask=A.layers.mask|U.layers.mask;const at=Y.parent,wt=M.cameras;it(M,at);for(let Ut=0;Ut0&&(m.alphaTest.value=u.alphaTest);const T=t.get(u),b=T.envMap,y=T.envMapRotation;b&&(m.envMap.value=b,jn.copy(y),jn.x*=-1,jn.y*=-1,jn.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(jn.y*=-1,jn.z*=-1),m.envMapRotation.value.setFromMatrix4(Xm.makeRotationFromEuler(jn)),m.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=u.reflectivity,m.ior.value=u.ior,m.refractionRatio.value=u.refractionRatio),u.lightMap&&(m.lightMap.value=u.lightMap,m.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,m.lightMapTransform)),u.aoMap&&(m.aoMap.value=u.aoMap,m.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,m.aoMapTransform))}function a(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform))}function o(m,u){m.dashSize.value=u.dashSize,m.totalSize.value=u.dashSize+u.gapSize,m.scale.value=u.scale}function l(m,u,T,b){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.size.value=u.size*T,m.scale.value=b*.5,u.map&&(m.map.value=u.map,e(u.map,m.uvTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function c(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.rotation.value=u.rotation,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function h(m,u){m.specular.value.copy(u.specular),m.shininess.value=Math.max(u.shininess,1e-4)}function d(m,u){u.gradientMap&&(m.gradientMap.value=u.gradientMap)}function f(m,u){m.metalness.value=u.metalness,u.metalnessMap&&(m.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,m.metalnessMapTransform)),m.roughness.value=u.roughness,u.roughnessMap&&(m.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,m.roughnessMapTransform)),u.envMap&&(m.envMapIntensity.value=u.envMapIntensity)}function p(m,u,T){m.ior.value=u.ior,u.sheen>0&&(m.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),m.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(m.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,m.sheenColorMapTransform)),u.sheenRoughnessMap&&(m.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,m.sheenRoughnessMapTransform))),u.clearcoat>0&&(m.clearcoat.value=u.clearcoat,m.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(m.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,m.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(m.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===He&&m.clearcoatNormalScale.value.negate())),u.dispersion>0&&(m.dispersion.value=u.dispersion),u.iridescence>0&&(m.iridescence.value=u.iridescence,m.iridescenceIOR.value=u.iridescenceIOR,m.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(m.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,m.iridescenceMapTransform)),u.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),u.transmission>0&&(m.transmission.value=u.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),u.transmissionMap&&(m.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,m.transmissionMapTransform)),m.thickness.value=u.thickness,u.thicknessMap&&(m.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=u.attenuationDistance,m.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(m.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(m.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=u.specularIntensity,m.specularColor.value.copy(u.specularColor),u.specularColorMap&&(m.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,m.specularColorMapTransform)),u.specularIntensityMap&&(m.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,u){u.matcap&&(m.matcap.value=u.matcap)}function v(m,u){const T=t.get(u).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function qm(i,t,e,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(T,b){const y=b.program;n.uniformBlockBinding(T,y)}function c(T,b){let y=s[T.id];y===void 0&&(g(T),y=h(T),s[T.id]=y,T.addEventListener("dispose",m));const L=b.program;n.updateUBOMapping(T,L);const R=t.render.frame;r[T.id]!==R&&(f(T),r[T.id]=R)}function h(T){const b=d();T.__bindingPointIndex=b;const y=i.createBuffer(),L=T.__size,R=T.usage;return i.bindBuffer(i.UNIFORM_BUFFER,y),i.bufferData(i.UNIFORM_BUFFER,L,R),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,y),y}function d(){for(let T=0;T0&&(y+=L-R),T.__size=y,T.__cache={},this}function v(T){const b={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(b.boundary=4,b.storage=4):T.isVector2?(b.boundary=8,b.storage=8):T.isVector3||T.isColor?(b.boundary=16,b.storage=12):T.isVector4?(b.boundary=16,b.storage=16):T.isMatrix3?(b.boundary=48,b.storage=48):T.isMatrix4?(b.boundary=64,b.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),b}function m(T){const b=T.target;b.removeEventListener("dispose",m);const y=a.indexOf(b.__bindingPointIndex);a.splice(y,1),i.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function u(){for(const T in s)i.deleteBuffer(s[T]);a=[],s={},r={}}return{bind:l,update:c,dispose:u}}class jm{constructor(t={}){const{canvas:e=yh(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const g=new Uint32Array(4),v=new Int32Array(4);let m=null,u=null;const T=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Je,this.toneMapping=On,this.toneMappingExposure=1;const y=this;let L=!1,R=0,A=0,U=null,S=-1,M=null;const D=new le,W=new le;let z=null;const V=new pt(0);let $=0,G=e.width,J=e.height,k=1,it=null,ut=null;const yt=new le(0,0,G,J),Lt=new le(0,0,G,J);let jt=!1;const Y=new to;let et=!1,xt=!1;this.transmissionResolutionScale=1;const at=new ne,wt=new ne,Ut=new P,Gt=new le,ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let rt=!1;function Ct(){return U===null?k:1}let w=n;function ve(x,I){return e.getContext(x,I)}try{const x={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Xa}`),e.addEventListener("webglcontextlost",Z,!1),e.addEventListener("webglcontextrestored",ht,!1),e.addEventListener("webglcontextcreationerror",lt,!1),w===null){const I="webgl2";if(w=ve(I,x),w===null)throw ve(I)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let Ft,kt,Mt,ie,Et,E,_,F,j,K,X,St,ot,dt,Zt,tt,mt,bt,Pt,ft,Yt,zt,Xt,C;function nt(){Ft=new ip(w),Ft.init(),zt=new zm(w,Ft),kt=new $f(w,Ft,t,zt),Mt=new Om(w,Ft),kt.reverseDepthBuffer&&f&&Mt.buffers.depth.setReversed(!0),ie=new ap(w),Et=new bm,E=new Bm(w,Ft,Mt,Et,kt,zt,ie),_=new Qf(y),F=new np(y),j=new du(w),Xt=new Zf(w,j),K=new sp(w,j,ie,Xt),X=new lp(w,K,j,ie),Pt=new op(w,kt,E),tt=new Jf(Et),St=new Em(y,_,F,Ft,kt,Xt,tt),ot=new Ym(y,Et),dt=new wm,Zt=new Lm(Ft),bt=new jf(y,_,F,Mt,X,p,l),mt=new Nm(y,X,kt),C=new qm(w,ie,kt,Mt),ft=new Kf(w,Ft,ie),Yt=new rp(w,Ft,ie),ie.programs=St.programs,y.capabilities=kt,y.extensions=Ft,y.properties=Et,y.renderLists=dt,y.shadowMap=mt,y.state=Mt,y.info=ie}nt();const H=new Wm(y,w);this.xr=H,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const x=Ft.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){const x=Ft.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(x){x!==void 0&&(k=x,this.setSize(G,J,!1))},this.getSize=function(x){return x.set(G,J)},this.setSize=function(x,I,O=!0){if(H.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}G=x,J=I,e.width=Math.floor(x*k),e.height=Math.floor(I*k),O===!0&&(e.style.width=x+"px",e.style.height=I+"px"),this.setViewport(0,0,x,I)},this.getDrawingBufferSize=function(x){return x.set(G*k,J*k).floor()},this.setDrawingBufferSize=function(x,I,O){G=x,J=I,k=O,e.width=Math.floor(x*O),e.height=Math.floor(I*O),this.setViewport(0,0,x,I)},this.getCurrentViewport=function(x){return x.copy(D)},this.getViewport=function(x){return x.copy(yt)},this.setViewport=function(x,I,O,B){x.isVector4?yt.set(x.x,x.y,x.z,x.w):yt.set(x,I,O,B),Mt.viewport(D.copy(yt).multiplyScalar(k).round())},this.getScissor=function(x){return x.copy(Lt)},this.setScissor=function(x,I,O,B){x.isVector4?Lt.set(x.x,x.y,x.z,x.w):Lt.set(x,I,O,B),Mt.scissor(W.copy(Lt).multiplyScalar(k).round())},this.getScissorTest=function(){return jt},this.setScissorTest=function(x){Mt.setScissorTest(jt=x)},this.setOpaqueSort=function(x){it=x},this.setTransparentSort=function(x){ut=x},this.getClearColor=function(x){return x.copy(bt.getClearColor())},this.setClearColor=function(){bt.setClearColor.apply(bt,arguments)},this.getClearAlpha=function(){return bt.getClearAlpha()},this.setClearAlpha=function(){bt.setClearAlpha.apply(bt,arguments)},this.clear=function(x=!0,I=!0,O=!0){let B=0;if(x){let N=!1;if(U!==null){const Q=U.texture.format;N=Q===Ja||Q===$a||Q===Ka}if(N){const Q=U.texture.type,ct=Q===An||Q===ei||Q===os||Q===zi||Q===qa||Q===ja,gt=bt.getClearColor(),_t=bt.getClearAlpha(),It=gt.r,Nt=gt.g,Tt=gt.b;ct?(g[0]=It,g[1]=Nt,g[2]=Tt,g[3]=_t,w.clearBufferuiv(w.COLOR,0,g)):(v[0]=It,v[1]=Nt,v[2]=Tt,v[3]=_t,w.clearBufferiv(w.COLOR,0,v))}else B|=w.COLOR_BUFFER_BIT}I&&(B|=w.DEPTH_BUFFER_BIT),O&&(B|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(B)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Z,!1),e.removeEventListener("webglcontextrestored",ht,!1),e.removeEventListener("webglcontextcreationerror",lt,!1),bt.dispose(),dt.dispose(),Zt.dispose(),Et.dispose(),_.dispose(),F.dispose(),X.dispose(),Xt.dispose(),C.dispose(),St.dispose(),H.dispose(),H.removeEventListener("sessionstart",so),H.removeEventListener("sessionend",ro),kn.stop()};function Z(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function ht(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1;const x=ie.autoReset,I=mt.enabled,O=mt.autoUpdate,B=mt.needsUpdate,N=mt.type;nt(),ie.autoReset=x,mt.enabled=I,mt.autoUpdate=O,mt.needsUpdate=B,mt.type=N}function lt(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function Ot(x){const I=x.target;I.removeEventListener("dispose",Ot),he(I)}function he(x){Ee(x),Et.remove(x)}function Ee(x){const I=Et.get(x).programs;I!==void 0&&(I.forEach(function(O){St.releaseProgram(O)}),x.isShaderMaterial&&St.releaseShaderCache(x))}this.renderBufferDirect=function(x,I,O,B,N,Q){I===null&&(I=ce);const ct=N.isMesh&&N.matrixWorld.determinant()<0,gt=xc(x,I,O,B,N);Mt.setMaterial(B,ct);let _t=O.index,It=1;if(B.wireframe===!0){if(_t=K.getWireframeAttribute(O),_t===void 0)return;It=2}const Nt=O.drawRange,Tt=O.attributes.position;let Kt=Nt.start*It,te=(Nt.start+Nt.count)*It;Q!==null&&(Kt=Math.max(Kt,Q.start*It),te=Math.min(te,(Q.start+Q.count)*It)),_t!==null?(Kt=Math.max(Kt,0),te=Math.min(te,_t.count)):Tt!=null&&(Kt=Math.max(Kt,0),te=Math.min(te,Tt.count));const me=te-Kt;if(me<0||me===1/0)return;Xt.setup(N,B,gt,O,_t);let fe,$t=ft;if(_t!==null&&(fe=j.get(_t),$t=Yt,$t.setIndex(fe)),N.isMesh)B.wireframe===!0?(Mt.setLineWidth(B.wireframeLinewidth*Ct()),$t.setMode(w.LINES)):$t.setMode(w.TRIANGLES);else if(N.isLine){let At=B.linewidth;At===void 0&&(At=1),Mt.setLineWidth(At*Ct()),N.isLineSegments?$t.setMode(w.LINES):N.isLineLoop?$t.setMode(w.LINE_LOOP):$t.setMode(w.LINE_STRIP)}else N.isPoints?$t.setMode(w.POINTS):N.isSprite&&$t.setMode(w.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)$t.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if(Ft.get("WEBGL_multi_draw"))$t.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const At=N._multiDrawStarts,Te=N._multiDrawCounts,ee=N._multiDrawCount,en=_t?j.get(_t).bytesPerElement:1,ai=Et.get(B).currentProgram.getUniforms();for(let ke=0;ke{function Q(){if(B.forEach(function(ct){Et.get(ct).currentProgram.isReady()&&B.delete(ct)}),B.size===0){N(x);return}setTimeout(Q,10)}Ft.get("KHR_parallel_shader_compile")!==null?Q():setTimeout(Q,10)})};let tn=null;function mn(x){tn&&tn(x)}function so(){kn.stop()}function ro(){kn.start()}const kn=new uc;kn.setAnimationLoop(mn),typeof self<"u"&&kn.setContext(self),this.setAnimationLoop=function(x){tn=x,H.setAnimationLoop(x),x===null?kn.stop():kn.start()},H.addEventListener("sessionstart",so),H.addEventListener("sessionend",ro),this.render=function(x,I){if(I!==void 0&&I.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;if(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),I.parent===null&&I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),H.enabled===!0&&H.isPresenting===!0&&(H.cameraAutoUpdate===!0&&H.updateCamera(I),I=H.getCamera()),x.isScene===!0&&x.onBeforeRender(y,x,I,U),u=Zt.get(x,b.length),u.init(I),b.push(u),wt.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse),Y.setFromProjectionMatrix(wt),xt=this.localClippingEnabled,et=tt.init(this.clippingPlanes,xt),m=dt.get(x,T.length),m.init(),T.push(m),H.enabled===!0&&H.isPresenting===!0){const Q=y.xr.getDepthSensingMesh();Q!==null&&pr(Q,I,-1/0,y.sortObjects)}pr(x,I,0,y.sortObjects),m.finish(),y.sortObjects===!0&&m.sort(it,ut),rt=H.enabled===!1||H.isPresenting===!1||H.hasDepthSensing()===!1,rt&&bt.addToRenderList(m,x),this.info.render.frame++,et===!0&&tt.beginShadows();const O=u.state.shadowsArray;mt.render(O,x,I),et===!0&&tt.endShadows(),this.info.autoReset===!0&&this.info.reset();const B=m.opaque,N=m.transmissive;if(u.setupLights(),I.isArrayCamera){const Q=I.cameras;if(N.length>0)for(let ct=0,gt=Q.length;ct0&&oo(B,N,x,I),rt&&bt.render(x),ao(m,x,I);U!==null&&A===0&&(E.updateMultisampleRenderTarget(U),E.updateRenderTargetMipmap(U)),x.isScene===!0&&x.onAfterRender(y,x,I),Xt.resetDefaultState(),S=-1,M=null,b.pop(),b.length>0?(u=b[b.length-1],et===!0&&tt.setGlobalState(y.clippingPlanes,u.state.camera)):u=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function pr(x,I,O,B){if(x.visible===!1)return;if(x.layers.test(I.layers)){if(x.isGroup)O=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(I);else if(x.isLight)u.pushLight(x),x.castShadow&&u.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||Y.intersectsSprite(x)){B&&Gt.setFromMatrixPosition(x.matrixWorld).applyMatrix4(wt);const ct=X.update(x),gt=x.material;gt.visible&&m.push(x,ct,gt,O,Gt.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||Y.intersectsObject(x))){const ct=X.update(x),gt=x.material;if(B&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),Gt.copy(x.boundingSphere.center)):(ct.boundingSphere===null&&ct.computeBoundingSphere(),Gt.copy(ct.boundingSphere.center)),Gt.applyMatrix4(x.matrixWorld).applyMatrix4(wt)),Array.isArray(gt)){const _t=ct.groups;for(let It=0,Nt=_t.length;It0&&fs(N,I,O),Q.length>0&&fs(Q,I,O),ct.length>0&&fs(ct,I,O),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1)}function oo(x,I,O,B){if((O.isScene===!0?O.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[B.id]===void 0&&(u.state.transmissionRenderTarget[B.id]=new on(1,1,{generateMipmaps:!0,type:Ft.has("EXT_color_buffer_half_float")||Ft.has("EXT_color_buffer_float")?Tn:An,minFilter:Qn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Jt.workingColorSpace}));const Q=u.state.transmissionRenderTarget[B.id],ct=B.viewport||D;Q.setSize(ct.z*y.transmissionResolutionScale,ct.w*y.transmissionResolutionScale);const gt=y.getRenderTarget();y.setRenderTarget(Q),y.getClearColor(V),$=y.getClearAlpha(),$<1&&y.setClearColor(16777215,.5),y.clear(),rt&&bt.render(O);const _t=y.toneMapping;y.toneMapping=On;const It=B.viewport;if(B.viewport!==void 0&&(B.viewport=void 0),u.setupLightsView(B),et===!0&&tt.setGlobalState(y.clippingPlanes,B),fs(x,O,B),E.updateMultisampleRenderTarget(Q),E.updateRenderTargetMipmap(Q),Ft.has("WEBGL_multisampled_render_to_texture")===!1){let Nt=!1;for(let Tt=0,Kt=I.length;Tt0),Tt=!!O.morphAttributes.position,Kt=!!O.morphAttributes.normal,te=!!O.morphAttributes.color;let me=On;B.toneMapped&&(U===null||U.isXRRenderTarget===!0)&&(me=y.toneMapping);const fe=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,$t=fe!==void 0?fe.length:0,At=Et.get(B),Te=u.state.lights;if(et===!0&&(xt===!0||x!==M)){const De=x===M&&B.id===S;tt.setState(B,x,De)}let ee=!1;B.version===At.__version?(At.needsLights&&At.lightsStateVersion!==Te.state.version||At.outputColorSpace!==gt||N.isBatchedMesh&&At.batching===!1||!N.isBatchedMesh&&At.batching===!0||N.isBatchedMesh&&At.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&At.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&At.instancing===!1||!N.isInstancedMesh&&At.instancing===!0||N.isSkinnedMesh&&At.skinning===!1||!N.isSkinnedMesh&&At.skinning===!0||N.isInstancedMesh&&At.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&At.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&At.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&At.instancingMorph===!1&&N.morphTexture!==null||At.envMap!==_t||B.fog===!0&&At.fog!==Q||At.numClippingPlanes!==void 0&&(At.numClippingPlanes!==tt.numPlanes||At.numIntersection!==tt.numIntersection)||At.vertexAlphas!==It||At.vertexTangents!==Nt||At.morphTargets!==Tt||At.morphNormals!==Kt||At.morphColors!==te||At.toneMapping!==me||At.morphTargetsCount!==$t)&&(ee=!0):(ee=!0,At.__version=B.version);let en=At.currentProgram;ee===!0&&(en=ps(B,I,N));let ai=!1,ke=!1,Xi=!1;const ue=en.getUniforms(),je=At.uniforms;if(Mt.useProgram(en.program)&&(ai=!0,ke=!0,Xi=!0),B.id!==S&&(S=B.id,ke=!0),ai||M!==x){Mt.buffers.depth.getReversed()?(at.copy(x.projectionMatrix),bh(at),Th(at),ue.setValue(w,"projectionMatrix",at)):ue.setValue(w,"projectionMatrix",x.projectionMatrix),ue.setValue(w,"viewMatrix",x.matrixWorldInverse);const Fe=ue.map.cameraPosition;Fe!==void 0&&Fe.setValue(w,Ut.setFromMatrixPosition(x.matrixWorld)),kt.logarithmicDepthBuffer&&ue.setValue(w,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(B.isMeshPhongMaterial||B.isMeshToonMaterial||B.isMeshLambertMaterial||B.isMeshBasicMaterial||B.isMeshStandardMaterial||B.isShaderMaterial)&&ue.setValue(w,"isOrthographic",x.isOrthographicCamera===!0),M!==x&&(M=x,ke=!0,Xi=!0)}if(N.isSkinnedMesh){ue.setOptional(w,N,"bindMatrix"),ue.setOptional(w,N,"bindMatrixInverse");const De=N.skeleton;De&&(De.boneTexture===null&&De.computeBoneTexture(),ue.setValue(w,"boneTexture",De.boneTexture,E))}N.isBatchedMesh&&(ue.setOptional(w,N,"batchingTexture"),ue.setValue(w,"batchingTexture",N._matricesTexture,E),ue.setOptional(w,N,"batchingIdTexture"),ue.setValue(w,"batchingIdTexture",N._indirectTexture,E),ue.setOptional(w,N,"batchingColorTexture"),N._colorsTexture!==null&&ue.setValue(w,"batchingColorTexture",N._colorsTexture,E));const Ze=O.morphAttributes;if((Ze.position!==void 0||Ze.normal!==void 0||Ze.color!==void 0)&&Pt.update(N,O,en),(ke||At.receiveShadow!==N.receiveShadow)&&(At.receiveShadow=N.receiveShadow,ue.setValue(w,"receiveShadow",N.receiveShadow)),B.isMeshGouraudMaterial&&B.envMap!==null&&(je.envMap.value=_t,je.flipEnvMap.value=_t.isCubeTexture&&_t.isRenderTargetTexture===!1?-1:1),B.isMeshStandardMaterial&&B.envMap===null&&I.environment!==null&&(je.envMapIntensity.value=I.environmentIntensity),ke&&(ue.setValue(w,"toneMappingExposure",y.toneMappingExposure),At.needsLights&&Mc(je,Xi),Q&&B.fog===!0&&ot.refreshFogUniforms(je,Q),ot.refreshMaterialUniforms(je,B,k,J,u.state.transmissionRenderTarget[x.id]),$s.upload(w,co(At),je,E)),B.isShaderMaterial&&B.uniformsNeedUpdate===!0&&($s.upload(w,co(At),je,E),B.uniformsNeedUpdate=!1),B.isSpriteMaterial&&ue.setValue(w,"center",N.center),ue.setValue(w,"modelViewMatrix",N.modelViewMatrix),ue.setValue(w,"normalMatrix",N.normalMatrix),ue.setValue(w,"modelMatrix",N.matrixWorld),B.isShaderMaterial||B.isRawShaderMaterial){const De=B.uniformsGroups;for(let Fe=0,mr=De.length;Fe0&&E.useMultisampledRTT(x)===!1?N=Et.get(x).__webglMultisampledFramebuffer:Array.isArray(Nt)?N=Nt[O]:N=Nt,D.copy(x.viewport),W.copy(x.scissor),z=x.scissorTest}else D.copy(yt).multiplyScalar(k).floor(),W.copy(Lt).multiplyScalar(k).floor(),z=jt;if(O!==0&&(N=yc),Mt.bindFramebuffer(w.FRAMEBUFFER,N)&&B&&Mt.drawBuffers(x,N),Mt.viewport(D),Mt.scissor(W),Mt.setScissorTest(z),Q){const _t=Et.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+I,_t.__webglTexture,O)}else if(ct){const _t=Et.get(x.texture),It=I;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,_t.__webglTexture,O,It)}else if(x!==null&&O!==0){const _t=Et.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,_t.__webglTexture,O)}S=-1},this.readRenderTargetPixels=function(x,I,O,B,N,Q,ct){if(!(x&&x.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=Et.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ct!==void 0&&(gt=gt[ct]),gt){Mt.bindFramebuffer(w.FRAMEBUFFER,gt);try{const _t=x.texture,It=_t.format,Nt=_t.type;if(!kt.textureFormatReadable(It)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!kt.textureTypeReadable(Nt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}I>=0&&I<=x.width-B&&O>=0&&O<=x.height-N&&w.readPixels(I,O,B,N,zt.convert(It),zt.convert(Nt),Q)}finally{const _t=U!==null?Et.get(U).__webglFramebuffer:null;Mt.bindFramebuffer(w.FRAMEBUFFER,_t)}}},this.readRenderTargetPixelsAsync=async function(x,I,O,B,N,Q,ct){if(!(x&&x.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let gt=Et.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ct!==void 0&&(gt=gt[ct]),gt){const _t=x.texture,It=_t.format,Nt=_t.type;if(!kt.textureFormatReadable(It))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!kt.textureTypeReadable(Nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(I>=0&&I<=x.width-B&&O>=0&&O<=x.height-N){Mt.bindFramebuffer(w.FRAMEBUFFER,gt);const Tt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Tt),w.bufferData(w.PIXEL_PACK_BUFFER,Q.byteLength,w.STREAM_READ),w.readPixels(I,O,B,N,zt.convert(It),zt.convert(Nt),0);const Kt=U!==null?Et.get(U).__webglFramebuffer:null;Mt.bindFramebuffer(w.FRAMEBUFFER,Kt);const te=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await Eh(w,te,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Tt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,Q),w.deleteBuffer(Tt),w.deleteSync(te),Q}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(x,I=null,O=0){x.isTexture!==!0&&(Ai("WebGLRenderer: copyFramebufferToTexture function signature has changed."),I=arguments[0]||null,x=arguments[1]);const B=Math.pow(2,-O),N=Math.floor(x.image.width*B),Q=Math.floor(x.image.height*B),ct=I!==null?I.x:0,gt=I!==null?I.y:0;E.setTexture2D(x,0),w.copyTexSubImage2D(w.TEXTURE_2D,O,0,0,ct,gt,N,Q),Mt.unbindTexture()};const Ec=w.createFramebuffer(),bc=w.createFramebuffer();this.copyTextureToTexture=function(x,I,O=null,B=null,N=0,Q=null){x.isTexture!==!0&&(Ai("WebGLRenderer: copyTextureToTexture function signature has changed."),B=arguments[0]||null,x=arguments[1],I=arguments[2],Q=arguments[3]||0,O=null),Q===null&&(N!==0?(Ai("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Q=N,N=0):Q=0);let ct,gt,_t,It,Nt,Tt,Kt,te,me;const fe=x.isCompressedTexture?x.mipmaps[Q]:x.image;if(O!==null)ct=O.max.x-O.min.x,gt=O.max.y-O.min.y,_t=O.isBox3?O.max.z-O.min.z:1,It=O.min.x,Nt=O.min.y,Tt=O.isBox3?O.min.z:0;else{const Ze=Math.pow(2,-N);ct=Math.floor(fe.width*Ze),gt=Math.floor(fe.height*Ze),x.isDataArrayTexture?_t=fe.depth:x.isData3DTexture?_t=Math.floor(fe.depth*Ze):_t=1,It=0,Nt=0,Tt=0}B!==null?(Kt=B.x,te=B.y,me=B.z):(Kt=0,te=0,me=0);const $t=zt.convert(I.format),At=zt.convert(I.type);let Te;I.isData3DTexture?(E.setTexture3D(I,0),Te=w.TEXTURE_3D):I.isDataArrayTexture||I.isCompressedArrayTexture?(E.setTexture2DArray(I,0),Te=w.TEXTURE_2D_ARRAY):(E.setTexture2D(I,0),Te=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,I.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,I.unpackAlignment);const ee=w.getParameter(w.UNPACK_ROW_LENGTH),en=w.getParameter(w.UNPACK_IMAGE_HEIGHT),ai=w.getParameter(w.UNPACK_SKIP_PIXELS),ke=w.getParameter(w.UNPACK_SKIP_ROWS),Xi=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,fe.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,fe.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,It),w.pixelStorei(w.UNPACK_SKIP_ROWS,Nt),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Tt);const ue=x.isDataArrayTexture||x.isData3DTexture,je=I.isDataArrayTexture||I.isData3DTexture;if(x.isDepthTexture){const Ze=Et.get(x),De=Et.get(I),Fe=Et.get(Ze.__renderTarget),mr=Et.get(De.__renderTarget);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,Fe.__webglFramebuffer),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,mr.__webglFramebuffer);for(let Vn=0;Vn<_t;Vn++)ue&&(w.framebufferTextureLayer(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Et.get(x).__webglTexture,N,Tt+Vn),w.framebufferTextureLayer(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Et.get(I).__webglTexture,Q,me+Vn)),w.blitFramebuffer(It,Nt,ct,gt,Kt,te,ct,gt,w.DEPTH_BUFFER_BIT,w.NEAREST);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,null)}else if(N!==0||x.isRenderTargetTexture||Et.has(x)){const Ze=Et.get(x),De=Et.get(I);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,Ec),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,bc);for(let Fe=0;Fe<_t;Fe++)ue?w.framebufferTextureLayer(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ze.__webglTexture,N,Tt+Fe):w.framebufferTexture2D(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ze.__webglTexture,N),je?w.framebufferTextureLayer(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,De.__webglTexture,Q,me+Fe):w.framebufferTexture2D(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,De.__webglTexture,Q),N!==0?w.blitFramebuffer(It,Nt,ct,gt,Kt,te,ct,gt,w.COLOR_BUFFER_BIT,w.NEAREST):je?w.copyTexSubImage3D(Te,Q,Kt,te,me+Fe,It,Nt,ct,gt):w.copyTexSubImage2D(Te,Q,Kt,te,It,Nt,ct,gt);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,null)}else je?x.isDataTexture||x.isData3DTexture?w.texSubImage3D(Te,Q,Kt,te,me,ct,gt,_t,$t,At,fe.data):I.isCompressedArrayTexture?w.compressedTexSubImage3D(Te,Q,Kt,te,me,ct,gt,_t,$t,fe.data):w.texSubImage3D(Te,Q,Kt,te,me,ct,gt,_t,$t,At,fe):x.isDataTexture?w.texSubImage2D(w.TEXTURE_2D,Q,Kt,te,ct,gt,$t,At,fe.data):x.isCompressedTexture?w.compressedTexSubImage2D(w.TEXTURE_2D,Q,Kt,te,fe.width,fe.height,$t,fe.data):w.texSubImage2D(w.TEXTURE_2D,Q,Kt,te,ct,gt,$t,At,fe);w.pixelStorei(w.UNPACK_ROW_LENGTH,ee),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,en),w.pixelStorei(w.UNPACK_SKIP_PIXELS,ai),w.pixelStorei(w.UNPACK_SKIP_ROWS,ke),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Xi),Q===0&&I.generateMipmaps&&w.generateMipmap(Te),Mt.unbindTexture()},this.copyTextureToTexture3D=function(x,I,O=null,B=null,N=0){return x.isTexture!==!0&&(Ai("WebGLRenderer: copyTextureToTexture3D function signature has changed."),O=arguments[0]||null,B=arguments[1]||null,x=arguments[2],I=arguments[3],N=arguments[4]||0),Ai('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(x,I,O,B,N)},this.initRenderTarget=function(x){Et.get(x).__webglFramebuffer===void 0&&E.setupRenderTarget(x)},this.initTexture=function(x){x.isCubeTexture?E.setTextureCube(x,0):x.isData3DTexture?E.setTexture3D(x,0):x.isDataArrayTexture||x.isCompressedArrayTexture?E.setTexture2DArray(x,0):E.setTexture2D(x,0),Mt.unbindTexture()},this.resetState=function(){R=0,A=0,U=null,Mt.reset(),Xt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return En}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorspace=Jt._getDrawingBufferColorSpace(t),e.unpackColorSpace=Jt._getUnpackColorSpace()}}const yl={type:"change"},io={type:"start"},gc={type:"end"},Ws=new cs,El=new Nn,Zm=Math.cos(70*Sh.DEG2RAD),xe=new P,Oe=2*Math.PI,oe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Kr=1e-6;class Km extends hu{constructor(t,e=null){super(t,e),this.state=oe.NONE,this.enabled=!0,this.target=new P,this.cursor=new P,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Di.ROTATE,MIDDLE:Di.DOLLY,RIGHT:Di.PAN},this.touches={ONE:Ri.ROTATE,TWO:Ri.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new P,this._lastQuaternion=new ni,this._lastTargetPosition=new P,this._quat=new ni().setFromUnitVectors(t.up,new P(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Ko,this._sphericalDelta=new Ko,this._scale=1,this._panOffset=new P,this._rotateStart=new vt,this._rotateEnd=new vt,this._rotateDelta=new vt,this._panStart=new vt,this._panEnd=new vt,this._panDelta=new vt,this._dollyStart=new vt,this._dollyEnd=new vt,this._dollyDelta=new vt,this._dollyDirection=new P,this._mouse=new vt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Jm.bind(this),this._onPointerDown=$m.bind(this),this._onPointerUp=Qm.bind(this),this._onContextMenu=ag.bind(this),this._onMouseWheel=ng.bind(this),this._onKeyDown=ig.bind(this),this._onTouchStart=sg.bind(this),this._onTouchMove=rg.bind(this),this._onMouseDown=tg.bind(this),this._onMouseMove=eg.bind(this),this._interceptControlDown=og.bind(this),this._interceptControlUp=lg.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(yl),this.update(),this.state=oe.NONE}update(t=null){const e=this.object.position;xe.copy(e).sub(this.target),xe.applyQuaternion(this._quat),this._spherical.setFromVector3(xe),this.autoRotate&&this.state===oe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(n)&&isFinite(s)&&(n<-Math.PI?n+=Oe:n>Math.PI&&(n-=Oe),s<-Math.PI?s+=Oe:s>Math.PI&&(s-=Oe),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(xe.setFromSpherical(this._spherical),xe.applyQuaternion(this._quatInverse),e.copy(this.target).add(xe),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=xe.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new P(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new P(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=xe.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Ws.origin.copy(this.object.position),Ws.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Ws.direction))Kr||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Kr||this._lastTargetPosition.distanceToSquared(this.target)>Kr?(this.dispatchEvent(yl),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Oe/60*this.autoRotateSpeed*t:Oe/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){xe.setFromMatrixColumn(e,0),xe.multiplyScalar(-t),this._panOffset.add(xe)}_panUp(t,e){this.screenSpacePanning===!0?xe.setFromMatrixColumn(e,1):(xe.setFromMatrixColumn(e,0),xe.crossVectors(this.object.up,xe)),xe.multiplyScalar(t),this._panOffset.add(xe)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;xe.copy(s).sub(this.target);let r=xe.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Oe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Oe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Oe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Oe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e=0&&(y[at]=null,b[at].disconnect(xt))}for(let nt=0;nt=y.length){y.push(xt),at=Ut;break}else if(y[Ut]===null){y[Ut]=xt,at=Ut;break}if(at===-1)break}const wt=b[at];wt&&wt.connect(xt)}}const G=new P,J=new P;function k(Y,nt,xt){G.setFromMatrixPosition(nt.matrixWorld),J.setFromMatrixPosition(xt.matrixWorld);const at=G.distanceTo(J),wt=nt.projectionMatrix.elements,Ut=xt.projectionMatrix.elements,Gt=wt[14]/(wt[10]-1),ce=wt[14]/(wt[10]+1),rt=(wt[9]+1)/wt[5],Ct=(wt[9]-1)/wt[5],w=(wt[8]-1)/wt[0],ve=(Ut[8]+1)/Ut[0],Bt=Gt*w,kt=Gt*ve,Mt=at/(-w+ve),ne=Mt*-w;if(nt.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(ne),Y.translateZ(Mt),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),wt[10]===-1)Y.projectionMatrix.copy(nt.projectionMatrix),Y.projectionMatrixInverse.copy(nt.projectionMatrixInverse);else{const Et=Gt+Mt,E=ce+Mt,_=Bt-ne,F=kt+(at-ne),Z=rt*ce/E*Et,K=Ct*ce/E*Et;Y.projectionMatrix.makePerspective(_,F,Z,K,Et,E),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function it(Y,nt){nt===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(nt.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let nt=Y.near,xt=Y.far;v.texture!==null&&(v.depthNear>0&&(nt=v.depthNear),v.depthFar>0&&(xt=v.depthFar)),M.near=U.near=A.near=nt,M.far=U.far=A.far=xt,(D!==M.near||W!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),D=M.near,W=M.far),A.layers.mask=Y.layers.mask|2,U.layers.mask=Y.layers.mask|4,M.layers.mask=A.layers.mask|U.layers.mask;const at=Y.parent,wt=M.cameras;it(M,at);for(let Ut=0;Ut0&&(m.alphaTest.value=u.alphaTest);const T=t.get(u),b=T.envMap,y=T.envMapRotation;b&&(m.envMap.value=b,jn.copy(y),jn.x*=-1,jn.y*=-1,jn.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(jn.y*=-1,jn.z*=-1),m.envMapRotation.value.setFromMatrix4(Ym.makeRotationFromEuler(jn)),m.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=u.reflectivity,m.ior.value=u.ior,m.refractionRatio.value=u.refractionRatio),u.lightMap&&(m.lightMap.value=u.lightMap,m.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,m.lightMapTransform)),u.aoMap&&(m.aoMap.value=u.aoMap,m.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,m.aoMapTransform))}function a(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform))}function o(m,u){m.dashSize.value=u.dashSize,m.totalSize.value=u.dashSize+u.gapSize,m.scale.value=u.scale}function l(m,u,T,b){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.size.value=u.size*T,m.scale.value=b*.5,u.map&&(m.map.value=u.map,e(u.map,m.uvTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function c(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.rotation.value=u.rotation,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function h(m,u){m.specular.value.copy(u.specular),m.shininess.value=Math.max(u.shininess,1e-4)}function d(m,u){u.gradientMap&&(m.gradientMap.value=u.gradientMap)}function f(m,u){m.metalness.value=u.metalness,u.metalnessMap&&(m.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,m.metalnessMapTransform)),m.roughness.value=u.roughness,u.roughnessMap&&(m.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,m.roughnessMapTransform)),u.envMap&&(m.envMapIntensity.value=u.envMapIntensity)}function p(m,u,T){m.ior.value=u.ior,u.sheen>0&&(m.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),m.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(m.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,m.sheenColorMapTransform)),u.sheenRoughnessMap&&(m.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,m.sheenRoughnessMapTransform))),u.clearcoat>0&&(m.clearcoat.value=u.clearcoat,m.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(m.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,m.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(m.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===ke&&m.clearcoatNormalScale.value.negate())),u.dispersion>0&&(m.dispersion.value=u.dispersion),u.iridescence>0&&(m.iridescence.value=u.iridescence,m.iridescenceIOR.value=u.iridescenceIOR,m.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(m.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,m.iridescenceMapTransform)),u.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),u.transmission>0&&(m.transmission.value=u.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),u.transmissionMap&&(m.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,m.transmissionMapTransform)),m.thickness.value=u.thickness,u.thicknessMap&&(m.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=u.attenuationDistance,m.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(m.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(m.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=u.specularIntensity,m.specularColor.value.copy(u.specularColor),u.specularColorMap&&(m.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,m.specularColorMapTransform)),u.specularIntensityMap&&(m.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,u){u.matcap&&(m.matcap.value=u.matcap)}function v(m,u){const T=t.get(u).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function jm(i,t,e,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(T,b){const y=b.program;n.uniformBlockBinding(T,y)}function c(T,b){let y=s[T.id];y===void 0&&(g(T),y=h(T),s[T.id]=y,T.addEventListener("dispose",m));const L=b.program;n.updateUBOMapping(T,L);const R=t.render.frame;r[T.id]!==R&&(f(T),r[T.id]=R)}function h(T){const b=d();T.__bindingPointIndex=b;const y=i.createBuffer(),L=T.__size,R=T.usage;return i.bindBuffer(i.UNIFORM_BUFFER,y),i.bufferData(i.UNIFORM_BUFFER,L,R),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,y),y}function d(){for(let T=0;T0&&(y+=L-R),T.__size=y,T.__cache={},this}function v(T){const b={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(b.boundary=4,b.storage=4):T.isVector2?(b.boundary=8,b.storage=8):T.isVector3||T.isColor?(b.boundary=16,b.storage=12):T.isVector4?(b.boundary=16,b.storage=16):T.isMatrix3?(b.boundary=48,b.storage=48):T.isMatrix4?(b.boundary=64,b.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),b}function m(T){const b=T.target;b.removeEventListener("dispose",m);const y=a.indexOf(b.__bindingPointIndex);a.splice(y,1),i.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function u(){for(const T in s)i.deleteBuffer(s[T]);a=[],s={},r={}}return{bind:l,update:c,dispose:u}}class Zm{constructor(t={}){const{canvas:e=Eh(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const g=new Uint32Array(4),v=new Int32Array(4);let m=null,u=null;const T=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Qe,this.toneMapping=On,this.toneMappingExposure=1;const y=this;let L=!1,R=0,A=0,U=null,S=-1,M=null;const D=new le,W=new le;let z=null;const V=new pt(0);let $=0,G=e.width,J=e.height,k=1,it=null,ut=null;const yt=new le(0,0,G,J),Lt=new le(0,0,G,J);let qt=!1;const Y=new to;let nt=!1,xt=!1;this.transmissionResolutionScale=1;const at=new ee,wt=new ee,Ut=new P,Gt=new le,ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let rt=!1;function Ct(){return U===null?k:1}let w=n;function ve(x,I){return e.getContext(x,I)}try{const x={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Xa}`),e.addEventListener("webglcontextlost",q,!1),e.addEventListener("webglcontextrestored",lt,!1),e.addEventListener("webglcontextcreationerror",ct,!1),w===null){const I="webgl2";if(w=ve(I,x),w===null)throw ve(I)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let Bt,kt,Mt,ne,Et,E,_,F,Z,K,X,St,ot,dt,jt,tt,mt,bt,Pt,ft,Xt,zt,ie,C;function et(){Bt=new sp(w),Bt.init(),zt=new Hm(w,Bt),kt=new Jf(w,Bt,t,zt),Mt=new Bm(w,Bt),kt.reverseDepthBuffer&&f&&Mt.buffers.depth.setReversed(!0),ne=new op(w),Et=new Tm,E=new zm(w,Bt,Mt,Et,kt,zt,ne),_=new tp(y),F=new ip(y),Z=new fu(w),ie=new Kf(w,Z),K=new rp(w,Z,ne,ie),X=new cp(w,K,Z,ne),Pt=new lp(w,kt,E),tt=new Qf(Et),St=new bm(y,_,F,Bt,kt,ie,tt),ot=new qm(y,Et),dt=new Am,jt=new Um(Bt),bt=new Zf(y,_,F,Mt,X,p,l),mt=new Fm(y,X,kt),C=new jm(w,ne,kt,Mt),ft=new $f(w,Bt,ne),Xt=new ap(w,Bt,ne),ne.programs=St.programs,y.capabilities=kt,y.extensions=Bt,y.properties=Et,y.renderLists=dt,y.shadowMap=mt,y.state=Mt,y.info=ne}et();const H=new Xm(y,w);this.xr=H,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const x=Bt.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){const x=Bt.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(x){x!==void 0&&(k=x,this.setSize(G,J,!1))},this.getSize=function(x){return x.set(G,J)},this.setSize=function(x,I,O=!0){if(H.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}G=x,J=I,e.width=Math.floor(x*k),e.height=Math.floor(I*k),O===!0&&(e.style.width=x+"px",e.style.height=I+"px"),this.setViewport(0,0,x,I)},this.getDrawingBufferSize=function(x){return x.set(G*k,J*k).floor()},this.setDrawingBufferSize=function(x,I,O){G=x,J=I,k=O,e.width=Math.floor(x*O),e.height=Math.floor(I*O),this.setViewport(0,0,x,I)},this.getCurrentViewport=function(x){return x.copy(D)},this.getViewport=function(x){return x.copy(yt)},this.setViewport=function(x,I,O,B){x.isVector4?yt.set(x.x,x.y,x.z,x.w):yt.set(x,I,O,B),Mt.viewport(D.copy(yt).multiplyScalar(k).round())},this.getScissor=function(x){return x.copy(Lt)},this.setScissor=function(x,I,O,B){x.isVector4?Lt.set(x.x,x.y,x.z,x.w):Lt.set(x,I,O,B),Mt.scissor(W.copy(Lt).multiplyScalar(k).round())},this.getScissorTest=function(){return qt},this.setScissorTest=function(x){Mt.setScissorTest(qt=x)},this.setOpaqueSort=function(x){it=x},this.setTransparentSort=function(x){ut=x},this.getClearColor=function(x){return x.copy(bt.getClearColor())},this.setClearColor=function(){bt.setClearColor.apply(bt,arguments)},this.getClearAlpha=function(){return bt.getClearAlpha()},this.setClearAlpha=function(){bt.setClearAlpha.apply(bt,arguments)},this.clear=function(x=!0,I=!0,O=!0){let B=0;if(x){let N=!1;if(U!==null){const Q=U.texture.format;N=Q===Ja||Q===$a||Q===Ka}if(N){const Q=U.texture.type,ht=Q===An||Q===ei||Q===os||Q===zi||Q===qa||Q===ja,gt=bt.getClearColor(),_t=bt.getClearAlpha(),It=gt.r,Ft=gt.g,Tt=gt.b;ht?(g[0]=It,g[1]=Ft,g[2]=Tt,g[3]=_t,w.clearBufferuiv(w.COLOR,0,g)):(v[0]=It,v[1]=Ft,v[2]=Tt,v[3]=_t,w.clearBufferiv(w.COLOR,0,v))}else B|=w.COLOR_BUFFER_BIT}I&&(B|=w.DEPTH_BUFFER_BIT),O&&(B|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(B)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",q,!1),e.removeEventListener("webglcontextrestored",lt,!1),e.removeEventListener("webglcontextcreationerror",ct,!1),bt.dispose(),dt.dispose(),jt.dispose(),Et.dispose(),_.dispose(),F.dispose(),X.dispose(),ie.dispose(),C.dispose(),St.dispose(),H.dispose(),H.removeEventListener("sessionstart",so),H.removeEventListener("sessionend",ro),kn.stop()};function q(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function lt(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1;const x=ne.autoReset,I=mt.enabled,O=mt.autoUpdate,B=mt.needsUpdate,N=mt.type;et(),ne.autoReset=x,mt.enabled=I,mt.autoUpdate=O,mt.needsUpdate=B,mt.type=N}function ct(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function Nt(x){const I=x.target;I.removeEventListener("dispose",Nt),he(I)}function he(x){xe(x),Et.remove(x)}function xe(x){const I=Et.get(x).programs;I!==void 0&&(I.forEach(function(O){St.releaseProgram(O)}),x.isShaderMaterial&&St.releaseShaderCache(x))}this.renderBufferDirect=function(x,I,O,B,N,Q){I===null&&(I=ce);const ht=N.isMesh&&N.matrixWorld.determinant()<0,gt=vc(x,I,O,B,N);Mt.setMaterial(B,ht);let _t=O.index,It=1;if(B.wireframe===!0){if(_t=K.getWireframeAttribute(O),_t===void 0)return;It=2}const Ft=O.drawRange,Tt=O.attributes.position;let Zt=Ft.start*It,Qt=(Ft.start+Ft.count)*It;Q!==null&&(Zt=Math.max(Zt,Q.start*It),Qt=Math.min(Qt,(Q.start+Q.count)*It)),_t!==null?(Zt=Math.max(Zt,0),Qt=Math.min(Qt,_t.count)):Tt!=null&&(Zt=Math.max(Zt,0),Qt=Math.min(Qt,Tt.count));const me=Qt-Zt;if(me<0||me===1/0)return;ie.setup(N,B,gt,O,_t);let fe,Kt=ft;if(_t!==null&&(fe=Z.get(_t),Kt=Xt,Kt.setIndex(fe)),N.isMesh)B.wireframe===!0?(Mt.setLineWidth(B.wireframeLinewidth*Ct()),Kt.setMode(w.LINES)):Kt.setMode(w.TRIANGLES);else if(N.isLine){let At=B.linewidth;At===void 0&&(At=1),Mt.setLineWidth(At*Ct()),N.isLineSegments?Kt.setMode(w.LINES):N.isLineLoop?Kt.setMode(w.LINE_LOOP):Kt.setMode(w.LINE_STRIP)}else N.isPoints?Kt.setMode(w.POINTS):N.isSprite&&Kt.setMode(w.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)Kt.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if(Bt.get("WEBGL_multi_draw"))Kt.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const At=N._multiDrawStarts,Te=N._multiDrawCounts,te=N._multiDrawCount,en=_t?Z.get(_t).bytesPerElement:1,ai=Et.get(B).currentProgram.getUniforms();for(let Ge=0;Ge{function Q(){if(B.forEach(function(ht){Et.get(ht).currentProgram.isReady()&&B.delete(ht)}),B.size===0){N(x);return}setTimeout(Q,10)}Bt.get("KHR_parallel_shader_compile")!==null?Q():setTimeout(Q,10)})};let Ve=null;function mn(x){Ve&&Ve(x)}function so(){kn.stop()}function ro(){kn.start()}const kn=new hc;kn.setAnimationLoop(mn),typeof self<"u"&&kn.setContext(self),this.setAnimationLoop=function(x){Ve=x,H.setAnimationLoop(x),x===null?kn.stop():kn.start()},H.addEventListener("sessionstart",so),H.addEventListener("sessionend",ro),this.render=function(x,I){if(I!==void 0&&I.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;if(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),I.parent===null&&I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),H.enabled===!0&&H.isPresenting===!0&&(H.cameraAutoUpdate===!0&&H.updateCamera(I),I=H.getCamera()),x.isScene===!0&&x.onBeforeRender(y,x,I,U),u=jt.get(x,b.length),u.init(I),b.push(u),wt.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse),Y.setFromProjectionMatrix(wt),xt=this.localClippingEnabled,nt=tt.init(this.clippingPlanes,xt),m=dt.get(x,T.length),m.init(),T.push(m),H.enabled===!0&&H.isPresenting===!0){const Q=y.xr.getDepthSensingMesh();Q!==null&&pr(Q,I,-1/0,y.sortObjects)}pr(x,I,0,y.sortObjects),m.finish(),y.sortObjects===!0&&m.sort(it,ut),rt=H.enabled===!1||H.isPresenting===!1||H.hasDepthSensing()===!1,rt&&bt.addToRenderList(m,x),this.info.render.frame++,nt===!0&&tt.beginShadows();const O=u.state.shadowsArray;mt.render(O,x,I),nt===!0&&tt.endShadows(),this.info.autoReset===!0&&this.info.reset();const B=m.opaque,N=m.transmissive;if(u.setupLights(),I.isArrayCamera){const Q=I.cameras;if(N.length>0)for(let ht=0,gt=Q.length;ht0&&oo(B,N,x,I),rt&&bt.render(x),ao(m,x,I);U!==null&&A===0&&(E.updateMultisampleRenderTarget(U),E.updateRenderTargetMipmap(U)),x.isScene===!0&&x.onAfterRender(y,x,I),ie.resetDefaultState(),S=-1,M=null,b.pop(),b.length>0?(u=b[b.length-1],nt===!0&&tt.setGlobalState(y.clippingPlanes,u.state.camera)):u=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function pr(x,I,O,B){if(x.visible===!1)return;if(x.layers.test(I.layers)){if(x.isGroup)O=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(I);else if(x.isLight)u.pushLight(x),x.castShadow&&u.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||Y.intersectsSprite(x)){B&&Gt.setFromMatrixPosition(x.matrixWorld).applyMatrix4(wt);const ht=X.update(x),gt=x.material;gt.visible&&m.push(x,ht,gt,O,Gt.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||Y.intersectsObject(x))){const ht=X.update(x),gt=x.material;if(B&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),Gt.copy(x.boundingSphere.center)):(ht.boundingSphere===null&&ht.computeBoundingSphere(),Gt.copy(ht.boundingSphere.center)),Gt.applyMatrix4(x.matrixWorld).applyMatrix4(wt)),Array.isArray(gt)){const _t=ht.groups;for(let It=0,Ft=_t.length;It0&&fs(N,I,O),Q.length>0&&fs(Q,I,O),ht.length>0&&fs(ht,I,O),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1)}function oo(x,I,O,B){if((O.isScene===!0?O.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[B.id]===void 0&&(u.state.transmissionRenderTarget[B.id]=new on(1,1,{generateMipmaps:!0,type:Bt.has("EXT_color_buffer_half_float")||Bt.has("EXT_color_buffer_float")?Tn:An,minFilter:Qn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$t.workingColorSpace}));const Q=u.state.transmissionRenderTarget[B.id],ht=B.viewport||D;Q.setSize(ht.z*y.transmissionResolutionScale,ht.w*y.transmissionResolutionScale);const gt=y.getRenderTarget();y.setRenderTarget(Q),y.getClearColor(V),$=y.getClearAlpha(),$<1&&y.setClearColor(16777215,.5),y.clear(),rt&&bt.render(O);const _t=y.toneMapping;y.toneMapping=On;const It=B.viewport;if(B.viewport!==void 0&&(B.viewport=void 0),u.setupLightsView(B),nt===!0&&tt.setGlobalState(y.clippingPlanes,B),fs(x,O,B),E.updateMultisampleRenderTarget(Q),E.updateRenderTargetMipmap(Q),Bt.has("WEBGL_multisampled_render_to_texture")===!1){let Ft=!1;for(let Tt=0,Zt=I.length;Tt0),Tt=!!O.morphAttributes.position,Zt=!!O.morphAttributes.normal,Qt=!!O.morphAttributes.color;let me=On;B.toneMapped&&(U===null||U.isXRRenderTarget===!0)&&(me=y.toneMapping);const fe=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,Kt=fe!==void 0?fe.length:0,At=Et.get(B),Te=u.state.lights;if(nt===!0&&(xt===!0||x!==M)){const De=x===M&&B.id===S;tt.setState(B,x,De)}let te=!1;B.version===At.__version?(At.needsLights&&At.lightsStateVersion!==Te.state.version||At.outputColorSpace!==gt||N.isBatchedMesh&&At.batching===!1||!N.isBatchedMesh&&At.batching===!0||N.isBatchedMesh&&At.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&At.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&At.instancing===!1||!N.isInstancedMesh&&At.instancing===!0||N.isSkinnedMesh&&At.skinning===!1||!N.isSkinnedMesh&&At.skinning===!0||N.isInstancedMesh&&At.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&At.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&At.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&At.instancingMorph===!1&&N.morphTexture!==null||At.envMap!==_t||B.fog===!0&&At.fog!==Q||At.numClippingPlanes!==void 0&&(At.numClippingPlanes!==tt.numPlanes||At.numIntersection!==tt.numIntersection)||At.vertexAlphas!==It||At.vertexTangents!==Ft||At.morphTargets!==Tt||At.morphNormals!==Zt||At.morphColors!==Qt||At.toneMapping!==me||At.morphTargetsCount!==Kt)&&(te=!0):(te=!0,At.__version=B.version);let en=At.currentProgram;te===!0&&(en=ps(B,I,N));let ai=!1,Ge=!1,Xi=!1;const ue=en.getUniforms(),Ze=At.uniforms;if(Mt.useProgram(en.program)&&(ai=!0,Ge=!0,Xi=!0),B.id!==S&&(S=B.id,Ge=!0),ai||M!==x){Mt.buffers.depth.getReversed()?(at.copy(x.projectionMatrix),Th(at),wh(at),ue.setValue(w,"projectionMatrix",at)):ue.setValue(w,"projectionMatrix",x.projectionMatrix),ue.setValue(w,"viewMatrix",x.matrixWorldInverse);const Fe=ue.map.cameraPosition;Fe!==void 0&&Fe.setValue(w,Ut.setFromMatrixPosition(x.matrixWorld)),kt.logarithmicDepthBuffer&&ue.setValue(w,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(B.isMeshPhongMaterial||B.isMeshToonMaterial||B.isMeshLambertMaterial||B.isMeshBasicMaterial||B.isMeshStandardMaterial||B.isShaderMaterial)&&ue.setValue(w,"isOrthographic",x.isOrthographicCamera===!0),M!==x&&(M=x,Ge=!0,Xi=!0)}if(N.isSkinnedMesh){ue.setOptional(w,N,"bindMatrix"),ue.setOptional(w,N,"bindMatrixInverse");const De=N.skeleton;De&&(De.boneTexture===null&&De.computeBoneTexture(),ue.setValue(w,"boneTexture",De.boneTexture,E))}N.isBatchedMesh&&(ue.setOptional(w,N,"batchingTexture"),ue.setValue(w,"batchingTexture",N._matricesTexture,E),ue.setOptional(w,N,"batchingIdTexture"),ue.setValue(w,"batchingIdTexture",N._indirectTexture,E),ue.setOptional(w,N,"batchingColorTexture"),N._colorsTexture!==null&&ue.setValue(w,"batchingColorTexture",N._colorsTexture,E));const Ke=O.morphAttributes;if((Ke.position!==void 0||Ke.normal!==void 0||Ke.color!==void 0)&&Pt.update(N,O,en),(Ge||At.receiveShadow!==N.receiveShadow)&&(At.receiveShadow=N.receiveShadow,ue.setValue(w,"receiveShadow",N.receiveShadow)),B.isMeshGouraudMaterial&&B.envMap!==null&&(Ze.envMap.value=_t,Ze.flipEnvMap.value=_t.isCubeTexture&&_t.isRenderTargetTexture===!1?-1:1),B.isMeshStandardMaterial&&B.envMap===null&&I.environment!==null&&(Ze.envMapIntensity.value=I.environmentIntensity),Ge&&(ue.setValue(w,"toneMappingExposure",y.toneMappingExposure),At.needsLights&&xc(Ze,Xi),Q&&B.fog===!0&&ot.refreshFogUniforms(Ze,Q),ot.refreshMaterialUniforms(Ze,B,k,J,u.state.transmissionRenderTarget[x.id]),$s.upload(w,co(At),Ze,E)),B.isShaderMaterial&&B.uniformsNeedUpdate===!0&&($s.upload(w,co(At),Ze,E),B.uniformsNeedUpdate=!1),B.isSpriteMaterial&&ue.setValue(w,"center",N.center),ue.setValue(w,"modelViewMatrix",N.modelViewMatrix),ue.setValue(w,"normalMatrix",N.normalMatrix),ue.setValue(w,"modelMatrix",N.matrixWorld),B.isShaderMaterial||B.isRawShaderMaterial){const De=B.uniformsGroups;for(let Fe=0,mr=De.length;Fe0&&E.useMultisampledRTT(x)===!1?N=Et.get(x).__webglMultisampledFramebuffer:Array.isArray(Ft)?N=Ft[O]:N=Ft,D.copy(x.viewport),W.copy(x.scissor),z=x.scissorTest}else D.copy(yt).multiplyScalar(k).floor(),W.copy(Lt).multiplyScalar(k).floor(),z=qt;if(O!==0&&(N=Sc),Mt.bindFramebuffer(w.FRAMEBUFFER,N)&&B&&Mt.drawBuffers(x,N),Mt.viewport(D),Mt.scissor(W),Mt.setScissorTest(z),Q){const _t=Et.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+I,_t.__webglTexture,O)}else if(ht){const _t=Et.get(x.texture),It=I;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,_t.__webglTexture,O,It)}else if(x!==null&&O!==0){const _t=Et.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,_t.__webglTexture,O)}S=-1},this.readRenderTargetPixels=function(x,I,O,B,N,Q,ht){if(!(x&&x.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=Et.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ht!==void 0&&(gt=gt[ht]),gt){Mt.bindFramebuffer(w.FRAMEBUFFER,gt);try{const _t=x.texture,It=_t.format,Ft=_t.type;if(!kt.textureFormatReadable(It)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!kt.textureTypeReadable(Ft)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}I>=0&&I<=x.width-B&&O>=0&&O<=x.height-N&&w.readPixels(I,O,B,N,zt.convert(It),zt.convert(Ft),Q)}finally{const _t=U!==null?Et.get(U).__webglFramebuffer:null;Mt.bindFramebuffer(w.FRAMEBUFFER,_t)}}},this.readRenderTargetPixelsAsync=async function(x,I,O,B,N,Q,ht){if(!(x&&x.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let gt=Et.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ht!==void 0&&(gt=gt[ht]),gt){const _t=x.texture,It=_t.format,Ft=_t.type;if(!kt.textureFormatReadable(It))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!kt.textureTypeReadable(Ft))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(I>=0&&I<=x.width-B&&O>=0&&O<=x.height-N){Mt.bindFramebuffer(w.FRAMEBUFFER,gt);const Tt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Tt),w.bufferData(w.PIXEL_PACK_BUFFER,Q.byteLength,w.STREAM_READ),w.readPixels(I,O,B,N,zt.convert(It),zt.convert(Ft),0);const Zt=U!==null?Et.get(U).__webglFramebuffer:null;Mt.bindFramebuffer(w.FRAMEBUFFER,Zt);const Qt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await bh(w,Qt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Tt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,Q),w.deleteBuffer(Tt),w.deleteSync(Qt),Q}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(x,I=null,O=0){x.isTexture!==!0&&(Ai("WebGLRenderer: copyFramebufferToTexture function signature has changed."),I=arguments[0]||null,x=arguments[1]);const B=Math.pow(2,-O),N=Math.floor(x.image.width*B),Q=Math.floor(x.image.height*B),ht=I!==null?I.x:0,gt=I!==null?I.y:0;E.setTexture2D(x,0),w.copyTexSubImage2D(w.TEXTURE_2D,O,0,0,ht,gt,N,Q),Mt.unbindTexture()};const yc=w.createFramebuffer(),Ec=w.createFramebuffer();this.copyTextureToTexture=function(x,I,O=null,B=null,N=0,Q=null){x.isTexture!==!0&&(Ai("WebGLRenderer: copyTextureToTexture function signature has changed."),B=arguments[0]||null,x=arguments[1],I=arguments[2],Q=arguments[3]||0,O=null),Q===null&&(N!==0?(Ai("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Q=N,N=0):Q=0);let ht,gt,_t,It,Ft,Tt,Zt,Qt,me;const fe=x.isCompressedTexture?x.mipmaps[Q]:x.image;if(O!==null)ht=O.max.x-O.min.x,gt=O.max.y-O.min.y,_t=O.isBox3?O.max.z-O.min.z:1,It=O.min.x,Ft=O.min.y,Tt=O.isBox3?O.min.z:0;else{const Ke=Math.pow(2,-N);ht=Math.floor(fe.width*Ke),gt=Math.floor(fe.height*Ke),x.isDataArrayTexture?_t=fe.depth:x.isData3DTexture?_t=Math.floor(fe.depth*Ke):_t=1,It=0,Ft=0,Tt=0}B!==null?(Zt=B.x,Qt=B.y,me=B.z):(Zt=0,Qt=0,me=0);const Kt=zt.convert(I.format),At=zt.convert(I.type);let Te;I.isData3DTexture?(E.setTexture3D(I,0),Te=w.TEXTURE_3D):I.isDataArrayTexture||I.isCompressedArrayTexture?(E.setTexture2DArray(I,0),Te=w.TEXTURE_2D_ARRAY):(E.setTexture2D(I,0),Te=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,I.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,I.unpackAlignment);const te=w.getParameter(w.UNPACK_ROW_LENGTH),en=w.getParameter(w.UNPACK_IMAGE_HEIGHT),ai=w.getParameter(w.UNPACK_SKIP_PIXELS),Ge=w.getParameter(w.UNPACK_SKIP_ROWS),Xi=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,fe.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,fe.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,It),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ft),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Tt);const ue=x.isDataArrayTexture||x.isData3DTexture,Ze=I.isDataArrayTexture||I.isData3DTexture;if(x.isDepthTexture){const Ke=Et.get(x),De=Et.get(I),Fe=Et.get(Ke.__renderTarget),mr=Et.get(De.__renderTarget);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,Fe.__webglFramebuffer),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,mr.__webglFramebuffer);for(let Vn=0;Vn<_t;Vn++)ue&&(w.framebufferTextureLayer(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Et.get(x).__webglTexture,N,Tt+Vn),w.framebufferTextureLayer(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Et.get(I).__webglTexture,Q,me+Vn)),w.blitFramebuffer(It,Ft,ht,gt,Zt,Qt,ht,gt,w.DEPTH_BUFFER_BIT,w.NEAREST);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,null)}else if(N!==0||x.isRenderTargetTexture||Et.has(x)){const Ke=Et.get(x),De=Et.get(I);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,yc),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,Ec);for(let Fe=0;Fe<_t;Fe++)ue?w.framebufferTextureLayer(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ke.__webglTexture,N,Tt+Fe):w.framebufferTexture2D(w.READ_FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ke.__webglTexture,N),Ze?w.framebufferTextureLayer(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,De.__webglTexture,Q,me+Fe):w.framebufferTexture2D(w.DRAW_FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,De.__webglTexture,Q),N!==0?w.blitFramebuffer(It,Ft,ht,gt,Zt,Qt,ht,gt,w.COLOR_BUFFER_BIT,w.NEAREST):Ze?w.copyTexSubImage3D(Te,Q,Zt,Qt,me+Fe,It,Ft,ht,gt):w.copyTexSubImage2D(Te,Q,Zt,Qt,It,Ft,ht,gt);Mt.bindFramebuffer(w.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,null)}else Ze?x.isDataTexture||x.isData3DTexture?w.texSubImage3D(Te,Q,Zt,Qt,me,ht,gt,_t,Kt,At,fe.data):I.isCompressedArrayTexture?w.compressedTexSubImage3D(Te,Q,Zt,Qt,me,ht,gt,_t,Kt,fe.data):w.texSubImage3D(Te,Q,Zt,Qt,me,ht,gt,_t,Kt,At,fe):x.isDataTexture?w.texSubImage2D(w.TEXTURE_2D,Q,Zt,Qt,ht,gt,Kt,At,fe.data):x.isCompressedTexture?w.compressedTexSubImage2D(w.TEXTURE_2D,Q,Zt,Qt,fe.width,fe.height,Kt,fe.data):w.texSubImage2D(w.TEXTURE_2D,Q,Zt,Qt,ht,gt,Kt,At,fe);w.pixelStorei(w.UNPACK_ROW_LENGTH,te),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,en),w.pixelStorei(w.UNPACK_SKIP_PIXELS,ai),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ge),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Xi),Q===0&&I.generateMipmaps&&w.generateMipmap(Te),Mt.unbindTexture()},this.copyTextureToTexture3D=function(x,I,O=null,B=null,N=0){return x.isTexture!==!0&&(Ai("WebGLRenderer: copyTextureToTexture3D function signature has changed."),O=arguments[0]||null,B=arguments[1]||null,x=arguments[2],I=arguments[3],N=arguments[4]||0),Ai('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(x,I,O,B,N)},this.initRenderTarget=function(x){Et.get(x).__webglFramebuffer===void 0&&E.setupRenderTarget(x)},this.initTexture=function(x){x.isCubeTexture?E.setTextureCube(x,0):x.isData3DTexture?E.setTexture3D(x,0):x.isDataArrayTexture||x.isCompressedArrayTexture?E.setTexture2DArray(x,0):E.setTexture2D(x,0),Mt.unbindTexture()},this.resetState=function(){R=0,A=0,U=null,Mt.reset(),ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return En}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorspace=$t._getDrawingBufferColorSpace(t),e.unpackColorSpace=$t._getUnpackColorSpace()}}const yl={type:"change"},io={type:"start"},mc={type:"end"},Ws=new cs,El=new Nn,Km=Math.cos(70*yh.DEG2RAD),Me=new P,Oe=2*Math.PI,oe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Kr=1e-6;class $m extends uu{constructor(t,e=null){super(t,e),this.state=oe.NONE,this.enabled=!0,this.target=new P,this.cursor=new P,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Di.ROTATE,MIDDLE:Di.DOLLY,RIGHT:Di.PAN},this.touches={ONE:Ri.ROTATE,TWO:Ri.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new P,this._lastQuaternion=new ni,this._lastTargetPosition=new P,this._quat=new ni().setFromUnitVectors(t.up,new P(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Ko,this._sphericalDelta=new Ko,this._scale=1,this._panOffset=new P,this._rotateStart=new vt,this._rotateEnd=new vt,this._rotateDelta=new vt,this._panStart=new vt,this._panEnd=new vt,this._panDelta=new vt,this._dollyStart=new vt,this._dollyEnd=new vt,this._dollyDelta=new vt,this._dollyDirection=new P,this._mouse=new vt,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Qm.bind(this),this._onPointerDown=Jm.bind(this),this._onPointerUp=tg.bind(this),this._onContextMenu=og.bind(this),this._onMouseWheel=ig.bind(this),this._onKeyDown=sg.bind(this),this._onTouchStart=rg.bind(this),this._onTouchMove=ag.bind(this),this._onMouseDown=eg.bind(this),this._onMouseMove=ng.bind(this),this._interceptControlDown=lg.bind(this),this._interceptControlUp=cg.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(yl),this.update(),this.state=oe.NONE}update(t=null){const e=this.object.position;Me.copy(e).sub(this.target),Me.applyQuaternion(this._quat),this._spherical.setFromVector3(Me),this.autoRotate&&this.state===oe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(n)&&isFinite(s)&&(n<-Math.PI?n+=Oe:n>Math.PI&&(n-=Oe),s<-Math.PI?s+=Oe:s>Math.PI&&(s-=Oe),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(Me.setFromSpherical(this._spherical),Me.applyQuaternion(this._quatInverse),e.copy(this.target).add(Me),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=Me.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),r=!!l}else if(this.object.isOrthographicCamera){const o=new P(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=l!==this.object.zoom;const c=new P(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=Me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Ws.origin.copy(this.object.position),Ws.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Ws.direction))Kr||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Kr||this._lastTargetPosition.distanceToSquared(this.target)>Kr?(this.dispatchEvent(yl),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Oe/60*this.autoRotateSpeed*t:Oe/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){Me.setFromMatrixColumn(e,0),Me.multiplyScalar(-t),this._panOffset.add(Me)}_panUp(t,e){this.screenSpacePanning===!0?Me.setFromMatrixColumn(e,1):(Me.setFromMatrixColumn(e,0),Me.crossVectors(this.object.up,Me)),Me.multiplyScalar(t),this._panOffset.add(Me)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;Me.copy(s).sub(this.target);let r=Me.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Oe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Oe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(Oe*this._rotateDelta.x/e.clientHeight),this._rotateUp(Oe*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e{var e;(t instanceof Me||t instanceof $h)&&((e=t.geometry)==null||e.dispose(),Array.isArray(t.material)?t.material.forEach(n=>n.dispose()):t.material&&t.material.dispose())}),i.renderer.dispose(),i.composer.dispose()}class xg{constructor(t){Wt(this,"positions");Wt(this,"velocities");Wt(this,"running",!0);Wt(this,"step",0);Wt(this,"repulsionStrength",500);Wt(this,"attractionStrength",.01);Wt(this,"dampening",.9);Wt(this,"baseMaxSteps",300);Wt(this,"maxSteps",300);Wt(this,"cooldownExtension",0);this.positions=t,this.velocities=new Map;for(const e of t.keys())this.velocities.set(e,new P)}addNode(t,e){this.positions.set(t,e.clone()),this.velocities.set(t,new P),this.cooldownExtension=100,this.maxSteps=Math.max(this.maxSteps,this.step+this.cooldownExtension),this.running=!0}removeNode(t){this.positions.delete(t),this.velocities.delete(t)}tick(t){if(!this.running)return;if(this.step>this.maxSteps){this.cooldownExtension>0&&(this.cooldownExtension=0,this.maxSteps=this.baseMaxSteps);return}this.step++;const e=Math.max(.001,1-this.step/this.maxSteps),n=Array.from(this.positions.keys());for(let s=0;s0?.15+t.retention*.2:0,blending:ze}),h=new Br(c);h.scale.set(s*4*n,s*4*n,1),h.position.copy(e),h.userData={isGlow:!0,nodeId:t.id},this.glowMap.set(t.id,h),this.group.add(h);const d=t.label||t.type,f=this.createTextSprite(d,"#e2e8f0");return f.position.copy(e),f.position.y+=s*2+1.5,f.userData={isLabel:!0,nodeId:t.id,offset:s*2+1.5},this.group.add(f),this.labelSprites.set(t.id,f),{mesh:l,glow:h,label:f,size:s}}addNode(t,e){const n=(e==null?void 0:e.clone())??new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);this.positions.set(t.id,n);const{mesh:s,glow:r,label:a}=this.createNodeMeshes(t,n,0);return s.scale.setScalar(.001),r.scale.set(.001,.001,1),r.material.opacity=0,a.material.opacity=0,this.materializingNodes.push({id:t.id,frame:0,totalFrames:30,mesh:s,glow:r,label:a,targetScale:.5+t.retention*2}),n}removeNode(t){const e=this.meshMap.get(t),n=this.glowMap.get(t),s=this.labelSprites.get(t);!e||!n||!s||(this.materializingNodes=this.materializingNodes.filter(r=>r.id!==t),this.dissolvingNodes.push({id:t,frame:0,totalFrames:60,mesh:e,glow:n,label:s,originalScale:e.scale.x}))}growNode(t,e){const n=this.meshMap.get(t);if(!n)return;const s=n.scale.x,r=.5+e*2;n.userData.retention=e,this.growingNodes.push({id:t,frame:0,totalFrames:30,startScale:s,targetScale:r})}createTextSprite(t,e){const n=document.createElement("canvas"),s=n.getContext("2d");n.width=512,n.height=64;const r=t.length>40?t.slice(0,37)+"...":t;s.clearRect(0,0,n.width,n.height),s.font="bold 28px -apple-system, BlinkMacSystemFont, sans-serif",s.textAlign="center",s.textBaseline="middle",s.shadowColor="rgba(0, 0, 0, 0.8)",s.shadowBlur=6,s.shadowOffsetX=0,s.shadowOffsetY=2,s.fillStyle=e,s.fillText(r,n.width/2,n.height/2);const a=new tu(n);a.needsUpdate=!0;const o=new Ha({map:a,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),l=new Br(o);return l.scale.set(12,1.5,1),l}updatePositions(){this.group.children.forEach(t=>{if(t.userData.nodeId){const e=this.positions.get(t.userData.nodeId);if(!e)return;t.userData.isGlow?t.position.copy(e):t.userData.isLabel?(t.position.copy(e),t.position.y+=t.userData.offset):t instanceof Me&&t.position.copy(e)}})}animate(t,e,n){var r,a;for(let o=this.materializingNodes.length-1;o>=0;o--){const l=this.materializingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=Tl(c);if(l.mesh.scale.setScalar(Math.max(.001,h)),l.frame>=5){const d=Math.min((l.frame-5)/5,1),f=l.glow.material;f.opacity=d*.25;const p=l.targetScale*4*h;l.glow.scale.set(p,p,1)}if(l.frame>=40){const d=Math.min((l.frame-40)/20,1);l.label.material.opacity=d*.9}l.frame>=60&&this.materializingNodes.splice(o,1)}for(let o=this.dissolvingNodes.length-1;o>=0;o--){const l=this.dissolvingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=1-Mg(c),d=Math.max(.001,l.originalScale*h);l.mesh.scale.setScalar(d);const f=d*4;l.glow.scale.set(f,f,1);const p=l.mesh.material;p.opacity*=.97,l.glow.material.opacity*=.95,l.label.material.opacity*=.93,l.frame>=l.totalFrames&&(this.group.remove(l.mesh),this.group.remove(l.glow),this.group.remove(l.label),l.mesh.geometry.dispose(),l.mesh.material.dispose(),(r=l.glow.material.map)==null||r.dispose(),l.glow.material.dispose(),(a=l.label.material.map)==null||a.dispose(),l.label.material.dispose(),this.meshMap.delete(l.id),this.glowMap.delete(l.id),this.labelSprites.delete(l.id),this.positions.delete(l.id),this.dissolvingNodes.splice(o,1))}for(let o=this.growingNodes.length-1;o>=0;o--){const l=this.growingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=l.startScale+(l.targetScale-l.startScale)*Tl(c),d=this.meshMap.get(l.id);d&&d.scale.setScalar(h);const f=this.glowMap.get(l.id);if(f){const p=h*4;f.scale.set(p,p,1)}l.frame>=l.totalFrames&&this.growingNodes.splice(o,1)}const s=new Set([...this.materializingNodes.map(o=>o.id),...this.dissolvingNodes.map(o=>o.id),...this.growingNodes.map(o=>o.id)]);this.meshMap.forEach((o,l)=>{if(s.has(l))return;const c=e.find(f=>f.id===l);if(!c)return;const h=1+Math.sin(t*1.5+e.indexOf(c)*.5)*.15*c.retention;o.scale.setScalar(h);const d=o.material;if(l===this.hoveredNode)d.emissiveIntensity=1;else if(l===this.selectedNode)d.emissiveIntensity=.8;else{const p=.3+c.retention*.5+Math.sin(t*(.8+c.retention*.7))*.1*c.retention;d.emissiveIntensity=p}}),this.labelSprites.forEach((o,l)=>{if(s.has(l))return;const c=this.positions.get(l);if(!c)return;const h=n.position.distanceTo(c),d=o.material,f=l===this.hoveredNode||l===this.selectedNode?1:h<40?.9:h<80?.9*(1-(h-40)/40):0;d.opacity+=(f-d.opacity)*.1})}getMeshes(){return Array.from(this.meshMap.values())}dispose(){this.group.traverse(t=>{var e,n,s,r,a;t instanceof Me?((e=t.geometry)==null||e.dispose(),(n=t.material)==null||n.dispose()):t instanceof Br&&((r=(s=t.material)==null?void 0:s.map)==null||r.dispose(),(a=t.material)==null||a.dispose())}),this.materializingNodes=[],this.dissolvingNodes=[],this.growingNodes=[]}}function yg(i){return 1-Math.pow(1-i,3)}class Eg{constructor(){Wt(this,"group");Wt(this,"growingEdges",[]);Wt(this,"dissolvingEdges",[]);this.group=new Ci}createEdges(t,e){for(const n of t){const s=e.get(n.source),r=e.get(n.target);if(!s||!r)continue;const a=[s,r],o=new pe().setFromPoints(a),l=new rr({color:4868730,transparent:!0,opacity:Math.min(.1+n.weight*.5,.6),blending:ze}),c=new ka(o,l);c.userData={source:n.source,target:n.target},this.group.add(c)}}addEdge(t,e){const n=e.get(t.source),s=e.get(t.target);if(!n||!s)return;const r=[n.clone(),n.clone()],a=new pe().setFromPoints(r),o=new rr({color:4868730,transparent:!0,opacity:0,blending:ze}),l=new ka(a,o);l.userData={source:t.source,target:t.target},this.group.add(l),this.growingEdges.push({line:l,source:t.source,target:t.target,frame:0,totalFrames:45})}removeEdgesForNode(t){const e=[];this.group.children.forEach(n=>{const s=n;(s.userData.source===t||s.userData.target===t)&&e.push(s)});for(const n of e)this.growingEdges=this.growingEdges.filter(s=>s.line!==n),this.dissolvingEdges.push({line:n,frame:0,totalFrames:40})}animateEdges(t){for(let e=this.growingEdges.length-1;e>=0;e--){const n=this.growingEdges[e];n.frame++;const s=yg(Math.min(n.frame/n.totalFrames,1)),r=t.get(n.source),a=t.get(n.target);if(!r||!a)continue;const o=r.clone().lerp(a,s),l=n.line.geometry.attributes.position;l.setXYZ(0,r.x,r.y,r.z),l.setXYZ(1,o.x,o.y,o.z),l.needsUpdate=!0;const c=n.line.material;c.opacity=s*.5,n.frame>=n.totalFrames&&(c.opacity=.5,this.growingEdges.splice(e,1))}for(let e=this.dissolvingEdges.length-1;e>=0;e--){const n=this.dissolvingEdges[e];n.frame++;const s=n.frame/n.totalFrames,r=n.line.material;r.opacity=Math.max(0,.5*(1-s)),n.frame>=n.totalFrames&&(this.group.remove(n.line),n.line.geometry.dispose(),n.line.material.dispose(),this.dissolvingEdges.splice(e,1))}}updatePositions(t){this.group.children.forEach(e=>{const n=e;if(this.growingEdges.some(a=>a.line===n)||this.dissolvingEdges.some(a=>a.line===n))return;const s=t.get(n.userData.source),r=t.get(n.userData.target);if(s&&r){const a=n.geometry.attributes.position;a.setXYZ(0,s.x,s.y,s.z),a.setXYZ(1,r.x,r.y,r.z),a.needsUpdate=!0}})}dispose(){this.group.children.forEach(t=>{var n,s;const e=t;(n=e.geometry)==null||n.dispose(),(s=e.material)==null||s.dispose()}),this.growingEdges=[],this.dissolvingEdges=[]}}class bg{constructor(t){Wt(this,"starField");Wt(this,"neuralParticles");this.starField=this.createStarField(),this.neuralParticles=this.createNeuralParticles(),t.add(this.starField),t.add(this.neuralParticles)}createStarField(){const e=new pe,n=new Float32Array(3e3*3),s=new Float32Array(3e3);for(let a=0;a<3e3;a++)n[a*3]=(Math.random()-.5)*1e3,n[a*3+1]=(Math.random()-.5)*1e3,n[a*3+2]=(Math.random()-.5)*1e3,s[a]=Math.random()*1.5;e.setAttribute("position",new de(n,3)),e.setAttribute("size",new de(s,1));const r=new Ni({color:6514417,size:.5,transparent:!0,opacity:.4,sizeAttenuation:!0,blending:ze});return new rs(e,r)}createNeuralParticles(){const e=new pe,n=new Float32Array(500*3),s=new Float32Array(500*3);for(let a=0;a<500;a++)n[a*3]=(Math.random()-.5)*100,n[a*3+1]=(Math.random()-.5)*100,n[a*3+2]=(Math.random()-.5)*100,s[a*3]=.4+Math.random()*.3,s[a*3+1]=.3+Math.random()*.2,s[a*3+2]=.8+Math.random()*.2;e.setAttribute("position",new de(n,3)),e.setAttribute("color",new de(s,3));const r=new Ni({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:ze,sizeAttenuation:!0});return new rs(e,r)}animate(t){this.starField.rotation.y+=1e-4,this.starField.rotation.x+=5e-5;const e=this.neuralParticles.geometry.attributes.position;for(let n=0;n=0;s--){const r=this.pulseEffects[s];if(r.intensity-=r.decay,r.intensity<=0){this.pulseEffects.splice(s,1);continue}const a=t.get(r.nodeId);if(a){const o=a.material;o.emissive.lerp(r.color,r.intensity*.3),o.emissiveIntensity=Math.max(o.emissiveIntensity,r.intensity)}}for(let s=this.spawnBursts.length-1;s>=0;s--){const r=this.spawnBursts[s];if(r.age++,r.age>120){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),this.spawnBursts.splice(s,1);continue}const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity;for(let c=0;c=0;s--){const r=this.rainbowBursts[s];if(r.age++,r.age>r.maxAge){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),this.rainbowBursts.splice(s,1);continue}const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity;for(let f=0;f=0;s--){const r=this.rippleWaves[s];if(r.age++,r.radius+=r.speed,r.age>r.maxAge){this.rippleWaves.splice(s,1);continue}const a=r.radius,o=3;n.forEach((l,c)=>{if(r.pulsedNodes.has(c))return;const h=l.distanceTo(r.origin);if(h>=a-o&&h<=a+o){r.pulsedNodes.add(c),this.addPulse(c,.8,new pt(65489),.03);const d=t.get(c);d&&d.scale.multiplyScalar(1.3)}})}for(let s=this.implosions.length-1;s>=0;s--){const r=this.implosions[s];if(r.age++,r.age>r.maxAge+20){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),r.flash&&(this.scene.remove(r.flash),r.flash.geometry.dispose(),r.flash.material.dispose()),this.implosions.splice(s,1);continue}if(r.age<=r.maxAge){const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity,l=1+r.age*.02;for(let h=0;hr.maxAge){const a=(r.age-r.maxAge)/20;r.flash.material.opacity=Math.max(0,1-a),r.flash.scale.setScalar(1+a*3)}}for(let s=this.shockwaves.length-1;s>=0;s--){const r=this.shockwaves[s];if(r.age++,r.age>r.maxAge){this.scene.remove(r.mesh),r.mesh.geometry.dispose(),r.mesh.material.dispose(),this.shockwaves.splice(s,1);continue}const a=r.age/r.maxAge;r.mesh.scale.setScalar(1+a*20),r.mesh.material.opacity=.8*(1-a),r.mesh.lookAt(e.position)}for(let s=this.connectionFlashes.length-1;s>=0;s--){const r=this.connectionFlashes[s];if(r.intensity-=.015,r.intensity<=0){this.scene.remove(r.line),r.line.geometry.dispose(),r.line.material.dispose(),this.connectionFlashes.splice(s,1);continue}r.line.material.opacity=r.intensity}}dispose(){for(const t of this.spawnBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.rainbowBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.implosions)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose(),t.flash&&(this.scene.remove(t.flash),t.flash.geometry.dispose(),t.flash.material.dispose());for(const t of this.shockwaves)this.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose();for(const t of this.connectionFlashes)this.scene.remove(t.line),t.line.geometry.dispose(),t.line.material.dispose();this.pulseEffects=[],this.spawnBursts=[],this.rainbowBursts=[],this.rippleWaves=[],this.implosions=[],this.shockwaves=[],this.connectionFlashes=[]}}const Sn={bloomStrength:.8,rotateSpeed:.3,fogColor:328976,fogDensity:.008,nebulaIntensity:0,chromaticIntensity:.002,vignetteRadius:.9,breatheAmplitude:1},In={bloomStrength:1.8,rotateSpeed:.08,fogColor:656672,fogDensity:.006,nebulaIntensity:1,chromaticIntensity:.005,vignetteRadius:.7,breatheAmplitude:2};class wg{constructor(){Wt(this,"active",!1);Wt(this,"transition",0);Wt(this,"transitionSpeed",.008);Wt(this,"current");Wt(this,"auroraHue",0);this.current={...Sn}}setActive(t){this.active=t}update(t,e,n,s,r){const a=this.active?1:0;this.transition+=(a-this.transition)*this.transitionSpeed*60*(1/60),this.transition=Math.max(0,Math.min(1,this.transition));const o=this.transition;this.current.bloomStrength=this.lerp(Sn.bloomStrength,In.bloomStrength,o),this.current.rotateSpeed=this.lerp(Sn.rotateSpeed,In.rotateSpeed,o),this.current.fogDensity=this.lerp(Sn.fogDensity,In.fogDensity,o),this.current.nebulaIntensity=this.lerp(Sn.nebulaIntensity,In.nebulaIntensity,o),this.current.chromaticIntensity=this.lerp(Sn.chromaticIntensity,In.chromaticIntensity,o),this.current.vignetteRadius=this.lerp(Sn.vignetteRadius,In.vignetteRadius,o),this.current.breatheAmplitude=this.lerp(Sn.breatheAmplitude,In.breatheAmplitude,o),e.strength=this.current.bloomStrength,n.autoRotateSpeed=this.current.rotateSpeed;const l=new pt(Sn.fogColor),c=new pt(In.fogColor),h=l.clone().lerp(c,o);if(t.fog=new ur(h,this.current.fogDensity),o>.01){this.auroraHue=r*.1%1;const d=new pt().setHSL(.75+this.auroraHue*.15,.8,.5),f=new pt().setHSL(.55+this.auroraHue*.2,.7,.4);s.point1.color.lerp(d,o*.3),s.point2.color.lerp(f,o*.3)}else s.point1.color.set(6514417),s.point2.color.set(11032055)}lerp(t,e,n){return t+(e-t)*n}}const Ag=50,as=[];function Rg(i,t,e){const n=i.tags??[],s=i.type??"";let r=null,a=0;for(const o of t){let l=0;o.type===s&&(l+=2);for(const c of o.tags)n.includes(c)&&(l+=1);l>a&&(a=l,r=o.id)}if(r&&a>0){const o=e.get(r);if(o)return new P(o.x+(Math.random()-.5)*10,o.y+(Math.random()-.5)*10,o.z+(Math.random()-.5)*10)}return new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40)}function Cg(i,t){if(as.length<=Ag)return;const e=as.shift();i.edgeManager.removeEdgesForNode(e),i.nodeManager.removeNode(e),i.forceSim.removeNode(e),i.onMutation({type:"edgesRemoved",nodeId:e}),i.onMutation({type:"nodeRemoved",nodeId:e});const n=t.findIndex(s=>s.id===e);n!==-1&&t.splice(n,1)}function Pg(i,t,e){var d,f;const{effects:n,nodeManager:s,edgeManager:r,forceSim:a,camera:o,onMutation:l}=t,c=s.positions,h=s.meshMap;switch(i.type){case"MemoryCreated":{const p=i.data;if(!p.id)break;const g={id:p.id,label:(p.content??"").slice(0,60),type:p.node_type??"fact",retention:p.retention??.9,tags:p.tags??[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isCenter:!1},v=Rg(g,e,c),m=s.addNode(g,v);a.addNode(p.id,m),as.push(p.id),Cg(t,e);const u=new pt(Fl[g.type]||"#00ffd1");n.createRainbowBurst(v,u),n.createShockwave(v,u,o);const T=u.clone();T.offsetHSL(.15,0,0),setTimeout(()=>{n.createShockwave(v,T,o)},166),n.createRippleWave(v),l({type:"nodeAdded",node:g});break}case"ConnectionDiscovered":{const p=i.data;if(!p.source_id||!p.target_id)break;const g=c.get(p.source_id),v=c.get(p.target_id),m={source:p.source_id,target:p.target_id,weight:p.weight??.5,type:p.connection_type??"semantic"};r.addEdge(m,c),g&&v&&n.createConnectionFlash(g,v,new pt(54527)),p.source_id&&h.has(p.source_id)&&n.addPulse(p.source_id,1,new pt(54527),.02),p.target_id&&h.has(p.target_id)&&n.addPulse(p.target_id,1,new pt(54527),.02),l({type:"edgeAdded",edge:m});break}case"MemoryDeleted":{const p=i.data;if(!p.id)break;const g=c.get(p.id);if(g){const m=new pt(16729943);n.createImplosion(g,m)}r.removeEdgesForNode(p.id),s.removeNode(p.id),a.removeNode(p.id);const v=as.indexOf(p.id);v!==-1&&as.splice(v,1),l({type:"edgesRemoved",nodeId:p.id}),l({type:"nodeRemoved",nodeId:p.id});break}case"MemoryPromoted":{const p=i.data,g=p==null?void 0:p.id;if(!g)break;const v=p.new_retention??.95;if(h.has(g)){s.growNode(g,v),n.addPulse(g,1.2,new pt(65416),.01);const m=c.get(g);m&&(n.createShockwave(m,new pt(65416),o),n.createSpawnBurst(m,new pt(65416))),l({type:"nodeUpdated",nodeId:g,retention:v})}break}case"MemoryDemoted":{const p=i.data,g=p==null?void 0:p.id;if(!g)break;const v=p.new_retention??.3;h.has(g)&&(s.growNode(g,v),n.addPulse(g,.8,new pt(16729943),.03),l({type:"nodeUpdated",nodeId:g,retention:v}));break}case"MemoryUpdated":{const p=i.data,g=p==null?void 0:p.id;if(!g||!h.has(g))break;n.addPulse(g,.6,new pt(8490232),.02),p.retention!==void 0&&(s.growNode(g,p.retention),l({type:"nodeUpdated",nodeId:g,retention:p.retention}));break}case"SearchPerformed":{h.forEach((p,g)=>{n.addPulse(g,.6+Math.random()*.4,new pt(8490232),.02)});break}case"DreamStarted":{h.forEach((p,g)=>{n.addPulse(g,1,new pt(11032055),.005)});break}case"DreamProgress":{const p=(d=i.data)==null?void 0:d.memory_id;p&&h.has(p)&&n.addPulse(p,1.5,new pt(12616956),.01);break}case"DreamCompleted":{n.createSpawnBurst(new P(0,0,0),new pt(11032055)),n.createShockwave(new P(0,0,0),new pt(11032055),o);break}case"RetentionDecayed":{const p=(f=i.data)==null?void 0:f.id;p&&h.has(p)&&n.addPulse(p,.8,new pt(16729943),.03);break}case"ConsolidationCompleted":{h.forEach((p,g)=>{n.addPulse(g,.4+Math.random()*.3,new pt(16758784),.015)});break}case"ActivationSpread":{const p=i.data;if(p.source_id&&p.target_ids){const g=c.get(p.source_id);if(g)for(const v of p.target_ids){const m=c.get(v);m&&n.createConnectionFlash(g,m,new pt(1370310))}}break}}}const Dg=` + }`})}}Gi.BlurDirectionX=new vt(1,0);Gi.BlurDirectionY=new vt(0,1);function _g(i){const t=new jh;t.fog=new ur(328976,.008);const e=new Ye(60,i.clientWidth/i.clientHeight,.1,2e3);e.position.set(0,30,80);const n=new Zm({antialias:!0,alpha:!0,powerPreference:"high-performance"});n.setSize(i.clientWidth,i.clientHeight),n.setPixelRatio(Math.min(window.devicePixelRatio,2)),n.toneMapping=Bl,n.toneMappingExposure=1.2,i.appendChild(n.domElement);const s=new $m(e,n.domElement);s.enableDamping=!0,s.dampingFactor=.05,s.rotateSpeed=.5,s.zoomSpeed=.8,s.minDistance=10,s.maxDistance=500,s.autoRotate=!0,s.autoRotateSpeed=.3;const r=new pg(n);r.addPass(new mg(t,e));const a=new Gi(new vt(i.clientWidth,i.clientHeight),.8,.4,.85);r.addPass(a);const o=new ou(1710650,.5);t.add(o);const l=new Yo(6514417,1.5,200);l.position.set(50,50,50),t.add(l);const c=new Yo(11032055,1,200);c.position.set(-50,-30,-50),t.add(c);const h=new hu;h.params.Points={threshold:2};const d=new vt;return{scene:t,camera:e,renderer:n,controls:s,composer:r,bloomPass:a,raycaster:h,mouse:d,lights:{ambient:o,point1:l,point2:c}}}function vg(i,t){const e=t.clientWidth,n=t.clientHeight;i.camera.aspect=e/n,i.camera.updateProjectionMatrix(),i.renderer.setSize(e,n),i.composer.setSize(e,n)}function xg(i){i.scene.traverse(t=>{var e;(t instanceof Se||t instanceof Jh)&&((e=t.geometry)==null||e.dispose(),Array.isArray(t.material)?t.material.forEach(n=>n.dispose()):t.material&&t.material.dispose())}),i.renderer.dispose(),i.composer.dispose()}class Mg{constructor(t){Wt(this,"positions");Wt(this,"velocities");Wt(this,"running",!0);Wt(this,"step",0);Wt(this,"repulsionStrength",500);Wt(this,"attractionStrength",.01);Wt(this,"dampening",.9);Wt(this,"baseMaxSteps",300);Wt(this,"maxSteps",300);Wt(this,"cooldownExtension",0);this.positions=t,this.velocities=new Map;for(const e of t.keys())this.velocities.set(e,new P)}addNode(t,e){this.positions.set(t,e.clone()),this.velocities.set(t,new P),this.cooldownExtension=100,this.maxSteps=Math.max(this.maxSteps,this.step+this.cooldownExtension),this.running=!0}removeNode(t){this.positions.delete(t),this.velocities.delete(t)}tick(t){if(!this.running)return;if(this.step>this.maxSteps){this.cooldownExtension>0&&(this.cooldownExtension=0,this.maxSteps=this.baseMaxSteps);return}this.step++;const e=Math.max(.001,1-this.step/this.maxSteps),n=Array.from(this.positions.keys());for(let s=0;s0?.15+t.retention*.2:0,blending:He}),h=new Br(c);h.scale.set(s*4*n,s*4*n,1),h.position.copy(e),h.userData={isGlow:!0,nodeId:t.id},this.glowMap.set(t.id,h),this.group.add(h);const d=t.label||t.type,f=this.createTextSprite(d,"#e2e8f0");return f.position.copy(e),f.position.y+=s*2+1.5,f.userData={isLabel:!0,nodeId:t.id,offset:s*2+1.5},this.group.add(f),this.labelSprites.set(t.id,f),{mesh:l,glow:h,label:f,size:s}}addNode(t,e){const n=(e==null?void 0:e.clone())??new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);this.positions.set(t.id,n);const{mesh:s,glow:r,label:a}=this.createNodeMeshes(t,n,0);return s.scale.setScalar(.001),r.scale.set(.001,.001,1),r.material.opacity=0,a.material.opacity=0,this.materializingNodes.push({id:t.id,frame:0,totalFrames:30,mesh:s,glow:r,label:a,targetScale:.5+t.retention*2}),n}removeNode(t){const e=this.meshMap.get(t),n=this.glowMap.get(t),s=this.labelSprites.get(t);!e||!n||!s||(this.materializingNodes=this.materializingNodes.filter(r=>r.id!==t),this.dissolvingNodes.push({id:t,frame:0,totalFrames:60,mesh:e,glow:n,label:s,originalScale:e.scale.x}))}growNode(t,e){const n=this.meshMap.get(t);if(!n)return;const s=n.scale.x,r=.5+e*2;n.userData.retention=e,this.growingNodes.push({id:t,frame:0,totalFrames:30,startScale:s,targetScale:r})}createTextSprite(t,e){const n=document.createElement("canvas"),s=n.getContext("2d");n.width=512,n.height=64;const r=t.length>40?t.slice(0,37)+"...":t;s.clearRect(0,0,n.width,n.height),s.font="bold 28px -apple-system, BlinkMacSystemFont, sans-serif",s.textAlign="center",s.textBaseline="middle",s.shadowColor="rgba(0, 0, 0, 0.8)",s.shadowBlur=6,s.shadowOffsetX=0,s.shadowOffsetY=2,s.fillStyle=e,s.fillText(r,n.width/2,n.height/2);const a=new eu(n);a.needsUpdate=!0;const o=new Ha({map:a,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),l=new Br(o);return l.scale.set(12,1.5,1),l}updatePositions(){this.group.children.forEach(t=>{if(t.userData.nodeId){const e=this.positions.get(t.userData.nodeId);if(!e)return;t.userData.isGlow?t.position.copy(e):t.userData.isLabel?(t.position.copy(e),t.position.y+=t.userData.offset):t instanceof Se&&t.position.copy(e)}})}animate(t,e,n){var r,a;for(let o=this.materializingNodes.length-1;o>=0;o--){const l=this.materializingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=Tl(c);if(l.mesh.scale.setScalar(Math.max(.001,h)),l.frame>=5){const d=Math.min((l.frame-5)/5,1),f=l.glow.material;f.opacity=d*.25;const p=l.targetScale*4*h;l.glow.scale.set(p,p,1)}if(l.frame>=40){const d=Math.min((l.frame-40)/20,1);l.label.material.opacity=d*.9}l.frame>=60&&this.materializingNodes.splice(o,1)}for(let o=this.dissolvingNodes.length-1;o>=0;o--){const l=this.dissolvingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=1-Sg(c),d=Math.max(.001,l.originalScale*h);l.mesh.scale.setScalar(d);const f=d*4;l.glow.scale.set(f,f,1);const p=l.mesh.material;p.opacity*=.97,l.glow.material.opacity*=.95,l.label.material.opacity*=.93,l.frame>=l.totalFrames&&(this.group.remove(l.mesh),this.group.remove(l.glow),this.group.remove(l.label),l.mesh.geometry.dispose(),l.mesh.material.dispose(),(r=l.glow.material.map)==null||r.dispose(),l.glow.material.dispose(),(a=l.label.material.map)==null||a.dispose(),l.label.material.dispose(),this.meshMap.delete(l.id),this.glowMap.delete(l.id),this.labelSprites.delete(l.id),this.positions.delete(l.id),this.dissolvingNodes.splice(o,1))}for(let o=this.growingNodes.length-1;o>=0;o--){const l=this.growingNodes[o];l.frame++;const c=Math.min(l.frame/l.totalFrames,1),h=l.startScale+(l.targetScale-l.startScale)*Tl(c),d=this.meshMap.get(l.id);d&&d.scale.setScalar(h);const f=this.glowMap.get(l.id);if(f){const p=h*4;f.scale.set(p,p,1)}l.frame>=l.totalFrames&&this.growingNodes.splice(o,1)}const s=new Set([...this.materializingNodes.map(o=>o.id),...this.dissolvingNodes.map(o=>o.id),...this.growingNodes.map(o=>o.id)]);this.meshMap.forEach((o,l)=>{if(s.has(l))return;const c=e.find(f=>f.id===l);if(!c)return;const h=1+Math.sin(t*1.5+e.indexOf(c)*.5)*.15*c.retention;o.scale.setScalar(h);const d=o.material;if(l===this.hoveredNode)d.emissiveIntensity=1;else if(l===this.selectedNode)d.emissiveIntensity=.8;else{const p=.3+c.retention*.5+Math.sin(t*(.8+c.retention*.7))*.1*c.retention;d.emissiveIntensity=p}}),this.labelSprites.forEach((o,l)=>{if(s.has(l))return;const c=this.positions.get(l);if(!c)return;const h=n.position.distanceTo(c),d=o.material,f=l===this.hoveredNode||l===this.selectedNode?1:h<40?.9:h<80?.9*(1-(h-40)/40):0;d.opacity+=(f-d.opacity)*.1})}getMeshes(){return Array.from(this.meshMap.values())}dispose(){this.group.traverse(t=>{var e,n,s,r,a;t instanceof Se?((e=t.geometry)==null||e.dispose(),(n=t.material)==null||n.dispose()):t instanceof Br&&((r=(s=t.material)==null?void 0:s.map)==null||r.dispose(),(a=t.material)==null||a.dispose())}),this.materializingNodes=[],this.dissolvingNodes=[],this.growingNodes=[]}}function Eg(i){return 1-Math.pow(1-i,3)}class bg{constructor(){Wt(this,"group");Wt(this,"growingEdges",[]);Wt(this,"dissolvingEdges",[]);this.group=new Ci}createEdges(t,e){for(const n of t){const s=e.get(n.source),r=e.get(n.target);if(!s||!r)continue;const a=[s,r],o=new pe().setFromPoints(a),l=new rr({color:4868730,transparent:!0,opacity:Math.min(.1+n.weight*.5,.6),blending:He}),c=new ka(o,l);c.userData={source:n.source,target:n.target},this.group.add(c)}}addEdge(t,e){const n=e.get(t.source),s=e.get(t.target);if(!n||!s)return;const r=[n.clone(),n.clone()],a=new pe().setFromPoints(r),o=new rr({color:4868730,transparent:!0,opacity:0,blending:He}),l=new ka(a,o);l.userData={source:t.source,target:t.target},this.group.add(l),this.growingEdges.push({line:l,source:t.source,target:t.target,frame:0,totalFrames:45})}removeEdgesForNode(t){const e=[];this.group.children.forEach(n=>{const s=n;(s.userData.source===t||s.userData.target===t)&&e.push(s)});for(const n of e)this.growingEdges=this.growingEdges.filter(s=>s.line!==n),this.dissolvingEdges.push({line:n,frame:0,totalFrames:40})}animateEdges(t){for(let e=this.growingEdges.length-1;e>=0;e--){const n=this.growingEdges[e];n.frame++;const s=Eg(Math.min(n.frame/n.totalFrames,1)),r=t.get(n.source),a=t.get(n.target);if(!r||!a)continue;const o=r.clone().lerp(a,s),l=n.line.geometry.attributes.position;l.setXYZ(0,r.x,r.y,r.z),l.setXYZ(1,o.x,o.y,o.z),l.needsUpdate=!0;const c=n.line.material;c.opacity=s*.5,n.frame>=n.totalFrames&&(c.opacity=.5,this.growingEdges.splice(e,1))}for(let e=this.dissolvingEdges.length-1;e>=0;e--){const n=this.dissolvingEdges[e];n.frame++;const s=n.frame/n.totalFrames,r=n.line.material;r.opacity=Math.max(0,.5*(1-s)),n.frame>=n.totalFrames&&(this.group.remove(n.line),n.line.geometry.dispose(),n.line.material.dispose(),this.dissolvingEdges.splice(e,1))}}updatePositions(t){this.group.children.forEach(e=>{const n=e;if(this.growingEdges.some(a=>a.line===n)||this.dissolvingEdges.some(a=>a.line===n))return;const s=t.get(n.userData.source),r=t.get(n.userData.target);if(s&&r){const a=n.geometry.attributes.position;a.setXYZ(0,s.x,s.y,s.z),a.setXYZ(1,r.x,r.y,r.z),a.needsUpdate=!0}})}dispose(){this.group.children.forEach(t=>{var n,s;const e=t;(n=e.geometry)==null||n.dispose(),(s=e.material)==null||s.dispose()}),this.growingEdges=[],this.dissolvingEdges=[]}}class Tg{constructor(t){Wt(this,"starField");Wt(this,"neuralParticles");this.starField=this.createStarField(),this.neuralParticles=this.createNeuralParticles(),t.add(this.starField),t.add(this.neuralParticles)}createStarField(){const e=new pe,n=new Float32Array(3e3*3),s=new Float32Array(3e3);for(let a=0;a<3e3;a++)n[a*3]=(Math.random()-.5)*1e3,n[a*3+1]=(Math.random()-.5)*1e3,n[a*3+2]=(Math.random()-.5)*1e3,s[a]=Math.random()*1.5;e.setAttribute("position",new de(n,3)),e.setAttribute("size",new de(s,1));const r=new Ni({color:6514417,size:.5,transparent:!0,opacity:.4,sizeAttenuation:!0,blending:He});return new rs(e,r)}createNeuralParticles(){const e=new pe,n=new Float32Array(500*3),s=new Float32Array(500*3);for(let a=0;a<500;a++)n[a*3]=(Math.random()-.5)*100,n[a*3+1]=(Math.random()-.5)*100,n[a*3+2]=(Math.random()-.5)*100,s[a*3]=.4+Math.random()*.3,s[a*3+1]=.3+Math.random()*.2,s[a*3+2]=.8+Math.random()*.2;e.setAttribute("position",new de(n,3)),e.setAttribute("color",new de(s,3));const r=new Ni({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:He,sizeAttenuation:!0});return new rs(e,r)}animate(t){this.starField.rotation.y+=1e-4,this.starField.rotation.x+=5e-5;const e=this.neuralParticles.geometry.attributes.position;for(let n=0;n=0;s--){const r=this.pulseEffects[s];if(r.intensity-=r.decay,r.intensity<=0){this.pulseEffects.splice(s,1);continue}const a=t.get(r.nodeId);if(a){const o=a.material;o.emissive.lerp(r.color,r.intensity*.3),o.emissiveIntensity=Math.max(o.emissiveIntensity,r.intensity)}}for(let s=this.spawnBursts.length-1;s>=0;s--){const r=this.spawnBursts[s];if(r.age++,r.age>120){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),this.spawnBursts.splice(s,1);continue}const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity;for(let c=0;c=0;s--){const r=this.rainbowBursts[s];if(r.age++,r.age>r.maxAge){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),this.rainbowBursts.splice(s,1);continue}const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity;for(let f=0;f=0;s--){const r=this.rippleWaves[s];if(r.age++,r.radius+=r.speed,r.age>r.maxAge){this.rippleWaves.splice(s,1);continue}const a=r.radius,o=3;n.forEach((l,c)=>{if(r.pulsedNodes.has(c))return;const h=l.distanceTo(r.origin);if(h>=a-o&&h<=a+o){r.pulsedNodes.add(c),this.addPulse(c,.8,new pt(65489),.03);const d=t.get(c);d&&d.scale.multiplyScalar(1.3)}})}for(let s=this.implosions.length-1;s>=0;s--){const r=this.implosions[s];if(r.age++,r.age>r.maxAge+20){this.scene.remove(r.particles),r.particles.geometry.dispose(),r.particles.material.dispose(),r.flash&&(this.scene.remove(r.flash),r.flash.geometry.dispose(),r.flash.material.dispose()),this.implosions.splice(s,1);continue}if(r.age<=r.maxAge){const a=r.particles.geometry.attributes.position,o=r.particles.geometry.attributes.velocity,l=1+r.age*.02;for(let h=0;hr.maxAge){const a=(r.age-r.maxAge)/20;r.flash.material.opacity=Math.max(0,1-a),r.flash.scale.setScalar(1+a*3)}}for(let s=this.shockwaves.length-1;s>=0;s--){const r=this.shockwaves[s];if(r.age++,r.age>r.maxAge){this.scene.remove(r.mesh),r.mesh.geometry.dispose(),r.mesh.material.dispose(),this.shockwaves.splice(s,1);continue}const a=r.age/r.maxAge;r.mesh.scale.setScalar(1+a*20),r.mesh.material.opacity=.8*(1-a),r.mesh.lookAt(e.position)}for(let s=this.connectionFlashes.length-1;s>=0;s--){const r=this.connectionFlashes[s];if(r.intensity-=.015,r.intensity<=0){this.scene.remove(r.line),r.line.geometry.dispose(),r.line.material.dispose(),this.connectionFlashes.splice(s,1);continue}r.line.material.opacity=r.intensity}}dispose(){for(const t of this.spawnBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.rainbowBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.implosions)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose(),t.flash&&(this.scene.remove(t.flash),t.flash.geometry.dispose(),t.flash.material.dispose());for(const t of this.shockwaves)this.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose();for(const t of this.connectionFlashes)this.scene.remove(t.line),t.line.geometry.dispose(),t.line.material.dispose();this.pulseEffects=[],this.spawnBursts=[],this.rainbowBursts=[],this.rippleWaves=[],this.implosions=[],this.shockwaves=[],this.connectionFlashes=[]}}const Sn={bloomStrength:.8,rotateSpeed:.3,fogColor:328976,fogDensity:.008,nebulaIntensity:0,chromaticIntensity:.002,vignetteRadius:.9,breatheAmplitude:1},In={bloomStrength:1.8,rotateSpeed:.08,fogColor:656672,fogDensity:.006,nebulaIntensity:1,chromaticIntensity:.005,vignetteRadius:.7,breatheAmplitude:2};class Ag{constructor(){Wt(this,"active",!1);Wt(this,"transition",0);Wt(this,"transitionSpeed",.008);Wt(this,"current");Wt(this,"auroraHue",0);this.current={...Sn}}setActive(t){this.active=t}update(t,e,n,s,r){const a=this.active?1:0;this.transition+=(a-this.transition)*this.transitionSpeed*60*(1/60),this.transition=Math.max(0,Math.min(1,this.transition));const o=this.transition;this.current.bloomStrength=this.lerp(Sn.bloomStrength,In.bloomStrength,o),this.current.rotateSpeed=this.lerp(Sn.rotateSpeed,In.rotateSpeed,o),this.current.fogDensity=this.lerp(Sn.fogDensity,In.fogDensity,o),this.current.nebulaIntensity=this.lerp(Sn.nebulaIntensity,In.nebulaIntensity,o),this.current.chromaticIntensity=this.lerp(Sn.chromaticIntensity,In.chromaticIntensity,o),this.current.vignetteRadius=this.lerp(Sn.vignetteRadius,In.vignetteRadius,o),this.current.breatheAmplitude=this.lerp(Sn.breatheAmplitude,In.breatheAmplitude,o),e.strength=this.current.bloomStrength,n.autoRotateSpeed=this.current.rotateSpeed;const l=new pt(Sn.fogColor),c=new pt(In.fogColor),h=l.clone().lerp(c,o);if(t.fog=new ur(h,this.current.fogDensity),o>.01){this.auroraHue=r*.1%1;const d=new pt().setHSL(.75+this.auroraHue*.15,.8,.5),f=new pt().setHSL(.55+this.auroraHue*.2,.7,.4);s.point1.color.lerp(d,o*.3),s.point2.color.lerp(f,o*.3)}else s.point1.color.set(6514417),s.point2.color.set(11032055)}lerp(t,e,n){return t+(e-t)*n}}const Rg=50,as=[];function Cg(i,t,e){const n=i.tags??[],s=i.type??"";let r=null,a=0;for(const o of t){let l=0;o.type===s&&(l+=2);for(const c of o.tags)n.includes(c)&&(l+=1);l>a&&(a=l,r=o.id)}if(r&&a>0){const o=e.get(r);if(o)return new P(o.x+(Math.random()-.5)*10,o.y+(Math.random()-.5)*10,o.z+(Math.random()-.5)*10)}return new P((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40)}function Pg(i,t){if(as.length<=Rg)return;const e=as.shift();i.edgeManager.removeEdgesForNode(e),i.nodeManager.removeNode(e),i.forceSim.removeNode(e),i.onMutation({type:"edgesRemoved",nodeId:e}),i.onMutation({type:"nodeRemoved",nodeId:e});const n=t.findIndex(s=>s.id===e);n!==-1&&t.splice(n,1)}function Dg(i,t,e){var d,f;const{effects:n,nodeManager:s,edgeManager:r,forceSim:a,camera:o,onMutation:l}=t,c=s.positions,h=s.meshMap;switch(i.type){case"MemoryCreated":{const p=i.data;if(!p.id)break;const g={id:p.id,label:(p.content??"").slice(0,60),type:p.node_type??"fact",retention:p.retention??.9,tags:p.tags??[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isCenter:!1},v=Cg(g,e,c),m=s.addNode(g,v);a.addNode(p.id,m),as.push(p.id),Pg(t,e);const u=new pt(Nl[g.type]||"#00ffd1");n.createRainbowBurst(v,u),n.createShockwave(v,u,o);const T=u.clone();T.offsetHSL(.15,0,0),setTimeout(()=>{n.createShockwave(v,T,o)},166),n.createRippleWave(v),l({type:"nodeAdded",node:g});break}case"ConnectionDiscovered":{const p=i.data;if(!p.source_id||!p.target_id)break;const g=c.get(p.source_id),v=c.get(p.target_id),m={source:p.source_id,target:p.target_id,weight:p.weight??.5,type:p.connection_type??"semantic"};r.addEdge(m,c),g&&v&&n.createConnectionFlash(g,v,new pt(54527)),p.source_id&&h.has(p.source_id)&&n.addPulse(p.source_id,1,new pt(54527),.02),p.target_id&&h.has(p.target_id)&&n.addPulse(p.target_id,1,new pt(54527),.02),l({type:"edgeAdded",edge:m});break}case"MemoryDeleted":{const p=i.data;if(!p.id)break;const g=c.get(p.id);if(g){const m=new pt(16729943);n.createImplosion(g,m)}r.removeEdgesForNode(p.id),s.removeNode(p.id),a.removeNode(p.id);const v=as.indexOf(p.id);v!==-1&&as.splice(v,1),l({type:"edgesRemoved",nodeId:p.id}),l({type:"nodeRemoved",nodeId:p.id});break}case"MemoryPromoted":{const p=i.data,g=p==null?void 0:p.id;if(!g)break;const v=p.new_retention??.95;if(h.has(g)){s.growNode(g,v),n.addPulse(g,1.2,new pt(65416),.01);const m=c.get(g);m&&(n.createShockwave(m,new pt(65416),o),n.createSpawnBurst(m,new pt(65416))),l({type:"nodeUpdated",nodeId:g,retention:v})}break}case"MemoryDemoted":{const p=i.data,g=p==null?void 0:p.id;if(!g)break;const v=p.new_retention??.3;h.has(g)&&(s.growNode(g,v),n.addPulse(g,.8,new pt(16729943),.03),l({type:"nodeUpdated",nodeId:g,retention:v}));break}case"MemoryUpdated":{const p=i.data,g=p==null?void 0:p.id;if(!g||!h.has(g))break;n.addPulse(g,.6,new pt(8490232),.02),p.retention!==void 0&&(s.growNode(g,p.retention),l({type:"nodeUpdated",nodeId:g,retention:p.retention}));break}case"SearchPerformed":{h.forEach((p,g)=>{n.addPulse(g,.6+Math.random()*.4,new pt(8490232),.02)});break}case"DreamStarted":{h.forEach((p,g)=>{n.addPulse(g,1,new pt(11032055),.005)});break}case"DreamProgress":{const p=(d=i.data)==null?void 0:d.memory_id;p&&h.has(p)&&n.addPulse(p,1.5,new pt(12616956),.01);break}case"DreamCompleted":{n.createSpawnBurst(new P(0,0,0),new pt(11032055)),n.createShockwave(new P(0,0,0),new pt(11032055),o);break}case"RetentionDecayed":{const p=(f=i.data)==null?void 0:f.id;p&&h.has(p)&&n.addPulse(p,.8,new pt(16729943),.03);break}case"ConsolidationCompleted":{h.forEach((p,g)=>{n.addPulse(g,.4+Math.random()*.3,new pt(16758784),.015)});break}case"ActivationSpread":{const p=i.data;if(p.source_id&&p.target_ids){const g=c.get(p.source_id);if(g)for(const v of p.target_ids){const m=c.get(v);m&&n.createConnectionFlash(g,m,new pt(1370310))}}break}}}const Lg=` varying vec2 vUv; void main() { vUv = uv; gl_Position = vec4(position, 1.0); } -`,Lg=` +`,Ug=` precision highp float; uniform float uTime; @@ -4031,7 +4031,7 @@ void main() { gl_FragColor = vec4(color, 1.0); } -`;function Ug(i){const t=new us(2,2),e=new Ne({vertexShader:Dg,fragmentShader:Lg,uniforms:{uTime:{value:0},uResolution:{value:new vt(window.innerWidth,window.innerHeight)},uDreamIntensity:{value:0}},depthWrite:!1,depthTest:!1,transparent:!1}),n=new Me(t,e);return n.frustumCulled=!1,n.renderOrder=-1e3,i.add(n),{mesh:n,material:e}}function Ig(i,t,e,n,s){i.uniforms.uTime.value=t,i.uniforms.uDreamIntensity.value=e,i.uniforms.uResolution.value.set(n,s)}const Ng={uniforms:{tDiffuse:{value:null},uIntensity:{value:.002}},vertexShader:` +`;function Ig(i){const t=new us(2,2),e=new Ne({vertexShader:Lg,fragmentShader:Ug,uniforms:{uTime:{value:0},uResolution:{value:new vt(window.innerWidth,window.innerHeight)},uDreamIntensity:{value:0}},depthWrite:!1,depthTest:!1,transparent:!1}),n=new Se(t,e);return n.frustumCulled=!1,n.renderOrder=-1e3,i.add(n),{mesh:n,material:e}}function Ng(i,t,e,n,s){i.uniforms.uTime.value=t,i.uniforms.uDreamIntensity.value=e,i.uniforms.uResolution.value.set(n,s)}const Fg={uniforms:{tDiffuse:{value:null},uIntensity:{value:.002}},vertexShader:` varying vec2 vUv; void main() { vUv = uv; @@ -4061,7 +4061,7 @@ void main() { gl_FragColor = vec4(r, g, b, 1.0); } - `},Fg={uniforms:{tDiffuse:{value:null},uTime:{value:0},uIntensity:{value:.04}},vertexShader:` + `},Og={uniforms:{tDiffuse:{value:null},uTime:{value:0},uIntensity:{value:.04}},vertexShader:` varying vec2 vUv; void main() { vUv = uv; @@ -4083,7 +4083,7 @@ void main() { color.rgb += grain * uIntensity; gl_FragColor = color; } - `},Og={uniforms:{tDiffuse:{value:null},uRadius:{value:.9},uSoftness:{value:.5}},vertexShader:` + `},Bg={uniforms:{tDiffuse:{value:null},uRadius:{value:.9},uSoftness:{value:.5}},vertexShader:` varying vec2 vUv; void main() { vUv = uv; @@ -4103,11 +4103,11 @@ void main() { color.rgb *= vignette; gl_FragColor = color; } - `};function Bg(i){const t=new Js(Ng),e=new Js(Fg),n=new Js(Og);return i.addPass(t),i.addPass(e),i.addPass(n),{chromatic:t,grain:e,vignette:n}}function zg(i,t,e){i.chromatic.uniforms.uIntensity.value=.002+(.005-.002)*e,i.grain.uniforms.uTime.value=t,i.grain.uniforms.uIntensity.value=.04+e*.02;const r=.9,a=.7;i.vignette.uniforms.uRadius.value=r+(a-r)*e}var Hg=qe('
');function kg(i,t){lr(t,!0);let e=Qs(t,"events",19,()=>[]),n=Qs(t,"isDreaming",3,!1),s,r,a,o,l,c,h,d,f,p,g,v=0,m=[];Al(()=>{r=gg(s),p=Ug(r.scene).material,g=Bg(r.composer),c=new bg(r.scene),o=new Sg,l=new Eg,h=new Tg(r.scene),f=new wg;const U=o.createNodes(t.nodes);l.createEdges(t.edges,U),d=new xg(U),m=[...t.nodes],r.scene.add(l.group),r.scene.add(o.group),u(),window.addEventListener("resize",b),s.addEventListener("pointermove",y),s.addEventListener("click",L)}),Rl(()=>{cancelAnimationFrame(a),window.removeEventListener("resize",b),s==null||s.removeEventListener("pointermove",y),s==null||s.removeEventListener("click",L),h==null||h.dispose(),c==null||c.dispose(),o==null||o.dispose(),l==null||l.dispose(),r&&vg(r)});function u(){a=requestAnimationFrame(u);const A=performance.now()*.001;d.tick(t.edges),o.updatePositions(),l.updatePositions(o.positions),l.animateEdges(o.positions),c.animate(A),o.animate(A,m,r.camera),f.setActive(n()),f.update(r.scene,r.bloomPass,r.controls,r.lights,A),Ig(p,A,f.current.nebulaIntensity,s.clientWidth,s.clientHeight),zg(g,A,f.current.nebulaIntensity),T(),h.update(o.meshMap,r.camera,o.positions),r.controls.update(),r.composer.render()}function T(){if(!e()||e().length<=v)return;const A=e().slice(v);v=e().length;const U={effects:h,nodeManager:o,edgeManager:l,forceSim:d,camera:r.camera,onMutation:S=>{var M;S.type==="nodeAdded"?m=[...m,S.node]:S.type==="nodeRemoved"&&(m=m.filter(D=>D.id!==S.nodeId)),(M=t.onGraphMutation)==null||M.call(t,S)}};for(const S of A)Pg(S,U,m)}function b(){!s||!r||_g(r,s)}function y(A){const U=s.getBoundingClientRect();r.mouse.x=(A.clientX-U.left)/U.width*2-1,r.mouse.y=-((A.clientY-U.top)/U.height)*2+1,r.raycaster.setFromCamera(r.mouse,r.camera);const S=r.raycaster.intersectObjects(o.getMeshes());S.length>0?(o.hoveredNode=S[0].object.userData.nodeId,s.style.cursor="pointer"):(o.hoveredNode=null,s.style.cursor="grab")}function L(){var A;if(o.hoveredNode){o.selectedNode=o.hoveredNode,(A=t.onSelect)==null||A.call(t,o.hoveredNode);const U=o.positions.get(o.hoveredNode);U&&r.controls.target.lerp(U.clone(),.5)}}var R=Hg();Lc(R,A=>s=A,()=>s),Be(i,R),cr()}var Vg=qe('
'),Gg=qe('
');function Wg(i,t){lr(t,!0);let e=Qs(t,"width",3,240),n=Qs(t,"height",3,80);function s(m){return t.stability<=0?0:Math.exp(-m/t.stability)}let r=ti(()=>{const m=[],u=Math.max(t.stability*3,30),T=4,b=e()-T*2,y=n()-T*2;for(let L=0;L<=50;L++){const R=L/50*u,A=s(R),U=T+L/50*b,S=T+(1-A)*y;m.push(`${L===0?"M":"L"}${U.toFixed(1)},${S.toFixed(1)}`)}return m.join(" ")}),a=ti(()=>[{label:"Now",days:0,value:t.retention},{label:"1d",days:1,value:s(1)},{label:"7d",days:7,value:s(7)},{label:"30d",days:30,value:s(30)}]);function o(m){return m>.7?"#10b981":m>.4?"#f59e0b":"#ef4444"}var l=Gg(),c=Dt(l),h=Dt(c),d=Bt(h),f=Bt(d),p=Bt(f),g=Bt(p);Cl(),Rt(c);var v=Bt(c,2);$r(v,21,()=>q(a),Jr,(m,u)=>{var T=Vg(),b=Dt(T),y=Dt(b);Rt(b);var L=Bt(b,2),R=Dt(L);Rt(L),Rt(T),ln((A,U)=>{_e(y,`${q(u).label??""}:`),Ul(L,`color: ${A??""}`),_e(R,`${U??""}%`)},[()=>o(q(u).value),()=>(q(u).value*100).toFixed(0)]),Be(m,T)}),Rt(v),Rt(l),ln(m=>{Ve(c,"width",e()),Ve(c,"height",n()),Ve(c,"viewBox",`0 0 ${e()??""} ${n()??""}`),Ve(h,"y1",4+(n()-8)*.5),Ve(h,"x2",e()-4),Ve(h,"y2",4+(n()-8)*.5),Ve(d,"y1",4+(n()-8)*.8),Ve(d,"x2",e()-4),Ve(d,"y2",4+(n()-8)*.8),Ve(f,"d",q(r)),Ve(p,"d",`${q(r)??""} L${e()-4},${n()-4} L4,${n()-4} Z`),Ve(g,"cy",4+(1-t.retention)*(n()-8)),Ve(g,"fill",m)},[()=>o(t.retention)]),Be(i,l),cr()}function wl(i,t,e){const n=e.getTime(),s=new Set,r=new Map,a=i.filter(l=>{const c=new Date(l.createdAt).getTime();if(c<=n){s.add(l.id);const h=n-c,d=1440*60*1e3,f=hs.has(l.source)&&s.has(l.target));return{visibleNodes:a,visibleEdges:o,nodeOpacities:r}}function Xg(i){if(i.length===0){const n=new Date;return{oldest:n,newest:n}}let t=1/0,e=-1/0;for(const n of i){const s=new Date(n.createdAt).getTime();se&&(e=s)}return{oldest:new Date(t),newest:new Date(e)}}var Yg=qe(`
');function Vg(i,t){lr(t,!0);let e=Qs(t,"events",19,()=>[]),n=Qs(t,"isDreaming",3,!1),s,r,a,o,l,c,h,d,f,p,g,v=0,m=[];Al(()=>{r=_g(s),p=Ig(r.scene).material,g=zg(r.composer),c=new Tg(r.scene),o=new yg,l=new bg,h=new wg(r.scene),f=new Ag;const U=o.createNodes(t.nodes);l.createEdges(t.edges,U),d=new Mg(U),m=[...t.nodes],r.scene.add(l.group),r.scene.add(o.group),u(),window.addEventListener("resize",b),s.addEventListener("pointermove",y),s.addEventListener("click",L)}),Rl(()=>{cancelAnimationFrame(a),window.removeEventListener("resize",b),s==null||s.removeEventListener("pointermove",y),s==null||s.removeEventListener("click",L),h==null||h.dispose(),c==null||c.dispose(),o==null||o.dispose(),l==null||l.dispose(),r&&xg(r)});function u(){a=requestAnimationFrame(u);const A=performance.now()*.001;d.tick(t.edges),o.updatePositions(),l.updatePositions(o.positions),l.animateEdges(o.positions),c.animate(A),o.animate(A,m,r.camera),f.setActive(n()),f.update(r.scene,r.bloomPass,r.controls,r.lights,A),Ng(p,A,f.current.nebulaIntensity,s.clientWidth,s.clientHeight),Hg(g,A,f.current.nebulaIntensity),T(),h.update(o.meshMap,r.camera,o.positions),r.controls.update(),r.composer.render()}function T(){if(!e()||e().length<=v)return;const A=e().slice(v);v=e().length;const U={effects:h,nodeManager:o,edgeManager:l,forceSim:d,camera:r.camera,onMutation:S=>{var M;S.type==="nodeAdded"?m=[...m,S.node]:S.type==="nodeRemoved"&&(m=m.filter(D=>D.id!==S.nodeId)),(M=t.onGraphMutation)==null||M.call(t,S)}};for(const S of A)Dg(S,U,m)}function b(){!s||!r||vg(r,s)}function y(A){const U=s.getBoundingClientRect();r.mouse.x=(A.clientX-U.left)/U.width*2-1,r.mouse.y=-((A.clientY-U.top)/U.height)*2+1,r.raycaster.setFromCamera(r.mouse,r.camera);const S=r.raycaster.intersectObjects(o.getMeshes());S.length>0?(o.hoveredNode=S[0].object.userData.nodeId,s.style.cursor="pointer"):(o.hoveredNode=null,s.style.cursor="grab")}function L(){var A;if(o.hoveredNode){o.selectedNode=o.hoveredNode,(A=t.onSelect)==null||A.call(t,o.hoveredNode);const U=o.positions.get(o.hoveredNode);U&&r.controls.target.lerp(U.clone(),.5)}}var R=kg();Uc(R,A=>s=A,()=>s),ze(i,R),cr()}var Gg=je('
'),Wg=je('
');function Xg(i,t){lr(t,!0);let e=Qs(t,"width",3,240),n=Qs(t,"height",3,80);function s(m){return t.stability<=0?0:Math.exp(-m/t.stability)}let r=ti(()=>{const m=[],u=Math.max(t.stability*3,30),T=4,b=e()-T*2,y=n()-T*2;for(let L=0;L<=50;L++){const R=L/50*u,A=s(R),U=T+L/50*b,S=T+(1-A)*y;m.push(`${L===0?"M":"L"}${U.toFixed(1)},${S.toFixed(1)}`)}return m.join(" ")}),a=ti(()=>[{label:"Now",days:0,value:t.retention},{label:"1d",days:1,value:s(1)},{label:"7d",days:7,value:s(7)},{label:"30d",days:30,value:s(30)}]);function o(m){return m>.7?"#10b981":m>.4?"#f59e0b":"#ef4444"}var l=Wg(),c=Dt(l),h=Dt(c),d=Ot(h),f=Ot(d),p=Ot(f),g=Ot(p);wc(),Rt(c);var v=Ot(c,2);$r(v,21,()=>j(a),Jr,(m,u)=>{var T=Gg(),b=Dt(T),y=Dt(b);Rt(b);var L=Ot(b,2),R=Dt(L);Rt(L),Rt(T),ln((A,U)=>{_e(y,`${j(u).label??""}:`),Ll(L,`color: ${A??""}`),_e(R,`${U??""}%`)},[()=>o(j(u).value),()=>(j(u).value*100).toFixed(0)]),ze(m,T)}),Rt(v),Rt(l),ln(m=>{Be(c,"width",e()),Be(c,"height",n()),Be(c,"viewBox",`0 0 ${e()??""} ${n()??""}`),Be(h,"y1",4+(n()-8)*.5),Be(h,"x2",e()-4),Be(h,"y2",4+(n()-8)*.5),Be(d,"y1",4+(n()-8)*.8),Be(d,"x2",e()-4),Be(d,"y2",4+(n()-8)*.8),Be(f,"d",j(r)),Be(p,"d",`${j(r)??""} L${e()-4},${n()-4} L4,${n()-4} Z`),Be(g,"cy",4+(1-t.retention)*(n()-8)),Be(g,"fill",m)},[()=>o(t.retention)]),ze(i,l),cr()}function wl(i,t,e){const n=e.getTime(),s=new Set,r=new Map,a=i.filter(l=>{const c=new Date(l.createdAt).getTime();if(c<=n){s.add(l.id);const h=n-c,d=1440*60*1e3,f=hs.has(l.source)&&s.has(l.target));return{visibleNodes:a,visibleEdges:o,nodeOpacities:r}}function Yg(i){if(i.length===0){const n=new Date;return{oldest:n,newest:n}}let t=1/0,e=-1/0;for(const n of i){const s=new Date(n.createdAt).getTime();se&&(e=s)}return{oldest:new Date(t),newest:new Date(e)}}var qg=je(`
`),qg=qe('');function jg(i,t){lr(t,!0);let e=Ie(!1),n=Ie(!1),s=Ie(1),r=Ie(100),a,o=0,l=ti(()=>Xg(t.nodes)),c=ti(()=>{const b=q(l).oldest.getTime(),L=q(l).newest.getTime()-b||1;return new Date(b+q(r)/100*L)});function h(b){return b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function d(){se(e,!q(e)),t.onToggle(q(e)),q(e)&&(se(r,100),t.onDateChange(q(c)))}function f(){se(n,!q(n)),q(n)?(se(r,0),o=performance.now(),p()):cancelAnimationFrame(a)}function p(){a=requestAnimationFrame(b=>{const y=(b-o)/1e3;o=b;const L=q(l).oldest.getTime(),A=(q(l).newest.getTime()-L)/(1440*60*1e3)||1,U=q(s)/A*100;if(se(r,Math.min(100,q(r)+U*y),!0),t.onDateChange(q(c)),q(r)>=100){se(n,!1);return}p()})}function g(){t.onDateChange(q(c))}Rl(()=>{cancelAnimationFrame(a)});var v=Rc(),m=Pl(v);{var u=b=>{var y=Yg(),L=Dt(y),R=Dt(L),A=Dt(R),U=Dt(A),S=Dt(U,!0);Rt(U);var M=Bt(U,2),D=Dt(M);D.value=D.__value=1;var W=Bt(D);W.value=W.__value=7;var z=Bt(W);z.value=z.__value=30,Rt(M),Rt(A);var V=Bt(A,2),$=Dt(V,!0);Rt(V);var G=Bt(V,2);Rt(R);var J=Bt(R,2);Ll(J);var k=Bt(J,2),it=Dt(k),ut=Dt(it,!0);Rt(it);var yt=Bt(it,2),Lt=Dt(yt,!0);Rt(yt),Rt(k),Rt(L),Rt(y),ln((jt,Y,et)=>{_e(S,q(n)?"⏸":"▶"),_e($,jt),_e(ut,Y),_e(Lt,et)},[()=>h(q(c)),()=>h(q(l).oldest),()=>h(q(l).newest)]),$e("click",U,f),Nl(M,()=>q(s),jt=>se(s,jt)),$e("click",G,d),$e("input",J,g),Il(J,()=>q(r),jt=>se(r,jt)),Be(b,y)},T=b=>{var y=qg();$e("click",y,d),Be(b,y)};wi(m,b=>{q(e)?b(u):b(T,!1)})}Be(i,v),cr()}Dl(["click","input"]);var Zg=qe('

Loading memory graph...

'),Kg=qe('

Your Mind Awaits

'),$g=qe(' · · ',1),Jg=qe(' '),Qg=qe('
'),t_=qe("
"),e_=qe(`

Memory Detail

Retention Forecast
◬ Explore Connections
`),n_=qe(`
`);function y_(i,t){lr(t,!0);const e=()=>Dc(Uc,"$eventFeed",n),[n,s]=Pc();let r=Ie(null),a=Ie(null),o=Ie(!0),l=Ie(""),c=Ie(!1),h=Ie(""),d=Ie(150),f=Ie(!1),p=Ie(Ac(new Date)),g=Ie(0),v=Ie(0),m=ti(()=>q(r)?q(f)?wl(q(r).nodes,q(r).edges,q(p)).visibleNodes:q(r).nodes:[]),u=ti(()=>q(r)?q(f)?wl(q(r).nodes,q(r).edges,q(p)).visibleEdges:q(r).edges:[]);function T(rt){if(q(r))switch(rt.type){case"nodeAdded":q(r).nodes=[...q(r).nodes,rt.node],q(r).nodeCount=q(r).nodes.length,se(g,q(r).nodeCount,!0);break;case"nodeRemoved":q(r).nodes=q(r).nodes.filter(Ct=>Ct.id!==rt.nodeId),q(r).nodeCount=q(r).nodes.length,se(g,q(r).nodeCount,!0);break;case"edgeAdded":q(r).edges=[...q(r).edges,rt.edge],q(r).edgeCount=q(r).edges.length,se(v,q(r).edgeCount,!0);break;case"edgesRemoved":q(r).edges=q(r).edges.filter(Ct=>Ct.source!==rt.nodeId&&Ct.target!==rt.nodeId),q(r).edgeCount=q(r).edges.length,se(v,q(r).edgeCount,!0);break;case"nodeUpdated":{const Ct=q(r).nodes.find(w=>w.id===rt.nodeId);Ct&&(Ct.retention=rt.retention);break}}}Al(()=>b());async function b(rt,Ct){se(o,!0),se(l,"");try{se(r,await Yi.graph({max_nodes:q(d),depth:3,query:rt||void 0,center_id:Ct||void 0}),!0),q(r)&&(se(g,q(r).nodeCount,!0),se(v,q(r).edgeCount,!0))}catch{se(l,"No memories yet. Start using Vestige to populate your graph.")}finally{se(o,!1)}}async function y(){se(c,!0);try{await Yi.dream(),await b()}catch{}finally{se(c,!1)}}async function L(rt){try{se(a,await Yi.memories.get(rt),!0)}catch{se(a,null)}}function R(){q(h).trim()&&b(q(h))}var A=n_(),U=Dt(A);{var S=rt=>{var Ct=Zg();Be(rt,Ct)},M=rt=>{var Ct=Kg(),w=Dt(Ct),ve=Bt(Dt(w),4),Ft=Dt(ve,!0);Rt(ve),Rt(w),Rt(Ct),ln(()=>_e(Ft,q(l))),Be(rt,Ct)},D=rt=>{kg(rt,{get nodes(){return q(m)},get edges(){return q(u)},get centerId(){return q(r).center_id},get events(){return e()},get isDreaming(){return q(c)},onSelect:L,onGraphMutation:T})};wi(U,rt=>{q(o)?rt(S):q(l)?rt(M,1):q(r)&&rt(D,2)})}var W=Bt(U,2),z=Dt(W),V=Dt(z);Ll(V);var $=Bt(V,2);Rt(z);var G=Bt(z,2),J=Dt(G),k=Dt(J);k.value=k.__value=50;var it=Bt(k);it.value=it.__value=100;var ut=Bt(it);ut.value=ut.__value=150;var yt=Bt(ut);yt.value=yt.__value=200,Rt(J);var Lt=Bt(J,2),jt=Dt(Lt,!0);Rt(Lt);var Y=Bt(Lt,2);Rt(G),Rt(W);var et=Bt(W,2),xt=Dt(et);{var at=rt=>{var Ct=$g(),w=Pl(Ct),ve=Dt(w);Rt(w);var Ft=Bt(w,4),kt=Dt(Ft);Rt(Ft);var Mt=Bt(Ft,4),ie=Dt(Mt);Rt(Mt),ln(()=>{_e(ve,`${q(g)??""} nodes`),_e(kt,`${q(v)??""} edges`),_e(ie,`depth ${q(r).depth??""}`)}),Be(rt,Ct)};wi(xt,rt=>{q(r)&&rt(at)})}Rt(et);var wt=Bt(et,2);{var Ut=rt=>{jg(rt,{get nodes(){return q(r).nodes},onDateChange:Ct=>{se(p,Ct,!0)},onToggle:Ct=>{se(f,Ct,!0)}})};wi(wt,rt=>{q(r)&&rt(Ut)})}var Gt=Bt(wt,2);{var ce=rt=>{var Ct=e_(),w=Dt(Ct),ve=Bt(Dt(w),2);Rt(w);var Ft=Bt(w,2),kt=Dt(Ft),Mt=Dt(kt),ie=Dt(Mt,!0);Rt(Mt);var Et=Bt(Mt,2);$r(Et,17,()=>q(a).tags,Jr,(Xt,C)=>{var nt=Jg(),H=Dt(nt,!0);Rt(nt),ln(()=>_e(H,q(C))),Be(Xt,nt)}),Rt(kt);var E=Bt(kt,2),_=Dt(E,!0);Rt(E);var F=Bt(E,2);$r(F,21,()=>[{label:"Retention",value:q(a).retentionStrength},{label:"Storage",value:q(a).storageStrength},{label:"Retrieval",value:q(a).retrievalStrength}],Jr,(Xt,C)=>{var nt=Qg(),H=Dt(nt),Z=Dt(H),ht=Dt(Z,!0);Rt(Z);var lt=Bt(Z,2),Ot=Dt(lt);Rt(lt),Rt(H);var he=Bt(H,2),Ee=Dt(he);Rt(he),Rt(nt),ln(Qt=>{_e(ht,q(C).label),_e(Ot,`${Qt??""}%`),Ul(Ee,`width: ${q(C).value*100}%; background: ${q(C).value>.7?"#10b981":q(C).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(q(C).value*100).toFixed(1)]),Be(Xt,nt)}),Rt(F);var j=Bt(F,2),K=Bt(Dt(j),2);{let Xt=ti(()=>q(a).storageStrength*30);Wg(K,{get retention(){return q(a).retentionStrength},get stability(){return q(Xt)}})}Rt(j);var X=Bt(j,2),St=Dt(X),ot=Dt(St);Rt(St);var dt=Bt(St,2),Zt=Dt(dt);Rt(dt);var tt=Bt(dt,2);{var mt=Xt=>{var C=t_(),nt=Dt(C);Rt(C),ln(H=>_e(nt,`Accessed: ${H??""}`),[()=>new Date(q(a).lastAccessedAt).toLocaleString()]),Be(Xt,C)};wi(tt,Xt=>{q(a).lastAccessedAt&&Xt(mt)})}var bt=Bt(tt,2),Pt=Dt(bt);Rt(bt),Rt(X);var ft=Bt(X,2),Yt=Dt(ft),zt=Bt(Yt,2);Rt(ft),Cl(2),Rt(Ft),Rt(Ct),ln((Xt,C)=>{_e(ie,q(a).nodeType),_e(_,q(a).content),_e(ot,`Created: ${Xt??""}`),_e(Zt,`Updated: ${C??""}`),_e(Pt,`Reviews: ${q(a).reviewCount??0??""}`)},[()=>new Date(q(a).createdAt).toLocaleString(),()=>new Date(q(a).updatedAt).toLocaleString()]),$e("click",ve,()=>se(a,null)),$e("click",Yt,()=>{q(a)&&Yi.memories.promote(q(a).id)}),$e("click",zt,()=>{q(a)&&Yi.memories.demote(q(a).id)}),Be(rt,Ct)};wi(Gt,rt=>{q(a)&&rt(ce)})}Rt(A),ln(()=>{Lt.disabled=q(c),Cc(Lt,1,`px-4 py-2 rounded-xl bg-dream/20 border border-dream/40 text-dream-glow text-sm + [&::-webkit-slider-thumb]:shadow-[0_0_8px_rgba(129,140,248,0.4)]"/>
`),jg=je('');function Zg(i,t){lr(t,!0);let e=Ie(!1),n=Ie(!1),s=Ie(1),r=Ie(100),a,o=0,l=ti(()=>Yg(t.nodes)),c=ti(()=>{const b=j(l).oldest.getTime(),L=j(l).newest.getTime()-b||1;return new Date(b+j(r)/100*L)});function h(b){return b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function d(){se(e,!j(e)),t.onToggle(j(e)),j(e)&&(se(r,100),t.onDateChange(j(c)))}function f(){se(n,!j(n)),j(n)?(se(r,0),o=performance.now(),p()):cancelAnimationFrame(a)}function p(){a=requestAnimationFrame(b=>{const y=(b-o)/1e3;o=b;const L=j(l).oldest.getTime(),A=(j(l).newest.getTime()-L)/(1440*60*1e3)||1,U=j(s)/A*100;if(se(r,Math.min(100,j(r)+U*y),!0),t.onDateChange(j(c)),j(r)>=100){se(n,!1);return}p()})}function g(){t.onDateChange(j(c))}Rl(()=>{cancelAnimationFrame(a)});var v=Rc(),m=Cl(v);{var u=b=>{var y=qg(),L=Dt(y),R=Dt(L),A=Dt(R),U=Dt(A),S=Dt(U,!0);Rt(U);var M=Ot(U,2),D=Dt(M);D.value=D.__value=1;var W=Ot(D);W.value=W.__value=7;var z=Ot(W);z.value=z.__value=30,Rt(M),Rt(A);var V=Ot(A,2),$=Dt(V,!0);Rt(V);var G=Ot(V,2);Rt(R);var J=Ot(R,2);Dl(J);var k=Ot(J,2),it=Dt(k),ut=Dt(it,!0);Rt(it);var yt=Ot(it,2),Lt=Dt(yt,!0);Rt(yt),Rt(k),Rt(L),Rt(y),ln((qt,Y,nt)=>{_e(S,j(n)?"⏸":"▶"),_e($,qt),_e(ut,Y),_e(Lt,nt)},[()=>h(j(c)),()=>h(j(l).oldest),()=>h(j(l).newest)]),Je("click",U,f),Il(M,()=>j(s),qt=>se(s,qt)),Je("click",G,d),Je("input",J,g),Ul(J,()=>j(r),qt=>se(r,qt)),ze(b,y)},T=b=>{var y=jg();Je("click",y,d),ze(b,y)};wi(m,b=>{j(e)?b(u):b(T,!1)})}ze(i,v),cr()}Pl(["click","input"]);var Kg=je('

Loading memory graph...

'),$g=je('

Your Mind Awaits

'),Jg=je(' · · ',1),Qg=je(' '),t_=je('
'),e_=je("
"),n_=je(`

Memory Detail

Retention Forecast
◬ Explore Connections
`),i_=je(`
`);function b_(i,t){lr(t,!0);const e=()=>Dc(Ic,"$eventFeed",n),[n,s]=Pc();let r=Ie(null),a=Ie(null),o=Ie(!0),l=Ie(""),c=Ie(!1),h=Ie(""),d=Ie(150),f=Ie(!1),p=Ie(Ac(new Date)),g=Ie(0),v=Ie(0),m=ti(()=>j(r)?j(f)?wl(j(r).nodes,j(r).edges,j(p)).visibleNodes:j(r).nodes:[]),u=ti(()=>j(r)?j(f)?wl(j(r).nodes,j(r).edges,j(p)).visibleEdges:j(r).edges:[]);function T(rt){if(j(r))switch(rt.type){case"nodeAdded":j(r).nodes=[...j(r).nodes,rt.node],j(r).nodeCount=j(r).nodes.length,se(g,j(r).nodeCount,!0);break;case"nodeRemoved":j(r).nodes=j(r).nodes.filter(Ct=>Ct.id!==rt.nodeId),j(r).nodeCount=j(r).nodes.length,se(g,j(r).nodeCount,!0);break;case"edgeAdded":j(r).edges=[...j(r).edges,rt.edge],j(r).edgeCount=j(r).edges.length,se(v,j(r).edgeCount,!0);break;case"edgesRemoved":j(r).edges=j(r).edges.filter(Ct=>Ct.source!==rt.nodeId&&Ct.target!==rt.nodeId),j(r).edgeCount=j(r).edges.length,se(v,j(r).edgeCount,!0);break;case"nodeUpdated":{const Ct=j(r).nodes.find(w=>w.id===rt.nodeId);Ct&&(Ct.retention=rt.retention);break}}}Al(()=>b());async function b(rt,Ct){se(o,!0),se(l,"");try{se(r,await Yi.graph({max_nodes:j(d),depth:3,query:rt||void 0,center_id:Ct||void 0}),!0),j(r)&&(se(g,j(r).nodeCount,!0),se(v,j(r).edgeCount,!0))}catch{se(l,"No memories yet. Start using Vestige to populate your graph.")}finally{se(o,!1)}}async function y(){se(c,!0);try{await Yi.dream(),await b()}catch{}finally{se(c,!1)}}async function L(rt){try{se(a,await Yi.memories.get(rt),!0)}catch{se(a,null)}}function R(){j(h).trim()&&b(j(h))}var A=i_(),U=Dt(A);{var S=rt=>{var Ct=Kg();ze(rt,Ct)},M=rt=>{var Ct=$g(),w=Dt(Ct),ve=Ot(Dt(w),4),Bt=Dt(ve,!0);Rt(ve),Rt(w),Rt(Ct),ln(()=>_e(Bt,j(l))),ze(rt,Ct)},D=rt=>{Vg(rt,{get nodes(){return j(m)},get edges(){return j(u)},get centerId(){return j(r).center_id},get events(){return e()},get isDreaming(){return j(c)},onSelect:L,onGraphMutation:T})};wi(U,rt=>{j(o)?rt(S):j(l)?rt(M,1):j(r)&&rt(D,2)})}var W=Ot(U,2),z=Dt(W),V=Dt(z);Dl(V);var $=Ot(V,2);Rt(z);var G=Ot(z,2),J=Dt(G),k=Dt(J);k.value=k.__value=50;var it=Ot(k);it.value=it.__value=100;var ut=Ot(it);ut.value=ut.__value=150;var yt=Ot(ut);yt.value=yt.__value=200,Rt(J);var Lt=Ot(J,2),qt=Dt(Lt,!0);Rt(Lt);var Y=Ot(Lt,2);Rt(G),Rt(W);var nt=Ot(W,2),xt=Dt(nt);{var at=rt=>{var Ct=Jg(),w=Cl(Ct),ve=Dt(w);Rt(w);var Bt=Ot(w,4),kt=Dt(Bt);Rt(Bt);var Mt=Ot(Bt,4),ne=Dt(Mt);Rt(Mt),ln(()=>{_e(ve,`${j(g)??""} nodes`),_e(kt,`${j(v)??""} edges`),_e(ne,`depth ${j(r).depth??""}`)}),ze(rt,Ct)};wi(xt,rt=>{j(r)&&rt(at)})}Rt(nt);var wt=Ot(nt,2);{var Ut=rt=>{Zg(rt,{get nodes(){return j(r).nodes},onDateChange:Ct=>{se(p,Ct,!0)},onToggle:Ct=>{se(f,Ct,!0)}})};wi(wt,rt=>{j(r)&&rt(Ut)})}var Gt=Ot(wt,2);{var ce=rt=>{var Ct=n_(),w=Dt(Ct),ve=Ot(Dt(w),2);Rt(w);var Bt=Ot(w,2),kt=Dt(Bt),Mt=Dt(kt),ne=Dt(Mt,!0);Rt(Mt);var Et=Ot(Mt,2);$r(Et,17,()=>j(a).tags,Jr,(C,et)=>{var H=Qg(),q=Dt(H,!0);Rt(H),ln(()=>_e(q,j(et))),ze(C,H)}),Rt(kt);var E=Ot(kt,2),_=Dt(E,!0);Rt(E);var F=Ot(E,2);$r(F,21,()=>[{label:"Retention",value:j(a).retentionStrength},{label:"Storage",value:j(a).storageStrength},{label:"Retrieval",value:j(a).retrievalStrength}],Jr,(C,et)=>{var H=t_(),q=Dt(H),lt=Dt(q),ct=Dt(lt,!0);Rt(lt);var Nt=Ot(lt,2),he=Dt(Nt);Rt(Nt),Rt(q);var xe=Ot(q,2),Jt=Dt(xe);Rt(xe),Rt(H),ln(Ve=>{_e(ct,j(et).label),_e(he,`${Ve??""}%`),Ll(Jt,`width: ${j(et).value*100}%; background: ${j(et).value>.7?"#10b981":j(et).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(j(et).value*100).toFixed(1)]),ze(C,H)}),Rt(F);var Z=Ot(F,2),K=Ot(Dt(Z),2);{let C=ti(()=>j(a).storageStrength*30);Xg(K,{get retention(){return j(a).retentionStrength},get stability(){return j(C)}})}Rt(Z);var X=Ot(Z,2),St=Dt(X),ot=Dt(St);Rt(St);var dt=Ot(St,2),jt=Dt(dt);Rt(dt);var tt=Ot(dt,2);{var mt=C=>{var et=e_(),H=Dt(et);Rt(et),ln(q=>_e(H,`Accessed: ${q??""}`),[()=>new Date(j(a).lastAccessedAt).toLocaleString()]),ze(C,et)};wi(tt,C=>{j(a).lastAccessedAt&&C(mt)})}var bt=Ot(tt,2),Pt=Dt(bt);Rt(bt),Rt(X);var ft=Ot(X,2),Xt=Dt(ft),zt=Ot(Xt,2);Rt(ft);var ie=Ot(ft,2);Rt(Bt),Rt(Ct),ln((C,et)=>{_e(ne,j(a).nodeType),_e(_,j(a).content),_e(ot,`Created: ${C??""}`),_e(jt,`Updated: ${et??""}`),_e(Pt,`Reviews: ${j(a).reviewCount??0??""}`),Be(ie,"href",`${Lc??""}/explore`)},[()=>new Date(j(a).createdAt).toLocaleString(),()=>new Date(j(a).updatedAt).toLocaleString()]),Je("click",ve,()=>se(a,null)),Je("click",Xt,()=>{j(a)&&Yi.memories.promote(j(a).id)}),Je("click",zt,()=>{j(a)&&Yi.memories.demote(j(a).id)}),ze(rt,Ct)};wi(Gt,rt=>{j(a)&&rt(ce)})}Rt(A),ln(()=>{Lt.disabled=j(c),Cc(Lt,1,`px-4 py-2 rounded-xl bg-dream/20 border border-dream/40 text-dream-glow text-sm hover:bg-dream/30 transition-all backdrop-blur-sm disabled:opacity-50 - ${q(c)?"glow-dream animate-pulse-glow":""}`),_e(jt,q(c)?"◈ Dreaming...":"◈ Dream")}),$e("keydown",V,rt=>rt.key==="Enter"&&R()),Il(V,()=>q(h),rt=>se(h,rt)),$e("click",$,R),$e("change",J,()=>b()),Nl(J,()=>q(d),rt=>se(d,rt)),$e("click",Lt,y),$e("click",Y,()=>b()),Be(i,A),cr(),s()}Dl(["keydown","click","change"]);export{y_ as component}; + ${j(c)?"glow-dream animate-pulse-glow":""}`),_e(qt,j(c)?"◈ Dreaming...":"◈ Dream")}),Je("keydown",V,rt=>rt.key==="Enter"&&R()),Ul(V,()=>j(h),rt=>se(h,rt)),Je("click",$,R),Je("change",J,()=>b()),Il(J,()=>j(d),rt=>se(d,rt)),Je("click",Lt,y),Je("click",Y,()=>b()),ze(i,A),cr(),s()}Pl(["keydown","click","change"]);export{b_ as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.br b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.br new file mode 100644 index 0000000..c0af552 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.gz new file mode 100644 index 0000000..fbb9870 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.CBsTT29y.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.br b/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.br deleted file mode 100644 index 8efc5d1..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.gz deleted file mode 100644 index 768e97b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.DXXEUSu1.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br deleted file mode 100644 index 5467de2..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz deleted file mode 100644 index 5057033..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js similarity index 92% rename from apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js rename to apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js index 82325de..774aa7c 100644 --- a/apps/dashboard/build/_app/immutable/nodes/7.BI22Pt_j.js +++ b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{o as ut}from"../chunks/CkyfbJUz.js";import{p as gt,s as T,c as Q,t as u,a as ft,d,e as s,h as $,g as t,r as e,G as ht}from"../chunks/C9Z4nxhR.js";import{d as bt,s as l,a as yt}from"../chunks/DP9qWekZ.js";import{i as R}from"../chunks/C2oj68pw.js";import{e as U,i as D}from"../chunks/kH-DTQyy.js";import{a as o,f as n}from"../chunks/DPfxVJHQ.js";import{s as q}from"../chunks/Co2v30Gm.js";import{a as Z}from"../chunks/BcuCGYSa.js";var wt=n(""),Rt=n('
'),Nt=n('
'),St=n('

Use "Remind me..." in conversation to create intentions.

'),kt=n(' '),Ot=n(' '),$t=n('

'),zt=n('
'),Ct=n('

No predictions yet. Use Vestige more to train the predictive model.

'),It=n(" "),Pt=n(' '),Tt=n('

'),Ut=n('
'),Dt=n('

Intentions & Predictions

Prospective Memory

"Remember to do X when Y happens"

Predicted Needs

What you might need next
');function Wt(tt,et){gt(et,!0);let z=T(Q([])),j=T(Q([])),A=T(!0),N=T("active");const at={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-white/[0.03] border-subtle/20",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},st={critical:"text-decay",high:"text-amber-400",normal:"text-dim",low:"text-muted"},rt={time:"⏰",context:"◎",event:"⚡"};ut(async()=>{await B()});async function B(){$(A,!0);try{const[r,i]=await Promise.all([Z.intentions(t(N)),Z.predict()]);$(z,r.intentions||[],!0),$(j,i.predictions||[],!0)}catch{}finally{$(A,!1)}}async function it(r){$(N,r,!0),await B()}function F(r){if(!r)return"";try{return new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return r}}var G=Dt(),L=s(G),H=d(s(L),2),dt=s(H);e(H),e(L);var M=d(L,2),Y=d(s(M),2);U(Y,20,()=>["active","fulfilled","snoozed","cancelled","all"],D,(r,i)=>{var v=wt(),a=s(v,!0);e(v),u(x=>{q(v,1,`px-3 py-1.5 rounded-xl text-xs transition ${t(N)===i?"bg-synapse/20 text-synapse-glow border border-synapse/40":"glass-subtle text-dim hover:bg-white/[0.03]"}`),l(a,x)},[()=>i.charAt(0).toUpperCase()+i.slice(1)]),yt("click",v,()=>it(i)),o(r,v)}),e(Y);var lt=d(Y,2);{var vt=r=>{var i=Nt();U(i,20,()=>Array(4),D,(v,a)=>{var x=Rt();o(v,x)}),e(i),o(r,i)},ot=r=>{var i=St(),v=d(s(i),2),a=s(v);e(v),ht(2),e(i),u(()=>l(a,`No ${t(N)==="all"?"":t(N)+" "}intentions.`)),o(r,i)},nt=r=>{var i=zt();U(i,21,()=>t(z),D,(v,a)=>{var x=$t(),f=s(x),h=s(f),C=s(h,!0);e(h);var g=d(h,2),S=s(g),I=s(S,!0);e(S);var b=d(S,2),y=s(b),P=s(y,!0);e(y);var w=d(y,2),E=s(w);e(w);var k=d(w,2),c=s(k);e(k);var p=d(k,2);{var O=m=>{var _=kt(),W=s(_);e(_),u(X=>l(W,`deadline: ${X??""}`),[()=>F(t(a).deadline)]),o(m,_)};R(p,m=>{t(a).deadline&&m(O)})}var V=d(p,2);{var mt=m=>{var _=Ot(),W=s(_);e(_),u(X=>l(W,`snoozed until ${X??""}`),[()=>F(t(a).snoozed_until)]),o(m,_)};R(V,m=>{t(a).snoozed_until&&m(mt)})}e(b),e(g);var K=d(g,2),_t=s(K,!0);e(K),e(f),e(x),u((m,_)=>{l(C,rt[t(a).trigger_type]||"◇"),l(I,t(a).content),q(y,1,`px-2 py-0.5 text-[10px] rounded-lg border ${(at[t(a).status]||"text-dim bg-white/[0.03] border-subtle/20")??""}`),l(P,t(a).status),q(w,1,`text-[10px] ${(st[t(a).priority]||"text-muted")??""}`),l(E,`${t(a).priority??""} priority`),l(c,`${t(a).trigger_type??""}: ${m??""}`),l(_t,_)},[()=>t(a).trigger_value.length>40?t(a).trigger_value.slice(0,37)+"...":t(a).trigger_value,()=>F(t(a).created_at)]),o(v,x)}),e(i),o(r,i)};R(lt,r=>{t(A)?r(vt):t(z).length===0?r(ot,1):r(nt,!1)})}e(M);var J=d(M,2),pt=d(s(J),2);{var xt=r=>{var i=Ct();o(r,i)},ct=r=>{var i=Ut();U(i,21,()=>t(j),D,(v,a,x)=>{var f=Tt(),h=s(f);h.textContent=x+1;var C=d(h,2),g=s(C),S=s(g,!0);e(g);var I=d(g,2),b=s(I),y=s(b,!0);e(b);var P=d(b,2);{var w=c=>{var p=It(),O=s(p);e(p),u(V=>l(O,`${V??""}% retention`),[()=>(Number(t(a).retention)*100).toFixed(0)]),o(c,p)};R(P,c=>{t(a).retention&&c(w)})}var E=d(P,2);{var k=c=>{var p=Pt(),O=s(p);e(p),u(()=>l(O,`${t(a).predictedNeed??""} need`)),o(c,p)};R(E,c=>{t(a).predictedNeed&&c(k)})}e(I),e(C),e(f),u(()=>{l(S,t(a).content),l(y,t(a).nodeType)}),o(v,f)}),e(i),o(r,i)};R(pt,r=>{t(j).length===0?r(xt):r(ct,!1)})}e(J),e(G),u(()=>l(dt,`${t(z).length??""} intentions`)),o(tt,G),ft()}bt(["click"]);export{Wt as component}; +import"../chunks/Bzak7iHL.js";import{o as ut}from"../chunks/DUC-ssvh.js";import{p as gt,s as T,c as Q,t as u,a as ft,d,e as s,h as $,g as t,r as e,G as ht}from"../chunks/BBD-8XME.js";import{d as bt,s as l,a as yt}from"../chunks/DNn3Nckx.js";import{i as R}from"../chunks/RaRNNC-y.js";import{e as U,i as D}from"../chunks/C5a--lgk.js";import{a as o,f as n}from"../chunks/CKcqngaU.js";import{s as q}from"../chunks/CBWLjDtu.js";import{a as Z}from"../chunks/BcuCGYSa.js";var wt=n(""),Rt=n('
'),Nt=n('
'),St=n('

Use "Remind me..." in conversation to create intentions.

'),kt=n(' '),Ot=n(' '),$t=n('

'),zt=n('
'),Ct=n('

No predictions yet. Use Vestige more to train the predictive model.

'),It=n(" "),Pt=n(' '),Tt=n('

'),Ut=n('
'),Dt=n('

Intentions & Predictions

Prospective Memory

"Remember to do X when Y happens"

Predicted Needs

What you might need next
');function Wt(tt,et){gt(et,!0);let z=T(Q([])),j=T(Q([])),A=T(!0),N=T("active");const at={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-white/[0.03] border-subtle/20",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},st={critical:"text-decay",high:"text-amber-400",normal:"text-dim",low:"text-muted"},rt={time:"⏰",context:"◎",event:"⚡"};ut(async()=>{await B()});async function B(){$(A,!0);try{const[r,i]=await Promise.all([Z.intentions(t(N)),Z.predict()]);$(z,r.intentions||[],!0),$(j,i.predictions||[],!0)}catch{}finally{$(A,!1)}}async function it(r){$(N,r,!0),await B()}function F(r){if(!r)return"";try{return new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return r}}var G=Dt(),L=s(G),H=d(s(L),2),dt=s(H);e(H),e(L);var M=d(L,2),Y=d(s(M),2);U(Y,20,()=>["active","fulfilled","snoozed","cancelled","all"],D,(r,i)=>{var v=wt(),a=s(v,!0);e(v),u(x=>{q(v,1,`px-3 py-1.5 rounded-xl text-xs transition ${t(N)===i?"bg-synapse/20 text-synapse-glow border border-synapse/40":"glass-subtle text-dim hover:bg-white/[0.03]"}`),l(a,x)},[()=>i.charAt(0).toUpperCase()+i.slice(1)]),yt("click",v,()=>it(i)),o(r,v)}),e(Y);var lt=d(Y,2);{var vt=r=>{var i=Nt();U(i,20,()=>Array(4),D,(v,a)=>{var x=Rt();o(v,x)}),e(i),o(r,i)},ot=r=>{var i=St(),v=d(s(i),2),a=s(v);e(v),ht(2),e(i),u(()=>l(a,`No ${t(N)==="all"?"":t(N)+" "}intentions.`)),o(r,i)},nt=r=>{var i=zt();U(i,21,()=>t(z),D,(v,a)=>{var x=$t(),f=s(x),h=s(f),C=s(h,!0);e(h);var g=d(h,2),S=s(g),I=s(S,!0);e(S);var b=d(S,2),y=s(b),P=s(y,!0);e(y);var w=d(y,2),E=s(w);e(w);var k=d(w,2),c=s(k);e(k);var p=d(k,2);{var O=m=>{var _=kt(),W=s(_);e(_),u(X=>l(W,`deadline: ${X??""}`),[()=>F(t(a).deadline)]),o(m,_)};R(p,m=>{t(a).deadline&&m(O)})}var V=d(p,2);{var mt=m=>{var _=Ot(),W=s(_);e(_),u(X=>l(W,`snoozed until ${X??""}`),[()=>F(t(a).snoozed_until)]),o(m,_)};R(V,m=>{t(a).snoozed_until&&m(mt)})}e(b),e(g);var K=d(g,2),_t=s(K,!0);e(K),e(f),e(x),u((m,_)=>{l(C,rt[t(a).trigger_type]||"◇"),l(I,t(a).content),q(y,1,`px-2 py-0.5 text-[10px] rounded-lg border ${(at[t(a).status]||"text-dim bg-white/[0.03] border-subtle/20")??""}`),l(P,t(a).status),q(w,1,`text-[10px] ${(st[t(a).priority]||"text-muted")??""}`),l(E,`${t(a).priority??""} priority`),l(c,`${t(a).trigger_type??""}: ${m??""}`),l(_t,_)},[()=>t(a).trigger_value.length>40?t(a).trigger_value.slice(0,37)+"...":t(a).trigger_value,()=>F(t(a).created_at)]),o(v,x)}),e(i),o(r,i)};R(lt,r=>{t(A)?r(vt):t(z).length===0?r(ot,1):r(nt,!1)})}e(M);var J=d(M,2),pt=d(s(J),2);{var xt=r=>{var i=Ct();o(r,i)},ct=r=>{var i=Ut();U(i,21,()=>t(j),D,(v,a,x)=>{var f=Tt(),h=s(f);h.textContent=x+1;var C=d(h,2),g=s(C),S=s(g,!0);e(g);var I=d(g,2),b=s(I),y=s(b,!0);e(b);var P=d(b,2);{var w=c=>{var p=It(),O=s(p);e(p),u(V=>l(O,`${V??""}% retention`),[()=>(Number(t(a).retention)*100).toFixed(0)]),o(c,p)};R(P,c=>{t(a).retention&&c(w)})}var E=d(P,2);{var k=c=>{var p=Pt(),O=s(p);e(p),u(()=>l(O,`${t(a).predictedNeed??""} need`)),o(c,p)};R(E,c=>{t(a).predictedNeed&&c(k)})}e(I),e(C),e(f),u(()=>{l(S,t(a).content),l(y,t(a).nodeType)}),o(v,f)}),e(i),o(r,i)};R(pt,r=>{t(j).length===0?r(xt):r(ct,!1)})}e(J),e(G),u(()=>l(dt,`${t(z).length??""} intentions`)),o(tt,G),ft()}bt(["click"]);export{Wt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.br b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.br new file mode 100644 index 0000000..bc143fd Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.gz new file mode 100644 index 0000000..985dd20 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.UPq6Ja2I.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js similarity index 90% rename from apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js rename to apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js index 6bbf26e..47f865c 100644 --- a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js +++ b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{o as qe}from"../chunks/CkyfbJUz.js";import{p as Be,s as b,c as Qe,t as E,g as e,a as Ye,d as t,e as s,h as u,r as a}from"../chunks/C9Z4nxhR.js";import{d as ze,a as p,s as v}from"../chunks/DP9qWekZ.js";import{i as ce}from"../chunks/C2oj68pw.js";import{e as Z,i as ue}from"../chunks/kH-DTQyy.js";import{a as _,f as g}from"../chunks/DPfxVJHQ.js";import{r as xe}from"../chunks/ZesQ8l8p.js";import{s as Ge}from"../chunks/Co2v30Gm.js";import{s as _e}from"../chunks/BkopTN9z.js";import{b as fe}from"../chunks/P9ZHwQBL.js";import{b as He}from"../chunks/-jeO_JOJ.js";import{a as f}from"../chunks/BcuCGYSa.js";import{N as Ie}from"../chunks/CZ45jJaw.js";var Je=g('
'),Ke=g('
'),Ue=g(' '),Ve=g('

Promote Demote Delete
'),We=g(''),Xe=g('
'),Ze=g(`

Memories

'),Ke=g('
'),Ue=g(' '),Ve=g('

Promote Demote Delete
'),We=g(''),Xe=g('
'),Ze=g(`

Memories

Min retention:
`);function xt(ge,me){Be(me,!0);let k=b(Qe([])),P=b(""),S=b(""),be="",h=b(0),F=b(!0),T=b(null),ee;qe(()=>m());async function m(){u(F,!0);try{const i={};e(P)&&(i.q=e(P)),e(S)&&(i.node_type=e(S)),e(h)>0&&(i.min_retention=String(e(h)));const c=await f.memories.list(i);u(k,c.memories,!0)}catch{u(k,[],!0)}finally{u(F,!1)}}function he(){clearTimeout(ee),ee=setTimeout(m,300)}function ye(i){return i>.7?"#10b981":i>.4?"#f59e0b":"#ef4444"}var M=Ze(),A=s(M),te=t(s(A),2),we=s(te);a(te),a(A);var C=t(A,2),$=s(C);xe($);var y=t($,2),N=s(y);N.value=N.__value="";var O=t(N);O.value=O.__value="fact";var R=t(O);R.value=R.__value="concept";var j=t(R);j.value=j.__value="event";var L=t(j);L.value=L.__value="person";var q=t(L);q.value=q.__value="place";var B=t(q);B.value=B.__value="note";var Q=t(B);Q.value=Q.__value="pattern";var ae=t(Q);ae.value=ae.__value="decision",a(y);var se=t(y,2),D=t(s(se),2);xe(D);var ie=t(D,2),ke=s(ie);a(ie),a(se),a(C);var Pe=t(C,2);{var Se=i=>{var c=Ke();Z(c,20,()=>Array(8),ue,(w,o)=>{var x=Je();_(w,x)}),a(c),_(i,c)},Te=i=>{var c=Xe();Z(c,21,()=>e(k),w=>w.id,(w,o)=>{var x=We(),Y=s(x),z=s(Y),G=s(z),oe=s(G),H=t(oe,2),$e=s(H,!0);a(H);var De=t(H,2);Z(De,17,()=>e(o).tags.slice(0,3),ue,(n,l)=>{var d=Ue(),J=s(d,!0);a(d),E(()=>v(J,e(l))),_(n,d)}),a(G);var re=t(G,2),Ee=s(re,!0);a(re),a(z);var ne=t(z,2),I=s(ne),Fe=s(I);a(I);var le=t(I,2),Me=s(le);a(le),a(ne),a(Y);var Ae=t(Y,2);{var Ce=n=>{var l=Ve(),d=s(l),J=s(d,!0);a(d);var K=t(d,2),U=s(K),Ne=s(U);a(U);var V=t(U,2),Oe=s(V);a(V);var de=t(V,2),Re=s(de);a(de),a(K);var pe=t(K,2),W=s(pe),X=t(W,2),ve=t(X,2);a(pe),a(l),E((r,je,Le)=>{v(J,e(o).content),v(Ne,`Storage: ${r??""}%`),v(Oe,`Retrieval: ${je??""}%`),v(Re,`Created: ${Le??""}`)},[()=>(e(o).storageStrength*100).toFixed(1),()=>(e(o).retrievalStrength*100).toFixed(1),()=>new Date(e(o).createdAt).toLocaleDateString()]),p("click",W,r=>{r.stopPropagation(),f.memories.promote(e(o).id)}),p("keydown",W,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.promote(e(o).id))}),p("click",X,r=>{r.stopPropagation(),f.memories.demote(e(o).id)}),p("keydown",X,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.demote(e(o).id))}),p("click",ve,async r=>{r.stopPropagation(),await f.memories.delete(e(o).id),m()}),p("keydown",ve,async r=>{r.key==="Enter"&&(r.stopPropagation(),await f.memories.delete(e(o).id),m())}),_(n,l)};ce(Ae,n=>{var l;((l=e(T))==null?void 0:l.id)===e(o).id&&n(Ce)})}a(x),E((n,l)=>{var d;Ge(x,1,`text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.04] transition-all duration-200 group ${((d=e(T))==null?void 0:d.id)===e(o).id?"!border-synapse/40 glow-synapse":""}`),_e(oe,`background: ${(Ie[e(o).nodeType]||"#8B95A5")??""}`),v($e,e(o).nodeType),v(Ee,e(o).content),_e(Fe,`width: ${e(o).retentionStrength*100}%; background: ${n??""}`),v(Me,`${l??""}%`)},[()=>ye(e(o).retentionStrength),()=>(e(o).retentionStrength*100).toFixed(0)]),p("click",x,()=>{var n;return u(T,((n=e(T))==null?void 0:n.id)===e(o).id?null:e(o),!0)}),_(w,x)}),a(c),_(i,c)};ce(Pe,i=>{e(F)?i(Se):i(Te,!1)})}a(M),E(i=>{v(we,`${e(k).length??""} results`),v(ke,`${i??""}%`)},[()=>(e(h)*100).toFixed(0)]),p("input",$,he),fe($,()=>e(P),i=>u(P,i)),p("change",y,m),He(y,()=>e(S),i=>u(S,i)),p("change",D,m),fe(D,()=>e(h),i=>u(h,i)),_(ge,M),Ye()}ze(["input","change","click","keydown"]);export{xt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.br b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.br new file mode 100644 index 0000000..9b46fd8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.gz new file mode 100644 index 0000000..b6b6ac8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.B2QXJFjO.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br deleted file mode 100644 index 28cfe5e..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz deleted file mode 100644 index 8b7d58d..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.Cq7jwWnG.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br deleted file mode 100644 index 76953f8..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz deleted file mode 100644 index 1aab59f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js similarity index 93% rename from apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js rename to apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js index 6b5d886..700377e 100644 --- a/apps/dashboard/build/_app/immutable/nodes/9.19crbYuZ.js +++ b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js @@ -1,2 +1,2 @@ -import"../chunks/Bzak7iHL.js";import{o as ze}from"../chunks/CkyfbJUz.js";import{p as Je,t as w,a as We,d as r,e as t,g as s,s as S,h as m,r as e,G as b,f as Be,u as j}from"../chunks/C9Z4nxhR.js";import{d as He,a as X,s as p}from"../chunks/DP9qWekZ.js";import{i as u}from"../chunks/C2oj68pw.js";import{e as Z,i as ee}from"../chunks/kH-DTQyy.js";import{a as v,f as l,t as ue}from"../chunks/DPfxVJHQ.js";import{s as ge}from"../chunks/Co2v30Gm.js";import{s as fe}from"../chunks/BkopTN9z.js";import{s as Le,a as te}from"../chunks/DWr9YED7.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/BmeMLq0p.js";var Qe=l(' Running...',1),Xe=l('
Processed
'),Ze=l('
Decayed
'),et=l('
Embedded
'),tt=l('
'),st=l(' Dreaming...',1),at=l('
'),it=l('
Insights Discovered:
',1),dt=l('
Connections found:
'),rt=l('
Memories replayed:
'),ot=l('
'),nt=l('
'),vt=l('
'),lt=l('

Retention Distribution

'),ct=l('
'),xt=l(`

Settings & System

Memories
Avg Retention
WebSocket
v2.1
Vestige

Cognitive Operations

FSRS-6 Consolidation
Apply spaced-repetition decay, regenerate embeddings, run maintenance
Memory Dream Cycle
Replay memories, discover hidden connections, synthesize insights

Keyboard Shortcuts

About

V
Vestige v2.1 "Nuclear Dashboard"
Your AI's long-term memory system
29 cognitive modules
FSRS-6 spaced repetition
Nomic Embed v1.5 (256d)
Jina Reranker v1 Turbo
USearch HNSW (20x FAISS)
Local-first, zero cloud
Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
`);function Ct(_e,be){Je(be,!0);const ye=()=>te(Ue,"$memoryCount",I),P=()=>te(Ye,"$avgRetention",I),se=()=>te(qe,"$isConnected",I),[I,he]=Le();let E=S(!1),A=S(!1),y=S(null),g=S(null),we=S(null),$=S(null),ae=S(!0),Se=S(null);ze(()=>{N()});async function N(){m(ae,!0);try{const[a,o,c]=await Promise.all([T.stats().catch(()=>null),T.health().catch(()=>null),T.retentionDistribution().catch(()=>null)]);m(we,a,!0),m(Se,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function ke(){m(E,!0),m(y,null);try{m(y,await T.consolidate(),!0),await N()}catch{}finally{m(E,!1)}}async function Ce(){m(A,!0),m(g,null);try{m(g,await T.dream(),!0),await N()}catch{}finally{m(A,!1)}}var K=xt(),V=t(K),Re=r(t(V),2);e(V);var z=r(V,2),J=t(z),ie=t(J),$e=t(ie,!0);e(ie),b(2),e(J);var W=r(J,2),B=t(W),Ae=t(B);e(B),b(2),e(W);var de=r(W,2),re=t(de),oe=t(re),ne=r(oe,2),De=t(ne,!0);e(ne),e(re),b(2),e(de),b(2),e(z);var H=r(z,2),L=r(t(H),2),U=t(L),O=r(t(U),2),Ge=t(O);{var Me=a=>{var o=Qe();b(),v(a,o)},Fe=a=>{var o=ue("Consolidate");v(a,o)};u(Ge,a=>{s(E)?a(Me):a(Fe,!1)})}e(O),e(U);var je=r(U,2);{var Te=a=>{var o=tt(),c=t(o),f=t(c);{var k=d=>{var i=Xe(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).nodesProcessed)),v(d,i)};u(f,d=>{s(y).nodesProcessed!==void 0&&d(k)})}var _=r(f,2);{var h=d=>{var i=Ze(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).decayApplied)),v(d,i)};u(_,d=>{s(y).decayApplied!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=et(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).embeddingsGenerated)),v(d,i)};u(C,d=>{s(y).embeddingsGenerated!==void 0&&d(G)})}e(c),e(o),v(a,o)};u(je,a=>{s(y)&&a(Te)})}e(L);var ve=r(L,2),Y=t(ve),D=r(t(Y),2),Ee=t(D);{var Ne=a=>{var o=st();b(),v(a,o)},Oe=a=>{var o=ue("Dream");v(a,o)};u(Ee,a=>{s(A)?a(Ne):a(Oe,!1)})}e(D),e(Y);var Pe=r(Y,2);{var Ie=a=>{var o=ot(),c=t(o);{var f=d=>{var i=it(),n=r(Be(i),2);Z(n,17,()=>s(g).insights,ee,(x,M)=>{var R=at(),F=t(R,!0);e(R),w(q=>p(F,q),[()=>typeof s(M)=="string"?s(M):JSON.stringify(s(M))]),v(x,R)}),v(d,i)},k=j(()=>s(g).insights&&Array.isArray(s(g).insights));u(c,d=>{s(k)&&d(f)})}var _=r(c,2);{var h=d=>{var i=dt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).connections_found)),v(d,i)};u(_,d=>{s(g).connections_found!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=rt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).memories_replayed)),v(d,i)};u(C,d=>{s(g).memories_replayed!==void 0&&d(G)})}e(o),v(a,o)};u(Pe,a=>{s(g)&&a(Ie)})}e(ve),e(H);var le=r(H,2);{var Ke=a=>{var o=lt(),c=r(t(o),2),f=t(c);{var k=h=>{var C=vt();Z(C,21,()=>s($).distribution,ee,(G,d,i)=>{const n=j(()=>Math.max(...s($).distribution.map(Q=>Q.count),1)),x=j(()=>s(d).count/s(n)*100),M=j(()=>i<2?"#ef4444":i<4?"#f59e0b":i<7?"#6366f1":"#10b981");var R=nt(),F=t(R),q=t(F,!0);e(F);var pe=r(F,2),Ve=r(pe,2);Ve.textContent=`${i*10}%`,e(R),w(Q=>{p(q,s(d).count),fe(pe,`height: ${Q??""}%; background: ${s(M)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(G,R)}),e(C),v(h,C)},_=j(()=>s($).distribution&&Array.isArray(s($).distribution));u(f,h=>{s(_)&&h(k)})}e(c),e(o),v(a,o)};u(le,a=>{s($)&&a(Ke)})}var ce=r(le,2),xe=r(t(ce),2),me=t(xe);Z(me,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],ee,(a,o)=>{var c=ct(),f=t(c),k=t(f,!0);e(f);var _=r(f,2),h=t(_,!0);e(_),e(c),w(()=>{p(k,o.key),p(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),b(2),e(K),w(a=>{p($e,ye()),fe(B,`color: ${P()>.7?"#10b981":P()>.4?"#f59e0b":"#ef4444"}`),p(Ae,`${a??""}%`),ge(oe,1,`w-2.5 h-2.5 rounded-full ${se()?"bg-recall animate-pulse-glow":"bg-decay"}`),p(De,se()?"Online":"Offline"),O.disabled=s(E),D.disabled=s(A),ge(D,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 +import"../chunks/Bzak7iHL.js";import{o as ze}from"../chunks/DUC-ssvh.js";import{p as Je,t as w,a as We,d as r,e as t,g as s,s as S,h as m,r as e,G as b,f as Be,u as j}from"../chunks/BBD-8XME.js";import{d as He,a as X,s as p}from"../chunks/DNn3Nckx.js";import{i as u}from"../chunks/RaRNNC-y.js";import{e as Z,i as ee}from"../chunks/C5a--lgk.js";import{a as v,f as l,t as ue}from"../chunks/CKcqngaU.js";import{s as ge}from"../chunks/CBWLjDtu.js";import{s as fe}from"../chunks/DBfx-YTU.js";import{s as Le,a as te}from"../chunks/BexJutgU.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/CruZBLYW.js";var Qe=l(' Running...',1),Xe=l('
Processed
'),Ze=l('
Decayed
'),et=l('
Embedded
'),tt=l('
'),st=l(' Dreaming...',1),at=l('
'),it=l('
Insights Discovered:
',1),dt=l('
Connections found:
'),rt=l('
Memories replayed:
'),ot=l('
'),nt=l('
'),vt=l('
'),lt=l('

Retention Distribution

'),ct=l('
'),xt=l(`

Settings & System

Memories
Avg Retention
WebSocket
v2.1
Vestige

Cognitive Operations

FSRS-6 Consolidation
Apply spaced-repetition decay, regenerate embeddings, run maintenance
Memory Dream Cycle
Replay memories, discover hidden connections, synthesize insights

Keyboard Shortcuts

About

V
Vestige v2.1 "Nuclear Dashboard"
Your AI's long-term memory system
29 cognitive modules
FSRS-6 spaced repetition
Nomic Embed v1.5 (256d)
Jina Reranker v1 Turbo
USearch HNSW (20x FAISS)
Local-first, zero cloud
Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
`);function Ct(_e,be){Je(be,!0);const ye=()=>te(Ue,"$memoryCount",I),P=()=>te(Ye,"$avgRetention",I),se=()=>te(qe,"$isConnected",I),[I,he]=Le();let E=S(!1),A=S(!1),y=S(null),g=S(null),we=S(null),$=S(null),ae=S(!0),Se=S(null);ze(()=>{N()});async function N(){m(ae,!0);try{const[a,o,c]=await Promise.all([T.stats().catch(()=>null),T.health().catch(()=>null),T.retentionDistribution().catch(()=>null)]);m(we,a,!0),m(Se,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function ke(){m(E,!0),m(y,null);try{m(y,await T.consolidate(),!0),await N()}catch{}finally{m(E,!1)}}async function Ce(){m(A,!0),m(g,null);try{m(g,await T.dream(),!0),await N()}catch{}finally{m(A,!1)}}var K=xt(),V=t(K),Re=r(t(V),2);e(V);var z=r(V,2),J=t(z),ie=t(J),$e=t(ie,!0);e(ie),b(2),e(J);var W=r(J,2),B=t(W),Ae=t(B);e(B),b(2),e(W);var de=r(W,2),re=t(de),oe=t(re),ne=r(oe,2),De=t(ne,!0);e(ne),e(re),b(2),e(de),b(2),e(z);var H=r(z,2),L=r(t(H),2),U=t(L),O=r(t(U),2),Ge=t(O);{var Me=a=>{var o=Qe();b(),v(a,o)},Fe=a=>{var o=ue("Consolidate");v(a,o)};u(Ge,a=>{s(E)?a(Me):a(Fe,!1)})}e(O),e(U);var je=r(U,2);{var Te=a=>{var o=tt(),c=t(o),f=t(c);{var k=d=>{var i=Xe(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).nodesProcessed)),v(d,i)};u(f,d=>{s(y).nodesProcessed!==void 0&&d(k)})}var _=r(f,2);{var h=d=>{var i=Ze(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).decayApplied)),v(d,i)};u(_,d=>{s(y).decayApplied!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=et(),n=t(i),x=t(n,!0);e(n),b(2),e(i),w(()=>p(x,s(y).embeddingsGenerated)),v(d,i)};u(C,d=>{s(y).embeddingsGenerated!==void 0&&d(G)})}e(c),e(o),v(a,o)};u(je,a=>{s(y)&&a(Te)})}e(L);var ve=r(L,2),Y=t(ve),D=r(t(Y),2),Ee=t(D);{var Ne=a=>{var o=st();b(),v(a,o)},Oe=a=>{var o=ue("Dream");v(a,o)};u(Ee,a=>{s(A)?a(Ne):a(Oe,!1)})}e(D),e(Y);var Pe=r(Y,2);{var Ie=a=>{var o=ot(),c=t(o);{var f=d=>{var i=it(),n=r(Be(i),2);Z(n,17,()=>s(g).insights,ee,(x,M)=>{var R=at(),F=t(R,!0);e(R),w(q=>p(F,q),[()=>typeof s(M)=="string"?s(M):JSON.stringify(s(M))]),v(x,R)}),v(d,i)},k=j(()=>s(g).insights&&Array.isArray(s(g).insights));u(c,d=>{s(k)&&d(f)})}var _=r(c,2);{var h=d=>{var i=dt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).connections_found)),v(d,i)};u(_,d=>{s(g).connections_found!==void 0&&d(h)})}var C=r(_,2);{var G=d=>{var i=rt(),n=r(t(i)),x=t(n,!0);e(n),e(i),w(()=>p(x,s(g).memories_replayed)),v(d,i)};u(C,d=>{s(g).memories_replayed!==void 0&&d(G)})}e(o),v(a,o)};u(Pe,a=>{s(g)&&a(Ie)})}e(ve),e(H);var le=r(H,2);{var Ke=a=>{var o=lt(),c=r(t(o),2),f=t(c);{var k=h=>{var C=vt();Z(C,21,()=>s($).distribution,ee,(G,d,i)=>{const n=j(()=>Math.max(...s($).distribution.map(Q=>Q.count),1)),x=j(()=>s(d).count/s(n)*100),M=j(()=>i<2?"#ef4444":i<4?"#f59e0b":i<7?"#6366f1":"#10b981");var R=nt(),F=t(R),q=t(F,!0);e(F);var pe=r(F,2),Ve=r(pe,2);Ve.textContent=`${i*10}%`,e(R),w(Q=>{p(q,s(d).count),fe(pe,`height: ${Q??""}%; background: ${s(M)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(G,R)}),e(C),v(h,C)},_=j(()=>s($).distribution&&Array.isArray(s($).distribution));u(f,h=>{s(_)&&h(k)})}e(c),e(o),v(a,o)};u(le,a=>{s($)&&a(Ke)})}var ce=r(le,2),xe=r(t(ce),2),me=t(xe);Z(me,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],ee,(a,o)=>{var c=ct(),f=t(c),k=t(f,!0);e(f);var _=r(f,2),h=t(_,!0);e(_),e(c),w(()=>{p(k,o.key),p(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),b(2),e(K),w(a=>{p($e,ye()),fe(B,`color: ${P()>.7?"#10b981":P()>.4?"#f59e0b":"#ef4444"}`),p(Ae,`${a??""}%`),ge(oe,1,`w-2.5 h-2.5 rounded-full ${se()?"bg-recall animate-pulse-glow":"bg-decay"}`),p(De,se()?"Online":"Offline"),O.disabled=s(E),D.disabled=s(A),ge(D,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 ${s(A)?"glow-dream animate-pulse-glow":""}`)},[()=>(P()*100).toFixed(1)]),X("click",Re,N),X("click",O,ke),X("click",D,Ce),v(_e,K),We(),he()}He(["click"]);export{Ct as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.br b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.br new file mode 100644 index 0000000..84fc5aa Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.gz new file mode 100644 index 0000000..856a655 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.B4Pp7ME7.js.gz differ diff --git a/apps/dashboard/build/_app/version.json b/apps/dashboard/build/_app/version.json index 10d0f4c..20252d2 100644 --- a/apps/dashboard/build/_app/version.json +++ b/apps/dashboard/build/_app/version.json @@ -1 +1 @@ -{"version":"1772569216424"} \ No newline at end of file +{"version":"1773441353786"} \ No newline at end of file diff --git a/apps/dashboard/build/_app/version.json.br b/apps/dashboard/build/_app/version.json.br index 40a86c3..7ac6ca9 100644 Binary files a/apps/dashboard/build/_app/version.json.br and b/apps/dashboard/build/_app/version.json.br differ diff --git a/apps/dashboard/build/_app/version.json.gz b/apps/dashboard/build/_app/version.json.gz index 74640ff..c0d2794 100644 Binary files a/apps/dashboard/build/_app/version.json.gz and b/apps/dashboard/build/_app/version.json.gz differ diff --git a/apps/dashboard/build/favicon.svg.gz b/apps/dashboard/build/favicon.svg.gz index 61b0904..88ee5b2 100644 Binary files a/apps/dashboard/build/favicon.svg.gz and b/apps/dashboard/build/favicon.svg.gz differ diff --git a/apps/dashboard/build/index.html b/apps/dashboard/build/index.html index 38a3b72..08a4155 100644 --- a/apps/dashboard/build/index.html +++ b/apps/dashboard/build/index.html @@ -8,23 +8,24 @@ - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + Vestige @@ -32,7 +33,7 @@
@@ -98,7 +98,7 @@