Files
OpenAvatarChat-WebUI/dist/assets/index.js
bingochaos 3fddf021be Init frontend (#1)
更新静态资源
2025-08-07 18:18:54 +08:00

60 lines
1.6 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var hI=Object.defineProperty;var y2=n=>{throw TypeError(n)};var fI=(n,e,t)=>e in n?hI(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xe=(n,e,t)=>fI(n,typeof e!="symbol"?e+"":e,t),U0=(n,e,t)=>e.has(n)||y2("Cannot "+t);var dt=(n,e,t)=>(U0(n,e,"read from private field"),t?t.call(n):e.get(n)),ri=(n,e,t)=>e.has(n)?y2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),En=(n,e,t,i)=>(U0(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),hi=(n,e,t)=>(U0(n,e,"access private method"),t);var Ku=(n,e,t,i)=>({set _(r){En(n,e,r,t)},get _(){return dt(n,e,i)}});function Yie(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();/**
* @vue/shared v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function kv(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const un={},Vc=[],Ws=()=>{},pI=()=>!1,Um=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Uv=n=>n.startsWith("onUpdate:"),Jn=Object.assign,zv=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},mI=Object.prototype.hasOwnProperty,Jt=(n,e)=>mI.call(n,e),yt=Array.isArray,Hc=n=>zm(n)==="[object Map]",IT=n=>zm(n)==="[object Set]",Ct=n=>typeof n=="function",wn=n=>typeof n=="string",Ba=n=>typeof n=="symbol",gn=n=>n!==null&&typeof n=="object",NT=n=>(gn(n)||Ct(n))&&Ct(n.then)&&Ct(n.catch),PT=Object.prototype.toString,zm=n=>PT.call(n),gI=n=>zm(n).slice(8,-1),LT=n=>zm(n)==="[object Object]",Vv=n=>wn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Ed=kv(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vm=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},yI=/-(\w)/g,ns=Vm(n=>n.replace(yI,(e,t)=>t?t.toUpperCase():"")),vI=/\B([A-Z])/g,Wl=Vm(n=>n.replace(vI,"-$1").toLowerCase()),Hm=Vm(n=>n.charAt(0).toUpperCase()+n.slice(1)),z0=Vm(n=>n?"on".concat(Hm(n)):""),Ra=(n,e)=>!Object.is(n,e),V0=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},L1=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},_I=n=>{const e=parseFloat(n);return isNaN(e)?n:e},xI=n=>{const e=wn(n)?Number(n):NaN;return isNaN(e)?n:e};let v2;const $m=()=>v2||(v2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qs(n){if(yt(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],r=wn(i)?TI(i):Qs(i);if(r)for(const s in r)e[s]=r[s]}return e}else if(wn(n)||gn(n))return n}const SI=/;(?![^(]*\))/g,AI=/:([^]+)/,bI=/\/\*[^]*?\*\//g;function TI(n){const e={};return n.replace(bI,"").split(SI).forEach(t=>{if(t){const i=t.split(AI);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ks(n){let e="";if(wn(n))e=n;else if(yt(n))for(let t=0;t<n.length;t++){const i=Ks(n[t]);i&&(e+=i+" ")}else if(gn(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const wI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",CI=kv(wI);function DT(n){return!!n||n===""}const FT=n=>!!(n&&n.__v_isRef===!0),su=n=>wn(n)?n:n==null?"":yt(n)||gn(n)&&(n.toString===PT||!Ct(n.toString))?FT(n)?su(n.value):JSON.stringify(n,OT,2):String(n),OT=(n,e)=>FT(e)?OT(n,e.value):Hc(e)?{["Map(".concat(e.size,")")]:[...e.entries()].reduce((t,[i,r],s)=>(t[H0(i,s)+" =>"]=r,t),{})}:IT(e)?{["Set(".concat(e.size,")")]:[...e.values()].map(t=>H0(t))}:Ba(e)?H0(e):gn(e)&&!yt(e)&&!LT(e)?String(e):e,H0=(n,e="")=>{var t;return Ba(n)?"Symbol(".concat((t=n.description)!=null?t:e,")"):n};/**
* @vue/reactivity v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ri;class BT{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ri,!e&&Ri&&(this.index=(Ri.scopes||(Ri.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Ri;try{return Ri=this,e()}finally{Ri=t}}}on(){++this._on===1&&(this.prevScope=Ri,Ri=this)}off(){this._on>0&&--this._on===0&&(Ri=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Hv(n){return new BT(n)}function kT(){return Ri}function EI(n,e=!1){Ri&&Ri.cleanups.push(n)}let fn;const $0=new WeakSet;class UT{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ri&&Ri.active&&Ri.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,$0.has(this)&&($0.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||VT(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_2(this),HT(this);const e=fn,t=vs;fn=this,vs=!0;try{return this.fn()}finally{$T(this),fn=e,vs=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Wv(e);this.deps=this.depsTail=void 0,_2(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?$0.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){D1(this)&&this.run()}get dirty(){return D1(this)}}let zT=0,Md,Rd;function VT(n,e=!1){if(n.flags|=8,e){n.next=Rd,Rd=n;return}n.next=Md,Md=n}function $v(){zT++}function Gv(){if(--zT>0)return;if(Rd){let e=Rd;for(Rd=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Md;){let e=Md;for(Md=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function HT(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function $T(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Wv(i),MI(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function D1(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(GT(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function GT(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Xd)||(n.globalVersion=Xd,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!D1(n))))return;n.flags|=2;const e=n.dep,t=fn,i=vs;fn=n,vs=!0;try{HT(n);const r=n.fn(n._value);(e.version===0||Ra(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{fn=t,vs=i,$T(n),n.flags&=-3}}function Wv(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Wv(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function MI(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let vs=!0;const WT=[];function $o(){WT.push(vs),vs=!1}function Go(){const n=WT.pop();vs=n===void 0?!0:n}function _2(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=fn;fn=void 0;try{e()}finally{fn=t}}}let Xd=0;class RI{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qv{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!fn||!vs||fn===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==fn)t=this.activeLink=new RI(fn,this),fn.deps?(t.prevDep=fn.depsTail,fn.depsTail.nextDep=t,fn.depsTail=t):fn.deps=fn.depsTail=t,QT(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=fn.depsTail,t.nextDep=void 0,fn.depsTail.nextDep=t,fn.depsTail=t,fn.deps===t&&(fn.deps=i)}return t}trigger(e){this.version++,Xd++,this.notify(e)}notify(e){$v();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Gv()}}}function QT(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)QT(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Qp=new WeakMap,Cl=Symbol(""),F1=Symbol(""),Kd=Symbol("");function Pi(n,e,t){if(vs&&fn){let i=Qp.get(n);i||Qp.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new Qv),r.map=i,r.key=t),r.track()}}function No(n,e,t,i,r,s){const o=Qp.get(n);if(!o){Xd++;return}const a=l=>{l&&l.trigger()};if($v(),e==="clear")o.forEach(a);else{const l=yt(n),c=l&&Vv(t);if(l&&t==="length"){const u=Number(i);o.forEach((d,h)=>{(h==="length"||h===Kd||!Ba(h)&&h>=u)&&a(d)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Kd)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Cl)),Hc(n)&&a(o.get(F1)));break;case"delete":l||(a(o.get(Cl)),Hc(n)&&a(o.get(F1)));break;case"set":Hc(n)&&a(o.get(Cl));break}}Gv()}function II(n,e){const t=Qp.get(n);return t&&t.get(e)}function Yl(n){const e=Ot(n);return e===n?e:(Pi(e,"iterate",Kd),Zr(n)?e:e.map(mi))}function Gm(n){return Pi(n=Ot(n),"iterate",Kd),n}const NI={__proto__:null,[Symbol.iterator](){return G0(this,Symbol.iterator,mi)},concat(...n){return Yl(this).concat(...n.map(e=>yt(e)?Yl(e):e))},entries(){return G0(this,"entries",n=>(n[1]=mi(n[1]),n))},every(n,e){return ho(this,"every",n,e,void 0,arguments)},filter(n,e){return ho(this,"filter",n,e,t=>t.map(mi),arguments)},find(n,e){return ho(this,"find",n,e,mi,arguments)},findIndex(n,e){return ho(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return ho(this,"findLast",n,e,mi,arguments)},findLastIndex(n,e){return ho(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return ho(this,"forEach",n,e,void 0,arguments)},includes(...n){return W0(this,"includes",n)},indexOf(...n){return W0(this,"indexOf",n)},join(n){return Yl(this).join(n)},lastIndexOf(...n){return W0(this,"lastIndexOf",n)},map(n,e){return ho(this,"map",n,e,void 0,arguments)},pop(){return Yu(this,"pop")},push(...n){return Yu(this,"push",n)},reduce(n,...e){return x2(this,"reduce",n,e)},reduceRight(n,...e){return x2(this,"reduceRight",n,e)},shift(){return Yu(this,"shift")},some(n,e){return ho(this,"some",n,e,void 0,arguments)},splice(...n){return Yu(this,"splice",n)},toReversed(){return Yl(this).toReversed()},toSorted(n){return Yl(this).toSorted(n)},toSpliced(...n){return Yl(this).toSpliced(...n)},unshift(...n){return Yu(this,"unshift",n)},values(){return G0(this,"values",mi)}};function G0(n,e,t){const i=Gm(n),r=i[e]();return i!==n&&!Zr(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=t(s.value)),s}),r}const PI=Array.prototype;function ho(n,e,t,i,r,s){const o=Gm(n),a=o!==n&&!Zr(n),l=o[e];if(l!==PI[e]){const d=l.apply(n,s);return a?mi(d):d}let c=t;o!==n&&(a?c=function(d,h){return t.call(this,mi(d),h,n)}:t.length>2&&(c=function(d,h){return t.call(this,d,h,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function x2(n,e,t,i){const r=Gm(n);let s=t;return r!==n&&(Zr(n)?t.length>3&&(s=function(o,a,l){return t.call(this,o,a,l,n)}):s=function(o,a,l){return t.call(this,o,mi(a),l,n)}),r[e](s,...i)}function W0(n,e,t){const i=Ot(n);Pi(i,"iterate",Kd);const r=i[e](...t);return(r===-1||r===!1)&&Xv(t[0])?(t[0]=Ot(t[0]),i[e](...t)):r}function Yu(n,e,t=[]){$o(),$v();const i=Ot(n)[e].apply(n,t);return Gv(),Go(),i}const LI=kv("__proto__,__v_isRef,__isVue"),jT=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ba));function DI(n){Ba(n)||(n=String(n));const e=Ot(this);return Pi(e,"has",n),e.hasOwnProperty(n)}class qT{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?GI:ZT:s?YT:KT).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=yt(e);if(!r){let l;if(o&&(l=NI[t]))return l;if(t==="hasOwnProperty")return DI}const a=Reflect.get(e,t,bn(e)?e:i);return(Ba(t)?jT.has(t):LI(t))||(r||Pi(e,"get",t),s)?a:bn(a)?o&&Vv(t)?a:a.value:gn(a)?r?JT(a):Ys(a):a}}class XT extends qT{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];if(!this._isShallow){const l=La(s);if(!Zr(i)&&!La(i)&&(s=Ot(s),i=Ot(i)),!yt(e)&&bn(s)&&!bn(i))return l?!1:(s.value=i,!0)}const o=yt(e)&&Vv(t)?Number(t)<e.length:Jt(e,t),a=Reflect.set(e,t,i,bn(e)?e:r);return e===Ot(r)&&(o?Ra(i,s)&&No(e,"set",t,i):No(e,"add",t,i)),a}deleteProperty(e,t){const i=Jt(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&No(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!Ba(t)||!jT.has(t))&&Pi(e,"has",t),i}ownKeys(e){return Pi(e,"iterate",yt(e)?"length":Cl),Reflect.ownKeys(e)}}class FI extends qT{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const OI=new XT,BI=new FI,kI=new XT(!0);const O1=n=>n,cf=n=>Reflect.getPrototypeOf(n);function UI(n,e,t){return function(...i){const r=this.__v_raw,s=Ot(r),o=Hc(s),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?O1:e?jp:mi;return!e&&Pi(s,"iterate",l?F1:Cl),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}},[Symbol.iterator](){return this}}}}function uf(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function zI(n,e){const t={get(r){const s=this.__v_raw,o=Ot(s),a=Ot(r);n||(Ra(r,a)&&Pi(o,"get",r),Pi(o,"get",a));const{has:l}=cf(o),c=e?O1:n?jp:mi;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&Pi(Ot(r),"iterate",Cl),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=Ot(s),a=Ot(r);return n||(Ra(r,a)&&Pi(o,"has",r),Pi(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=Ot(a),c=e?O1:n?jp:mi;return!n&&Pi(l,"iterate",Cl),a.forEach((u,d)=>r.call(s,c(u),c(d),o))}};return Jn(t,n?{add:uf("add"),set:uf("set"),delete:uf("delete"),clear:uf("clear")}:{add(r){!e&&!Zr(r)&&!La(r)&&(r=Ot(r));const s=Ot(this);return cf(s).has.call(s,r)||(s.add(r),No(s,"add",r,r)),this},set(r,s){!e&&!Zr(s)&&!La(s)&&(s=Ot(s));const o=Ot(this),{has:a,get:l}=cf(o);let c=a.call(o,r);c||(r=Ot(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?Ra(s,u)&&No(o,"set",r,s):No(o,"add",r,s),this},delete(r){const s=Ot(this),{has:o,get:a}=cf(s);let l=o.call(s,r);l||(r=Ot(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&No(s,"delete",r,void 0),c},clear(){const r=Ot(this),s=r.size!==0,o=r.clear();return s&&No(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=UI(r,n,e)}),t}function jv(n,e){const t=zI(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(Jt(t,r)&&r in i?t:i,r,s)}const VI={get:jv(!1,!1)},HI={get:jv(!1,!0)},$I={get:jv(!0,!1)};const KT=new WeakMap,YT=new WeakMap,ZT=new WeakMap,GI=new WeakMap;function WI(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function QI(n){return n.__v_skip||!Object.isExtensible(n)?0:WI(gI(n))}function Ys(n){return La(n)?n:qv(n,!1,OI,VI,KT)}function jI(n){return qv(n,!1,kI,HI,YT)}function JT(n){return qv(n,!0,BI,$I,ZT)}function qv(n,e,t,i,r){if(!gn(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=QI(n);if(s===0)return n;const o=r.get(n);if(o)return o;const a=new Proxy(n,s===2?i:t);return r.set(n,a),a}function Uo(n){return La(n)?Uo(n.__v_raw):!!(n&&n.__v_isReactive)}function La(n){return!!(n&&n.__v_isReadonly)}function Zr(n){return!!(n&&n.__v_isShallow)}function Xv(n){return n?!!n.__v_raw:!1}function Ot(n){const e=n&&n.__v_raw;return e?Ot(e):n}function Kv(n){return!Jt(n,"__v_skip")&&Object.isExtensible(n)&&L1(n,"__v_skip",!0),n}const mi=n=>gn(n)?Ys(n):n,jp=n=>gn(n)?JT(n):n;function bn(n){return n?n.__v_isRef===!0:!1}function Dn(n){return ew(n,!1)}function Nr(n){return ew(n,!0)}function ew(n,e){return bn(n)?n:new qI(n,e)}class qI{constructor(e,t){this.dep=new Qv,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ot(e),this._value=t?e:mi(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Zr(e)||La(e);e=i?e:Ot(e),Ra(e,t)&&(this._rawValue=e,this._value=i?e:mi(e),this.dep.trigger())}}function XI(n){n.dep&&n.dep.trigger()}function We(n){return bn(n)?n.value:n}const KI={get:(n,e,t)=>e==="__v_raw"?n:We(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return bn(r)&&!bn(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function tw(n){return Uo(n)?n:new Proxy(n,KI)}function YI(n){const e=yt(n)?new Array(n.length):{};for(const t in n)e[t]=nw(n,t);return e}class ZI{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return II(Ot(this._object),this._key)}}class JI{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function e8(n,e,t){return bn(n)?n:Ct(n)?new JI(n):gn(n)&&arguments.length>1?nw(n,e,t):Dn(n)}function nw(n,e,t){const i=n[e];return bn(i)?i:new ZI(n,e,t)}class t8{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Qv(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Xd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&fn!==this)return VT(this,!0),!0}get value(){const e=this.dep.track();return GT(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function n8(n,e,t=!1){let i,r;return Ct(n)?i=n:(i=n.get,r=n.set),new t8(i,r,t)}const df={},qp=new WeakMap;let ul;function i8(n,e=!1,t=ul){if(t){let i=qp.get(t);i||qp.set(t,i=[]),i.push(n)}}function r8(n,e,t=un){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=_=>r?_:Zr(_)||r===!1||r===0?Po(_,1):Po(_);let u,d,h,f,p=!1,g=!1;if(bn(n)?(d=()=>n.value,p=Zr(n)):Uo(n)?(d=()=>c(n),p=!0):yt(n)?(g=!0,p=n.some(_=>Uo(_)||Zr(_)),d=()=>n.map(_=>{if(bn(_))return _.value;if(Uo(_))return c(_);if(Ct(_))return l?l(_,2):_()})):Ct(n)?e?d=l?()=>l(n,2):n:d=()=>{if(h){$o();try{h()}finally{Go()}}const _=ul;ul=u;try{return l?l(n,3,[f]):n(f)}finally{ul=_}}:d=Ws,e&&r){const _=d,S=r===!0?1/0:r;d=()=>Po(_(),S)}const y=kT(),m=()=>{u.stop(),y&&y.active&&zv(y.effects,u)};if(s&&e){const _=e;e=(...S)=>{_(...S),m()}}let v=g?new Array(n.length).fill(df):df;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const S=u.run();if(r||p||(g?S.some((E,A)=>Ra(E,v[A])):Ra(S,v))){h&&h();const E=ul;ul=u;try{const A=[S,v===df?void 0:g&&v[0]===df?[]:v,f];v=S,l?l(e,3,A):e(...A)}finally{ul=E}}}else u.run()};return a&&a(x),u=new UT(d),u.scheduler=o?()=>o(x,!1):x,f=_=>i8(_,!1,u),h=u.onStop=()=>{const _=qp.get(u);if(_){if(l)l(_,4);else for(const S of _)S();qp.delete(u)}},e?i?x(!0):v=u.run():o?o(x.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function Po(n,e=1/0,t){if(e<=0||!gn(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,bn(n))Po(n.value,e,t);else if(yt(n))for(let i=0;i<n.length;i++)Po(n[i],e,t);else if(IT(n)||Hc(n))n.forEach(i=>{Po(i,e,t)});else if(LT(n)){for(const i in n)Po(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Po(n[i],e,t)}return n}/**
* @vue/runtime-core v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Nh(n,e,t,i){try{return i?n(...i):n()}catch(r){Wm(r,e,t)}}function As(n,e,t,i){if(Ct(n)){const r=Nh(n,e,t,i);return r&&NT(r)&&r.catch(s=>{Wm(s,e,t)}),r}if(yt(n)){const r=[];for(let s=0;s<n.length;s++)r.push(As(n[s],e,t,i));return r}}function Wm(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||un;if(e){let a=e.parent;const l=e.proxy,c="https://vuejs.org/error-reference/#runtime-".concat(t);for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](n,l,c)===!1)return}a=a.parent}if(s){$o(),Nh(s,null,10,[n,l,c]),Go();return}}s8(n,t,r,i,o)}function s8(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const Xi=[];let Fs=-1;const $c=[];let ga=null,Tc=0;const iw=Promise.resolve();let Xp=null;function Ph(n){const e=Xp||iw;return n?e.then(this?n.bind(this):n):e}function o8(n){let e=Fs+1,t=Xi.length;for(;e<t;){const i=e+t>>>1,r=Xi[i],s=Yd(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function Yv(n){if(!(n.flags&1)){const e=Yd(n),t=Xi[Xi.length-1];!t||!(n.flags&2)&&e>=Yd(t)?Xi.push(n):Xi.splice(o8(e),0,n),n.flags|=1,rw()}}function rw(){Xp||(Xp=iw.then(ow))}function a8(n){yt(n)?$c.push(...n):ga&&n.id===-1?ga.splice(Tc+1,0,n):n.flags&1||($c.push(n),n.flags|=1),rw()}function S2(n,e,t=Fs+1){for(;t<Xi.length;t++){const i=Xi[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;Xi.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function sw(n){if($c.length){const e=[...new Set($c)].sort((t,i)=>Yd(t)-Yd(i));if($c.length=0,ga){ga.push(...e);return}for(ga=e,Tc=0;Tc<ga.length;Tc++){const t=ga[Tc];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}ga=null,Tc=0}}const Yd=n=>n.id==null?n.flags&2?-1:1/0:n.id;function ow(n){try{for(Fs=0;Fs<Xi.length;Fs++){const e=Xi[Fs];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Nh(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Fs<Xi.length;Fs++){const e=Xi[Fs];e&&(e.flags&=-2)}Fs=-1,Xi.length=0,sw(),Xp=null,(Xi.length||$c.length)&&ow()}}let Zi=null,aw=null;function Kp(n){const e=Zi;return Zi=n,aw=n&&n.type.__scopeId||null,e}function lw(n,e=Zi,t){if(!e||n._n)return n;const i=(...r)=>{i._d&&D2(-1);const s=Kp(e);let o;try{o=n(...r)}finally{Kp(s),i._d&&D2(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Pc(n,e){if(Zi===null)return n;const t=Xm(Zi),i=n.dirs||(n.dirs=[]);for(let r=0;r<e.length;r++){let[s,o,a,l=un]=e[r];s&&(Ct(s)&&(s={mounted:s,updated:s}),s.deep&&Po(o),i.push({dir:s,instance:t,value:o,oldValue:void 0,arg:a,modifiers:l}))}return n}function qa(n,e,t,i){const r=n.dirs,s=e&&e.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&($o(),As(l,t,8,[n.el,a,n,e]),Go())}}const cw=Symbol("_vte"),l8=n=>n.__isTeleport,Id=n=>n&&(n.disabled||n.disabled===""),A2=n=>n&&(n.defer||n.defer===""),b2=n=>typeof SVGElement<"u"&&n instanceof SVGElement,T2=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,B1=(n,e)=>{const t=n&&n.to;return wn(t)?e?e(t):null:t},uw={name:"Teleport",__isTeleport:!0,process(n,e,t,i,r,s,o,a,l,c){const{mc:u,pc:d,pbc:h,o:{insert:f,querySelector:p,createText:g,createComment:y}}=c,m=Id(e.props);let{shapeFlag:v,children:x,dynamicChildren:_}=e;if(n==null){const S=e.el=g(""),E=e.anchor=g("");f(S,t,i),f(E,t,i);const A=(w,M)=>{v&16&&(r&&r.isCE&&(r.ce._teleportTarget=w),u(x,w,M,r,s,o,a,l))},R=()=>{const w=e.target=B1(e.props,p),M=hw(w,e,g,f);w&&(o!=="svg"&&b2(w)?o="svg":o!=="mathml"&&T2(w)&&(o="mathml"),m||(A(w,M),mp(e,!1)))};m&&(A(t,E),mp(e,!0)),A2(e.props)?(e.el.__isMounted=!1,ji(()=>{R(),delete e.el.__isMounted},s)):R()}else{if(A2(e.props)&&n.el.__isMounted===!1){ji(()=>{uw.process(n,e,t,i,r,s,o,a,l,c)},s);return}e.el=n.el,e.targetStart=n.targetStart;const S=e.anchor=n.anchor,E=e.target=n.target,A=e.targetAnchor=n.targetAnchor,R=Id(n.props),w=R?t:E,M=R?S:A;if(o==="svg"||b2(E)?o="svg":(o==="mathml"||T2(E))&&(o="mathml"),_?(h(n.dynamicChildren,_,w,r,s,o,a),n_(n,e,!0)):l||d(n,e,w,M,r,s,o,a,!1),m)R?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):hf(e,t,S,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const I=e.target=B1(e.props,p);I&&hf(e,I,null,c,0)}else R&&hf(e,E,A,c,1);mp(e,m)}},remove(n,e,t,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:h}=n;if(d&&(r(c),r(u)),s&&r(l),o&16){const f=s||!Id(h);for(let p=0;p<a.length;p++){const g=a[p];i(g,e,t,f,!!g.dynamicChildren)}}},move:hf,hydrate:c8};function hf(n,e,t,{o:{insert:i},m:r},s=2){s===0&&i(n.targetAnchor,e,t);const{el:o,anchor:a,shapeFlag:l,children:c,props:u}=n,d=s===2;if(d&&i(o,e,t),(!d||Id(u))&&l&16)for(let h=0;h<c.length;h++)r(c[h],e,t,2);d&&i(a,e,t)}function c8(n,e,t,i,r,s,{o:{nextSibling:o,parentNode:a,querySelector:l,insert:c,createText:u}},d){const h=e.target=B1(e.props,l);if(h){const f=Id(e.props),p=h._lpa||h.firstChild;if(e.shapeFlag&16)if(f)e.anchor=d(o(n),e,a(n),t,i,r,s),e.targetStart=p,e.targetAnchor=p&&o(p);else{e.anchor=o(n);let g=p;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")e.targetStart=g;else if(g.data==="teleport anchor"){e.targetAnchor=g,h._lpa=e.targetAnchor&&o(e.targetAnchor);break}}g=o(g)}e.targetAnchor||hw(h,e,u,c),d(p&&o(p),e,h,t,i,r,s)}mp(e,f)}return e.anchor&&o(e.anchor)}const dw=uw;function mp(n,e){const t=n.ctx;if(t&&t.ut){let i,r;for(e?(i=n.el,r=n.anchor):(i=n.targetStart,r=n.targetAnchor);i&&i!==r;)i.nodeType===1&&i.setAttribute("data-v-owner",t.uid),i=i.nextSibling;t.ut()}}function hw(n,e,t,i){const r=e.targetStart=t(""),s=e.targetAnchor=t("");return r[cw]=s,n&&(i(r,n),i(s,n)),s}const Zl=Symbol("_leaveCb"),ff=Symbol("_enterCb");function u8(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ka(()=>{n.isMounted=!0}),Jv(()=>{n.isUnmounting=!0}),n}const Vr=[Function,Array],d8={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vr,onEnter:Vr,onAfterEnter:Vr,onEnterCancelled:Vr,onBeforeLeave:Vr,onLeave:Vr,onAfterLeave:Vr,onLeaveCancelled:Vr,onBeforeAppear:Vr,onAppear:Vr,onAfterAppear:Vr,onAppearCancelled:Vr};function h8(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function k1(n,e,t,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:f,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:y,onAppear:m,onAfterAppear:v,onAppearCancelled:x}=e,_=String(n.key),S=h8(t,n),E=(w,M)=>{w&&As(w,i,9,M)},A=(w,M)=>{const I=M[1];E(w,M),yt(w)?w.every(L=>L.length<=1)&&I():w.length<=1&&I()},R={mode:o,persisted:a,beforeEnter(w){let M=l;if(!t.isMounted)if(s)M=y||l;else return;w[Zl]&&w[Zl](!0);const I=S[_];I&&wc(n,I)&&I.el[Zl]&&I.el[Zl](),E(M,[w])},enter(w){let M=c,I=u,L=d;if(!t.isMounted)if(s)M=m||c,I=v||u,L=x||d;else return;let k=!1;const T=w[ff]=F=>{k||(k=!0,F?E(L,[w]):E(I,[w]),R.delayedLeave&&R.delayedLeave(),w[ff]=void 0)};M?A(M,[w,T]):T()},leave(w,M){const I=String(n.key);if(w[ff]&&w[ff](!0),t.isUnmounting)return M();E(h,[w]);let L=!1;const k=w[Zl]=T=>{L||(L=!0,M(),T?E(g,[w]):E(p,[w]),w[Zl]=void 0,S[I]===n&&delete S[I])};S[I]=n,f?A(f,[w,k]):k()},clone(w){return k1(w,e,t,i)}};return R}function Zd(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Zd(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function fw(n,e=!1,t){let i=[],r=0;for(let s=0;s<n.length;s++){let o=n[s];const a=t==null?o.key:String(t)+String(o.key!=null?o.key:s);o.type===Hn?(o.patchFlag&128&&r++,i=i.concat(fw(o.children,e,a))):(e||o.type!==Zs)&&i.push(a!=null?Ol(o,{key:a}):o)}if(r>1)for(let s=0;s<i.length;s++)i[s].patchFlag=-2;return i}/*! #__NO_SIDE_EFFECTS__ */function rn(n,e){return Ct(n)?Jn({name:n.name},e,{setup:n}):n}function pw(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function Yp(n){const e=Wo(),t=Nr(null);if(e){const r=e.refs===un?e.refs={}:e.refs;Object.defineProperty(r,n,{enumerable:!0,get:()=>t.value,set:s=>t.value=s})}return t}function Nd(n,e,t,i,r=!1){if(yt(n)){n.forEach((p,g)=>Nd(p,e&&(yt(e)?e[g]:e),t,i,r));return}if(Pd(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Nd(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?Xm(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===un?a.refs={}:a.refs,d=a.setupState,h=Ot(d),f=d===un?()=>!1:p=>Jt(h,p);if(c!=null&&c!==l&&(wn(c)?(u[c]=null,f(c)&&(d[c]=null)):bn(c)&&(c.value=null)),Ct(l))Nh(l,a,12,[o,u]);else{const p=wn(l),g=bn(l);if(p||g){const y=()=>{if(n.f){const m=p?f(l)?d[l]:u[l]:l.value;r?yt(m)&&zv(m,s):yt(m)?m.includes(s)||m.push(s):p?(u[l]=[s],f(l)&&(d[l]=u[l])):(l.value=[s],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,f(l)&&(d[l]=o)):g&&(l.value=o,n.k&&(u[n.k]=o))};o?(y.id=-1,ji(y,t)):y()}}}$m().requestIdleCallback;$m().cancelIdleCallback;const Pd=n=>!!n.type.__asyncLoader,mw=n=>n.type.__isKeepAlive;function f8(n,e){gw(n,"a",e)}function p8(n,e){gw(n,"da",e)}function gw(n,e,t=li){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(Qm(e,i,t),t){let r=t.parent;for(;r&&r.parent;)mw(r.parent.vnode)&&m8(i,e,t,r),r=r.parent}}function m8(n,e,t,i){const r=Qm(e,n,i,!0);Lh(()=>{zv(i[e],r)},t)}function Qm(n,e,t=li,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{$o();const a=Dh(t),l=As(e,t,n,o);return a(),Go(),l});return i?r.unshift(s):r.push(s),s}}const ea=n=>(e,t=li)=>{(!th||n==="sp")&&Qm(n,(...i)=>e(...i),t)},yw=ea("bm"),ka=ea("m"),g8=ea("bu"),Zv=ea("u"),Jv=ea("bum"),Lh=ea("um"),y8=ea("sp"),v8=ea("rtg"),_8=ea("rtc");function x8(n,e=li){Qm("ec",n,e)}const vw="components",S8="directives",_w=Symbol.for("v-ndc");function A8(n){return wn(n)?xw(vw,n,!1)||n:n||_w}function b8(n){return xw(S8,n)}function xw(n,e,t=!0,i=!1){const r=Zi||li;if(r){const s=r.type;if(n===vw){const a=u9(s,!1);if(a&&(a===e||a===ns(e)||a===Hm(ns(e))))return s}const o=w2(r[n]||s[n],e)||w2(r.appContext[n],e);return!o&&i?s:o}}function w2(n,e){return n&&(n[e]||n[ns(e)]||n[Hm(ns(e))])}function Jd(n,e,t,i){let r;const s=t,o=yt(n);if(o||wn(n)){const a=o&&Uo(n);let l=!1,c=!1;a&&(l=!Zr(n),c=La(n),n=Gm(n)),r=new Array(n.length);for(let u=0,d=n.length;u<d;u++)r[u]=e(l?c?jp(mi(n[u])):mi(n[u]):n[u],u,void 0,s)}else if(typeof n=="number"){r=new Array(n);for(let a=0;a<n;a++)r[a]=e(a+1,a,void 0,s)}else if(gn(n))if(n[Symbol.iterator])r=Array.from(n,(a,l)=>e(a,l,void 0,s));else{const a=Object.keys(n);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=e(n[u],u,l,s)}}else r=[];return r}const U1=n=>n?kw(n)?Xm(n):U1(n.parent):null,Ld=Jn(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>U1(n.parent),$root:n=>U1(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Aw(n),$forceUpdate:n=>n.f||(n.f=()=>{Yv(n.update)}),$nextTick:n=>n.n||(n.n=Ph.bind(n.proxy)),$watch:n=>W8.bind(n)}),Q0=(n,e)=>n!==un&&!n.__isScriptSetup&&Jt(n,e),T8={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(Q0(i,e))return o[e]=1,i[e];if(r!==un&&Jt(r,e))return o[e]=2,r[e];if((c=n.propsOptions[0])&&Jt(c,e))return o[e]=3,s[e];if(t!==un&&Jt(t,e))return o[e]=4,t[e];z1&&(o[e]=0)}}const u=Ld[e];let d,h;if(u)return e==="$attrs"&&Pi(n.attrs,"get",""),u(n);if((d=a.__cssModules)&&(d=d[e]))return d;if(t!==un&&Jt(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,Jt(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return Q0(r,e)?(r[e]=t,!0):i!==un&&Jt(i,e)?(i[e]=t,!0):Jt(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!t[o]||n!==un&&Jt(n,o)||Q0(e,o)||(a=s[0])&&Jt(a,o)||Jt(i,o)||Jt(Ld,o)||Jt(r.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Jt(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function C2(n){return yt(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let z1=!0;function w8(n){const e=Aw(n),t=n.proxy,i=n.ctx;z1=!1,e.beforeCreate&&E2(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:p,activated:g,deactivated:y,beforeDestroy:m,beforeUnmount:v,destroyed:x,unmounted:_,render:S,renderTracked:E,renderTriggered:A,errorCaptured:R,serverPrefetch:w,expose:M,inheritAttrs:I,components:L,directives:k,filters:T}=e;if(c&&C8(c,i,null),o)for(const Q in o){const ee=o[Q];Ct(ee)&&(i[Q]=ee.bind(t))}if(r){const Q=r.call(t,t);gn(Q)&&(n.data=Ys(Q))}if(z1=!0,s)for(const Q in s){const ee=s[Q],se=Ct(ee)?ee.bind(t,t):Ct(ee.get)?ee.get.bind(t,t):Ws,he=!Ct(ee)&&Ct(ee.set)?ee.set.bind(t):Ws,ie=Ge({get:se,set:he});Object.defineProperty(i,Q,{enumerable:!0,configurable:!0,get:()=>ie.value,set:re=>ie.value=re})}if(a)for(const Q in a)Sw(a[Q],i,t,Q);if(l){const Q=Ct(l)?l.call(t):l;Reflect.ownKeys(Q).forEach(ee=>{ta(ee,Q[ee])})}u&&E2(u,n,"c");function V(Q,ee){yt(ee)?ee.forEach(se=>Q(se.bind(t))):ee&&Q(ee.bind(t))}if(V(yw,d),V(ka,h),V(g8,f),V(Zv,p),V(f8,g),V(p8,y),V(x8,R),V(_8,E),V(v8,A),V(Jv,v),V(Lh,_),V(y8,w),yt(M))if(M.length){const Q=n.exposed||(n.exposed={});M.forEach(ee=>{Object.defineProperty(Q,ee,{get:()=>t[ee],set:se=>t[ee]=se})})}else n.exposed||(n.exposed={});S&&n.render===Ws&&(n.render=S),I!=null&&(n.inheritAttrs=I),L&&(n.components=L),k&&(n.directives=k),w&&pw(n)}function C8(n,e,t=Ws){yt(n)&&(n=V1(n));for(const i in n){const r=n[i];let s;gn(r)?"default"in r?s=Ji(r.from||i,r.default,!0):s=Ji(r.from||i):s=Ji(r),bn(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function E2(n,e,t){As(yt(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Sw(n,e,t,i){let r=i.includes(".")?Lw(t,i):()=>t[i];if(wn(n)){const s=e[n];Ct(s)&&ci(r,s)}else if(Ct(n))ci(r,n.bind(t));else if(gn(n))if(yt(n))n.forEach(s=>Sw(s,e,t,i));else{const s=Ct(n.handler)?n.handler.bind(t):e[n.handler];Ct(s)&&ci(r,s,n)}}function Aw(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>Zp(l,c,o,!0)),Zp(l,e,o)),gn(e)&&s.set(e,l),l}function Zp(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&Zp(n,s,t,!0),r&&r.forEach(o=>Zp(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=E8[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const E8={data:M2,props:R2,emits:R2,methods:Ad,computed:Ad,beforeCreate:$i,created:$i,beforeMount:$i,mounted:$i,beforeUpdate:$i,updated:$i,beforeDestroy:$i,beforeUnmount:$i,destroyed:$i,unmounted:$i,activated:$i,deactivated:$i,errorCaptured:$i,serverPrefetch:$i,components:Ad,directives:Ad,watch:R8,provide:M2,inject:M8};function M2(n,e){return e?n?function(){return Jn(Ct(n)?n.call(this,this):n,Ct(e)?e.call(this,this):e)}:e:n}function M8(n,e){return Ad(V1(n),V1(e))}function V1(n){if(yt(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function $i(n,e){return n?[...new Set([].concat(n,e))]:e}function Ad(n,e){return n?Jn(Object.create(null),n,e):e}function R2(n,e){return n?yt(n)&&yt(e)?[...new Set([...n,...e])]:Jn(Object.create(null),C2(n),C2(e!=null?e:{})):e}function R8(n,e){if(!n)return e;if(!e)return n;const t=Jn(Object.create(null),n);for(const i in e)t[i]=$i(n[i],e[i]);return t}function bw(){return{app:null,config:{isNativeTag:pI,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let I8=0;function N8(n,e){return function(i,r=null){Ct(i)||(i=Jn({},i)),r!=null&&!gn(r)&&(r=null);const s=bw(),o=new WeakSet,a=[];let l=!1;const c=s.app={_uid:I8++,_component:i,_props:r,_container:null,_context:s,_instance:null,version:h9,get config(){return s.config},set config(u){},use(u,...d){return o.has(u)||(u&&Ct(u.install)?(o.add(u),u.install(c,...d)):Ct(u)&&(o.add(u),u(c,...d))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,d){return d?(s.components[u]=d,c):s.components[u]},directive(u,d){return d?(s.directives[u]=d,c):s.directives[u]},mount(u,d,h){if(!l){const f=c._ceVNode||Re(i,r);return f.appContext=s,h===!0?h="svg":h===!1&&(h=void 0),n(f,u,h),l=!0,c._container=u,u.__vue_app__=c,Xm(f.component)}},onUnmount(u){a.push(u)},unmount(){l&&(As(a,c._instance,16),n(null,c._container),delete c._container.__vue_app__)},provide(u,d){return s.provides[u]=d,c},runWithContext(u){const d=El;El=c;try{return u()}finally{El=d}}};return c}}let El=null;function ta(n,e){if(li){let t=li.provides;const i=li.parent&&li.parent.provides;i===t&&(t=li.provides=Object.create(i)),t[n]=e}}function Ji(n,e,t=!1){const i=li||Zi;if(i||El){let r=El?El._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&Ct(e)?e.call(i&&i.proxy):e}}function P8(){return!!(li||Zi||El)}const Tw={},ww=()=>Object.create(Tw),Cw=n=>Object.getPrototypeOf(n)===Tw;function L8(n,e,t,i=!1){const r={},s=ww();n.propsDefaults=Object.create(null),Ew(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:jI(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function D8(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=Ot(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(qm(n.emitsOptions,h))continue;const f=e[h];if(l)if(Jt(s,h))f!==s[h]&&(s[h]=f,c=!0);else{const p=ns(h);r[p]=H1(l,a,p,f,n,!1)}else f!==s[h]&&(s[h]=f,c=!0)}}}else{Ew(n,e,r,s)&&(c=!0);let u;for(const d in a)(!e||!Jt(e,d)&&((u=Wl(d))===d||!Jt(e,u)))&&(l?t&&(t[d]!==void 0||t[u]!==void 0)&&(r[d]=H1(l,a,d,void 0,n,!0)):delete r[d]);if(s!==a)for(const d in s)(!e||!Jt(e,d))&&(delete s[d],c=!0)}c&&No(n.attrs,"set","")}function Ew(n,e,t,i){const[r,s]=n.propsOptions;let o=!1,a;if(e)for(let l in e){if(Ed(l))continue;const c=e[l];let u;r&&Jt(r,u=ns(l))?!s||!s.includes(u)?t[u]=c:(a||(a={}))[u]=c:qm(n.emitsOptions,l)||(!(l in i)||c!==i[l])&&(i[l]=c,o=!0)}if(s){const l=Ot(t),c=a||un;for(let u=0;u<s.length;u++){const d=s[u];t[d]=H1(r,l,d,c[d],n,!Jt(c,d))}}return o}function H1(n,e,t,i,r,s){const o=n[t];if(o!=null){const a=Jt(o,"default");if(a&&i===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&Ct(l)){const{propsDefaults:c}=r;if(t in c)i=c[t];else{const u=Dh(r);i=c[t]=l.call(null,e),u()}}else i=l;r.ce&&r.ce._setProp(t,i)}o[0]&&(s&&!a?i=!1:o[1]&&(i===""||i===Wl(t))&&(i=!0))}return i}const F8=new WeakMap;function Mw(n,e,t=!1){const i=t?F8:e.propsCache,r=i.get(n);if(r)return r;const s=n.props,o={},a=[];let l=!1;if(!Ct(n)){const u=d=>{l=!0;const[h,f]=Mw(d,e,!0);Jn(o,h),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return gn(n)&&i.set(n,Vc),Vc;if(yt(s))for(let u=0;u<s.length;u++){const d=ns(s[u]);I2(d)&&(o[d]=un)}else if(s)for(const u in s){const d=ns(u);if(I2(d)){const h=s[u],f=o[d]=yt(h)||Ct(h)?{type:h}:Jn({},h),p=f.type;let g=!1,y=!0;if(yt(p))for(let m=0;m<p.length;++m){const v=p[m],x=Ct(v)&&v.name;if(x==="Boolean"){g=!0;break}else x==="String"&&(y=!1)}else g=Ct(p)&&p.name==="Boolean";f[0]=g,f[1]=y,(g||Jt(f,"default"))&&a.push(d)}}const c=[o,a];return gn(n)&&i.set(n,c),c}function I2(n){return n[0]!=="$"&&!Ed(n)}const e_=n=>n[0]==="_"||n==="$stable",t_=n=>yt(n)?n.map(ks):[ks(n)],O8=(n,e,t)=>{if(e._n)return e;const i=lw((...r)=>t_(e(...r)),t);return i._c=!1,i},Rw=(n,e,t)=>{const i=n._ctx;for(const r in n){if(e_(r))continue;const s=n[r];if(Ct(s))e[r]=O8(r,s,i);else if(s!=null){const o=t_(s);e[r]=()=>o}}},Iw=(n,e)=>{const t=t_(e);n.slots.default=()=>t},Nw=(n,e,t)=>{for(const i in e)(t||!e_(i))&&(n[i]=e[i])},B8=(n,e,t)=>{const i=n.slots=ww();if(n.vnode.shapeFlag&32){const r=e.__;r&&L1(i,"__",r,!0);const s=e._;s?(Nw(i,e,t),t&&L1(i,"_",s,!0)):Rw(e,i)}else e&&Iw(n,e)},k8=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=un;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:Nw(r,e,t):(s=!e.$stable,Rw(e,r)),o=e}else e&&(Iw(n,e),o={default:1});if(s)for(const a in r)!e_(a)&&o[a]==null&&delete r[a]},ji=Z8;function U8(n){return z8(n)}function z8(n,e){const t=$m();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Ws,insertStaticContent:p}=n,g=(te,ne,b,oe=null,J=null,H=null,P=void 0,U=null,j=!!ne.dynamicChildren)=>{if(te===ne)return;te&&!wc(te,ne)&&(oe=Ce(te),re(te,J,H,!0),te=null),ne.patchFlag===-2&&(j=!1,ne.dynamicChildren=null);const{type:B,ref:D,shapeFlag:W}=ne;switch(B){case Iu:y(te,ne,b,oe);break;case Zs:m(te,ne,b,oe);break;case gp:te==null&&v(ne,b,oe,P);break;case Hn:L(te,ne,b,oe,J,H,P,U,j);break;default:W&1?S(te,ne,b,oe,J,H,P,U,j):W&6?k(te,ne,b,oe,J,H,P,U,j):(W&64||W&128)&&B.process(te,ne,b,oe,J,H,P,U,j,Be)}D!=null&&J?Nd(D,te&&te.ref,H,ne||te,!ne):D==null&&te&&te.ref!=null&&Nd(te.ref,null,H,te,!0)},y=(te,ne,b,oe)=>{if(te==null)i(ne.el=a(ne.children),b,oe);else{const J=ne.el=te.el;ne.children!==te.children&&c(J,ne.children)}},m=(te,ne,b,oe)=>{te==null?i(ne.el=l(ne.children||""),b,oe):ne.el=te.el},v=(te,ne,b,oe)=>{[te.el,te.anchor]=p(te.children,ne,b,oe,te.el,te.anchor)},x=({el:te,anchor:ne},b,oe)=>{let J;for(;te&&te!==ne;)J=h(te),i(te,b,oe),te=J;i(ne,b,oe)},_=({el:te,anchor:ne})=>{let b;for(;te&&te!==ne;)b=h(te),r(te),te=b;r(ne)},S=(te,ne,b,oe,J,H,P,U,j)=>{ne.type==="svg"?P="svg":ne.type==="math"&&(P="mathml"),te==null?E(ne,b,oe,J,H,P,U,j):w(te,ne,J,H,P,U,j)},E=(te,ne,b,oe,J,H,P,U)=>{let j,B;const{props:D,shapeFlag:W,transition:G,dirs:X}=te;if(j=te.el=o(te.type,H,D&&D.is,D),W&8?u(j,te.children):W&16&&R(te.children,j,null,oe,J,j0(te,H),P,U),X&&qa(te,null,oe,"created"),A(j,te,te.scopeId,P,oe),D){for(const z in D)z!=="value"&&!Ed(z)&&s(j,z,null,D[z],H,oe);"value"in D&&s(j,"value",null,D.value,H),(B=D.onVnodeBeforeMount)&&Ms(B,oe,te)}X&&qa(te,null,oe,"beforeMount");const ue=V8(J,G);ue&&G.beforeEnter(j),i(j,ne,b),((B=D&&D.onVnodeMounted)||ue||X)&&ji(()=>{B&&Ms(B,oe,te),ue&&G.enter(j),X&&qa(te,null,oe,"mounted")},J)},A=(te,ne,b,oe,J)=>{if(b&&f(te,b),oe)for(let H=0;H<oe.length;H++)f(te,oe[H]);if(J){let H=J.subTree;if(ne===H||Fw(H.type)&&(H.ssContent===ne||H.ssFallback===ne)){const P=J.vnode;A(te,P,P.scopeId,P.slotScopeIds,J.parent)}}},R=(te,ne,b,oe,J,H,P,U,j=0)=>{for(let B=j;B<te.length;B++){const D=te[B]=U?ya(te[B]):ks(te[B]);g(null,D,ne,b,oe,J,H,P,U)}},w=(te,ne,b,oe,J,H,P)=>{const U=ne.el=te.el;let{patchFlag:j,dynamicChildren:B,dirs:D}=ne;j|=te.patchFlag&16;const W=te.props||un,G=ne.props||un;let X;if(b&&Xa(b,!1),(X=G.onVnodeBeforeUpdate)&&Ms(X,b,ne,te),D&&qa(ne,te,b,"beforeUpdate"),b&&Xa(b,!0),(W.innerHTML&&G.innerHTML==null||W.textContent&&G.textContent==null)&&u(U,""),B?M(te.dynamicChildren,B,U,b,oe,j0(ne,J),H):P||ee(te,ne,U,null,b,oe,j0(ne,J),H,!1),j>0){if(j&16)I(U,W,G,b,J);else if(j&2&&W.class!==G.class&&s(U,"class",null,G.class,J),j&4&&s(U,"style",W.style,G.style,J),j&8){const ue=ne.dynamicProps;for(let z=0;z<ue.length;z++){const C=ue[z],N=W[C],q=G[C];(q!==N||C==="value")&&s(U,C,N,q,J,b)}}j&1&&te.children!==ne.children&&u(U,ne.children)}else!P&&B==null&&I(U,W,G,b,J);((X=G.onVnodeUpdated)||D)&&ji(()=>{X&&Ms(X,b,ne,te),D&&qa(ne,te,b,"updated")},oe)},M=(te,ne,b,oe,J,H,P)=>{for(let U=0;U<ne.length;U++){const j=te[U],B=ne[U],D=j.el&&(j.type===Hn||!wc(j,B)||j.shapeFlag&198)?d(j.el):b;g(j,B,D,null,oe,J,H,P,!0)}},I=(te,ne,b,oe,J)=>{if(ne!==b){if(ne!==un)for(const H in ne)!Ed(H)&&!(H in b)&&s(te,H,ne[H],null,J,oe);for(const H in b){if(Ed(H))continue;const P=b[H],U=ne[H];P!==U&&H!=="value"&&s(te,H,U,P,J,oe)}"value"in b&&s(te,"value",ne.value,b.value,J)}},L=(te,ne,b,oe,J,H,P,U,j)=>{const B=ne.el=te?te.el:a(""),D=ne.anchor=te?te.anchor:a("");let{patchFlag:W,dynamicChildren:G,slotScopeIds:X}=ne;X&&(U=U?U.concat(X):X),te==null?(i(B,b,oe),i(D,b,oe),R(ne.children||[],b,D,J,H,P,U,j)):W>0&&W&64&&G&&te.dynamicChildren?(M(te.dynamicChildren,G,b,J,H,P,U),(ne.key!=null||J&&ne===J.subTree)&&n_(te,ne,!0)):ee(te,ne,b,D,J,H,P,U,j)},k=(te,ne,b,oe,J,H,P,U,j)=>{ne.slotScopeIds=U,te==null?ne.shapeFlag&512?J.ctx.activate(ne,b,oe,P,j):T(ne,b,oe,J,H,P,j):F(te,ne,j)},T=(te,ne,b,oe,J,H,P)=>{const U=te.component=s9(te,oe,J);if(mw(te)&&(U.ctx.renderer=Be),o9(U,!1,P),U.asyncDep){if(J&&J.registerDep(U,V,P),!te.el){const j=U.subTree=Re(Zs);m(null,j,ne,b)}}else V(U,te,ne,b,J,H,P)},F=(te,ne,b)=>{const oe=ne.component=te.component;if(K8(te,ne,b))if(oe.asyncDep&&!oe.asyncResolved){Q(oe,ne,b);return}else oe.next=ne,oe.update();else ne.el=te.el,oe.vnode=ne},V=(te,ne,b,oe,J,H,P)=>{const U=()=>{if(te.isMounted){let{next:W,bu:G,u:X,parent:ue,vnode:z}=te;{const $=Pw(te);if($){W&&(W.el=z.el,Q(te,W,P)),$.asyncDep.then(()=>{te.isUnmounted||U()});return}}let C=W,N;Xa(te,!1),W?(W.el=z.el,Q(te,W,P)):W=z,G&&V0(G),(N=W.props&&W.props.onVnodeBeforeUpdate)&&Ms(N,ue,W,z),Xa(te,!0);const q=P2(te),Z=te.subTree;te.subTree=q,g(Z,q,d(Z.el),Ce(Z),te,J,H),W.el=q.el,C===null&&Y8(te,q.el),X&&ji(X,J),(N=W.props&&W.props.onVnodeUpdated)&&ji(()=>Ms(N,ue,W,z),J)}else{let W;const{el:G,props:X}=ne,{bm:ue,m:z,parent:C,root:N,type:q}=te,Z=Pd(ne);Xa(te,!1),ue&&V0(ue),!Z&&(W=X&&X.onVnodeBeforeMount)&&Ms(W,C,ne),Xa(te,!0);{N.ce&&N.ce._def.shadowRoot!==!1&&N.ce._injectChildStyle(q);const $=te.subTree=P2(te);g(null,$,b,oe,te,J,H),ne.el=$.el}if(z&&ji(z,J),!Z&&(W=X&&X.onVnodeMounted)){const $=ne;ji(()=>Ms(W,C,$),J)}(ne.shapeFlag&256||C&&Pd(C.vnode)&&C.vnode.shapeFlag&256)&&te.a&&ji(te.a,J),te.isMounted=!0,ne=b=oe=null}};te.scope.on();const j=te.effect=new UT(U);te.scope.off();const B=te.update=j.run.bind(j),D=te.job=j.runIfDirty.bind(j);D.i=te,D.id=te.uid,j.scheduler=()=>Yv(D),Xa(te,!0),B()},Q=(te,ne,b)=>{ne.component=te;const oe=te.vnode.props;te.vnode=ne,te.next=null,D8(te,ne.props,oe,b),k8(te,ne.children,b),$o(),S2(te),Go()},ee=(te,ne,b,oe,J,H,P,U,j=!1)=>{const B=te&&te.children,D=te?te.shapeFlag:0,W=ne.children,{patchFlag:G,shapeFlag:X}=ne;if(G>0){if(G&128){he(B,W,b,oe,J,H,P,U,j);return}else if(G&256){se(B,W,b,oe,J,H,P,U,j);return}}X&8?(D&16&&Te(B,J,H),W!==B&&u(b,W)):D&16?X&16?he(B,W,b,oe,J,H,P,U,j):Te(B,J,H,!0):(D&8&&u(b,""),X&16&&R(W,b,oe,J,H,P,U,j))},se=(te,ne,b,oe,J,H,P,U,j)=>{te=te||Vc,ne=ne||Vc;const B=te.length,D=ne.length,W=Math.min(B,D);let G;for(G=0;G<W;G++){const X=ne[G]=j?ya(ne[G]):ks(ne[G]);g(te[G],X,b,null,J,H,P,U,j)}B>D?Te(te,J,H,!0,!1,W):R(ne,b,oe,J,H,P,U,j,W)},he=(te,ne,b,oe,J,H,P,U,j)=>{let B=0;const D=ne.length;let W=te.length-1,G=D-1;for(;B<=W&&B<=G;){const X=te[B],ue=ne[B]=j?ya(ne[B]):ks(ne[B]);if(wc(X,ue))g(X,ue,b,null,J,H,P,U,j);else break;B++}for(;B<=W&&B<=G;){const X=te[W],ue=ne[G]=j?ya(ne[G]):ks(ne[G]);if(wc(X,ue))g(X,ue,b,null,J,H,P,U,j);else break;W--,G--}if(B>W){if(B<=G){const X=G+1,ue=X<D?ne[X].el:oe;for(;B<=G;)g(null,ne[B]=j?ya(ne[B]):ks(ne[B]),b,ue,J,H,P,U,j),B++}}else if(B>G)for(;B<=W;)re(te[B],J,H,!0),B++;else{const X=B,ue=B,z=new Map;for(B=ue;B<=G;B++){const Le=ne[B]=j?ya(ne[B]):ks(ne[B]);Le.key!=null&&z.set(Le.key,B)}let C,N=0;const q=G-ue+1;let Z=!1,$=0;const ae=new Array(q);for(B=0;B<q;B++)ae[B]=0;for(B=X;B<=W;B++){const Le=te[B];if(N>=q){re(Le,J,H,!0);continue}let Ve;if(Le.key!=null)Ve=z.get(Le.key);else for(C=ue;C<=G;C++)if(ae[C-ue]===0&&wc(Le,ne[C])){Ve=C;break}Ve===void 0?re(Le,J,H,!0):(ae[Ve-ue]=B+1,Ve>=$?$=Ve:Z=!0,g(Le,ne[Ve],b,null,J,H,P,U,j),N++)}const ke=Z?H8(ae):Vc;for(C=ke.length-1,B=q-1;B>=0;B--){const Le=ue+B,Ve=ne[Le],Je=Le+1<D?ne[Le+1].el:oe;ae[B]===0?g(null,Ve,b,Je,J,H,P,U,j):Z&&(C<0||B!==ke[C]?ie(Ve,b,Je,2):C--)}}},ie=(te,ne,b,oe,J=null)=>{const{el:H,type:P,transition:U,children:j,shapeFlag:B}=te;if(B&6){ie(te.component.subTree,ne,b,oe);return}if(B&128){te.suspense.move(ne,b,oe);return}if(B&64){P.move(te,ne,b,Be);return}if(P===Hn){i(H,ne,b);for(let W=0;W<j.length;W++)ie(j[W],ne,b,oe);i(te.anchor,ne,b);return}if(P===gp){x(te,ne,b);return}if(oe!==2&&B&1&&U)if(oe===0)U.beforeEnter(H),i(H,ne,b),ji(()=>U.enter(H),J);else{const{leave:W,delayLeave:G,afterLeave:X}=U,ue=()=>{te.ctx.isUnmounted?r(H):i(H,ne,b)},z=()=>{W(H,()=>{ue(),X&&X()})};G?G(H,ue,z):z()}else i(H,ne,b)},re=(te,ne,b,oe=!1,J=!1)=>{const{type:H,props:P,ref:U,children:j,dynamicChildren:B,shapeFlag:D,patchFlag:W,dirs:G,cacheIndex:X}=te;if(W===-2&&(J=!1),U!=null&&($o(),Nd(U,null,b,te,!0),Go()),X!=null&&(ne.renderCache[X]=void 0),D&256){ne.ctx.deactivate(te);return}const ue=D&1&&G,z=!Pd(te);let C;if(z&&(C=P&&P.onVnodeBeforeUnmount)&&Ms(C,ne,te),D&6)fe(te.component,b,oe);else{if(D&128){te.suspense.unmount(b,oe);return}ue&&qa(te,null,ne,"beforeUnmount"),D&64?te.type.remove(te,ne,b,Be,oe):B&&!B.hasOnce&&(H!==Hn||W>0&&W&64)?Te(B,ne,b,!1,!0):(H===Hn&&W&384||!J&&D&16)&&Te(j,ne,b),oe&&be(te)}(z&&(C=P&&P.onVnodeUnmounted)||ue)&&ji(()=>{C&&Ms(C,ne,te),ue&&qa(te,null,ne,"unmounted")},b)},be=te=>{const{type:ne,el:b,anchor:oe,transition:J}=te;if(ne===Hn){le(b,oe);return}if(ne===gp){_(te);return}const H=()=>{r(b),J&&!J.persisted&&J.afterLeave&&J.afterLeave()};if(te.shapeFlag&1&&J&&!J.persisted){const{leave:P,delayLeave:U}=J,j=()=>P(b,H);U?U(te.el,H,j):j()}else H()},le=(te,ne)=>{let b;for(;te!==ne;)b=h(te),r(te),te=b;r(ne)},fe=(te,ne,b)=>{const{bum:oe,scope:J,job:H,subTree:P,um:U,m:j,a:B,parent:D,slots:{__:W}}=te;N2(j),N2(B),oe&&V0(oe),D&&yt(W)&&W.forEach(G=>{D.renderCache[G]=void 0}),J.stop(),H&&(H.flags|=8,re(P,te,ne,b)),U&&ji(U,ne),ji(()=>{te.isUnmounted=!0},ne),ne&&ne.pendingBranch&&!ne.isUnmounted&&te.asyncDep&&!te.asyncResolved&&te.suspenseId===ne.pendingId&&(ne.deps--,ne.deps===0&&ne.resolve())},Te=(te,ne,b,oe=!1,J=!1,H=0)=>{for(let P=H;P<te.length;P++)re(te[P],ne,b,oe,J)},Ce=te=>{if(te.shapeFlag&6)return Ce(te.component.subTree);if(te.shapeFlag&128)return te.suspense.next();const ne=h(te.anchor||te.el),b=ne&&ne[cw];return b?h(b):ne};let Ie=!1;const ze=(te,ne,b)=>{te==null?ne._vnode&&re(ne._vnode,null,null,!0):g(ne._vnode||null,te,ne,null,null,null,b),ne._vnode=te,Ie||(Ie=!0,S2(),sw(),Ie=!1)},Be={p:g,um:re,m:ie,r:be,mt:T,mc:R,pc:ee,pbc:M,n:Ce,o:n};return{render:ze,hydrate:void 0,createApp:N8(ze)}}function j0({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Xa({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function V8(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function n_(n,e,t=!1){const i=n.children,r=e.children;if(yt(i)&&yt(r))for(let s=0;s<i.length;s++){const o=i[s];let a=r[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[s]=ya(r[s]),a.el=o.el),!t&&a.patchFlag!==-2&&n_(o,a)),a.type===Iu&&(a.el=o.el),a.type===Zs&&!a.el&&(a.el=o.el)}}function H8(n){const e=n.slice(),t=[0];let i,r,s,o,a;const l=n.length;for(i=0;i<l;i++){const c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(s=0,o=t.length-1;s<o;)a=s+o>>1,n[t[a]]<c?s=a+1:o=a;c<n[t[s]]&&(s>0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function Pw(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Pw(e)}function N2(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}const $8=Symbol.for("v-scx"),G8=()=>Ji($8);function jm(n,e){return i_(n,null,e)}function ci(n,e,t){return i_(n,e,t)}function i_(n,e,t=un){const{immediate:i,deep:r,flush:s,once:o}=t,a=Jn({},t),l=e&&i||!e&&s!=="post";let c;if(th){if(s==="sync"){const f=G8();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Ws,f.resume=Ws,f.pause=Ws,f}}const u=li;a.call=(f,p,g)=>As(f,u,p,g);let d=!1;s==="post"?a.scheduler=f=>{ji(f,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(f,p)=>{p?f():Yv(f)}),a.augmentJob=f=>{e&&(f.flags|=4),d&&(f.flags|=2,u&&(f.id=u.uid,f.i=u))};const h=r8(n,e,a);return th&&(c?c.push(h):l&&h()),h}function W8(n,e,t){const i=this.proxy,r=wn(n)?n.includes(".")?Lw(i,n):()=>i[n]:n.bind(i,i);let s;Ct(e)?s=e:(s=e.handler,t=e);const o=Dh(this),a=i_(r,s.bind(i),t);return o(),a}function Lw(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r<t.length&&i;r++)i=i[t[r]];return i}}const Q8=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n["".concat(e,"Modifiers")]||n["".concat(ns(e),"Modifiers")]||n["".concat(Wl(e),"Modifiers")];function j8(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||un;let r=t;const s=e.startsWith("update:"),o=s&&Q8(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>wn(u)?u.trim():u)),o.number&&(r=t.map(_I)));let a,l=i[a=z0(e)]||i[a=z0(ns(e))];!l&&s&&(l=i[a=z0(Wl(e))]),l&&As(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,As(c,n,6,r)}}function Dw(n,e,t=!1){const i=e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!Ct(n)){const l=c=>{const u=Dw(c,e,!0);u&&(a=!0,Jn(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(gn(n)&&i.set(n,null),null):(yt(s)?s.forEach(l=>o[l]=null):Jn(o,s),gn(n)&&i.set(n,o),o)}function qm(n,e){return!n||!Um(e)?!1:(e=e.slice(2).replace(/Once$/,""),Jt(n,e[0].toLowerCase()+e.slice(1))||Jt(n,Wl(e))||Jt(n,e))}function P2(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:f,ctx:p,inheritAttrs:g}=n,y=Kp(n);let m,v;try{if(t.shapeFlag&4){const _=r||i,S=_;m=ks(c.call(S,_,u,d,f,h,p)),v=a}else{const _=e;m=ks(_.length>1?_(d,{attrs:a,slots:o,emit:l}):_(d,null)),v=e.props?a:q8(a)}}catch(_){Dd.length=0,Wm(_,n,1),m=Re(Zs)}let x=m;if(v&&g!==!1){const _=Object.keys(v),{shapeFlag:S}=x;_.length&&S&7&&(s&&_.some(Uv)&&(v=X8(v,s)),x=Ol(x,v,!1,!0))}return t.dirs&&(x=Ol(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&Zd(x,t.transition),m=x,Kp(y),m}const q8=n=>{let e;for(const t in n)(t==="class"||t==="style"||Um(t))&&((e||(e={}))[t]=n[t]);return e},X8=(n,e)=>{const t={};for(const i in n)(!Uv(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function K8(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?L2(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(o[h]!==i[h]&&!qm(c,h))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:i===o?!1:i?o?L2(i,o,c):!0:!!o;return!1}function L2(n,e,t){const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(e[s]!==n[s]&&!qm(t,s))return!0}return!1}function Y8({vnode:n,parent:e},t){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===n&&(i.el=n.el),i===n)(n=e.vnode).el=t,e=e.parent;else break}}const Fw=n=>n.__isSuspense;function Z8(n,e){e&&e.pendingBranch?yt(n)?e.effects.push(...n):e.effects.push(n):a8(n)}const Hn=Symbol.for("v-fgt"),Iu=Symbol.for("v-txt"),Zs=Symbol.for("v-cmt"),gp=Symbol.for("v-stc"),Dd=[];let Mr=null;function ft(n=!1){Dd.push(Mr=n?null:[])}function J8(){Dd.pop(),Mr=Dd[Dd.length-1]||null}let eh=1;function D2(n,e=!1){eh+=n,n<0&&Mr&&e&&(Mr.hasOnce=!0)}function Ow(n){return n.dynamicChildren=eh>0?Mr||Vc:null,J8(),eh>0&&Mr&&Mr.push(n),n}function xt(n,e,t,i,r,s){return Ow(zt(n,e,t,i,r,s,!0))}function ou(n,e,t,i,r){return Ow(Re(n,e,t,i,r,!0))}function Jp(n){return n?n.__v_isVNode===!0:!1}function wc(n,e){return n.type===e.type&&n.key===e.key}const Bw=({key:n})=>n!=null?n:null,yp=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?wn(n)||bn(n)||Ct(n)?{i:Zi,r:n,k:e,f:!!t}:n:null);function zt(n,e=null,t=null,i=0,r=null,s=n===Hn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Bw(e),ref:e&&yp(e),scopeId:aw,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Zi};return a?(r_(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=wn(t)?8:16),eh>0&&!o&&Mr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Mr.push(l),l}const Re=e9;function e9(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===_w)&&(n=Zs),Jp(n)){const a=Ol(n,e,!0);return t&&r_(a,t),eh>0&&!s&&Mr&&(a.shapeFlag&6?Mr[Mr.indexOf(n)]=a:Mr.push(a)),a.patchFlag=-2,a}if(d9(n)&&(n=n.__vccOpts),e){e=t9(e);let{class:a,style:l}=e;a&&!wn(a)&&(e.class=Ks(a)),gn(l)&&(Xv(l)&&!yt(l)&&(l=Jn({},l)),e.style=Qs(l))}const o=wn(n)?1:Fw(n)?128:l8(n)?64:gn(n)?4:Ct(n)?2:0;return zt(n,e,t,i,r,o,s,!0)}function t9(n){return n?Xv(n)||Cw(n)?Jn({},n):n:null}function Ol(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?n9(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&Bw(c),ref:e&&e.ref?t&&s?yt(s)?s.concat(yp(e)):[s,yp(e)]:yp(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Hn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Ol(n.ssContent),ssFallback:n.ssFallback&&Ol(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Zd(u,l.clone(u)),u}function em(n=" ",e=0){return Re(Iu,null,n,e)}function Nu(n,e){const t=Re(gp,null,n);return t.staticCount=e,t}function br(n="",e=!1){return e?(ft(),ou(Zs,null,n)):Re(Zs,null,n)}function ks(n){return n==null||typeof n=="boolean"?Re(Zs):yt(n)?Re(Hn,null,n.slice()):Jp(n)?ya(n):Re(Iu,null,String(n))}function ya(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Ol(n)}function r_(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(yt(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),r_(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!Cw(e)?e._ctx=Zi:r===3&&Zi&&(Zi.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ct(e)?(e={default:e,_ctx:Zi},t=32):(e=String(e),i&64?(t=16,e=[em(e)]):t=8);n.children=e,n.shapeFlag|=t}function n9(...n){const e={};for(let t=0;t<n.length;t++){const i=n[t];for(const r in i)if(r==="class")e.class!==i.class&&(e.class=Ks([e.class,i.class]));else if(r==="style")e.style=Qs([e.style,i.style]);else if(Um(r)){const s=e[r],o=i[r];o&&s!==o&&!(yt(s)&&s.includes(o))&&(e[r]=s?[].concat(s,o):o)}else r!==""&&(e[r]=i[r])}return e}function Ms(n,e,t,i=null){As(n,e,7,[t,i])}const i9=bw();let r9=0;function s9(n,e,t){const i=n.type,r=(e?e.appContext:n.appContext)||i9,s={uid:r9++,vnode:n,type:i,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new BT(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Mw(i,r),emitsOptions:Dw(i,r),emit:null,emitted:null,propsDefaults:un,inheritAttrs:i.inheritAttrs,ctx:un,data:un,props:un,attrs:un,slots:un,refs:un,setupState:un,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=j8.bind(null,s),n.ce&&n.ce(s),s}let li=null;const Wo=()=>li||Zi;let tm,$1;{const n=$m(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};tm=e("__VUE_INSTANCE_SETTERS__",t=>li=t),$1=e("__VUE_SSR_SETTERS__",t=>th=t)}const Dh=n=>{const e=li;return tm(n),n.scope.on(),()=>{n.scope.off(),tm(e)}},F2=()=>{li&&li.scope.off(),tm(null)};function kw(n){return n.vnode.shapeFlag&4}let th=!1;function o9(n,e=!1,t=!1){e&&$1(e);const{props:i,children:r}=n.vnode,s=kw(n);L8(n,i,s,e),B8(n,r,t||e);const o=s?a9(n,e):void 0;return e&&$1(!1),o}function a9(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,T8);const{setup:i}=t;if(i){$o();const r=n.setupContext=i.length>1?c9(n):null,s=Dh(n),o=Nh(i,n,0,[n.props,r]),a=NT(o);if(Go(),s(),(a||n.sp)&&!Pd(n)&&pw(n),a){if(o.then(F2,F2),e)return o.then(l=>{O2(n,l)}).catch(l=>{Wm(l,n,0)});n.asyncDep=o}else O2(n,o)}else Uw(n)}function O2(n,e,t){Ct(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:gn(e)&&(n.setupState=tw(e)),Uw(n)}function Uw(n,e,t){const i=n.type;n.render||(n.render=i.render||Ws);{const r=Dh(n);$o();try{w8(n)}finally{Go(),r()}}}const l9={get(n,e){return Pi(n,"get",""),n[e]}};function c9(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,l9),slots:n.slots,emit:n.emit,expose:e}}function Xm(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(tw(Kv(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Ld)return Ld[t](n)},has(e,t){return t in e||t in Ld}})):n.proxy}function u9(n,e=!0){return Ct(n)?n.displayName||n.name:n.name||e&&n.__name}function d9(n){return Ct(n)&&"__vccOpts"in n}const Ge=(n,e)=>n8(n,e,th);function Da(n,e,t){const i=arguments.length;return i===2?gn(e)&&!yt(e)?Jp(e)?Re(n,null,[e]):Re(n,e):Re(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Jp(t)&&(t=[t]),Re(n,e,t))}const h9="3.5.17";/**
* @vue/runtime-dom v3.5.17
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let G1;const B2=typeof window<"u"&&window.trustedTypes;if(B2)try{G1=B2.createPolicy("vue",{createHTML:n=>n})}catch(n){}const zw=G1?n=>G1.createHTML(n):n=>n,f9="http://www.w3.org/2000/svg",p9="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,k2=bo&&bo.createElement("template"),m9={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?bo.createElementNS(f9,n):e==="mathml"?bo.createElementNS(p9,n):t?bo.createElement(n,{is:t}):bo.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>bo.createTextNode(n),createComment:n=>bo.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>bo.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{k2.innerHTML=zw(i==="svg"?"<svg>".concat(n,"</svg>"):i==="mathml"?"<math>".concat(n,"</math>"):n);const a=k2.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},ia="transition",Zu="animation",au=Symbol("_vtc"),Vw={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},g9=Jn({},d8,Vw),Ka=(n,e=[])=>{yt(n)?n.forEach(t=>t(...e)):n&&n(...e)},U2=n=>n?yt(n)?n.some(e=>e.length>1):n.length>1:!1;function y9(n){const e={};for(const L in n)L in Vw||(e[L]=n[L]);if(n.css===!1)return e;const{name:t="v",type:i,duration:r,enterFromClass:s="".concat(t,"-enter-from"),enterActiveClass:o="".concat(t,"-enter-active"),enterToClass:a="".concat(t,"-enter-to"),appearFromClass:l=s,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d="".concat(t,"-leave-from"),leaveActiveClass:h="".concat(t,"-leave-active"),leaveToClass:f="".concat(t,"-leave-to")}=n,p=v9(r),g=p&&p[0],y=p&&p[1],{onBeforeEnter:m,onEnter:v,onEnterCancelled:x,onLeave:_,onLeaveCancelled:S,onBeforeAppear:E=m,onAppear:A=v,onAppearCancelled:R=x}=e,w=(L,k,T,F)=>{L._enterCancelled=F,fa(L,k?u:a),fa(L,k?c:o),T&&T()},M=(L,k)=>{L._isLeaving=!1,fa(L,d),fa(L,f),fa(L,h),k&&k()},I=L=>(k,T)=>{const F=L?A:v,V=()=>w(k,L,T);Ka(F,[k,V]),z2(()=>{fa(k,L?l:s),Ls(k,L?u:a),U2(F)||V2(k,i,g,V)})};return Jn(e,{onBeforeEnter(L){Ka(m,[L]),Ls(L,s),Ls(L,o)},onBeforeAppear(L){Ka(E,[L]),Ls(L,l),Ls(L,c)},onEnter:I(!1),onAppear:I(!0),onLeave(L,k){L._isLeaving=!0;const T=()=>M(L,k);Ls(L,d),L._enterCancelled?(Ls(L,h),W1()):(W1(),Ls(L,h)),z2(()=>{L._isLeaving&&(fa(L,d),Ls(L,f),U2(_)||V2(L,i,y,T))}),Ka(_,[L,T])},onEnterCancelled(L){w(L,!1,void 0,!0),Ka(x,[L])},onAppearCancelled(L){w(L,!0,void 0,!0),Ka(R,[L])},onLeaveCancelled(L){M(L),Ka(S,[L])}})}function v9(n){if(n==null)return null;if(gn(n))return[q0(n.enter),q0(n.leave)];{const e=q0(n);return[e,e]}}function q0(n){return xI(n)}function Ls(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[au]||(n[au]=new Set)).add(e)}function fa(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[au];t&&(t.delete(e),t.size||(n[au]=void 0))}function z2(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let _9=0;function V2(n,e,t,i){const r=n._endId=++_9,s=()=>{r===n._endId&&i()};if(t!=null)return setTimeout(s,t);const{type:o,timeout:a,propCount:l}=Hw(n,e);if(!o)return i();const c=o+"end";let u=0;const d=()=>{n.removeEventListener(c,h),s()},h=f=>{f.target===n&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),n.addEventListener(c,h)}function Hw(n,e){const t=window.getComputedStyle(n),i=p=>(t[p]||"").split(", "),r=i("".concat(ia,"Delay")),s=i("".concat(ia,"Duration")),o=H2(r,s),a=i("".concat(Zu,"Delay")),l=i("".concat(Zu,"Duration")),c=H2(a,l);let u=null,d=0,h=0;e===ia?o>0&&(u=ia,d=o,h=s.length):e===Zu?c>0&&(u=Zu,d=c,h=l.length):(d=Math.max(o,c),u=d>0?o>c?ia:Zu:null,h=u?u===ia?s.length:l.length:0);const f=u===ia&&/\b(transform|all)(,|$)/.test(i("".concat(ia,"Property")).toString());return{type:u,timeout:d,propCount:h,hasTransform:f}}function H2(n,e){for(;n.length<e.length;)n=n.concat(n);return Math.max(...e.map((t,i)=>$2(t)+$2(n[i])))}function $2(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function W1(){return document.body.offsetHeight}function x9(n,e,t){const i=n[au];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const nm=Symbol("_vod"),$w=Symbol("_vsh"),im={beforeMount(n,{value:e},{transition:t}){n[nm]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Ju(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),Ju(n,!0),i.enter(n)):i.leave(n,()=>{Ju(n,!1)}):Ju(n,e))},beforeUnmount(n,{value:e}){Ju(n,e)}};function Ju(n,e){n.style.display=e?n[nm]:"none",n[$w]=!e}const S9=Symbol(""),A9=/(^|;)\s*display\s*:/;function b9(n,e,t){const i=n.style,r=wn(t);let s=!1;if(t&&!r){if(e)if(wn(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&vp(i,a,"")}else for(const o in e)t[o]==null&&vp(i,o,"");for(const o in t)o==="display"&&(s=!0),vp(i,o,t[o])}else if(r){if(e!==t){const o=i[S9];o&&(t+=";"+o),i.cssText=t,s=A9.test(t)}}else e&&n.removeAttribute("style");nm in n&&(n[nm]=s?i.display:"",n[$w]&&(i.display="none"))}const G2=/\s*!important$/;function vp(n,e,t){if(yt(t))t.forEach(i=>vp(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=T9(n,e);G2.test(t)?n.setProperty(Wl(i),t.replace(G2,""),"important"):n[i]=t}}const W2=["Webkit","Moz","ms"],X0={};function T9(n,e){const t=X0[e];if(t)return t;let i=ns(e);if(i!=="filter"&&i in n)return X0[e]=i;i=Hm(i);for(let r=0;r<W2.length;r++){const s=W2[r]+i;if(s in n)return X0[e]=s}return e}const Q2="http://www.w3.org/1999/xlink";function j2(n,e,t,i,r,s=CI(e)){i&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(Q2,e.slice(6,e.length)):n.setAttributeNS(Q2,e,t):t==null||s&&!DT(t)?n.removeAttribute(e):n.setAttribute(e,s?"":Ba(t)?String(t):t)}function q2(n,e,t,i,r){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?zw(t):t);return}const s=n.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?n.getAttribute("value")||"":n.value,l=t==null?n.type==="checkbox"?"on":"":String(t);(a!==l||!("_value"in n))&&(n.value=l),t==null&&n.removeAttribute(e),n._value=t;return}let o=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=DT(t):t==null&&a==="string"?(t="",o=!0):a==="number"&&(t=0,o=!0)}try{n[e]=t}catch(a){}o&&n.removeAttribute(r||e)}function w9(n,e,t,i){n.addEventListener(e,t,i)}function C9(n,e,t,i){n.removeEventListener(e,t,i)}const X2=Symbol("_vei");function E9(n,e,t,i,r=null){const s=n[X2]||(n[X2]={}),o=s[e];if(i&&o)o.value=i;else{const[a,l]=M9(e);if(i){const c=s[e]=N9(i,r);w9(n,a,c,l)}else o&&(C9(n,a,o,l),s[e]=void 0)}}const K2=/(?:Once|Passive|Capture)$/;function M9(n){let e;if(K2.test(n)){e={};let i;for(;i=n.match(K2);)n=n.slice(0,n.length-i[0].length),e[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):Wl(n.slice(2)),e]}let K0=0;const R9=Promise.resolve(),I9=()=>K0||(R9.then(()=>K0=0),K0=Date.now());function N9(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;As(P9(i,t.value),e,5,[i])};return t.value=n,t.attached=I9(),t}function P9(n,e){if(yt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const Y2=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,L9=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?x9(n,i,o):e==="style"?b9(n,t,i):Um(e)?Uv(e)||E9(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):D9(n,e,i,o))?(q2(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&j2(n,e,i,o,s,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!wn(i))?q2(n,ns(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),j2(n,e,i,o))};function D9(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Y2(e)&&Ct(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Y2(e)&&wn(t)?!1:e in n}const Gw=new WeakMap,Ww=new WeakMap,rm=Symbol("_moveCb"),Z2=Symbol("_enterCb"),F9=n=>(delete n.props.mode,n),O9=F9({name:"TransitionGroup",props:Jn({},g9,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=Wo(),i=u8();let r,s;return Zv(()=>{if(!r.length)return;const o=n.moveClass||"".concat(n.name||"v","-move");if(!z9(r[0].el,t.vnode.el,o)){r=[];return}r.forEach(B9),r.forEach(k9);const a=r.filter(U9);W1(),a.forEach(l=>{const c=l.el,u=c.style;Ls(c,o),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[rm]=h=>{h&&h.target!==c||(!h||/transform$/.test(h.propertyName))&&(c.removeEventListener("transitionend",d),c[rm]=null,fa(c,o))};c.addEventListener("transitionend",d)}),r=[]}),()=>{const o=Ot(n),a=y9(o);let l=o.tag||Hn;if(r=[],s)for(let c=0;c<s.length;c++){const u=s[c];u.el&&u.el instanceof Element&&(r.push(u),Zd(u,k1(u,a,i,t)),Gw.set(u,u.el.getBoundingClientRect()))}s=e.default?fw(e.default()):[];for(let c=0;c<s.length;c++){const u=s[c];u.key!=null&&Zd(u,k1(u,a,i,t))}return Re(l,null,s)}}}),Qw=O9;function B9(n){const e=n.el;e[rm]&&e[rm](),e[Z2]&&e[Z2]()}function k9(n){Ww.set(n,n.el.getBoundingClientRect())}function U9(n){const e=Gw.get(n),t=Ww.get(n),i=e.left-t.left,r=e.top-t.top;if(i||r){const s=n.el.style;return s.transform=s.webkitTransform="translate(".concat(i,"px,").concat(r,"px)"),s.transitionDuration="0s",n}}function z9(n,e,t){const i=n.cloneNode(),r=n[au];r&&r.forEach(a=>{a.split(/\s+/).forEach(l=>l&&i.classList.remove(l))}),t.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(i);const{hasTransform:o}=Hw(i);return s.removeChild(i),o}const V9=["ctrl","shift","alt","meta"],H9={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>V9.some(t=>n["".concat(t,"Key")]&&!e.includes(t))},pf=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(r,...s)=>{for(let o=0;o<e.length;o++){const a=H9[e[o]];if(a&&a(r,e))return}return n(r,...s)})},$9=Jn({patchProp:L9},m9);let J2;function jw(){return J2||(J2=U8($9))}const eS=(...n)=>{jw().render(...n)},G9=(...n)=>{const e=jw().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=Q9(i);if(!r)return;const s=e._component;!Ct(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,W9(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function W9(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function Q9(n){return wn(n)?document.querySelector(n):n}/*!
* pinia v3.0.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let qw;const Km=n=>qw=n,Xw=Symbol();function Q1(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var Fd;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(Fd||(Fd={}));function j9(){const n=Hv(!0),e=n.run(()=>Dn({}));let t=[],i=[];const r=Kv({install(s){Km(r),r._a=s,s.provide(Xw,r),s.config.globalProperties.$pinia=r,i.forEach(o=>t.push(o)),i=[]},use(s){return this._a?t.push(s):i.push(s),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return r}const Kw=()=>{};function tS(n,e,t,i=Kw){n.push(e);const r=()=>{const s=n.indexOf(e);s>-1&&(n.splice(s,1),i())};return!t&&kT()&&EI(r),r}function Jl(n,...e){n.slice().forEach(t=>{t(...e)})}const q9=n=>n(),nS=Symbol(),Y0=Symbol();function j1(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],r=n[t];Q1(r)&&Q1(i)&&n.hasOwnProperty(t)&&!bn(i)&&!Uo(i)?n[t]=j1(r,i):n[t]=i}return n}const X9=Symbol();function K9(n){return!Q1(n)||!Object.prototype.hasOwnProperty.call(n,X9)}const{assign:pa}=Object;function Y9(n){return!!(bn(n)&&n.effect)}function Z9(n,e,t,i){const{state:r,actions:s,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=r?r():{});const u=YI(t.state.value[n]);return pa(u,s,Object.keys(o||{}).reduce((d,h)=>(d[h]=Kv(Ge(()=>{Km(t);const f=t._s.get(n);return o[h].call(f,f)})),d),{}))}return l=Yw(n,c,e,t,i,!0),l}function Yw(n,e,t={},i,r,s){let o;const a=pa({actions:{}},t),l={deep:!0};let c,u,d=[],h=[],f;const p=i.state.value[n];!s&&!p&&(i.state.value[n]={}),Dn({});let g;function y(R){let w;c=u=!1,typeof R=="function"?(R(i.state.value[n]),w={type:Fd.patchFunction,storeId:n,events:f}):(j1(i.state.value[n],R),w={type:Fd.patchObject,payload:R,storeId:n,events:f});const M=g=Symbol();Ph().then(()=>{g===M&&(c=!0)}),u=!0,Jl(d,w,i.state.value[n])}const m=s?function(){const{state:w}=t,M=w?w():{};this.$patch(I=>{pa(I,M)})}:Kw;function v(){o.stop(),d=[],h=[],i._s.delete(n)}const x=(R,w="")=>{if(nS in R)return R[Y0]=w,R;const M=function(){Km(i);const I=Array.from(arguments),L=[],k=[];function T(Q){L.push(Q)}function F(Q){k.push(Q)}Jl(h,{args:I,name:M[Y0],store:S,after:T,onError:F});let V;try{V=R.apply(this&&this.$id===n?this:S,I)}catch(Q){throw Jl(k,Q),Q}return V instanceof Promise?V.then(Q=>(Jl(L,Q),Q)).catch(Q=>(Jl(k,Q),Promise.reject(Q))):(Jl(L,V),V)};return M[nS]=!0,M[Y0]=w,M},_={_p:i,$id:n,$onAction:tS.bind(null,h),$patch:y,$reset:m,$subscribe(R,w={}){const M=tS(d,R,w.detached,()=>I()),I=o.run(()=>ci(()=>i.state.value[n],L=>{(w.flush==="sync"?u:c)&&R({storeId:n,type:Fd.direct,events:f},L)},pa({},l,w)));return M},$dispose:v},S=Ys(_);i._s.set(n,S);const A=(i._a&&i._a.runWithContext||q9)(()=>i._e.run(()=>(o=Hv()).run(()=>e({action:x}))));for(const R in A){const w=A[R];if(bn(w)&&!Y9(w)||Uo(w))s||(p&&K9(w)&&(bn(w)?w.value=p[R]:j1(w,p[R])),i.state.value[n][R]=w);else if(typeof w=="function"){const M=x(w,R);A[R]=M,a.actions[R]=w}}return pa(S,A),pa(Ot(S),A),Object.defineProperty(S,"$state",{get:()=>i.state.value[n],set:R=>{y(w=>{pa(w,R)})}}),i._p.forEach(R=>{pa(S,o.run(()=>R({store:S,app:i._a,pinia:i,options:a})))}),p&&s&&t.hydrate&&t.hydrate(S.$state,p),c=!0,u=!0,S}/*! #__NO_SIDE_EFFECTS__ */function Zw(n,e,t){let i;const r=typeof e=="function";i=r?t:e;function s(o,a){const l=P8();return o=o||(l?Ji(Xw,null):null),o&&Km(o),o=qw,o._s.has(n)||(r?Yw(n,e,i,o):Z9(n,i,o)),o._s.get(n)}return s.$id=n,s}function sm(n){const e=Ot(n),t={};for(const i in e){const r=e[i];r.effect?t[i]=Ge({get:()=>n[i],set(s){n[i]=s}}):(bn(r)||Uo(r))&&(t[i]=e8(n,i))}return t}function s_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Z0={exports:{}},iS;function J9(){return iS||(iS=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function s(l,c,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new r(u,d||l,h),p=t?t+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],f]:l._events[p].push(f):(l._events[p]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new i:delete l._events[c]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)e.call(u,d)&&c.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=t?t+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,p=new Array(f);h<f;h++)p[h]=d[h].fn;return p},a.prototype.listenerCount=function(c){var u=t?t+c:c,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(c,u,d,h,f,p){var g=t?t+c:c;if(!this._events[g])return!1;var y=this._events[g],m=arguments.length,v,x;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),m){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,u),!0;case 3:return y.fn.call(y.context,u,d),!0;case 4:return y.fn.call(y.context,u,d,h),!0;case 5:return y.fn.call(y.context,u,d,h,f),!0;case 6:return y.fn.call(y.context,u,d,h,f,p),!0}for(x=1,v=new Array(m-1);x<m;x++)v[x-1]=arguments[x];y.fn.apply(y.context,v)}else{var _=y.length,S;for(x=0;x<_;x++)switch(y[x].once&&this.removeListener(c,y[x].fn,void 0,!0),m){case 1:y[x].fn.call(y[x].context);break;case 2:y[x].fn.call(y[x].context,u);break;case 3:y[x].fn.call(y[x].context,u,d);break;case 4:y[x].fn.call(y[x].context,u,d,h);break;default:if(!v)for(S=1,v=new Array(m-1);S<m;S++)v[S-1]=arguments[S];y[x].fn.apply(y[x].context,v)}}return!0},a.prototype.on=function(c,u,d){return s(this,c,u,d,!1)},a.prototype.once=function(c,u,d){return s(this,c,u,d,!0)},a.prototype.removeListener=function(c,u,d,h){var f=t?t+c:c;if(!this._events[f])return this;if(!u)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===u&&(!h||p.once)&&(!d||p.context===d)&&o(this,f);else{for(var g=0,y=[],m=p.length;g<m;g++)(p[g].fn!==u||h&&!p[g].once||d&&p[g].context!==d)&&y.push(p[g]);y.length?this._events[f]=y.length===1?y[0]:y:o(this,f)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=t?t+c:c,this._events[u]&&o(this,u)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a}(Z0)),Z0.exports}var eN=J9();const o_=s_(eN);var xr=(n=>(n.ErrorReceived="ErrorReceived",n.MessageReceived="MessageReceived",n.StartSpeech="StartSpeech",n.EndSpeech="EndSpeech",n.StateChanged="StateChanged",n))(xr||{}),Kr=(n=>(n.WS_CLOSE="WS_CLOSE",n.WS_ERROR="WS_ERROR",n.WS_MESSAGE="WS_MESSAGE",n.WS_OPEN="WS_OPEN",n))(Kr||{}),Bl=(n=>(n.Player_EndSpeaking="Player_EndSpeaking",n.Player_NoLegacy="Player_NoLegacy",n.Player_StartSpeaking="Player_StartSpeaking",n.Player_WaitNextAudioClip="Player_WaitNextAudioClip",n))(Bl||{}),q1=(n=>(n.Change_Status="Change_Status",n.Chat_BinsizeError="Chat_BinsizeError",n))(q1||{});class tN extends o_{constructor(t){super();xe(this,"engine");xe(this,"_inited",!1);this._init(t)}_init(t){this._inited||(this._inited=!0,this.engine=new WebSocket(t),this.engine.addEventListener("error",i=>{this.emit(Kr.WS_ERROR,i)}),this.engine.addEventListener("open",()=>{this.emit(Kr.WS_OPEN)}),this.engine.addEventListener("message",i=>{this.emit(Kr.WS_MESSAGE,i.data)}),this.engine.addEventListener("close",()=>{this.emit(Kr.WS_CLOSE)}))}send(t){var i;(i=this.engine)==null||i.send(t)}stop(){var t;this.emit(Kr.WS_CLOSE),this._inited=!1,(t=this.engine)==null||t.close()}}var ma=(n=>(n.Idle="Idle",n.Listening="Listening",n.Responding="Responding",n.Thinking="Thinking",n))(ma||{}),qi=(n=>(n.closed="closed",n.open="open",n.waiting="waiting",n))(qi||{});class Jw extends Error{constructor(e){super(e),this.name="TimeoutError"}}class nN extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const rS=n=>globalThis.DOMException===void 0?new nN(n):new DOMException(n),sS=n=>{const e=n.reason===void 0?rS("This operation was aborted."):n.reason;return e instanceof Error?e:rS(e)};function iN(n,e){const{milliseconds:t,fallback:i,message:r,customTimers:s={setTimeout,clearTimeout}}=e;let o,a;const c=new Promise((u,d)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError("Expected `milliseconds` to be a positive number, got `".concat(t,"`"));if(e.signal){const{signal:f}=e;f.aborted&&d(sS(f)),a=()=>{d(sS(f))},f.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){n.then(u,d);return}const h=new Jw;o=s.setTimeout.call(void 0,()=>{if(i){try{u(i())}catch(f){d(f)}return}typeof n.cancel=="function"&&n.cancel(),r===!1?u():r instanceof Error?d(r):(h.message=r!=null?r:"Promise timed out after ".concat(t," milliseconds"),d(h))},t),(async()=>{try{u(await n)}catch(f){d(f)}})()}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{s.clearTimeout.call(void 0,o),o=void 0},c}function rN(n,e,t){let i=0,r=n.length;for(;r>0;){const s=Math.trunc(r/2);let o=i+s;t(n[o],e)<=0?(i=++o,r-=s+1):r=s}return i}var Gr;class sN{constructor(){ri(this,Gr,[])}enqueue(e,t){t={priority:0,...t};const i={priority:t.priority,id:t.id,run:e};if(this.size===0||dt(this,Gr)[this.size-1].priority>=t.priority){dt(this,Gr).push(i);return}const r=rN(dt(this,Gr),i,(s,o)=>o.priority-s.priority);dt(this,Gr).splice(r,0,i)}setPriority(e,t){const i=dt(this,Gr).findIndex(s=>s.id===e);if(i===-1)throw new ReferenceError('No promise function with the id "'.concat(e,'" exists in the queue.'));const[r]=dt(this,Gr).splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){const e=dt(this,Gr).shift();return e==null?void 0:e.run}filter(e){return dt(this,Gr).filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return dt(this,Gr).length}}Gr=new WeakMap;var eu,tu,Sa,Eh,nu,Mh,Wr,iu,Qi,Rh,Qr,ru,Io,Ih,Om,Gt,e5,t5,n5,i5,r5,_p,X1,K1,xp,s5,Sp;class oN extends o_{constructor(t){var i,r,s,o;super();ri(this,Gt);ri(this,eu);ri(this,tu);ri(this,Sa,0);ri(this,Eh);ri(this,nu);ri(this,Mh,0);ri(this,Wr);ri(this,iu);ri(this,Qi);ri(this,Rh);ri(this,Qr,0);ri(this,ru);ri(this,Io);ri(this,Ih);ri(this,Om,BigInt(1));xe(this,"timeout");if(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:sN,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat((r=(i=t.intervalCap)==null?void 0:i.toString())!=null?r:"","` (").concat(typeof t.intervalCap,")"));if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat((o=(s=t.interval)==null?void 0:s.toString())!=null?o:"","` (").concat(typeof t.interval,")"));En(this,eu,t.carryoverConcurrencyCount),En(this,tu,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0),En(this,Eh,t.intervalCap),En(this,nu,t.interval),En(this,Qi,new t.queueClass),En(this,Rh,t.queueClass),this.concurrency=t.concurrency,this.timeout=t.timeout,En(this,Ih,t.throwOnTimeout===!0),En(this,Io,t.autoStart===!1)}get concurrency(){return dt(this,ru)}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(t,"` (").concat(typeof t,")"));En(this,ru,t),hi(this,Gt,xp).call(this)}setPriority(t,i){dt(this,Qi).setPriority(t,i)}async add(t,i={}){var r;return(r=i.id)!=null||(i.id=(Ku(this,Om)._++).toString()),i={timeout:this.timeout,throwOnTimeout:dt(this,Ih),...i},new Promise((s,o)=>{dt(this,Qi).enqueue(async()=>{var a;Ku(this,Qr)._++,Ku(this,Sa)._++;try{(a=i.signal)==null||a.throwIfAborted();let l=t({signal:i.signal});i.timeout&&(l=iN(Promise.resolve(l),{milliseconds:i.timeout})),i.signal&&(l=Promise.race([l,hi(this,Gt,s5).call(this,i.signal)]));const c=await l;s(c),this.emit("completed",c)}catch(l){if(l instanceof Jw&&!i.throwOnTimeout){s();return}o(l),this.emit("error",l)}finally{hi(this,Gt,n5).call(this)}},i),this.emit("add"),hi(this,Gt,_p).call(this)})}async addAll(t,i){return Promise.all(t.map(async r=>this.add(r,i)))}start(){return dt(this,Io)?(En(this,Io,!1),hi(this,Gt,xp).call(this),this):this}pause(){En(this,Io,!0)}clear(){En(this,Qi,new(dt(this,Rh)))}async onEmpty(){dt(this,Qi).size!==0&&await hi(this,Gt,Sp).call(this,"empty")}async onSizeLessThan(t){dt(this,Qi).size<t||await hi(this,Gt,Sp).call(this,"next",()=>dt(this,Qi).size<t)}async onIdle(){dt(this,Qr)===0&&dt(this,Qi).size===0||await hi(this,Gt,Sp).call(this,"idle")}get size(){return dt(this,Qi).size}sizeBy(t){return dt(this,Qi).filter(t).length}get pending(){return dt(this,Qr)}get isPaused(){return dt(this,Io)}}eu=new WeakMap,tu=new WeakMap,Sa=new WeakMap,Eh=new WeakMap,nu=new WeakMap,Mh=new WeakMap,Wr=new WeakMap,iu=new WeakMap,Qi=new WeakMap,Rh=new WeakMap,Qr=new WeakMap,ru=new WeakMap,Io=new WeakMap,Ih=new WeakMap,Om=new WeakMap,Gt=new WeakSet,e5=function(){return dt(this,tu)||dt(this,Sa)<dt(this,Eh)},t5=function(){return dt(this,Qr)<dt(this,ru)},n5=function(){Ku(this,Qr)._--,hi(this,Gt,_p).call(this),this.emit("next")},i5=function(){hi(this,Gt,K1).call(this),hi(this,Gt,X1).call(this),En(this,iu,void 0)},r5=function(){const t=Date.now();if(dt(this,Wr)===void 0){const i=dt(this,Mh)-t;if(i<0)En(this,Sa,dt(this,eu)?dt(this,Qr):0);else return dt(this,iu)===void 0&&En(this,iu,setTimeout(()=>{hi(this,Gt,i5).call(this)},i)),!0}return!1},_p=function(){if(dt(this,Qi).size===0)return dt(this,Wr)&&clearInterval(dt(this,Wr)),En(this,Wr,void 0),this.emit("empty"),dt(this,Qr)===0&&this.emit("idle"),!1;if(!dt(this,Io)){const t=!dt(this,Gt,r5);if(dt(this,Gt,e5)&&dt(this,Gt,t5)){const i=dt(this,Qi).dequeue();return i?(this.emit("active"),i(),t&&hi(this,Gt,X1).call(this),!0):!1}}return!1},X1=function(){dt(this,tu)||dt(this,Wr)!==void 0||(En(this,Wr,setInterval(()=>{hi(this,Gt,K1).call(this)},dt(this,nu))),En(this,Mh,Date.now()+dt(this,nu)))},K1=function(){dt(this,Sa)===0&&dt(this,Qr)===0&&dt(this,Wr)&&(clearInterval(dt(this,Wr)),En(this,Wr,void 0)),En(this,Sa,dt(this,eu)?dt(this,Qr):0),hi(this,Gt,xp).call(this)},xp=function(){for(;hi(this,Gt,_p).call(this););},s5=async function(t){return new Promise((i,r)=>{t.addEventListener("abort",()=>{r(t.reason)},{once:!0})})},Sp=async function(t,i){return new Promise(r=>{const s=()=>{i&&!i()||(this.off(t,s),r())};this.on(t,s)})};var ed={},oS;function o5(){if(oS)return ed;oS=1,ed.byteLength=a,ed.toByteArray=c,ed.fromByteArray=h;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=i.length;r<s;++r)n[r]=i[r],e[i.charCodeAt(r)]=r;e[45]=62,e[95]=63;function o(f){var p=f.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=p);var y=g===p?0:4-g%4;return[g,y]}function a(f){var p=o(f),g=p[0],y=p[1];return(g+y)*3/4-y}function l(f,p,g){return(p+g)*3/4-g}function c(f){var p,g=o(f),y=g[0],m=g[1],v=new t(l(f,y,m)),x=0,_=m>0?y-4:y,S;for(S=0;S<_;S+=4)p=e[f.charCodeAt(S)]<<18|e[f.charCodeAt(S+1)]<<12|e[f.charCodeAt(S+2)]<<6|e[f.charCodeAt(S+3)],v[x++]=p>>16&255,v[x++]=p>>8&255,v[x++]=p&255;return m===2&&(p=e[f.charCodeAt(S)]<<2|e[f.charCodeAt(S+1)]>>4,v[x++]=p&255),m===1&&(p=e[f.charCodeAt(S)]<<10|e[f.charCodeAt(S+1)]<<4|e[f.charCodeAt(S+2)]>>2,v[x++]=p>>8&255,v[x++]=p&255),v}function u(f){return n[f>>18&63]+n[f>>12&63]+n[f>>6&63]+n[f&63]}function d(f,p,g){for(var y,m=[],v=p;v<g;v+=3)y=(f[v]<<16&16711680)+(f[v+1]<<8&65280)+(f[v+2]&255),m.push(u(y));return m.join("")}function h(f){for(var p,g=f.length,y=g%3,m=[],v=16383,x=0,_=g-y;x<_;x+=v)m.push(d(f,x,x+v>_?_:x+v));return y===1?(p=f[g-1],m.push(n[p>>2]+n[p<<4&63]+"==")):y===2&&(p=(f[g-2]<<8)+f[g-1],m.push(n[p>>10]+n[p>>4&63]+n[p<<2&63]+"=")),m.join("")}return ed}o5();var J0={},mf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var aS;function aN(){return aS||(aS=1,mf.read=function(n,e,t,i,r){var s,o,a=r*8-i-1,l=(1<<a)-1,c=l>>1,u=-7,d=t?r-1:0,h=t?-1:1,f=n[e+d];for(d+=h,s=f&(1<<-u)-1,f>>=-u,u+=a;u>0;s=s*256+n[e+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=o*256+n[e+d],d+=h,u-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-c}return(f?-1:1)*o*Math.pow(2,s-i)},mf.write=function(n,e,t,i,r,s){var o,a,l,c=s*8-r-1,u=(1<<c)-1,d=u>>1,h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:s-1,p=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?e+=h/l:e+=h*Math.pow(2,1-d),e*l>=2&&(o++,l/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(e*l-1)*Math.pow(2,r),o=o+d):(a=e*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;n[t+f]=a&255,f+=p,a/=256,r-=8);for(o=o<<r|a,c+=r;c>0;n[t+f]=o&255,f+=p,o/=256,c-=8);n[t+f-p]|=g*128}),mf}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/var lS;function a5(){return lS||(lS=1,function(n){const e=o5(),t=aN(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=a,n.SlowBuffer=v,n.INSPECT_MAX_BYTES=50;const r=2147483647;n.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const z=new Uint8Array(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,Uint8Array.prototype),Object.setPrototypeOf(z,C),z.foo()===42}catch(z){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(z){if(z>r)throw new RangeError('The value "'+z+'" is invalid for option "size"');const C=new Uint8Array(z);return Object.setPrototypeOf(C,a.prototype),C}function a(z,C,N){if(typeof z=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(z)}return l(z,C,N)}a.poolSize=8192;function l(z,C,N){if(typeof z=="string")return h(z,C);if(ArrayBuffer.isView(z))return p(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(D(z,ArrayBuffer)||z&&D(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(D(z,SharedArrayBuffer)||z&&D(z.buffer,SharedArrayBuffer)))return g(z,C,N);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const q=z.valueOf&&z.valueOf();if(q!=null&&q!==z)return a.from(q,C,N);const Z=y(z);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return a.from(z[Symbol.toPrimitive]("string"),C,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}a.from=function(z,C,N){return l(z,C,N)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function u(z,C,N){return c(z),z<=0?o(z):C!==void 0?typeof N=="string"?o(z).fill(C,N):o(z).fill(C):o(z)}a.alloc=function(z,C,N){return u(z,C,N)};function d(z){return c(z),o(z<0?0:m(z)|0)}a.allocUnsafe=function(z){return d(z)},a.allocUnsafeSlow=function(z){return d(z)};function h(z,C){if((typeof C!="string"||C==="")&&(C="utf8"),!a.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const N=x(z,C)|0;let q=o(N);const Z=q.write(z,C);return Z!==N&&(q=q.slice(0,Z)),q}function f(z){const C=z.length<0?0:m(z.length)|0,N=o(C);for(let q=0;q<C;q+=1)N[q]=z[q]&255;return N}function p(z){if(D(z,Uint8Array)){const C=new Uint8Array(z);return g(C.buffer,C.byteOffset,C.byteLength)}return f(z)}function g(z,C,N){if(C<0||z.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<C+(N||0))throw new RangeError('"length" is outside of buffer bounds');let q;return C===void 0&&N===void 0?q=new Uint8Array(z):N===void 0?q=new Uint8Array(z,C):q=new Uint8Array(z,C,N),Object.setPrototypeOf(q,a.prototype),q}function y(z){if(a.isBuffer(z)){const C=m(z.length)|0,N=o(C);return N.length===0||z.copy(N,0,0,C),N}if(z.length!==void 0)return typeof z.length!="number"||W(z.length)?o(0):f(z);if(z.type==="Buffer"&&Array.isArray(z.data))return f(z.data)}function m(z){if(z>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return z|0}function v(z){return+z!=z&&(z=0),a.alloc(+z)}a.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==a.prototype},a.compare=function(C,N){if(D(C,Uint8Array)&&(C=a.from(C,C.offset,C.byteLength)),D(N,Uint8Array)&&(N=a.from(N,N.offset,N.byteLength)),!a.isBuffer(C)||!a.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===N)return 0;let q=C.length,Z=N.length;for(let $=0,ae=Math.min(q,Z);$<ae;++$)if(C[$]!==N[$]){q=C[$],Z=N[$];break}return q<Z?-1:Z<q?1:0},a.isEncoding=function(C){switch(String(C).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(C,N){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return a.alloc(0);let q;if(N===void 0)for(N=0,q=0;q<C.length;++q)N+=C[q].length;const Z=a.allocUnsafe(N);let $=0;for(q=0;q<C.length;++q){let ae=C[q];if(D(ae,Uint8Array))$+ae.length>Z.length?(a.isBuffer(ae)||(ae=a.from(ae)),ae.copy(Z,$)):Uint8Array.prototype.set.call(Z,ae,$);else if(a.isBuffer(ae))ae.copy(Z,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=ae.length}return Z};function x(z,C){if(a.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||D(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);const N=z.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&N===0)return 0;let Z=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return H(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return j(z).length;default:if(Z)return q?-1:H(z).length;C=(""+C).toLowerCase(),Z=!0}}a.byteLength=x;function _(z,C,N){let q=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,C>>>=0,N<=C))return"";for(z||(z="utf8");;)switch(z){case"hex":return se(this,C,N);case"utf8":case"utf-8":return T(this,C,N);case"ascii":return Q(this,C,N);case"latin1":case"binary":return ee(this,C,N);case"base64":return k(this,C,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,C,N);default:if(q)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),q=!0}}a.prototype._isBuffer=!0;function S(z,C,N){const q=z[C];z[C]=z[N],z[N]=q}a.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<C;N+=2)S(this,N,N+1);return this},a.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<C;N+=4)S(this,N,N+3),S(this,N+1,N+2);return this},a.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<C;N+=8)S(this,N,N+7),S(this,N+1,N+6),S(this,N+2,N+5),S(this,N+3,N+4);return this},a.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?T(this,0,C):_.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(C){if(!a.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:a.compare(this,C)===0},a.prototype.inspect=function(){let C="";const N=n.INSPECT_MAX_BYTES;return C=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(C+=" ... "),"<Buffer "+C+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(C,N,q,Z,$){if(D(C,Uint8Array)&&(C=a.from(C,C.offset,C.byteLength)),!a.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(N===void 0&&(N=0),q===void 0&&(q=C?C.length:0),Z===void 0&&(Z=0),$===void 0&&($=this.length),N<0||q>C.length||Z<0||$>this.length)throw new RangeError("out of range index");if(Z>=$&&N>=q)return 0;if(Z>=$)return-1;if(N>=q)return 1;if(N>>>=0,q>>>=0,Z>>>=0,$>>>=0,this===C)return 0;let ae=$-Z,ke=q-N;const Le=Math.min(ae,ke),Ve=this.slice(Z,$),Je=C.slice(N,q);for(let st=0;st<Le;++st)if(Ve[st]!==Je[st]){ae=Ve[st],ke=Je[st];break}return ae<ke?-1:ke<ae?1:0};function E(z,C,N,q,Z){if(z.length===0)return-1;if(typeof N=="string"?(q=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,W(N)&&(N=Z?0:z.length-1),N<0&&(N=z.length+N),N>=z.length){if(Z)return-1;N=z.length-1}else if(N<0)if(Z)N=0;else return-1;if(typeof C=="string"&&(C=a.from(C,q)),a.isBuffer(C))return C.length===0?-1:A(z,C,N,q,Z);if(typeof C=="number")return C=C&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(z,C,N):Uint8Array.prototype.lastIndexOf.call(z,C,N):A(z,[C],N,q,Z);throw new TypeError("val must be string, number or Buffer")}function A(z,C,N,q,Z){let $=1,ae=z.length,ke=C.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(z.length<2||C.length<2)return-1;$=2,ae/=2,ke/=2,N/=2}function Le(Je,st){return $===1?Je[st]:Je.readUInt16BE(st*$)}let Ve;if(Z){let Je=-1;for(Ve=N;Ve<ae;Ve++)if(Le(z,Ve)===Le(C,Je===-1?0:Ve-Je)){if(Je===-1&&(Je=Ve),Ve-Je+1===ke)return Je*$}else Je!==-1&&(Ve-=Ve-Je),Je=-1}else for(N+ke>ae&&(N=ae-ke),Ve=N;Ve>=0;Ve--){let Je=!0;for(let st=0;st<ke;st++)if(Le(z,Ve+st)!==Le(C,st)){Je=!1;break}if(Je)return Ve}return-1}a.prototype.includes=function(C,N,q){return this.indexOf(C,N,q)!==-1},a.prototype.indexOf=function(C,N,q){return E(this,C,N,q,!0)},a.prototype.lastIndexOf=function(C,N,q){return E(this,C,N,q,!1)};function R(z,C,N,q){N=Number(N)||0;const Z=z.length-N;q?(q=Number(q),q>Z&&(q=Z)):q=Z;const $=C.length;q>$/2&&(q=$/2);let ae;for(ae=0;ae<q;++ae){const ke=parseInt(C.substr(ae*2,2),16);if(W(ke))return ae;z[N+ae]=ke}return ae}function w(z,C,N,q){return B(H(C,z.length-N),z,N,q)}function M(z,C,N,q){return B(P(C),z,N,q)}function I(z,C,N,q){return B(j(C),z,N,q)}function L(z,C,N,q){return B(U(C,z.length-N),z,N,q)}a.prototype.write=function(C,N,q,Z){if(N===void 0)Z="utf8",q=this.length,N=0;else if(q===void 0&&typeof N=="string")Z=N,q=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(q)?(q=q>>>0,Z===void 0&&(Z="utf8")):(Z=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-N;if((q===void 0||q>$)&&(q=$),C.length>0&&(q<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let ae=!1;for(;;)switch(Z){case"hex":return R(this,C,N,q);case"utf8":case"utf-8":return w(this,C,N,q);case"ascii":case"latin1":case"binary":return M(this,C,N,q);case"base64":return I(this,C,N,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,C,N,q);default:if(ae)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),ae=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(z,C,N){return C===0&&N===z.length?e.fromByteArray(z):e.fromByteArray(z.slice(C,N))}function T(z,C,N){N=Math.min(z.length,N);const q=[];let Z=C;for(;Z<N;){const $=z[Z];let ae=null,ke=$>239?4:$>223?3:$>191?2:1;if(Z+ke<=N){let Le,Ve,Je,st;switch(ke){case 1:$<128&&(ae=$);break;case 2:Le=z[Z+1],(Le&192)===128&&(st=($&31)<<6|Le&63,st>127&&(ae=st));break;case 3:Le=z[Z+1],Ve=z[Z+2],(Le&192)===128&&(Ve&192)===128&&(st=($&15)<<12|(Le&63)<<6|Ve&63,st>2047&&(st<55296||st>57343)&&(ae=st));break;case 4:Le=z[Z+1],Ve=z[Z+2],Je=z[Z+3],(Le&192)===128&&(Ve&192)===128&&(Je&192)===128&&(st=($&15)<<18|(Le&63)<<12|(Ve&63)<<6|Je&63,st>65535&&st<1114112&&(ae=st))}}ae===null?(ae=65533,ke=1):ae>65535&&(ae-=65536,q.push(ae>>>10&1023|55296),ae=56320|ae&1023),q.push(ae),Z+=ke}return V(q)}const F=4096;function V(z){const C=z.length;if(C<=F)return String.fromCharCode.apply(String,z);let N="",q=0;for(;q<C;)N+=String.fromCharCode.apply(String,z.slice(q,q+=F));return N}function Q(z,C,N){let q="";N=Math.min(z.length,N);for(let Z=C;Z<N;++Z)q+=String.fromCharCode(z[Z]&127);return q}function ee(z,C,N){let q="";N=Math.min(z.length,N);for(let Z=C;Z<N;++Z)q+=String.fromCharCode(z[Z]);return q}function se(z,C,N){const q=z.length;(!C||C<0)&&(C=0),(!N||N<0||N>q)&&(N=q);let Z="";for(let $=C;$<N;++$)Z+=G[z[$]];return Z}function he(z,C,N){const q=z.slice(C,N);let Z="";for(let $=0;$<q.length-1;$+=2)Z+=String.fromCharCode(q[$]+q[$+1]*256);return Z}a.prototype.slice=function(C,N){const q=this.length;C=~~C,N=N===void 0?q:~~N,C<0?(C+=q,C<0&&(C=0)):C>q&&(C=q),N<0?(N+=q,N<0&&(N=0)):N>q&&(N=q),N<C&&(N=C);const Z=this.subarray(C,N);return Object.setPrototypeOf(Z,a.prototype),Z};function ie(z,C,N){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+C>N)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(C,N,q){C=C>>>0,N=N>>>0,q||ie(C,N,this.length);let Z=this[C],$=1,ae=0;for(;++ae<N&&($*=256);)Z+=this[C+ae]*$;return Z},a.prototype.readUintBE=a.prototype.readUIntBE=function(C,N,q){C=C>>>0,N=N>>>0,q||ie(C,N,this.length);let Z=this[C+--N],$=1;for(;N>0&&($*=256);)Z+=this[C+--N]*$;return Z},a.prototype.readUint8=a.prototype.readUInt8=function(C,N){return C=C>>>0,N||ie(C,1,this.length),this[C]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(C,N){return C=C>>>0,N||ie(C,2,this.length),this[C]|this[C+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(C,N){return C=C>>>0,N||ie(C,2,this.length),this[C]<<8|this[C+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},a.prototype.readBigUInt64LE=X(function(C){C=C>>>0,ne(C,"offset");const N=this[C],q=this[C+7];(N===void 0||q===void 0)&&b(C,this.length-8);const Z=N+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,$=this[++C]+this[++C]*2**8+this[++C]*2**16+q*2**24;return BigInt(Z)+(BigInt($)<<BigInt(32))}),a.prototype.readBigUInt64BE=X(function(C){C=C>>>0,ne(C,"offset");const N=this[C],q=this[C+7];(N===void 0||q===void 0)&&b(C,this.length-8);const Z=N*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],$=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+q;return(BigInt(Z)<<BigInt(32))+BigInt($)}),a.prototype.readIntLE=function(C,N,q){C=C>>>0,N=N>>>0,q||ie(C,N,this.length);let Z=this[C],$=1,ae=0;for(;++ae<N&&($*=256);)Z+=this[C+ae]*$;return $*=128,Z>=$&&(Z-=Math.pow(2,8*N)),Z},a.prototype.readIntBE=function(C,N,q){C=C>>>0,N=N>>>0,q||ie(C,N,this.length);let Z=N,$=1,ae=this[C+--Z];for(;Z>0&&($*=256);)ae+=this[C+--Z]*$;return $*=128,ae>=$&&(ae-=Math.pow(2,8*N)),ae},a.prototype.readInt8=function(C,N){return C=C>>>0,N||ie(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},a.prototype.readInt16LE=function(C,N){C=C>>>0,N||ie(C,2,this.length);const q=this[C]|this[C+1]<<8;return q&32768?q|4294901760:q},a.prototype.readInt16BE=function(C,N){C=C>>>0,N||ie(C,2,this.length);const q=this[C+1]|this[C]<<8;return q&32768?q|4294901760:q},a.prototype.readInt32LE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},a.prototype.readInt32BE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},a.prototype.readBigInt64LE=X(function(C){C=C>>>0,ne(C,"offset");const N=this[C],q=this[C+7];(N===void 0||q===void 0)&&b(C,this.length-8);const Z=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(q<<24);return(BigInt(Z)<<BigInt(32))+BigInt(N+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),a.prototype.readBigInt64BE=X(function(C){C=C>>>0,ne(C,"offset");const N=this[C],q=this[C+7];(N===void 0||q===void 0)&&b(C,this.length-8);const Z=(N<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(Z)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+q)}),a.prototype.readFloatLE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),t.read(this,C,!0,23,4)},a.prototype.readFloatBE=function(C,N){return C=C>>>0,N||ie(C,4,this.length),t.read(this,C,!1,23,4)},a.prototype.readDoubleLE=function(C,N){return C=C>>>0,N||ie(C,8,this.length),t.read(this,C,!0,52,8)},a.prototype.readDoubleBE=function(C,N){return C=C>>>0,N||ie(C,8,this.length),t.read(this,C,!1,52,8)};function re(z,C,N,q,Z,$){if(!a.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>Z||C<$)throw new RangeError('"value" argument is out of bounds');if(N+q>z.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(C,N,q,Z){if(C=+C,N=N>>>0,q=q>>>0,!Z){const ke=Math.pow(2,8*q)-1;re(this,C,N,q,ke,0)}let $=1,ae=0;for(this[N]=C&255;++ae<q&&($*=256);)this[N+ae]=C/$&255;return N+q},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(C,N,q,Z){if(C=+C,N=N>>>0,q=q>>>0,!Z){const ke=Math.pow(2,8*q)-1;re(this,C,N,q,ke,0)}let $=q-1,ae=1;for(this[N+$]=C&255;--$>=0&&(ae*=256);)this[N+$]=C/ae&255;return N+q},a.prototype.writeUint8=a.prototype.writeUInt8=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,1,255,0),this[N]=C&255,N+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,2,65535,0),this[N]=C&255,this[N+1]=C>>>8,N+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,2,65535,0),this[N]=C>>>8,this[N+1]=C&255,N+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,4,4294967295,0),this[N+3]=C>>>24,this[N+2]=C>>>16,this[N+1]=C>>>8,this[N]=C&255,N+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,4,4294967295,0),this[N]=C>>>24,this[N+1]=C>>>16,this[N+2]=C>>>8,this[N+3]=C&255,N+4};function be(z,C,N,q,Z){te(C,q,Z,z,N,7);let $=Number(C&BigInt(4294967295));z[N++]=$,$=$>>8,z[N++]=$,$=$>>8,z[N++]=$,$=$>>8,z[N++]=$;let ae=Number(C>>BigInt(32)&BigInt(4294967295));return z[N++]=ae,ae=ae>>8,z[N++]=ae,ae=ae>>8,z[N++]=ae,ae=ae>>8,z[N++]=ae,N}function le(z,C,N,q,Z){te(C,q,Z,z,N,7);let $=Number(C&BigInt(4294967295));z[N+7]=$,$=$>>8,z[N+6]=$,$=$>>8,z[N+5]=$,$=$>>8,z[N+4]=$;let ae=Number(C>>BigInt(32)&BigInt(4294967295));return z[N+3]=ae,ae=ae>>8,z[N+2]=ae,ae=ae>>8,z[N+1]=ae,ae=ae>>8,z[N]=ae,N+8}a.prototype.writeBigUInt64LE=X(function(C,N=0){return be(this,C,N,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=X(function(C,N=0){return le(this,C,N,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(C,N,q,Z){if(C=+C,N=N>>>0,!Z){const Le=Math.pow(2,8*q-1);re(this,C,N,q,Le-1,-Le)}let $=0,ae=1,ke=0;for(this[N]=C&255;++$<q&&(ae*=256);)C<0&&ke===0&&this[N+$-1]!==0&&(ke=1),this[N+$]=(C/ae>>0)-ke&255;return N+q},a.prototype.writeIntBE=function(C,N,q,Z){if(C=+C,N=N>>>0,!Z){const Le=Math.pow(2,8*q-1);re(this,C,N,q,Le-1,-Le)}let $=q-1,ae=1,ke=0;for(this[N+$]=C&255;--$>=0&&(ae*=256);)C<0&&ke===0&&this[N+$+1]!==0&&(ke=1),this[N+$]=(C/ae>>0)-ke&255;return N+q},a.prototype.writeInt8=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,1,127,-128),C<0&&(C=255+C+1),this[N]=C&255,N+1},a.prototype.writeInt16LE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,2,32767,-32768),this[N]=C&255,this[N+1]=C>>>8,N+2},a.prototype.writeInt16BE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,2,32767,-32768),this[N]=C>>>8,this[N+1]=C&255,N+2},a.prototype.writeInt32LE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,4,2147483647,-2147483648),this[N]=C&255,this[N+1]=C>>>8,this[N+2]=C>>>16,this[N+3]=C>>>24,N+4},a.prototype.writeInt32BE=function(C,N,q){return C=+C,N=N>>>0,q||re(this,C,N,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[N]=C>>>24,this[N+1]=C>>>16,this[N+2]=C>>>8,this[N+3]=C&255,N+4},a.prototype.writeBigInt64LE=X(function(C,N=0){return be(this,C,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=X(function(C,N=0){return le(this,C,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(z,C,N,q,Z,$){if(N+q>z.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Te(z,C,N,q,Z){return C=+C,N=N>>>0,Z||fe(z,C,N,4),t.write(z,C,N,q,23,4),N+4}a.prototype.writeFloatLE=function(C,N,q){return Te(this,C,N,!0,q)},a.prototype.writeFloatBE=function(C,N,q){return Te(this,C,N,!1,q)};function Ce(z,C,N,q,Z){return C=+C,N=N>>>0,Z||fe(z,C,N,8),t.write(z,C,N,q,52,8),N+8}a.prototype.writeDoubleLE=function(C,N,q){return Ce(this,C,N,!0,q)},a.prototype.writeDoubleBE=function(C,N,q){return Ce(this,C,N,!1,q)},a.prototype.copy=function(C,N,q,Z){if(!a.isBuffer(C))throw new TypeError("argument should be a Buffer");if(q||(q=0),!Z&&Z!==0&&(Z=this.length),N>=C.length&&(N=C.length),N||(N=0),Z>0&&Z<q&&(Z=q),Z===q||C.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),C.length-N<Z-q&&(Z=C.length-N+q);const $=Z-q;return this===C&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,q,Z):Uint8Array.prototype.set.call(C,this.subarray(q,Z),N),$},a.prototype.fill=function(C,N,q,Z){if(typeof C=="string"){if(typeof N=="string"?(Z=N,N=0,q=this.length):typeof q=="string"&&(Z=q,q=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!a.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(C.length===1){const ae=C.charCodeAt(0);(Z==="utf8"&&ae<128||Z==="latin1")&&(C=ae)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(N<0||this.length<N||this.length<q)throw new RangeError("Out of range index");if(q<=N)return this;N=N>>>0,q=q===void 0?this.length:q>>>0,C||(C=0);let $;if(typeof C=="number")for($=N;$<q;++$)this[$]=C;else{const ae=a.isBuffer(C)?C:a.from(C,Z),ke=ae.length;if(ke===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for($=0;$<q-N;++$)this[$+N]=ae[$%ke]}return this};const Ie={};function ze(z,C,N){Ie[z]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(z,"]"),this.stack,delete this.name}get code(){return z}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return"".concat(this.name," [").concat(z,"]: ").concat(this.message)}}}ze("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?"".concat(z," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),ze("ERR_INVALID_ARG_TYPE",function(z,C){return'The "'.concat(z,'" argument must be of type number. Received type ').concat(typeof C)},TypeError),ze("ERR_OUT_OF_RANGE",function(z,C,N){let q='The value of "'.concat(z,'" is out of range.'),Z=N;return Number.isInteger(N)&&Math.abs(N)>2**32?Z=Be(String(N)):typeof N=="bigint"&&(Z=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(Z=Be(Z)),Z+="n"),q+=" It must be ".concat(C,". Received ").concat(Z),q},RangeError);function Be(z){let C="",N=z.length;const q=z[0]==="-"?1:0;for(;N>=q+4;N-=3)C="_".concat(z.slice(N-3,N)).concat(C);return"".concat(z.slice(0,N)).concat(C)}function it(z,C,N){ne(C,"offset"),(z[C]===void 0||z[C+N]===void 0)&&b(C,z.length-(N+1))}function te(z,C,N,q,Z,$){if(z>N||z<C){const ae=typeof C=="bigint"?"n":"";let ke;throw C===0||C===BigInt(0)?ke=">= 0".concat(ae," and < 2").concat(ae," ** ").concat(($+1)*8).concat(ae):ke=">= -(2".concat(ae," ** ").concat(($+1)*8-1).concat(ae,") and < 2 ** ")+"".concat(($+1)*8-1).concat(ae),new Ie.ERR_OUT_OF_RANGE("value",ke,z)}it(q,Z,$)}function ne(z,C){if(typeof z!="number")throw new Ie.ERR_INVALID_ARG_TYPE(C,"number",z)}function b(z,C,N){throw Math.floor(z)!==z?(ne(z,N),new Ie.ERR_OUT_OF_RANGE("offset","an integer",z)):C<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE("offset",">= 0 and <= ".concat(C),z)}const oe=/[^+/0-9A-Za-z-_]/g;function J(z){if(z=z.split("=")[0],z=z.trim().replace(oe,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function H(z,C){C=C||1/0;let N;const q=z.length;let Z=null;const $=[];for(let ae=0;ae<q;++ae){if(N=z.charCodeAt(ae),N>55295&&N<57344){if(!Z){if(N>56319){(C-=3)>-1&&$.push(239,191,189);continue}else if(ae+1===q){(C-=3)>-1&&$.push(239,191,189);continue}Z=N;continue}if(N<56320){(C-=3)>-1&&$.push(239,191,189),Z=N;continue}N=(Z-55296<<10|N-56320)+65536}else Z&&(C-=3)>-1&&$.push(239,191,189);if(Z=null,N<128){if((C-=1)<0)break;$.push(N)}else if(N<2048){if((C-=2)<0)break;$.push(N>>6|192,N&63|128)}else if(N<65536){if((C-=3)<0)break;$.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((C-=4)<0)break;$.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return $}function P(z){const C=[];for(let N=0;N<z.length;++N)C.push(z.charCodeAt(N)&255);return C}function U(z,C){let N,q,Z;const $=[];for(let ae=0;ae<z.length&&!((C-=2)<0);++ae)N=z.charCodeAt(ae),q=N>>8,Z=N%256,$.push(Z),$.push(q);return $}function j(z){return e.toByteArray(J(z))}function B(z,C,N,q){let Z;for(Z=0;Z<q&&!(Z+N>=C.length||Z>=z.length);++Z)C[Z+N]=z[Z];return Z}function D(z,C){return z instanceof C||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===C.name}function W(z){return z!==z}const G=function(){const z="0123456789abcdef",C=new Array(256);for(let N=0;N<16;++N){const q=N*16;for(let Z=0;Z<16;++Z)C[q+Z]=z[N]+z[Z]}return C}();function X(z){return typeof BigInt>"u"?ue:z}function ue(){throw new Error("BigInt not supported")}}(J0)),J0}var lN=a5(),eg,cS;function cN(){if(cS)return eg;cS=1;const n=(f,p,g)=>{const y=f.indexOf(0,p),m=Math.min(p+g,y===-1?f.length:y);return f.slice(p,m).toString("utf8")},e=(f,p,g,y)=>{const m=p.write(f,g,y,"utf8");m<y&&p.fill(0,g+m,g+y)},t=(f,p,g)=>{let y=f[0];return y>=g&&(y=g-1),p++,f.slice(p,p+y).toString("utf8")},i=(f,p,g,y)=>{let m=Buffer.alloc(f,"utf8"),v=m.length;v>=y&&(v=y-1),v>255&&(v=255),m[g]=v,m.copy(p,g+1,0,v),p.fill(0,g+1+v,g+y)},r=(f,p)=>f.readUInt32LE(p,!0),s=(f,p)=>f.readUInt32BE(p,!0),o=(f,p)=>f.readInt32LE(p,!0),a=(f,p)=>f.readInt32BE(p,!0),l=(f,p,g)=>{p.writeUInt32LE(f,g,!0)},c=(f,p,g)=>{p.writeUInt32BE(f,g,!0)},u=(f,p,g)=>{p.writeInt32LE(f,g,!0)},d=(f,p,g)=>{p.writeInt32BE(f,g,!0)};function h(f){const p=f.Buffer,g=f.isLittleEndian===void 0?!0:!!f.isLittleEndian,y=f.is64bit===void 0?!0:!!f.is64bit,m=f.unpackUInt64LE,v=f.unpackUInt64BE,x=f.unpackInt64LE,_=f.unpackInt64BE,S=f.packUInt64LE,E=f.packUInt64BE,A=f.packInt64LE,R=f.packInt64BE,w={x:[1,1,null,null],c:[1,1,(T,F)=>String.fromCharCode(T[F]),(T,F,V)=>{F[V]=T.charCodeAt(0)}],b:[1,1,(T,F)=>T.readInt8(F),(T,F,V)=>{F.writeInt8(T,V,!0)}],B:[1,1,(T,F)=>T[F],(T,F,V)=>{F[V]=T}],h:[2,2,g?(T,F)=>T.readInt16LE(F):(T,F)=>T.readInt16BE(F),g?(T,F,V)=>F.writeInt16LE(T,V,!0):(T,F,V)=>F.writeInt16BE(T,V,!0)],H:[2,2,g?(T,F)=>T.readUInt16LE(F):(T,F)=>T.readUInt16BE(F),g?(T,F,V)=>F.writeUInt16LE(T,V,!0):(T,F,V)=>F.writeUInt16BE(T,V,!0)],i:[4,4,g?o:a,g?u:d],I:[4,4,g?r:s,g?l:c],l:[4,4,g?o:a,g?u:d],L:[4,4,g?r:s,g?l:c],f:[4,4,g?(T,F)=>T.readFloatLE(F):(T,F)=>T.readFloatBE(F),g?(T,F,V)=>F.writeFloatLE(T,V,!0):(T,F,V)=>F.writeFloatBE(T,V,!0)],d:[8,8,g?(T,F)=>T.readDoubleLE(F):(T,F)=>T.readDoubleBE(F),g?(T,F,V)=>F.writeDoubleLE(T,V,!0):(T,F,V)=>F.writeDoubleBE(T,V,!0)],s:[1,1,n,e],p:[1,1,t,i],P:[y?8:4,y?8:4,g?y?m:r:y?v:s,g?y?S:l:y?E:c],q:[8,8,g?x:_,g?A:R],Q:[8,8,g?m:v,g?S:E],"?":[1,1,(T,F)=>T[F]!==0,(T,F,V)=>{F[V]=T?1:0}]},M={x:[1,1,null,null],c:[1,1,(T,F)=>String.fromCharCode(T[F]),(T,F,V)=>{F[V]=T.charCodeAt(0)}],b:[1,1,(T,F)=>T.readInt8(F),(T,F,V)=>{F.writeInt8(T,V,!0)}],B:[1,1,(T,F)=>T[F],(T,F,V)=>{F[V]=T}],h:[2,1,(T,F)=>T.readInt16LE(F),(T,F,V)=>F.writeInt16LE(T,V,!0)],H:[2,1,(T,F)=>T.readUInt16LE(F),(T,F,V)=>F.writeUInt16LE(T,V,!0)],i:[4,1,o,u],I:[4,1,r,l],l:[4,1,o,u],L:[4,1,r,l],f:[4,1,(T,F)=>T.readFloatLE(F),(T,F,V)=>F.writeFloatLE(T,V,!0)],d:[8,1,(T,F)=>T.readDoubleLE(F),(T,F,V)=>F.writeDoubleLE(T,V,!0)],s:[1,1,n,e],p:[1,1,t,i],P:[y?8:4,1,y?m:r,y?S:l],q:[8,1,x,A],Q:[8,1,m,S],"?":[1,1,(T,F)=>T[F]!==0,(T,F,V)=>{F[V]=T?1:0}]},I={x:[1,1,null,null],c:[1,1,(T,F)=>String.fromCharCode(T[F]),(T,F,V)=>{F[V]=T.charCodeAt(0)}],b:[1,1,(T,F)=>T.readInt8(F),(T,F,V)=>{F.writeInt8(T,V,!0)}],B:[1,1,(T,F)=>T[F],(T,F,V)=>{F[V]=T}],h:[2,1,(T,F)=>T.readInt16BE(F),(T,F,V)=>F.writeInt16BE(T,V,!0)],H:[2,1,(T,F)=>T.readUInt16BE(F),(T,F,V)=>F.writeUInt16BE(T,V,!0)],i:[4,1,a,d],I:[4,1,s,c],l:[4,1,a,d],L:[4,1,s,c],f:[4,1,(T,F)=>T.readFloatBE(F),(T,F,V)=>F.writeFloatBE(T,V,!0)],d:[8,1,(T,F)=>T.readDoubleBE(F),(T,F,V)=>F.writeDoubleBE(T,V,!0)],s:[1,1,n,e],p:[1,1,t,i],P:[y?8:4,1,y?v:s,y?E:c],q:[8,1,_,R],Q:[8,1,v,E],"?":[1,1,(T,F)=>T[F]!==0,(T,F,V)=>{F[V]=T?1:0}]};let L=T=>{let F=T[0],V=!0,Q=w;switch(F){case"<":Q=M;break;case">":case"!":Q=I;break;case"=":Q=g?M:I;break;default:V=!1;case"@":Q=w;break}return{map:Q,skipFirst:V}};class k{static sizeOf(F){let V=0,Q=null,ee=0,se,he,ie,re,be=L(F),le=be.map;for(be.skipFirst&&ee++,he=F.length;ee<he;ee++){if(se=F[ee],se>="0"&&se<="9"){Q=Q===null?se:Q+se;continue}ie=le[se],ie&&(re=ie[1],re>1&&(V=Math.ceil(V/re)*re),Q=Q?parseInt(Q,10):0,se==="s"?V+=Q||0:se==="p"?V+=Q||1:V+=ie[0]*(Q||1),Q=null)}return V}static unpack(F,V,Q){return k.unpackFrom(F,V,Q,0)}static unpackFrom(F,V,Q,ee){let se=[],he=null,ie=0,re=L(F),be=re.map;re.skipFirst&&ie++;for(const le=F.length;ie<le;ie++){let fe=F[ie];if(fe>="0"&&fe<="9"){he=he===null?fe:he+fe;continue}const Te=be[fe];if(!Te)continue;let Ce=Te[0];const Ie=Te[1];Ie>1&&(ee=Math.ceil(ee/Ie)*Ie),he=he?parseInt(he,10):0;let ze;fe==="s"?(ze=1,Ce=he):fe==="p"?(ze=1,Ce=he||1):ze=he||1;let Be=Te[2];for(;ze>0;){if(Be){if(Q&&ee+Ce>=V.length)throw new Error("Reached end of buffer, can't unpack anymore data.");se.push(Be(V,ee,he))}ee+=Ce,ze--}he=null}return se}static pack(F,V,Q){Array.isArray(V)||(V=Array.prototype.slice.call(arguments,1),Q=!0);let ee=p.alloc(k.sizeOf(F)),se=0,he=null,ie=0,re=0,be=L(F),le=be.map;be.skipFirst&&ie++;for(const fe=F.length;ie<fe;ie++){let Te=F[ie];if(Te>="0"&&Te<="9"){he=he===null?Te:he+Te;continue}const Ce=le[Te];if(!Ce)continue;let Ie=Ce[0];const ze=Ce[1];ze>1&&(se=Math.ceil(se/ze)*ze),he=he?parseInt(he,10):0;let Be;Te==="s"?(Be=1,Ie=he):Te==="p"?(Be=1,Ie=he||1):Be=he||1;let it=Ce[3];for(;Be>0;){if(it){if(Q&&re>=V.length)throw new Error("Reached end of data, no more elements to pack.");it(V[re],ee,se,he),re++}se+=Ie,Be--}he=null}return ee}}return k}return eg=h,eg}var tg,uS;function uN(){if(uS)return tg;uS=1,tg=e;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(M){}function e(M,I,L){this.low=M|0,this.high=I|0,this.unsigned=!!L}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0});function t(M){return(M&&M.__isLong__)===!0}e.isLong=t;var i={},r={};function s(M,I){var L,k,T;return I?(M>>>=0,(T=0<=M&&M<256)&&(k=r[M],k)?k:(L=a(M,(M|0)<0?-1:0,!0),T&&(r[M]=L),L)):(M|=0,(T=-128<=M&&M<128)&&(k=i[M],k)?k:(L=a(M,M<0?-1:0,!1),T&&(i[M]=L),L))}e.fromInt=s;function o(M,I){if(isNaN(M))return I?v:m;if(I){if(M<0)return v;if(M>=p)return A}else{if(M<=-g)return R;if(M+1>=g)return E}return M<0?o(-M,I).neg():a(M%f|0,M/f|0,I)}e.fromNumber=o;function a(M,I,L){return new e(M,I,L)}e.fromBits=a;var l=Math.pow;function c(M,I,L){if(M.length===0)throw Error("empty string");if(M==="NaN"||M==="Infinity"||M==="+Infinity"||M==="-Infinity")return m;if(typeof I=="number"?(L=I,I=!1):I=!!I,L=L||10,L<2||36<L)throw RangeError("radix");var k;if((k=M.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return c(M.substring(1),I,L).neg();for(var T=o(l(L,8)),F=m,V=0;V<M.length;V+=8){var Q=Math.min(8,M.length-V),ee=parseInt(M.substring(V,V+Q),L);if(Q<8){var se=o(l(L,Q));F=F.mul(se).add(o(ee))}else F=F.mul(T),F=F.add(o(ee))}return F.unsigned=I,F}e.fromString=c;function u(M,I){return typeof M=="number"?o(M,I):typeof M=="string"?c(M,I):a(M.low,M.high,typeof I=="boolean"?I:M.unsigned)}e.fromValue=u;var d=65536,h=1<<24,f=d*d,p=f*f,g=p/2,y=s(h),m=s(0);e.ZERO=m;var v=s(0,!0);e.UZERO=v;var x=s(1);e.ONE=x;var _=s(1,!0);e.UONE=_;var S=s(-1);e.NEG_ONE=S;var E=a(-1,2147483647,!1);e.MAX_VALUE=E;var A=a(-1,-1,!0);e.MAX_UNSIGNED_VALUE=A;var R=a(0,-2147483648,!1);e.MIN_VALUE=R;var w=e.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},w.toString=function(I){if(I=I||10,I<2||36<I)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(R)){var L=o(I),k=this.div(L),T=k.mul(L).sub(this);return k.toString(I)+T.toInt().toString(I)}else return"-"+this.neg().toString(I);for(var F=o(l(I,6),this.unsigned),V=this,Q="";;){var ee=V.div(F),se=V.sub(ee.mul(F)).toInt()>>>0,he=se.toString(I);if(V=ee,V.isZero())return he+Q;for(;he.length<6;)he="0"+he;Q=""+he+Q}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var I=this.high!=0?this.high:this.low,L=31;L>0&&(I&1<<L)==0;L--);return this.high!=0?L+33:L+1},w.isZero=function(){return this.high===0&&this.low===0},w.eqz=w.isZero,w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return(this.low&1)===1},w.isEven=function(){return(this.low&1)===0},w.equals=function(I){return t(I)||(I=u(I)),this.unsigned!==I.unsigned&&this.high>>>31===1&&I.high>>>31===1?!1:this.high===I.high&&this.low===I.low},w.eq=w.equals,w.notEquals=function(I){return!this.eq(I)},w.neq=w.notEquals,w.ne=w.notEquals,w.lessThan=function(I){return this.comp(I)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(I){return this.comp(I)<=0},w.lte=w.lessThanOrEqual,w.le=w.lessThanOrEqual,w.greaterThan=function(I){return this.comp(I)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(I){return this.comp(I)>=0},w.gte=w.greaterThanOrEqual,w.ge=w.greaterThanOrEqual,w.compare=function(I){if(t(I)||(I=u(I)),this.eq(I))return 0;var L=this.isNegative(),k=I.isNegative();return L&&!k?-1:!L&&k?1:this.unsigned?I.high>>>0>this.high>>>0||I.high===this.high&&I.low>>>0>this.low>>>0?-1:1:this.sub(I).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(x)},w.neg=w.negate,w.add=function(I){t(I)||(I=u(I));var L=this.high>>>16,k=this.high&65535,T=this.low>>>16,F=this.low&65535,V=I.high>>>16,Q=I.high&65535,ee=I.low>>>16,se=I.low&65535,he=0,ie=0,re=0,be=0;return be+=F+se,re+=be>>>16,be&=65535,re+=T+ee,ie+=re>>>16,re&=65535,ie+=k+Q,he+=ie>>>16,ie&=65535,he+=L+V,he&=65535,a(re<<16|be,he<<16|ie,this.unsigned)},w.subtract=function(I){return t(I)||(I=u(I)),this.add(I.neg())},w.sub=w.subtract,w.multiply=function(I){if(this.isZero())return m;if(t(I)||(I=u(I)),n){var L=n.mul(this.low,this.high,I.low,I.high);return a(L,n.get_high(),this.unsigned)}if(I.isZero())return m;if(this.eq(R))return I.isOdd()?R:m;if(I.eq(R))return this.isOdd()?R:m;if(this.isNegative())return I.isNegative()?this.neg().mul(I.neg()):this.neg().mul(I).neg();if(I.isNegative())return this.mul(I.neg()).neg();if(this.lt(y)&&I.lt(y))return o(this.toNumber()*I.toNumber(),this.unsigned);var k=this.high>>>16,T=this.high&65535,F=this.low>>>16,V=this.low&65535,Q=I.high>>>16,ee=I.high&65535,se=I.low>>>16,he=I.low&65535,ie=0,re=0,be=0,le=0;return le+=V*he,be+=le>>>16,le&=65535,be+=F*he,re+=be>>>16,be&=65535,be+=V*se,re+=be>>>16,be&=65535,re+=T*he,ie+=re>>>16,re&=65535,re+=F*se,ie+=re>>>16,re&=65535,re+=V*ee,ie+=re>>>16,re&=65535,ie+=k*he+T*se+F*ee+V*Q,ie&=65535,a(be<<16|le,ie<<16|re,this.unsigned)},w.mul=w.multiply,w.divide=function(I){if(t(I)||(I=u(I)),I.isZero())throw Error("division by zero");if(n){if(!this.unsigned&&this.high===-2147483648&&I.low===-1&&I.high===-1)return this;var L=(this.unsigned?n.div_u:n.div_s)(this.low,this.high,I.low,I.high);return a(L,n.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?v:m;var k,T,F;if(this.unsigned){if(I.unsigned||(I=I.toUnsigned()),I.gt(this))return v;if(I.gt(this.shru(1)))return _;F=v}else{if(this.eq(R)){if(I.eq(x)||I.eq(S))return R;if(I.eq(R))return x;var V=this.shr(1);return k=V.div(I).shl(1),k.eq(m)?I.isNegative()?x:S:(T=this.sub(I.mul(k)),F=k.add(T.div(I)),F)}else if(I.eq(R))return this.unsigned?v:m;if(this.isNegative())return I.isNegative()?this.neg().div(I.neg()):this.neg().div(I).neg();if(I.isNegative())return this.div(I.neg()).neg();F=m}for(T=this;T.gte(I);){k=Math.max(1,Math.floor(T.toNumber()/I.toNumber()));for(var Q=Math.ceil(Math.log(k)/Math.LN2),ee=Q<=48?1:l(2,Q-48),se=o(k),he=se.mul(I);he.isNegative()||he.gt(T);)k-=ee,se=o(k,this.unsigned),he=se.mul(I);se.isZero()&&(se=x),F=F.add(se),T=T.sub(he)}return F},w.div=w.divide,w.modulo=function(I){if(t(I)||(I=u(I)),n){var L=(this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,I.low,I.high);return a(L,n.get_high(),this.unsigned)}return this.sub(this.div(I).mul(I))},w.mod=w.modulo,w.rem=w.modulo,w.not=function(){return a(~this.low,~this.high,this.unsigned)},w.and=function(I){return t(I)||(I=u(I)),a(this.low&I.low,this.high&I.high,this.unsigned)},w.or=function(I){return t(I)||(I=u(I)),a(this.low|I.low,this.high|I.high,this.unsigned)},w.xor=function(I){return t(I)||(I=u(I)),a(this.low^I.low,this.high^I.high,this.unsigned)},w.shiftLeft=function(I){return t(I)&&(I=I.toInt()),(I&=63)===0?this:I<32?a(this.low<<I,this.high<<I|this.low>>>32-I,this.unsigned):a(0,this.low<<I-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(I){return t(I)&&(I=I.toInt()),(I&=63)===0?this:I<32?a(this.low>>>I|this.high<<32-I,this.high>>I,this.unsigned):a(this.high>>I-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(I){if(t(I)&&(I=I.toInt()),I&=63,I===0)return this;var L=this.high;if(I<32){var k=this.low;return a(k>>>I|L<<32-I,L>>>I,this.unsigned)}else return I===32?a(L,0,this.unsigned):a(L>>>I-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.shr_u=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},w.toBytes=function(I){return I?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var I=this.high,L=this.low;return[L&255,L>>>8&255,L>>>16&255,L>>>24,I&255,I>>>8&255,I>>>16&255,I>>>24]},w.toBytesBE=function(){var I=this.high,L=this.low;return[I>>>24,I>>>16&255,I>>>8&255,I&255,L>>>24,L>>>16&255,L>>>8&255,L&255]},e.fromBytes=function(I,L,k){return k?e.fromBytesLE(I,L):e.fromBytesBE(I,L)},e.fromBytesLE=function(I,L){return new e(I[0]|I[1]<<8|I[2]<<16|I[3]<<24,I[4]|I[5]<<8|I[6]<<16|I[7]<<24,L)},e.fromBytesBE=function(I,L){return new e(I[4]<<24|I[5]<<16|I[6]<<8|I[7],I[0]<<24|I[1]<<16|I[2]<<8|I[3],L)},tg}var ng,dS;function dN(){if(dS)return ng;dS=1;const n=uN(),e=(a,l)=>n.fromBits(a.readInt32LE(l),a.readInt32LE(l+4),!0),t=(a,l)=>n.fromBits(a.readInt32BE(l+4),a.readInt32BE(l),!0),i=(a,l)=>n.fromBits(a.readInt32LE(l),a.readInt32LE(l+4),!1),r=(a,l)=>n.fromBits(a.readInt32BE(l+4),a.readInt32BE(l),!1),s=(a,l,c)=>{a instanceof n||(typeof a=="number"?a=n.fromNumber(a):a=n.fromString(a||"")),l.writeInt32LE(a.getLowBits(),c,!0),l.writeInt32LE(a.getHighBits(),c+4,!0)},o=(a,l,c)=>{a instanceof n||(typeof a=="number"?a=n.fromNumber(a):a=n.fromString(a||"")),l.writeInt32BE(a.getHighBits(),c,!0),l.writeInt32BE(a.getLowBits(),c+4,!0)};return ng={unpackUInt64LE:e,unpackUInt64BE:t,unpackInt64LE:i,unpackInt64BE:r,packUInt64LE:s,packUInt64BE:o,packInt64LE:s,packInt64BE:o},ng}var ig,hS;function hN(){return hS||(hS=1,ig=cN()(Object.assign({Buffer:a5().Buffer,isLittleEndian:typeof Uint8Array!==void 0?new Uint8Array(new Uint32Array([305419896]).buffer)[0]===120:!0,is64bit:typeof navigator!==void 0?/WOW64|Win64|arm64|ia64|x64;|Mac OS X/i.test(navigator.userAgent):!0},dN()))),ig}var fN=hN();const pN=s_(fN),mN=async function(n,e="<II"){const t=await n.slice(4,12).arrayBuffer(),[i,r]=pN.unpack(e,lN.Buffer.from(t)),s=await n.slice(12,12+i).text();return{parsedData:JSON.parse(s),jsonSize:i,binSize:r}},gN="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let yN=(n=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)e+=gN[t[n]&63];return e};class a_{constructor(e,t){xe(this,"id",yN());xe(this,"analyserNode");xe(this,"audioCtx");xe(this,"autoPlay",!0);xe(this,"bufferSource");xe(this,"convertValue",32768);xe(this,"ee");xe(this,"gainNode");xe(this,"option",{inputCodec:"Int16",channels:1,sampleRate:8e3,fftSize:2048,onended:()=>{},isMute:!1});xe(this,"samplesList",[]);xe(this,"startTime");xe(this,"typedArray");xe(this,"_firstStartRelativeTime");xe(this,"_firstStartAbsoluteTime");this.ee=t,this.init(e)}static isTypedArray(e){return e.byteLength&&e.buffer&&e.buffer.constructor===ArrayBuffer||e.constructor===ArrayBuffer}async continue(){await this.audioCtx.resume()}destroy(){var e;this.samplesList=[],(e=this.audioCtx)==null||e.close(),this.audioCtx=void 0}feed(e){let{audio:t}=e;const{end_of_batch:i}=e;if(!t)return;this._isSupported(t),t=this._getFormattedValue(t);const r=new Float32Array(t.length);r.set(t,0);const s={data:r,end_of_batch:i};this.samplesList.push(s),this.flush(s,this.samplesList.length-1)}flush(e,t){if(!(e&&this.autoPlay&&this.audioCtx))return;const{data:i,end_of_batch:r}=e;this.bufferSource&&(this.bufferSource.onended=()=>{}),this.bufferSource=this.audioCtx.createBufferSource(),typeof this.option.onended=="function"&&(this.bufferSource.onended=()=>{!r&&t===this.samplesList.length-1&&this.ee.emit(Bl.Player_WaitNextAudioClip),this.option.onended()});const s=i.length/this.option.channels,o=this.audioCtx.createBuffer(this.option.channels,s,this.option.sampleRate);for(let a=0;a<this.option.channels;a++){const l=o.getChannelData(a);let c=a,u=50;for(let d=0;d<s;d++)l[d]=i[c],d<50&&(l[d]=l[d]*d/50),d>=s-51&&(l[d]=l[d]*u--/50),c+=this.option.channels}this.startTime<this.audioCtx.currentTime&&(this.startTime=this.audioCtx.currentTime),this.bufferSource.buffer=o,this.bufferSource.connect(this.gainNode),this.bufferSource.connect(this.analyserNode),this.bufferSource.start(this.startTime),e.startTime=this.startTime,this._firstStartAbsoluteTime===void 0&&(this._firstStartAbsoluteTime=Date.now()),this._firstStartRelativeTime===void 0&&(this._firstStartRelativeTime=this.startTime,this.ee.emit(Bl.Player_StartSpeaking,this)),this.startTime+=o.duration}init(e){this.option=Object.assign(this.option,e),this.convertValue=this._getConvertValue(),this.typedArray=this._getTypedArray(),this.initAudioContext()}initAudioContext(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=this.option.isMute?0:1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime,this.analyserNode=this.audioCtx.createAnalyser(),this.analyserNode.fftSize=this.option.fftSize}setMute(e){this.gainNode.gain.value=e?0:1}async pause(){await this.audioCtx.suspend()}async updateAutoPlay(e){this.autoPlay!==e&&e?(this.autoPlay=e,this.samplesList.forEach((t,i)=>{this.flush(t,i)})):this.autoPlay=e}volume(e){this.gainNode.gain.value=e}_getFormattedValue(e){const t=this.typedArray;e.constructor===ArrayBuffer?e=new t(e):e=new t(e.buffer);const i=new Float32Array(e.length);for(let r=0;r<e.length;r++)i[r]=e[r]/this.convertValue;return i}_isSupported(e){if(!a_.isTypedArray(e))throw new Error("请传入ArrayBuffer或者任意TypedArray");return!0}_getConvertValue(){const e={Int8:128,Int16:32768,Int32:2147483648,Float32:1};if(!e[this.option.inputCodec])throw new Error("wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32");return e[this.option.inputCodec]}_getTypedArray(){const e={Int8:Int8Array,Int16:Int16Array,Int32:Int32Array,Float32:Float32Array};if(!e[this.option.inputCodec])throw new Error("wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32");return e[this.option.inputCodec]}}const vN={int16:"Int16",int32:"Int32",float32:"Float32"},_N={int16:Int16Array,int32:Int32Array,float32:Float32Array};class xN{constructor(e){xe(this,"ee");xe(this,"_motionDataGroupHandlerQueue",new oN({concurrency:1}));xe(this,"_motionDataGroups",[]);xe(this,"_arkit_face_sample_rate");xe(this,"_arkit_face_channel_names");xe(this,"_tts2face_sample_rate");xe(this,"_tts2face_channel_names");xe(this,"_maxBatchId");xe(this,"_arkitFaceShape");xe(this,"_tts2FaceShape");this.ee=e}add(e){const{avatar_motion_data:t}=e;this._motionDataGroupHandlerQueue.add(async()=>await this._motionDataGroupHandler(t))}clear(){this._motionDataGroups.forEach(e=>{var t;(t=e.player)==null||t.destroy()}),this._motionDataGroups=[]}setMute(e){this._motionDataGroups.forEach(t=>{var i;(i=t.player)==null||i.setMute(e)})}getArkitFaceFrame(){return{arkitFace:this._getArkitFaceFrame()}}getLastBatchId(){let e;return this._motionDataGroups.forEach(t=>{t.batch_id&&(e=t.batch_id)}),e}getTtt2FaceFrame(){return{tts2Face:this._getTts2FaceFrame()}}interrupt(){this._motionDataGroups.forEach(e=>{var t;e.batch_id&&(this._maxBatchId=e.batch_id),(t=e.player)==null||t.destroy()}),this._motionDataGroups=[]}_getArkitFaceFrame(){if(!this._motionDataGroups.length)return null;const e=this._motionDataGroups.find(r=>r.player);if(!e)return null;const{arkitFaceArrayBufferArray:t,player:i}=e;if(i&&i._firstStartAbsoluteTime&&t&&t.length>0&&this._arkitFaceShape&&this._arkit_face_sample_rate){const r=Date.now()-i._firstStartAbsoluteTime;let s=0,o;i.samplesList.forEach((h,f)=>{o===void 0&&h.startTime!==void 0&&(o=h.startTime),h.startTime!==void 0&&h.startTime-o<=r/1e3&&(s=f)});const a=i.samplesList[s],l=r-a.startTime*1e3,c=Math.floor(l/1e3*this._arkit_face_sample_rate),u=new Float32Array(t[s]),d=u==null?void 0:u.slice(c*this._arkitFaceShape,c*this._arkitFaceShape+this._arkitFaceShape);if(d!=null&&d.length){const h={};return(this._arkit_face_channel_names||[]).forEach((p,g)=>{Object.assign(h,{[p]:d[g]})}),h}return null}return null}_getTts2FaceFrame(){if(!this._motionDataGroups.length)return null;const e=this._motionDataGroups.find(r=>r.player);if(!e)return null;const{tts2faceArrayBufferArray:t,player:i}=e;if(i&&i._firstStartAbsoluteTime&&t&&t.length>0&&this._tts2FaceShape&&this._tts2face_sample_rate){const r=Date.now()-i._firstStartAbsoluteTime;let s=0,o;i.samplesList.forEach((h,f)=>{o===void 0&&h.startTime!==void 0&&(o=h.startTime),h.startTime!==void 0&&h.startTime-o<=r/1e3&&(s=f)});const a=i.samplesList[s],l=r-a.startTime*1e3,c=Math.floor(l/1e3*this._tts2face_sample_rate),u=new Float32Array(t[s]),d=u==null?void 0:u.slice(c*this._tts2FaceShape,c*this._tts2FaceShape+this._tts2FaceShape);return d!=null&&d.length?d:null}return null}async _motionDataGroupHandler(e){try{const{first_package:t,motion_data_slice:i,segment_num:r,binary_size:s,use_binary_frame:o,is_audio_mute:a}=e;if(t){const l=this._motionDataGroups[this._motionDataGroups.length-1];l&&l.segment_num!==l.motion_data_slices.length&&this.ee.emit(xr.ErrorReceived,"lost data packets"),this._motionDataGroups.push({first_package:t,binary_size:s,segment_num:r,use_binary_frame:o,motion_data_slices:[],merged_motion_data:new Uint8Array(s)})}else{if(this._motionDataGroups.length===0||!i)return;const l=this._motionDataGroups[this._motionDataGroups.length-1],c=this._motionDataGroups[this._motionDataGroups.length-2];if(l.motion_data_slices.push(i),l.motion_data_slices.length===l.segment_num){const u=l.motion_data_slices[0],{parsedData:d,jsonSize:h,binSize:f}=await mN(u);l.jsonSize=h,l.binSize=f;const p=u.slice(12+l.jsonSize);if(p.size!==l.binSize&&this.ee.emit(q1.Chat_BinsizeError),!this._connectBatch(d,l,c))return;await this._handleArkitFaceConfig(d,l,c,p),await this._handleAudioConfig(d,l,c,p,a||!1),this._handleEvents(d)}}}catch(t){console.error("err",t),this.ee.emit(xr.ErrorReceived,t.message)}}async _handleAudioConfig(e,t,i,r,s){const{data_records:o={},end_of_batch:a}=e,{audio:l}=o;if(l){const{sample_rate:c,shape:u,data_offset:d,data_type:h}=l,f=vN[h],p=_N[h];if(t.player===void 0&&(i&&i.player&&i.batch_id===t.batch_id?t.player=i.player:c&&(t.player=new a_({inputCodec:f,channels:1,sampleRate:c,fftSize:1024,isMute:s,onended:S=>{if(!S)return;const{end_of_batch:E,lastMotionGroup:A}=S;if(E){const{batch_id:R,player:w}=A;this.ee.emit(Bl.Player_EndSpeaking,w),this._motionDataGroups=this._motionDataGroups.filter(M=>M.batch_id>R),this._motionDataGroups.length&&this._motionDataGroups[0].player?this._motionDataGroups[0].player.updateAutoPlay(!0):this.ee.emit(Bl.Player_NoLegacy)}}},this.ee)),a)){const S=t.player.option.onended;t.player.option.onended=()=>{S({end_of_batch:a,lastMotionGroup:t})}}const g=u.reduce((S,E)=>S*E,f==="Int16"?2:4),y=d,m=d+g,x=await r.slice(y,m).arrayBuffer(),_=this._motionDataGroups.find(S=>S.player);this._motionDataGroups.length&&t.player&&_&&_.player!==t.player&&(t.player.autoPlay=!1),t.player&&t.player.feed({audio:new p(x),end_of_batch:a})}else i&&i.player&&t.batch_id===i.batch_id&&(t.player=i.player)}async _handleArkitFaceConfig(e,t,i,r){const{data_records:s={}}=e,{arkit_face:o}=s;if(o){const{channel_names:a,shape:l,data_offset:c,sample_rate:u}=o;if(a&&!this._arkit_face_channel_names&&(this._arkit_face_channel_names=a,this._arkit_face_sample_rate=u),t.arkitFaceArrayBufferArray===void 0){i&&i.arkitFaceArrayBufferArray&&i.batch_id===t.batch_id?t.arkitFaceArrayBufferArray=i.arkitFaceArrayBufferArray:t.arkitFaceArrayBufferArray=[];const d=l.reduce((p,g)=>p*g,4);this._arkitFaceShape=l[1];const f=await r.slice(c,c+d).arrayBuffer();t.arkitFaceArrayBufferArray.push(f)}}else i&&i.arkitFaceArrayBufferArray&&t.batch_id===i.batch_id&&(t.arkitFaceArrayBufferArray=i.arkitFaceArrayBufferArray)}async _handletts2faceConfig(e,t,i,r){const{data_records:s={}}=e,{tts2face:o}=s;if(o){const{channel_names:a,shape:l,data_offset:c,sample_rate:u}=o;if(a&&!this._tts2face_channel_names&&(this._tts2face_channel_names=a,this._tts2face_sample_rate=u),t.tts2faceArrayBufferArray===void 0){i&&i.tts2faceArrayBufferArray&&i.batch_id===t.batch_id?t.tts2faceArrayBufferArray=i.tts2faceArrayBufferArray:t.tts2faceArrayBufferArray=[];const d=l.reduce((p,g)=>p*g,4);this._tts2FaceShape=l[1];const f=await r.slice(c,c+d).arrayBuffer();t.tts2faceArrayBufferArray.push(f)}}else i&&i.tts2faceArrayBufferArray&&t.batch_id===i.batch_id&&(t.tts2faceArrayBufferArray=i.tts2faceArrayBufferArray)}_handleEvents(e){const{events:t}=e;t&&t.length&&t.forEach(i=>{switch(i.event_type){case"interrupt_speech":break;case"change_status":this.ee.emit(q1.Change_Status,i);break}})}_connectBatch(e,t,i){let r=!0;return e.batch_id&&t.batch_id===void 0&&(t.batch_id=e.batch_id),!t.batch_id&&i&&i.batch_id&&(t.batch_id=i.batch_id),e.batch_name&&t.batch_name===void 0&&(t.batch_name=e.batch_name),this._maxBatchId&&t.batch_id&&t.batch_id<=this._maxBatchId&&(this.clear(),r=!1),r}}const vl=class vl{constructor(e,t){let i,r;this.promise=new Promise((c,u)=>{i=c,r=u});const s=i.bind(this),o=r.bind(this),a=(...c)=>{s(...c)},l=c=>{o(c)};e(a.bind(this),l.bind(this)),this.abortHandler=t,this.id=vl.idGen++}then(e){return new vl((t,i)=>{this.promise=this.promise.then((...r)=>{const s=e(...r);s instanceof Promise||s instanceof vl?s.then((...o)=>{t(...o)}):t(s)}).catch(r=>{i(r)})},this.abortHandler)}catch(e){return new vl(t=>{this.promise=this.promise.then((...i)=>{t(...i)}).catch(e)},this.abortHandler)}abort(e){this.abortHandler&&this.abortHandler(e)}};xe(vl,"idGen",0);let nh=vl;class Ap extends Error{constructor(e){super(e)}}(function(){const n=new Float32Array(1),e=new Int32Array(n.buffer);return function(t){n[0]=t;const i=e[0];let r=i>>16&32768,s=i>>12&2047;const o=i>>23&255;return o<103?r:o>142?(r|=31744,r|=(o==255?0:1)&&i&8388607,r):o<113?(s|=2048,r|=(s>>114-o)+(s>>113-o&1),r):(r|=o-112<<10|s>>1,r+=s&1,r)}})();const Vi=function(){const n=new Float32Array(1),e=new Int32Array(n.buffer);return function(t){return n[0]=t,e[0]}}(),SN=function(n,e){return n[e]+(n[e+1]<<8)+(n[e+2]<<16)+(n[e+3]<<24)},l_=function(n,e,t=!0,i){const r=new AbortController,s=r.signal;let o=!1;const a=l=>{r.abort(l),o=!0};return new nh((l,c)=>{const u={signal:s};i&&(u.headers=i),fetch(n,u).then(async d=>{if(!d.ok){const m=await d.text();c(new Error("Fetch failed: ".concat(d.status," ").concat(d.statusText," ").concat(m)));return}const h=d.body.getReader();let f=0,p=d.headers.get("Content-Length"),g=p?parseInt(p):void 0;const y=[];for(;!o;)try{const{value:m,done:v}=await h.read();if(v){if(e&&e(100,"100%",m,g),t){const S=new Blob(y).arrayBuffer();l(S)}else l();break}f+=m.length;let x,_;g!==void 0&&(x=f/g*100,_="".concat(x.toFixed(2),"%")),t&&y.push(m),e&&e(x,_,m,g)}catch(m){c(m);return}}).catch(d=>{c(new Ap(d))})},a)},gi=function(n,e,t){return Math.max(Math.min(n,t),e)},ec=function(){return performance.now()/1e3},Cc=n=>{if(n.geometry&&(n.geometry.dispose(),n.geometry=null),n.material&&(n.material.dispose(),n.material=null),n.children)for(let e of n.children)Cc(e)},ms=(n,e)=>new Promise(t=>{window.setTimeout(()=>{t(n())},e?1:50)}),Gc=(n=0)=>{switch(n){case 1:return 9;case 2:return 24}return 0},c_=()=>{let n,e;return{promise:new Promise((i,r)=>{n=i,e=r}),resolve:n,reject:e}},rg=n=>{let e,t;return n||(n=()=>{}),{promise:new nh((r,s)=>{e=r,t=s},n),resolve:e,reject:t}};class AN{constructor(e,t,i){this.major=e,this.minor=t,this.patch=i}toString(){return"".concat(this.major,"_").concat(this.minor,"_").concat(this.patch)}}function u_(){const n=navigator.userAgent;return n.indexOf("iPhone")>0||n.indexOf("iPad")>0}function l5(){if(u_()){const n=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);return new AN(parseInt(n[1]||0,10),parseInt(n[2]||0,10),parseInt(n[3]||0,10))}else return null}const bN=14,jd=class jd{constructor(e=0){this.sphericalHarmonicsDegree=e,this.sphericalHarmonicsCount=Gc(this.sphericalHarmonicsDegree),this.componentCount=this.sphericalHarmonicsCount+bN,this.defaultSphericalHarmonics=new Array(this.sphericalHarmonicsCount).fill(0),this.splats=[],this.splatCount=0}static createSplat(e=0){const t=[0,0,0,1,1,1,1,0,0,0,0,0,0,0];let i=Gc(e);for(let r=0;r<i;r++)t.push(0);return t}addSplat(e){this.splats.push(e),this.splatCount++}getSplat(e){return this.splats[e]}addDefaultSplat(){const e=jd.createSplat(this.sphericalHarmonicsDegree);return this.addSplat(e),e}addSplatFromComonents(e,t,i,r,s,o,a,l,c,u,d,h,f,p,...g){const y=[e,t,i,r,s,o,a,l,c,u,d,h,f,p,...this.defaultSphericalHarmonics];for(let m=0;m<g.length&&m<this.sphericalHarmonicsCount;m++)y[m]=g[m];return this.addSplat(y),y}addSplatFromArray(e,t){const i=e.splats[t],r=jd.createSplat(this.sphericalHarmonicsDegree);for(let s=0;s<this.componentCount&&s<i.length;s++)r[s]=i[s];this.addSplat(r)}};xe(jd,"OFFSET",{X:0,Y:1,Z:2,SCALE0:3,SCALE1:4,SCALE2:5,ROTATION0:6,ROTATION1:7,ROTATION2:8,ROTATION3:9,FDC0:10,FDC1:11,FDC2:12,OPACITY:13,FRC0:14,FRC1:15,FRC2:16,FRC3:17,FRC4:18,FRC5:19,FRC6:20,FRC7:21,FRC8:22,FRC9:23,FRC10:24,FRC11:25,FRC12:26,FRC13:27,FRC14:28,FRC15:29,FRC16:30,FRC17:31,FRC18:32,FRC19:33,FRC20:34,FRC21:35,FRC22:36,FRC23:37});let lt=jd;/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/const d_="173",tc={ROTATE:0,DOLLY:1,PAN:2},nc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},TN=0,fS=1,wN=2,c5=1,CN=2,Ar=3,bs=0,Fi=1,Cr=2,Ia=0,zo=1,pS=2,mS=3,gS=4,u5=5,hl=100,EN=101,MN=102,RN=103,IN=104,NN=200,PN=201,LN=202,DN=203,ih=204,rh=205,FN=206,ON=207,BN=208,kN=209,UN=210,zN=211,VN=212,HN=213,$N=214,Y1=0,Z1=1,J1=2,lu=3,ey=4,ty=5,ny=6,iy=7,d5=0,GN=1,WN=2,_s=0,QN=1,jN=2,qN=3,XN=4,KN=5,YN=6,ZN=7,yS="attached",JN="detached",h_=300,kl=301,Ul=302,ry=303,sy=304,Ym=306,cu=1e3,Aa=1001,om=1002,_i=1003,h5=1004,bd=1005,Rr=1006,bp=1007,Hs=1008,eP=1008,Js=1009,f5=1010,p5=1011,sh=1012,Zm=1013,Ni=1014,ir=1015,Ts=1016,f_=1017,p_=1018,uu=1020,m5=35902,g5=1021,y5=1022,Di=1023,v5=1024,_5=1025,Ml=1026,du=1027,m_=1028,Jm=1029,oh=1030,g_=1031,wo=1033,Tp=33776,wp=33777,Cp=33778,Ep=33779,oy=35840,ay=35841,ly=35842,cy=35843,uy=36196,dy=37492,hy=37496,fy=37808,py=37809,my=37810,gy=37811,yy=37812,vy=37813,_y=37814,xy=37815,Sy=37816,Ay=37817,by=37818,Ty=37819,wy=37820,Cy=37821,Mp=36492,Ey=36494,My=36495,x5=36283,Ry=36284,Iy=36285,Ny=36286,Jr=2200,zl=2201,tP=2202,ah=2300,lh=2301,sg=2302,Lc=2400,Dc=2401,am=2402,y_=2500,nP=2501,iP=0,S5=1,Py=2,rP=3200,sP=3201,lm=0,A5=1,Vs="",fi="srgb",Bi="srgb-linear",cm="linear",Zt="srgb",ic=7680,vS=519,oP=512,b5=513,aP=514,T5=515,lP=516,cP=517,uP=518,dP=519,um=35044,ba=35048,_S="300 es",Ir=2e3,Qo=2001;class ro{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const wi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let xS=1234567;const Od=Math.PI/180,hu=180/Math.PI;function xs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(wi[n&255]+wi[n>>8&255]+wi[n>>16&255]+wi[n>>24&255]+"-"+wi[e&255]+wi[e>>8&255]+"-"+wi[e>>16&15|64]+wi[e>>24&255]+"-"+wi[t&63|128]+wi[t>>8&255]+"-"+wi[t>>16&255]+wi[t>>24&255]+wi[i&255]+wi[i>>8&255]+wi[i>>16&255]+wi[i>>24&255]).toLowerCase()}function Nt(n,e,t){return Math.max(e,Math.min(t,n))}function v_(n,e){return(n%e+e)%e}function hP(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function fP(n,e,t){return n!==e?(t-n)/(e-n):0}function Bd(n,e,t){return(1-t)*n+t*e}function pP(n,e,t,i){return Bd(n,e,1-Math.exp(-t*i))}function mP(n,e=1){return e-Math.abs(v_(n,e*2)-e)}function gP(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function yP(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function vP(n,e){return n+Math.floor(Math.random()*(e-n+1))}function _P(n,e){return n+Math.random()*(e-n)}function xP(n){return n*(.5-Math.random())}function SP(n){n!==void 0&&(xS=n);let e=xS+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function AP(n){return n*Od}function bP(n){return n*hu}function TP(n){return(n&n-1)===0&&n!==0}function wP(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function CP(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function EP(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),h=o((e-i)/2),f=s((i-e)/2),p=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*d,l*h,a*c);break;case"YZY":n.set(l*h,a*u,l*d,a*c);break;case"ZXZ":n.set(l*d,l*h,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function fs(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function ln(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Ta={DEG2RAD:Od,RAD2DEG:hu,generateUUID:xs,clamp:Nt,euclideanModulo:v_,mapLinear:hP,inverseLerp:fP,lerp:Bd,damp:pP,pingpong:mP,smoothstep:gP,smootherstep:yP,randInt:vP,randFloat:_P,randFloatSpread:xP,seededRandom:SP,degToRad:AP,radToDeg:bP,isPowerOfTwo:TP,ceilPowerOfTwo:wP,floorPowerOfTwo:CP,setQuaternionFromProperEuler:EP,normalize:ln,denormalize:fs};class qe{constructor(e=0,t=0){qe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Nt(this.x,e.x,t.x),this.y=Nt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Nt(this.x,e,t),this.y=Nt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Nt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Nt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class mt{constructor(e,t,i,r,s,o,a,l,c){mt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],h=i[2],f=i[5],p=i[8],g=r[0],y=r[3],m=r[6],v=r[1],x=r[4],_=r[7],S=r[2],E=r[5],A=r[8];return s[0]=o*g+a*v+l*S,s[3]=o*y+a*x+l*E,s[6]=o*m+a*_+l*A,s[1]=c*g+u*v+d*S,s[4]=c*y+u*x+d*E,s[7]=c*m+u*_+d*A,s[2]=h*g+f*v+p*S,s[5]=h*y+f*x+p*E,s[8]=h*m+f*_+p*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,h=a*l-u*s,f=c*s-o*l,p=t*d+i*h+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=d*g,e[1]=(r*c-u*i)*g,e[2]=(a*i-r*o)*g,e[3]=h*g,e[4]=(u*t-r*l)*g,e[5]=(r*s-a*t)*g,e[6]=f*g,e[7]=(i*l-c*t)*g,e[8]=(o*t-i*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(og.makeScale(e,t)),this}rotate(e){return this.premultiply(og.makeRotation(-e)),this}translate(e,t){return this.premultiply(og.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const og=new mt;function w5(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ch(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function MP(){const n=ch("canvas");return n.style.display="block",n}const SS={};function Ec(n){n in SS||(SS[n]=!0,console.warn(n))}function RP(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}function IP(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function NP(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const AS=new mt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),bS=new mt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function PP(){const n={enabled:!0,workingColorSpace:Bi,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Zt&&(r.r=Vo(r.r),r.g=Vo(r.g),r.b=Vo(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===Zt&&(r.r=Wc(r.r),r.g=Wc(r.g),r.b=Wc(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Vs?cm:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Bi]:{primaries:e,whitePoint:i,transfer:cm,toXYZ:AS,fromXYZ:bS,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:fi},outputColorSpaceConfig:{drawingBufferColorSpace:fi}},[fi]:{primaries:e,whitePoint:i,transfer:Zt,toXYZ:AS,fromXYZ:bS,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:fi}}}),n}const wt=PP();function Vo(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Wc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let rc;class LP{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{rc===void 0&&(rc=ch("canvas")),rc.width=e.width,rc.height=e.height;const i=rc.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=rc}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ch("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Vo(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Vo(t[i]/255)*255):t[i]=Vo(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let DP=0;class C5{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:DP++}),this.uuid=xs(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(ag(r[o].image)):s.push(ag(r[o]))}else s=ag(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function ag(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?LP.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let FP=0;class Wn extends ro{constructor(e=Wn.DEFAULT_IMAGE,t=Wn.DEFAULT_MAPPING,i=Aa,r=Aa,s=Rr,o=Hs,a=Di,l=Js,c=Wn.DEFAULT_ANISOTROPY,u=Vs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:FP++}),this.uuid=xs(),this.name="",this.source=new C5(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new qe(0,0),this.repeat=new qe(1,1),this.center=new qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new mt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==h_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case cu:e.x=e.x-Math.floor(e.x);break;case Aa:e.x=e.x<0?0:1;break;case om:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case cu:e.y=e.y-Math.floor(e.y);break;case Aa:e.y=e.y<0?0:1;break;case om:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Wn.DEFAULT_IMAGE=null;Wn.DEFAULT_MAPPING=h_;Wn.DEFAULT_ANISOTROPY=1;class Mt{constructor(e=0,t=0,i=0,r=1){Mt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],h=l[1],f=l[5],p=l[9],g=l[2],y=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(d-g)<.01&&Math.abs(p-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(d+g)<.1&&Math.abs(p+y)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,_=(f+1)/2,S=(m+1)/2,E=(u+h)/4,A=(d+g)/4,R=(p+y)/4;return x>_&&x>S?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=E/i,s=A/i):_>S?_<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(_),i=E/r,s=R/r):S<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(S),i=A/s,r=R/s),this.set(i,r,s,t),this}let v=Math.sqrt((y-p)*(y-p)+(d-g)*(d-g)+(h-u)*(h-u));return Math.abs(v)<.001&&(v=1),this.x=(y-p)/v,this.y=(d-g)/v,this.z=(h-u)/v,this.w=Math.acos((c+f+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Nt(this.x,e.x,t.x),this.y=Nt(this.y,e.y,t.y),this.z=Nt(this.z,e.z,t.z),this.w=Nt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Nt(this.x,e,t),this.y=Nt(this.y,e,t),this.z=Nt(this.z,e,t),this.w=Nt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Nt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Fh extends ro{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Rr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Wn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,r=e.textures.length;i<r;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const t=Object.assign({},e.texture.image);return this.texture.source=new C5(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fa extends Fh{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class __ extends Wn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=_i,this.minFilter=_i,this.wrapR=Aa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class OP extends Wn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=_i,this.minFilter=_i,this.wrapR=Aa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Qt{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3];const h=s[o+0],f=s[o+1],p=s[o+2],g=s[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=d;return}if(a===1){e[t+0]=h,e[t+1]=f,e[t+2]=p,e[t+3]=g;return}if(d!==g||l!==h||c!==f||u!==p){let y=1-a;const m=l*h+c*f+u*p+d*g,v=m>=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const S=Math.sqrt(x),E=Math.atan2(S,m*v);y=Math.sin(y*E)/S,a=Math.sin(a*E)/S}const _=a*v;if(l=l*y+h*_,c=c*y+f*_,u=u*y+p*_,d=d*y+g*_,y===1-a){const S=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=S,c*=S,u*=S,d*=S}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],h=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*d+l*f-c*h,e[t+1]=l*p+u*h+c*d-a*f,e[t+2]=c*p+u*f+a*h-l*d,e[t+3]=u*p-a*d-l*h-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),h=l(i/2),f=l(r/2),p=l(s/2);switch(o){case"XYZ":this._x=h*u*d+c*f*p,this._y=c*f*d-h*u*p,this._z=c*u*p+h*f*d,this._w=c*u*d-h*f*p;break;case"YXZ":this._x=h*u*d+c*f*p,this._y=c*f*d-h*u*p,this._z=c*u*p-h*f*d,this._w=c*u*d+h*f*p;break;case"ZXY":this._x=h*u*d-c*f*p,this._y=c*f*d+h*u*p,this._z=c*u*p+h*f*d,this._w=c*u*d-h*f*p;break;case"ZYX":this._x=h*u*d-c*f*p,this._y=c*f*d+h*u*p,this._z=c*u*p-h*f*d,this._w=c*u*d+h*f*p;break;case"YZX":this._x=h*u*d+c*f*p,this._y=c*f*d+h*u*p,this._z=c*u*p-h*f*d,this._w=c*u*d-h*f*p;break;case"XZY":this._x=h*u*d-c*f*p,this._y=c*f*d-h*u*p,this._z=c*u*p+h*f*d,this._w=c*u*d+h*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],d=t[10],h=i+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-r)*f}else if(i>a&&i>d){const f=2*Math.sqrt(1+i-a-d);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>d){const f=2*Math.sqrt(1+a-i-d);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+d-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Nt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),d=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=o*d+this._w*h,this._x=i*d+this._x*h,this._y=r*d+this._y*h,this._z=s*d+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Y{constructor(e=0,t=0,i=0){Y.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(TS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(TS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Nt(this.x,e.x,t.x),this.y=Nt(this.y,e.y,t.y),this.z=Nt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Nt(this.x,e,t),this.y=Nt(this.y,e,t),this.z=Nt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Nt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return lg.copy(this).projectOnVector(e),this.sub(lg)}reflect(e){return this.sub(lg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Nt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const lg=new Y,TS=new Qt;class rr{constructor(e=new Y(1/0,1/0,1/0),t=new Y(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(ls.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(ls.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=ls.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,ls):ls.fromBufferAttribute(s,o),ls.applyMatrix4(e.matrixWorld),this.expandByPoint(ls);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),gf.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),gf.copy(i.boundingBox)),gf.applyMatrix4(e.matrixWorld),this.union(gf)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ls),ls.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(td),yf.subVectors(this.max,td),sc.subVectors(e.a,td),oc.subVectors(e.b,td),ac.subVectors(e.c,td),ra.subVectors(oc,sc),sa.subVectors(ac,oc),Ya.subVectors(sc,ac);let t=[0,-ra.z,ra.y,0,-sa.z,sa.y,0,-Ya.z,Ya.y,ra.z,0,-ra.x,sa.z,0,-sa.x,Ya.z,0,-Ya.x,-ra.y,ra.x,0,-sa.y,sa.x,0,-Ya.y,Ya.x,0];return!cg(t,sc,oc,ac,yf)||(t=[1,0,0,0,1,0,0,0,1],!cg(t,sc,oc,ac,yf))?!1:(vf.crossVectors(ra,sa),t=[vf.x,vf.y,vf.z],cg(t,sc,oc,ac,yf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ls).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ls).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(fo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fo),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const fo=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],ls=new Y,gf=new rr,sc=new Y,oc=new Y,ac=new Y,ra=new Y,sa=new Y,Ya=new Y,td=new Y,yf=new Y,vf=new Y,Za=new Y;function cg(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Za.fromArray(n,s);const a=r.x*Math.abs(Za.x)+r.y*Math.abs(Za.y)+r.z*Math.abs(Za.z),l=e.dot(Za),c=t.dot(Za),u=i.dot(Za);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const BP=new rr,nd=new Y,ug=new Y;class so{constructor(e=new Y,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):BP.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;nd.subVectors(e,this.center);const t=nd.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(nd,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ug.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(nd.copy(e.center).add(ug)),this.expandByPoint(nd.copy(e.center).sub(ug))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const po=new Y,dg=new Y,_f=new Y,oa=new Y,hg=new Y,xf=new Y,fg=new Y;let Oh=class{constructor(e=new Y,t=new Y(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,po)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=po.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(po.copy(this.origin).addScaledVector(this.direction,t),po.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){dg.copy(e).add(t).multiplyScalar(.5),_f.copy(t).sub(e).normalize(),oa.copy(this.origin).sub(dg);const s=e.distanceTo(t)*.5,o=-this.direction.dot(_f),a=oa.dot(this.direction),l=-oa.dot(_f),c=oa.lengthSq(),u=Math.abs(1-o*o);let d,h,f,p;if(u>0)if(d=o*l-a,h=o*a-l,p=s*u,d>=0)if(h>=-p)if(h<=p){const g=1/u;d*=g,h*=g,f=d*(d+o*h+2*a)+h*(o*d+h+2*l)+c}else h=s,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;else h=-s,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;else h<=-p?(d=Math.max(0,-(-o*s+a)),h=d>0?-s:Math.min(Math.max(-s,-l),s),f=-d*d+h*(h+2*l)+c):h<=p?(d=0,h=Math.min(Math.max(-s,-l),s),f=h*(h+2*l)+c):(d=Math.max(0,-(o*s+a)),h=d>0?s:Math.min(Math.max(-s,-l),s),f=-d*d+h*(h+2*l)+c);else h=o>0?-s:s,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(dg).addScaledVector(_f,h),f}intersectSphere(e,t){po.subVectors(e.center,this.origin);const i=po.dot(this.direction),r=po.dot(po)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(s=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(s=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),d>=0?(a=(e.min.z-h.z)*d,l=(e.max.z-h.z)*d):(a=(e.max.z-h.z)*d,l=(e.min.z-h.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,po)!==null}intersectTriangle(e,t,i,r,s){hg.subVectors(t,e),xf.subVectors(i,e),fg.crossVectors(hg,xf);let o=this.direction.dot(fg),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;oa.subVectors(this.origin,e);const l=a*this.direction.dot(xf.crossVectors(oa,xf));if(l<0)return null;const c=a*this.direction.dot(hg.cross(oa));if(c<0||l+c>o)return null;const u=-a*oa.dot(fg);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class Xe{constructor(e,t,i,r,s,o,a,l,c,u,d,h,f,p,g,y){Xe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,d,h,f,p,g,y)}set(e,t,i,r,s,o,a,l,c,u,d,h,f,p,g,y){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=h,m[3]=f,m[7]=p,m[11]=g,m[15]=y,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 Xe().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/lc.setFromMatrixColumn(e,0).length(),s=1/lc.setFromMatrixColumn(e,1).length(),o=1/lc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const h=o*u,f=o*d,p=a*u,g=a*d;t[0]=l*u,t[4]=-l*d,t[8]=c,t[1]=f+p*c,t[5]=h-g*c,t[9]=-a*l,t[2]=g-h*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*u,f=l*d,p=c*u,g=c*d;t[0]=h+g*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*d,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=g+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*u,f=l*d,p=c*u,g=c*d;t[0]=h-g*a,t[4]=-o*d,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=g-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*u,f=o*d,p=a*u,g=a*d;t[0]=l*u,t[4]=p*c-f,t[8]=h*c+g,t[1]=l*d,t[5]=g*c+h,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,f=o*c,p=a*l,g=a*c;t[0]=l*u,t[4]=g-h*d,t[8]=p*d+f,t[1]=d,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*d+p,t[10]=h-g*d}else if(e.order==="XZY"){const h=o*l,f=o*c,p=a*l,g=a*c;t[0]=l*u,t[4]=-d,t[8]=c*u,t[1]=h*d+g,t[5]=o*u,t[9]=f*d-p,t[2]=p*d-f,t[6]=a*u,t[10]=g*d+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(kP,e,UP)}lookAt(e,t,i){const r=this.elements;return hr.subVectors(e,t),hr.lengthSq()===0&&(hr.z=1),hr.normalize(),aa.crossVectors(i,hr),aa.lengthSq()===0&&(Math.abs(i.z)===1?hr.x+=1e-4:hr.z+=1e-4,hr.normalize(),aa.crossVectors(i,hr)),aa.normalize(),Sf.crossVectors(hr,aa),r[0]=aa.x,r[4]=Sf.x,r[8]=hr.x,r[1]=aa.y,r[5]=Sf.y,r[9]=hr.y,r[2]=aa.z,r[6]=Sf.z,r[10]=hr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],h=i[9],f=i[13],p=i[2],g=i[6],y=i[10],m=i[14],v=i[3],x=i[7],_=i[11],S=i[15],E=r[0],A=r[4],R=r[8],w=r[12],M=r[1],I=r[5],L=r[9],k=r[13],T=r[2],F=r[6],V=r[10],Q=r[14],ee=r[3],se=r[7],he=r[11],ie=r[15];return s[0]=o*E+a*M+l*T+c*ee,s[4]=o*A+a*I+l*F+c*se,s[8]=o*R+a*L+l*V+c*he,s[12]=o*w+a*k+l*Q+c*ie,s[1]=u*E+d*M+h*T+f*ee,s[5]=u*A+d*I+h*F+f*se,s[9]=u*R+d*L+h*V+f*he,s[13]=u*w+d*k+h*Q+f*ie,s[2]=p*E+g*M+y*T+m*ee,s[6]=p*A+g*I+y*F+m*se,s[10]=p*R+g*L+y*V+m*he,s[14]=p*w+g*k+y*Q+m*ie,s[3]=v*E+x*M+_*T+S*ee,s[7]=v*A+x*I+_*F+S*se,s[11]=v*R+x*L+_*V+S*he,s[15]=v*w+x*k+_*Q+S*ie,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],h=e[10],f=e[14],p=e[3],g=e[7],y=e[11],m=e[15];return p*(+s*l*d-r*c*d-s*a*h+i*c*h+r*a*f-i*l*f)+g*(+t*l*f-t*c*h+s*o*h-r*o*f+r*c*u-s*l*u)+y*(+t*c*d-t*a*f-s*o*d+i*o*f+s*a*u-i*c*u)+m*(-r*a*u-t*l*d+t*a*h+r*o*d-i*o*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],f=e[11],p=e[12],g=e[13],y=e[14],m=e[15],v=d*y*c-g*h*c+g*l*f-a*y*f-d*l*m+a*h*m,x=p*h*c-u*y*c-p*l*f+o*y*f+u*l*m-o*h*m,_=u*g*c-p*d*c+p*a*f-o*g*f-u*a*m+o*d*m,S=p*d*l-u*g*l-p*a*h+o*g*h+u*a*y-o*d*y,E=t*v+i*x+r*_+s*S;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/E;return e[0]=v*A,e[1]=(g*h*s-d*y*s-g*r*f+i*y*f+d*r*m-i*h*m)*A,e[2]=(a*y*s-g*l*s+g*r*c-i*y*c-a*r*m+i*l*m)*A,e[3]=(d*l*s-a*h*s-d*r*c+i*h*c+a*r*f-i*l*f)*A,e[4]=x*A,e[5]=(u*y*s-p*h*s+p*r*f-t*y*f-u*r*m+t*h*m)*A,e[6]=(p*l*s-o*y*s-p*r*c+t*y*c+o*r*m-t*l*m)*A,e[7]=(o*h*s-u*l*s+u*r*c-t*h*c-o*r*f+t*l*f)*A,e[8]=_*A,e[9]=(p*d*s-u*g*s-p*i*f+t*g*f+u*i*m-t*d*m)*A,e[10]=(o*g*s-p*a*s+p*i*c-t*g*c-o*i*m+t*a*m)*A,e[11]=(u*a*s-o*d*s-u*i*c+t*d*c+o*i*f-t*a*f)*A,e[12]=S*A,e[13]=(u*g*r-p*d*r+p*i*h-t*g*h-u*i*y+t*d*y)*A,e[14]=(p*a*r-o*g*r-p*i*l+t*g*l+o*i*y-t*a*y)*A,e[15]=(o*d*r-u*a*r+u*i*l-t*d*l-o*i*h+t*a*h)*A,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,d=a+a,h=s*c,f=s*u,p=s*d,g=o*u,y=o*d,m=a*d,v=l*c,x=l*u,_=l*d,S=i.x,E=i.y,A=i.z;return r[0]=(1-(g+m))*S,r[1]=(f+_)*S,r[2]=(p-x)*S,r[3]=0,r[4]=(f-_)*E,r[5]=(1-(h+m))*E,r[6]=(y+v)*E,r[7]=0,r[8]=(p+x)*A,r[9]=(y-v)*A,r[10]=(1-(h+g))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=lc.set(r[0],r[1],r[2]).length();const o=lc.set(r[4],r[5],r[6]).length(),a=lc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],cs.copy(this);const c=1/s,u=1/o,d=1/a;return cs.elements[0]*=c,cs.elements[1]*=c,cs.elements[2]*=c,cs.elements[4]*=u,cs.elements[5]*=u,cs.elements[6]*=u,cs.elements[8]*=d,cs.elements[9]*=d,cs.elements[10]*=d,t.setFromRotationMatrix(cs),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Ir){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),d=(t+e)/(t-e),h=(i+r)/(i-r);let f,p;if(a===Ir)f=-(o+s)/(o-s),p=-2*o*s/(o-s);else if(a===Qo)f=-o/(o-s),p=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Ir){const l=this.elements,c=1/(t-e),u=1/(i-r),d=1/(o-s),h=(t+e)*c,f=(i+r)*u;let p,g;if(a===Ir)p=(o+s)*d,g=-2*d;else if(a===Qo)p=s*d,g=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=g,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const lc=new Y,cs=new Xe,kP=new Y(0,0,0),UP=new Y(1,1,1),aa=new Y,Sf=new Y,hr=new Y,wS=new Xe,CS=new Qt;class ws{constructor(e=0,t=0,i=0,r=ws.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],h=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(Nt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Nt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(Nt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Nt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Nt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Nt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return wS.makeRotationFromQuaternion(e),this.setFromRotationMatrix(wS,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return CS.setFromEuler(this),this.setFromQuaternion(CS,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ws.DEFAULT_ORDER="XYZ";class E5{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let zP=0;const ES=new Y,cc=new Qt,mo=new Xe,Af=new Y,id=new Y,VP=new Y,HP=new Qt,MS=new Y(1,0,0),RS=new Y(0,1,0),IS=new Y(0,0,1),NS={type:"added"},$P={type:"removed"},uc={type:"childadded",child:null},pg={type:"childremoved",child:null};class nn extends ro{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zP++}),this.uuid=xs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=nn.DEFAULT_UP.clone();const e=new Y,t=new ws,i=new Qt,r=new Y(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Xe},normalMatrix:{value:new mt}}),this.matrix=new Xe,this.matrixWorld=new Xe,this.matrixAutoUpdate=nn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=nn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new E5,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return cc.setFromAxisAngle(e,t),this.quaternion.multiply(cc),this}rotateOnWorldAxis(e,t){return cc.setFromAxisAngle(e,t),this.quaternion.premultiply(cc),this}rotateX(e){return this.rotateOnAxis(MS,e)}rotateY(e){return this.rotateOnAxis(RS,e)}rotateZ(e){return this.rotateOnAxis(IS,e)}translateOnAxis(e,t){return ES.copy(e).applyQuaternion(this.quaternion),this.position.add(ES.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(MS,e)}translateY(e){return this.translateOnAxis(RS,e)}translateZ(e){return this.translateOnAxis(IS,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(mo.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Af.copy(e):Af.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),id.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?mo.lookAt(id,Af,this.up):mo.lookAt(Af,id,this.up),this.quaternion.setFromRotationMatrix(mo),r&&(mo.extractRotation(r.matrixWorld),cc.setFromRotationMatrix(mo),this.quaternion.premultiply(cc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(NS),uc.child=e,this.dispatchEvent(uc),uc.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent($P),pg.child=e,this.dispatchEvent(pg),pg.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),mo.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),mo.multiply(e.parent.matrixWorld)),e.applyMatrix4(mo),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(NS),uc.child=e,this.dispatchEvent(uc),uc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(id,e,VP),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(id,HP,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const d=l[c];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),u=o(e.images),d=o(e.shapes),h=o(e.skeletons),f=o(e.animations),p=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),h.length>0&&(i.skeletons=h),f.length>0&&(i.animations=f),p.length>0&&(i.nodes=p)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}nn.DEFAULT_UP=new Y(0,1,0);nn.DEFAULT_MATRIX_AUTO_UPDATE=!0;nn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const us=new Y,go=new Y,mg=new Y,yo=new Y,dc=new Y,hc=new Y,PS=new Y,gg=new Y,yg=new Y,vg=new Y,_g=new Mt,xg=new Mt,Sg=new Mt;class ps{constructor(e=new Y,t=new Y,i=new Y){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),us.subVectors(e,t),r.cross(us);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){us.subVectors(r,t),go.subVectors(i,t),mg.subVectors(e,t);const o=us.dot(us),a=us.dot(go),l=us.dot(mg),c=go.dot(go),u=go.dot(mg),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const h=1/d,f=(c*l-a*u)*h,p=(o*u-a*l)*h;return s.set(1-f-p,p,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,yo)===null?!1:yo.x>=0&&yo.y>=0&&yo.x+yo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,yo)===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(s,yo.x),l.addScaledVector(o,yo.y),l.addScaledVector(a,yo.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return _g.setScalar(0),xg.setScalar(0),Sg.setScalar(0),_g.fromBufferAttribute(e,t),xg.fromBufferAttribute(e,i),Sg.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(_g,s.x),o.addScaledVector(xg,s.y),o.addScaledVector(Sg,s.z),o}static isFrontFacing(e,t,i,r){return us.subVectors(i,t),go.subVectors(e,t),us.cross(go).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return us.subVectors(this.c,this.b),go.subVectors(this.a,this.b),us.cross(go).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ps.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ps.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return ps.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return ps.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ps.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;dc.subVectors(r,i),hc.subVectors(s,i),gg.subVectors(e,i);const l=dc.dot(gg),c=hc.dot(gg);if(l<=0&&c<=0)return t.copy(i);yg.subVectors(e,r);const u=dc.dot(yg),d=hc.dot(yg);if(u>=0&&d<=u)return t.copy(r);const h=l*d-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(dc,o);vg.subVectors(e,s);const f=dc.dot(vg),p=hc.dot(vg);if(p>=0&&f<=p)return t.copy(s);const g=f*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(hc,a);const y=u*p-f*d;if(y<=0&&d-u>=0&&f-p>=0)return PS.subVectors(s,r),a=(d-u)/(d-u+(f-p)),t.copy(r).addScaledVector(PS,a);const m=1/(y+g+h);return o=g*m,a=h*m,t.copy(i).addScaledVector(dc,o).addScaledVector(hc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const M5={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},la={h:0,s:0,l:0},bf={h:0,s:0,l:0};function Ag(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class gt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=fi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=wt.workingColorSpace){return this.r=e,this.g=t,this.b=i,wt.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=wt.workingColorSpace){if(e=v_(e,1),t=Nt(t,0,1),i=Nt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Ag(o,s,e+1/3),this.g=Ag(o,s,e),this.b=Ag(o,s,e-1/3)}return wt.toWorkingColorSpace(this,r),this}setStyle(e,t=fi){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=fi){const i=M5[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Vo(e.r),this.g=Vo(e.g),this.b=Vo(e.b),this}copyLinearToSRGB(e){return this.r=Wc(e.r),this.g=Wc(e.g),this.b=Wc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=fi){return wt.fromWorkingColorSpace(Ci.copy(this),e),Math.round(Nt(Ci.r*255,0,255))*65536+Math.round(Nt(Ci.g*255,0,255))*256+Math.round(Nt(Ci.b*255,0,255))}getHexString(e=fi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=wt.workingColorSpace){wt.fromWorkingColorSpace(Ci.copy(this),t);const i=Ci.r,r=Ci.g,s=Ci.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-i)/d+2;break;case s:l=(i-r)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=wt.workingColorSpace){return wt.fromWorkingColorSpace(Ci.copy(this),t),e.r=Ci.r,e.g=Ci.g,e.b=Ci.b,e}getStyle(e=fi){wt.fromWorkingColorSpace(Ci.copy(this),e);const t=Ci.r,i=Ci.g,r=Ci.b;return e!==fi?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(i.toFixed(3)," ").concat(r.toFixed(3),")"):"rgb(".concat(Math.round(t*255),",").concat(Math.round(i*255),",").concat(Math.round(r*255),")")}offsetHSL(e,t,i){return this.getHSL(la),this.setHSL(la.h+e,la.s+t,la.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(la),e.getHSL(bf);const i=Bd(la.h,bf.h,t),r=Bd(la.s,bf.s,t),s=Bd(la.l,bf.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ci=new gt;gt.NAMES=M5;let GP=0;class es extends ro{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:GP++}),this.uuid=xs(),this.name="",this.type="Material",this.blending=zo,this.side=bs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=ih,this.blendDst=rh,this.blendEquation=hl,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new gt(0,0,0),this.blendAlpha=0,this.depthFunc=lu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vS,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ic,this.stencilZFail=ic,this.stencilZPass=ic,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."));continue}const r=this[t];if(r===void 0){console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(this.type,"."));continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==zo&&(i.blending=this.blending),this.side!==bs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==ih&&(i.blendSrc=this.blendSrc),this.blendDst!==rh&&(i.blendDst=this.blendDst),this.blendEquation!==hl&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==lu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ic&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ic&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ic&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Yr extends es{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(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 ws,this.combine=d5,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Lo=WP();function WP(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function QP(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Nt(n,-65504,65504),Lo.floatView[0]=n;const e=Lo.uint32View[0],t=e>>23&511;return Lo.baseTable[t]+((e&8388607)>>Lo.shiftTable[t])}function jP(n){const e=n>>10;return Lo.uint32View[0]=Lo.mantissaTable[Lo.offsetTable[e]+(n&1023)]+Lo.exponentTable[e],Lo.floatView[0]}const uh={toHalfFloat:QP,fromHalfFloat:jP},zn=new Y,Tf=new qe;let qP=0;class xi{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:qP++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=um,this.updateRanges=[],this.gpuType=ir,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Tf.fromBufferAttribute(this,t),Tf.applyMatrix3(e),this.setXY(t,Tf.x,Tf.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)zn.fromBufferAttribute(this,t),zn.applyMatrix3(e),this.setXYZ(t,zn.x,zn.y,zn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)zn.fromBufferAttribute(this,t),zn.applyMatrix4(e),this.setXYZ(t,zn.x,zn.y,zn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)zn.fromBufferAttribute(this,t),zn.applyNormalMatrix(e),this.setXYZ(t,zn.x,zn.y,zn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)zn.fromBufferAttribute(this,t),zn.transformDirection(e),this.setXYZ(t,zn.x,zn.y,zn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=fs(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=ln(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=fs(t,this.array)),t}setX(e,t){return this.normalized&&(t=ln(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=fs(t,this.array)),t}setY(e,t){return this.normalized&&(t=ln(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=fs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ln(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=fs(t,this.array)),t}setW(e,t){return this.normalized&&(t=ln(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array),r=ln(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array),r=ln(r,this.array),s=ln(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==um&&(e.usage=this.usage),e}}class R5 extends xi{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class I5 extends xi{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class Si extends xi{constructor(e,t,i){super(new Float32Array(e),t,i)}}let XP=0;const Hr=new Xe,bg=new nn,fc=new Y,fr=new rr,rd=new rr,si=new Y;class ki extends ro{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:XP++}),this.uuid=xs(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(w5(e)?I5:R5)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new mt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Hr.makeRotationFromQuaternion(e),this.applyMatrix4(Hr),this}rotateX(e){return Hr.makeRotationX(e),this.applyMatrix4(Hr),this}rotateY(e){return Hr.makeRotationY(e),this.applyMatrix4(Hr),this}rotateZ(e){return Hr.makeRotationZ(e),this.applyMatrix4(Hr),this}translate(e,t,i){return Hr.makeTranslation(e,t,i),this.applyMatrix4(Hr),this}scale(e,t,i){return Hr.makeScale(e,t,i),this.applyMatrix4(Hr),this}lookAt(e){return bg.lookAt(e),bg.updateMatrix(),this.applyMatrix4(bg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(fc).negate(),this.translate(fc.x,fc.y,fc.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new Si(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Y(-1/0,-1/0,-1/0),new Y(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];fr.setFromBufferAttribute(s),this.morphTargetsRelative?(si.addVectors(this.boundingBox.min,fr.min),this.boundingBox.expandByPoint(si),si.addVectors(this.boundingBox.max,fr.max),this.boundingBox.expandByPoint(si)):(this.boundingBox.expandByPoint(fr.min),this.boundingBox.expandByPoint(fr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new so);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Y,1/0);return}if(e){const i=this.boundingSphere.center;if(fr.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];rd.setFromBufferAttribute(a),this.morphTargetsRelative?(si.addVectors(fr.min,rd.min),fr.expandByPoint(si),si.addVectors(fr.max,rd.max),fr.expandByPoint(si)):(fr.expandByPoint(rd.min),fr.expandByPoint(rd.max))}fr.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)si.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(si));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)si.fromBufferAttribute(a,c),l&&(fc.fromBufferAttribute(e,c),si.add(fc)),r=Math.max(r,i.distanceToSquared(si))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new xi(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let R=0;R<i.count;R++)a[R]=new Y,l[R]=new Y;const c=new Y,u=new Y,d=new Y,h=new qe,f=new qe,p=new qe,g=new Y,y=new Y;function m(R,w,M){c.fromBufferAttribute(i,R),u.fromBufferAttribute(i,w),d.fromBufferAttribute(i,M),h.fromBufferAttribute(s,R),f.fromBufferAttribute(s,w),p.fromBufferAttribute(s,M),u.sub(c),d.sub(c),f.sub(h),p.sub(h);const I=1/(f.x*p.y-p.x*f.y);isFinite(I)&&(g.copy(u).multiplyScalar(p.y).addScaledVector(d,-f.y).multiplyScalar(I),y.copy(d).multiplyScalar(f.x).addScaledVector(u,-p.x).multiplyScalar(I),a[R].add(g),a[w].add(g),a[M].add(g),l[R].add(y),l[w].add(y),l[M].add(y))}let v=this.groups;v.length===0&&(v=[{start:0,count:e.count}]);for(let R=0,w=v.length;R<w;++R){const M=v[R],I=M.start,L=M.count;for(let k=I,T=I+L;k<T;k+=3)m(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const x=new Y,_=new Y,S=new Y,E=new Y;function A(R){S.fromBufferAttribute(r,R),E.copy(S);const w=a[R];x.copy(w),x.sub(S.multiplyScalar(S.dot(w))).normalize(),_.crossVectors(E,w);const I=_.dot(l[R])<0?-1:1;o.setXYZW(R,x.x,x.y,x.z,I)}for(let R=0,w=v.length;R<w;++R){const M=v[R],I=M.start,L=M.count;for(let k=I,T=I+L;k<T;k+=3)A(e.getX(k+0)),A(e.getX(k+1)),A(e.getX(k+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new xi(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let h=0,f=i.count;h<f;h++)i.setXYZ(h,0,0,0);const r=new Y,s=new Y,o=new Y,a=new Y,l=new Y,c=new Y,u=new Y,d=new Y;if(e)for(let h=0,f=e.count;h<f;h+=3){const p=e.getX(h+0),g=e.getX(h+1),y=e.getX(h+2);r.fromBufferAttribute(t,p),s.fromBufferAttribute(t,g),o.fromBufferAttribute(t,y),u.subVectors(o,s),d.subVectors(r,s),u.cross(d),a.fromBufferAttribute(i,p),l.fromBufferAttribute(i,g),c.fromBufferAttribute(i,y),a.add(u),l.add(u),c.add(u),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(g,l.x,l.y,l.z),i.setXYZ(y,c.x,c.y,c.z)}else for(let h=0,f=t.count;h<f;h+=3)r.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),o.fromBufferAttribute(t,h+2),u.subVectors(o,s),d.subVectors(r,s),u.cross(d),i.setXYZ(h+0,u.x,u.y,u.z),i.setXYZ(h+1,u.x,u.y,u.z),i.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)si.fromBufferAttribute(e,t),si.normalize(),e.setXYZ(t,si.x,si.y,si.z)}toNonIndexed(){function e(a,l){const c=a.array,u=a.itemSize,d=a.normalized,h=new c.constructor(l.length*u);let f=0,p=0;for(let g=0,y=l.length;g<y;g++){a.isInterleavedBufferAttribute?f=l[g]*a.data.stride+a.offset:f=l[g]*u;for(let m=0;m<u;m++)h[p++]=c[f++]}return new xi(h,u,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ki,i=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,i);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let u=0,d=c.length;u<d;u++){const h=c[u],f=e(h,i);l.push(f)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,h=c.length;d<h;d++){const f=c[d];u.push(f.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let h=0,f=d.length;h<f;h++)u.push(d[h].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,u=o.length;c<u;c++){const d=o[c];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const LS=new Xe,Ja=new Oh,wf=new so,DS=new Y,Cf=new Y,Ef=new Y,Mf=new Y,Tg=new Y,Rf=new Y,FS=new Y,If=new Y;class pn extends nn{constructor(e=new ki,t=new Yr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){Rf.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=a[l],d=s[l];u!==0&&(Tg.fromBufferAttribute(d,e),o?Rf.addScaledVector(Tg,u):Rf.addScaledVector(Tg.sub(t),u))}t.add(Rf)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),wf.copy(i.boundingSphere),wf.applyMatrix4(s),Ja.copy(e.ray).recast(e.near),!(wf.containsPoint(Ja.origin)===!1&&(Ja.intersectSphere(wf,DS)===null||Ja.origin.distanceToSquared(DS)>(e.far-e.near)**2))&&(LS.copy(s).invert(),Ja.copy(e.ray).applyMatrix4(LS),!(i.boundingBox!==null&&Ja.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Ja)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,h=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,g=h.length;p<g;p++){const y=h[p],m=o[y.materialIndex],v=Math.max(y.start,f.start),x=Math.min(a.count,Math.min(y.start+y.count,f.start+f.count));for(let _=v,S=x;_<S;_+=3){const E=a.getX(_),A=a.getX(_+1),R=a.getX(_+2);r=Nf(this,m,e,i,c,u,d,E,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),g=Math.min(a.count,f.start+f.count);for(let y=p,m=g;y<m;y+=3){const v=a.getX(y),x=a.getX(y+1),_=a.getX(y+2);r=Nf(this,o,e,i,c,u,d,v,x,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let p=0,g=h.length;p<g;p++){const y=h[p],m=o[y.materialIndex],v=Math.max(y.start,f.start),x=Math.min(l.count,Math.min(y.start+y.count,f.start+f.count));for(let _=v,S=x;_<S;_+=3){const E=_,A=_+1,R=_+2;r=Nf(this,m,e,i,c,u,d,E,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),g=Math.min(l.count,f.start+f.count);for(let y=p,m=g;y<m;y+=3){const v=y,x=y+1,_=y+2;r=Nf(this,o,e,i,c,u,d,v,x,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}}}function KP(n,e,t,i,r,s,o,a){let l;if(e.side===Fi?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,e.side===bs,a),l===null)return null;If.copy(a),If.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(If);return c<t.near||c>t.far?null:{distance:c,point:If.clone(),object:n}}function Nf(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,Cf),n.getVertexPosition(l,Ef),n.getVertexPosition(c,Mf);const u=KP(n,e,t,i,Cf,Ef,Mf,FS);if(u){const d=new Y;ps.getBarycoord(FS,Cf,Ef,Mf,d),r&&(u.uv=ps.getInterpolatedAttribute(r,a,l,c,d,new qe)),s&&(u.uv1=ps.getInterpolatedAttribute(s,a,l,c,d,new qe)),o&&(u.normal=ps.getInterpolatedAttribute(o,a,l,c,d,new Y),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new Y,materialIndex:0};ps.getNormal(Cf,Ef,Mf,h.normal),u.face=h,u.barycoord=d}return u}class Pu extends ki{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],d=[];let h=0,f=0;p("z","y","x",-1,-1,i,t,e,o,s,0),p("z","y","x",1,-1,i,t,-e,o,s,1),p("x","z","y",1,1,e,i,t,r,o,2),p("x","z","y",1,-1,e,i,-t,r,o,3),p("x","y","z",1,-1,e,t,i,r,s,4),p("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Si(c,3)),this.setAttribute("normal",new Si(u,3)),this.setAttribute("uv",new Si(d,2));function p(g,y,m,v,x,_,S,E,A,R,w){const M=_/A,I=S/R,L=_/2,k=S/2,T=E/2,F=A+1,V=R+1;let Q=0,ee=0;const se=new Y;for(let he=0;he<V;he++){const ie=he*I-k;for(let re=0;re<F;re++){const be=re*M-L;se[g]=be*v,se[y]=ie*x,se[m]=T,c.push(se.x,se.y,se.z),se[g]=0,se[y]=0,se[m]=E>0?1:-1,u.push(se.x,se.y,se.z),d.push(re/A),d.push(1-he/R),Q+=1}}for(let he=0;he<R;he++)for(let ie=0;ie<A;ie++){const re=h+ie+F*he,be=h+ie+F*(he+1),le=h+(ie+1)+F*(he+1),fe=h+(ie+1)+F*he;l.push(re,be,fe),l.push(be,le,fe),ee+=6}a.addGroup(f,ee,w),f+=ee,h+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Pu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function fu(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function Gi(n){const e={};for(let t=0;t<n.length;t++){const i=fu(n[t]);for(const r in i)e[r]=i[r]}return e}function YP(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function N5(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:wt.workingColorSpace}const ZP={clone:fu,merge:Gi};var JP="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",eL="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";class Pr extends es{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=JP,this.fragmentShader=eL,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=fu(e.uniforms),this.uniformsGroups=YP(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class P5 extends nn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xe,this.projectionMatrix=new Xe,this.projectionMatrixInverse=new Xe,this.coordinateSystem=Ir}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ca=new Y,OS=new qe,BS=new qe;class Ki extends P5{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=hu*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Od*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return hu*2*Math.atan(Math.tan(Od*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){ca.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ca.x,ca.y).multiplyScalar(-e/ca.z),ca.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ca.x,ca.y).multiplyScalar(-e/ca.z)}getViewSize(e,t){return this.getViewBounds(e,OS,BS),t.subVectors(BS,OS)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Od*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const pc=-90,mc=1;class tL extends nn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Ki(pc,mc,e,t);r.layers=this.layers,this.add(r);const s=new Ki(pc,mc,e,t);s.layers=this.layers,this.add(s);const o=new Ki(pc,mc,e,t);o.layers=this.layers,this.add(o);const a=new Ki(pc,mc,e,t);a.layers=this.layers,this.add(a);const l=new Ki(pc,mc,e,t);l.layers=this.layers,this.add(l);const c=new Ki(pc,mc,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ir)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Qo)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.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: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,d=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(d,h,f),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class L5 extends Wn{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:kl,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nL extends Fa{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new L5(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Rr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include <begin_vertex>\n #include <project_vertex>\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include <common>\n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n "},r=new Pu(5,5,5),s=new Pr({name:"CubemapFromEquirect",uniforms:fu(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Fi,blending:Ia});s.uniforms.tEquirect.value=t;const o=new pn(r,s),a=t.minFilter;return t.minFilter===Hs&&(t.minFilter=Rr),new tL(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}class xl extends nn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const iL={type:"move"};class wg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new xl,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 xl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Y,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Y),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new xl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Y,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Y),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const g of e.hand.values()){const y=t.getJointPose(g,i),m=this._getHandJoint(c,g);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.visible=y!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],h=u.position.distanceTo(d.position),f=.02,p=.005;c.inputState.pinching&&h>f+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(iL)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new xl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class rL extends nn{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 ws,this.environmentIntensity=1,this.environmentRotation=new ws,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class x_{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=um,this.updateRanges=[],this.version=0,this.uuid=xs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=xs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=xs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Hi=new Y;class e0{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.applyMatrix4(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.applyNormalMatrix(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.transformDirection(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=fs(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=ln(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=ln(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=ln(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=ln(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=ln(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=fs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=fs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=fs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=fs(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array),r=ln(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=ln(t,this.array),i=ln(i,this.array),r=ln(r,this.array),s=ln(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new xi(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new e0(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const kS=new Y,US=new Mt,zS=new Mt,sL=new Y,VS=new Xe,Pf=new Y,Cg=new so,HS=new Xe,Eg=new Oh;class oL extends pn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=yS,this.bindMatrix=new Xe,this.bindMatrixInverse=new Xe,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new rr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Pf),this.boundingBox.expandByPoint(Pf)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new so),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Pf),this.boundingSphere.expandByPoint(Pf)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Cg.copy(this.boundingSphere),Cg.applyMatrix4(r),e.ray.intersectsSphere(Cg)!==!1&&(HS.copy(r).invert(),Eg.copy(e.ray).applyMatrix4(HS),!(this.boundingBox!==null&&Eg.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Eg)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Mt,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===yS?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===JN?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;US.fromBufferAttribute(r.attributes.skinIndex,e),zS.fromBufferAttribute(r.attributes.skinWeight,e),kS.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=zS.getComponent(s);if(o!==0){const a=US.getComponent(s);VS.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(sL.copy(kS).applyMatrix4(VS),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class dh extends nn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class vr extends Wn{constructor(e=null,t=1,i=1,r,s,o,a,l,c=_i,u=_i,d,h){super(null,o,a,l,c,u,r,s,d,h),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const $S=new Xe,aL=new Xe;class t0{constructor(e=[],t=[]){this.uuid=xs(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Xe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Xe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:aL;$S.multiplyMatrices(a,t[s]),$S.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new t0(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new vr(t,e,e,Di,ir);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new dh),this.bones.push(o),this.boneInverses.push(new Xe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=i[r];e.boneInverses.push(a.toArray())}return e}}class jo extends xi{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const gc=new Xe,GS=new Xe,Lf=[],WS=new rr,lL=new Xe,sd=new pn,od=new so;class cL extends pn{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new jo(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,lL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new rr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,gc),WS.copy(e.boundingBox).applyMatrix4(gc),this.boundingBox.union(WS)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new so),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,gc),od.copy(e.boundingSphere).applyMatrix4(gc),this.boundingSphere.union(od)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=i.length+1,o=e*s+1;for(let a=0;a<i.length;a++)i[a]=r[o+a]}raycast(e,t){const i=this.matrixWorld,r=this.count;if(sd.geometry=this.geometry,sd.material=this.material,sd.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),od.copy(this.boundingSphere),od.applyMatrix4(i),e.ray.intersectsSphere(od)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,gc),GS.multiplyMatrices(i,gc),sd.matrixWorld=GS,sd.raycast(e,Lf);for(let o=0,a=Lf.length;o<a;o++){const l=Lf[o];l.instanceId=s,l.object=this,t.push(l)}Lf.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new jo(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new vr(new Float32Array(r*this.count),r,this.count,m_,ir));const s=this.morphTexture.source.data.data;let o=0;for(let c=0;c<i.length;c++)o+=i[c];const a=this.geometry.morphTargetsRelative?1:1-o,l=r*e;s[l]=a,s.set(i,l+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}const Mg=new Y,uL=new Y,dL=new mt;class Co{constructor(e=new Y(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Mg.subVectors(i,t).cross(uL.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Mg),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||dL.getNormalMatrix(e),r=this.coplanarPoint(Mg).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const el=new so,Df=new Y;class S_{constructor(e=new Co,t=new Co,i=new Co,r=new Co,s=new Co,o=new Co){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ir){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],d=r[6],h=r[7],f=r[8],p=r[9],g=r[10],y=r[11],m=r[12],v=r[13],x=r[14],_=r[15];if(i[0].setComponents(l-s,h-c,y-f,_-m).normalize(),i[1].setComponents(l+s,h+c,y+f,_+m).normalize(),i[2].setComponents(l+o,h+u,y+p,_+v).normalize(),i[3].setComponents(l-o,h-u,y-p,_-v).normalize(),i[4].setComponents(l-a,h-d,y-g,_-x).normalize(),t===Ir)i[5].setComponents(l+a,h+d,y+g,_+x).normalize();else if(t===Qo)i[5].setComponents(a,d,g,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),el.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),el.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(el)}intersectsSprite(e){return el.center.set(0,0,0),el.radius=.7071067811865476,el.applyMatrix4(e.matrixWorld),this.intersectsSphere(el)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Df.x=r.normal.x>0?e.max.x:e.min.x,Df.y=r.normal.y>0?e.max.y:e.min.y,Df.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Df)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class D5 extends es{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new gt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const dm=new Y,hm=new Y,QS=new Xe,ad=new Oh,Ff=new so,Rg=new Y,jS=new Y;class A_ extends nn{constructor(e=new ki,t=new D5){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)dm.fromBufferAttribute(t,r-1),hm.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=dm.distanceTo(hm);e.setAttribute("lineDistance",new Si(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ff.copy(i.boundingSphere),Ff.applyMatrix4(r),Ff.radius+=s,e.ray.intersectsSphere(Ff)===!1)return;QS.copy(r).invert(),ad.copy(e.ray).applyMatrix4(QS);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,u=i.index,h=i.attributes.position;if(u!==null){const f=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=f,y=p-1;g<y;g+=c){const m=u.getX(g),v=u.getX(g+1),x=Of(this,e,ad,l,m,v,g);x&&t.push(x)}if(this.isLineLoop){const g=u.getX(p-1),y=u.getX(f),m=Of(this,e,ad,l,g,y,p-1);m&&t.push(m)}}else{const f=Math.max(0,o.start),p=Math.min(h.count,o.start+o.count);for(let g=f,y=p-1;g<y;g+=c){const m=Of(this,e,ad,l,g,g+1,g);m&&t.push(m)}if(this.isLineLoop){const g=Of(this,e,ad,l,p-1,f,p-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function Of(n,e,t,i,r,s,o){const a=n.geometry.attributes.position;if(dm.fromBufferAttribute(a,r),hm.fromBufferAttribute(a,s),t.distanceSqToSegment(dm,hm,Rg,jS)>i)return;Rg.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Rg);if(!(c<e.near||c>e.far))return{distance:c,point:jS.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const qS=new Y,XS=new Y;class hL extends A_{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)qS.fromBufferAttribute(t,r),XS.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+qS.distanceTo(XS);e.setAttribute("lineDistance",new Si(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class fL extends A_{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class F5 extends es{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new gt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const KS=new Xe,Ly=new Oh,Bf=new so,kf=new Y;class pL extends nn{constructor(e=new ki,t=new F5){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Bf.copy(i.boundingSphere),Bf.applyMatrix4(r),Bf.radius+=s,e.ray.intersectsSphere(Bf)===!1)return;KS.copy(r).invert(),Ly.copy(e.ray).applyMatrix4(KS);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=i.index,d=i.attributes.position;if(c!==null){const h=Math.max(0,o.start),f=Math.min(c.count,o.start+o.count);for(let p=h,g=f;p<g;p++){const y=c.getX(p);kf.fromBufferAttribute(d,y),YS(kf,y,l,r,e,t,this)}}else{const h=Math.max(0,o.start),f=Math.min(d.count,o.start+o.count);for(let p=h,g=f;p<g;p++)kf.fromBufferAttribute(d,p),YS(kf,p,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function YS(n,e,t,i,r,s,o){const a=Ly.distanceSqToPoint(n);if(a<t){const l=new Y;Ly.closestPointToPoint(n,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class O5 extends Wn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=_i,this.minFilter=_i,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ua extends Wn{constructor(e,t,i,r,s,o,a,l,c,u=Ml){if(u!==Ml&&u!==du)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===Ml&&(i=Ni),i===void 0&&u===du&&(i=uu),super(null,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:_i,this.minFilter=l!==void 0?l:_i,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class hh extends ki{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const u=[],d=[],h=[],f=[];let p=0;const g=[],y=i/2;let m=0;v(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Si(d,3)),this.setAttribute("normal",new Si(h,3)),this.setAttribute("uv",new Si(f,2));function v(){const _=new Y,S=new Y;let E=0;const A=(t-e)/i;for(let R=0;R<=s;R++){const w=[],M=R/s,I=M*(t-e)+e;for(let L=0;L<=r;L++){const k=L/r,T=k*l+a,F=Math.sin(T),V=Math.cos(T);S.x=I*F,S.y=-M*i+y,S.z=I*V,d.push(S.x,S.y,S.z),_.set(F,A,V).normalize(),h.push(_.x,_.y,_.z),f.push(k,1-M),w.push(p++)}g.push(w)}for(let R=0;R<r;R++)for(let w=0;w<s;w++){const M=g[w][R],I=g[w+1][R],L=g[w+1][R+1],k=g[w][R+1];(e>0||w!==0)&&(u.push(M,I,k),E+=3),(t>0||w!==s-1)&&(u.push(I,L,k),E+=3)}c.addGroup(m,E,0),m+=E}function x(_){const S=p,E=new qe,A=new Y;let R=0;const w=_===!0?e:t,M=_===!0?1:-1;for(let L=1;L<=r;L++)d.push(0,y*M,0),h.push(0,M,0),f.push(.5,.5),p++;const I=p;for(let L=0;L<=r;L++){const T=L/r*l+a,F=Math.cos(T),V=Math.sin(T);A.x=w*V,A.y=y*M,A.z=w*F,d.push(A.x,A.y,A.z),h.push(0,M,0),E.x=F*.5+.5,E.y=V*.5*M+.5,f.push(E.x,E.y),p++}for(let L=0;L<r;L++){const k=S+L,T=I+L;_===!0?u.push(T,T+1,k):u.push(T+1,T,k),R+=3}c.addGroup(m,R,_===!0?1:2),m+=R}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class b_ extends hh{constructor(e=1,t=1,i=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,i,r,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new b_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class pu extends ki{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(i),l=Math.floor(r),c=a+1,u=l+1,d=e/a,h=t/l,f=[],p=[],g=[],y=[];for(let m=0;m<u;m++){const v=m*h-o;for(let x=0;x<c;x++){const _=x*d-s;p.push(_,-v,0),g.push(0,0,1),y.push(x/a),y.push(1-m/l)}}for(let m=0;m<l;m++)for(let v=0;v<a;v++){const x=v+c*m,_=v+c*(m+1),S=v+1+c*(m+1),E=v+1+c*m;f.push(x,_,E),f.push(_,S,E)}this.setIndex(f),this.setAttribute("position",new Si(p,3)),this.setAttribute("normal",new Si(g,3)),this.setAttribute("uv",new Si(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pu(e.width,e.height,e.widthSegments,e.heightSegments)}}class fm extends ki{constructor(e=1,t=32,i=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(o+a,Math.PI);let c=0;const u=[],d=new Y,h=new Y,f=[],p=[],g=[],y=[];for(let m=0;m<=i;m++){const v=[],x=m/i;let _=0;m===0&&o===0?_=.5/t:m===i&&l===Math.PI&&(_=-.5/t);for(let S=0;S<=t;S++){const E=S/t;d.x=-e*Math.cos(r+E*s)*Math.sin(o+x*a),d.y=e*Math.cos(o+x*a),d.z=e*Math.sin(r+E*s)*Math.sin(o+x*a),p.push(d.x,d.y,d.z),h.copy(d).normalize(),g.push(h.x,h.y,h.z),y.push(E+_,1-x),v.push(c++)}u.push(v)}for(let m=0;m<i;m++)for(let v=0;v<t;v++){const x=u[m][v+1],_=u[m][v],S=u[m+1][v],E=u[m+1][v+1];(m!==0||o>0)&&f.push(x,_,E),(m!==i-1||l<Math.PI)&&f.push(_,S,E)}this.setIndex(f),this.setAttribute("position",new Si(p,3)),this.setAttribute("normal",new Si(g,3)),this.setAttribute("uv",new Si(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fm(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class T_ extends es{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new gt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=lm,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ws,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class oo extends T_{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new qe(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Nt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new gt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new gt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new gt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class mL extends es{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=rP,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class gL extends es{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Uf(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function yL(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function vL(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function ZS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function B5(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}class Bh{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(i=2,s=a);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class _L extends Bh{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Lc,endingEnd:Lc}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case Dc:s=e,a=2*t-i;break;case am:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Dc:o=e,l=2*i-t;break;case am:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}const c=(i-t)*.5,u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-i),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=this._offsetPrev,d=this._offsetNext,h=this._weightPrev,f=this._weightNext,p=(i-t)/(r-t),g=p*p,y=g*p,m=-h*y+2*h*g-h*p,v=(1+h)*y+(-1.5-2*h)*g+(-.5+h)*p+1,x=(-1-f)*y+(1.5+f)*g+.5*p,_=f*y-f*g;for(let S=0;S!==a;++S)s[S]=m*o[u+S]+v*o[c+S]+x*o[l+S]+_*o[d+S];return s}}class k5 extends Bh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,u=(i-t)/(r-t),d=1-u;for(let h=0;h!==a;++h)s[h]=o[c+h]*d+o[l+h]*u;return s}}class xL extends Bh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class ao{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Uf(t,this.TimeBufferType),this.values=Uf(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Uf(e.times,Array),values:Uf(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new xL(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new k5(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new _L(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ah:t=this.InterpolantFactoryMethodDiscrete;break;case lh:t=this.InterpolantFactoryMethodLinear;break;case sg:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ah;case this.InterpolantFactoryMethodLinear:return lh;case this.InterpolantFactoryMethodSmooth:return sg}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&yL(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===sg,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const c=e[a],u=e[a+1];if(c!==u&&(a!==1||c!==e[0]))if(r)l=!0;else{const d=a*i,h=d-i,f=d+i;for(let p=0;p!==i;++p){const g=t[d+p];if(g!==t[h+p]||g!==t[f+p]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const d=a*i,h=o*i;for(let f=0;f!==i;++f)t[h+f]=t[d+f]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}ao.prototype.TimeBufferType=Float32Array;ao.prototype.ValueBufferType=Float32Array;ao.prototype.DefaultInterpolation=lh;class Lu extends ao{constructor(e,t,i){super(e,t,i)}}Lu.prototype.ValueTypeName="bool";Lu.prototype.ValueBufferType=Array;Lu.prototype.DefaultInterpolation=ah;Lu.prototype.InterpolantFactoryMethodLinear=void 0;Lu.prototype.InterpolantFactoryMethodSmooth=void 0;class U5 extends ao{}U5.prototype.ValueTypeName="color";class mu extends ao{}mu.prototype.ValueTypeName="number";class SL extends Bh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Qt.slerpFlat(s,0,o,c-a,o,c,l);return s}}class gu extends ao{InterpolantFactoryMethodLinear(e){return new SL(this.times,this.values,this.getValueSize(),e)}}gu.prototype.ValueTypeName="quaternion";gu.prototype.InterpolantFactoryMethodSmooth=void 0;class Du extends ao{constructor(e,t,i){super(e,t,i)}}Du.prototype.ValueTypeName="string";Du.prototype.ValueBufferType=Array;Du.prototype.DefaultInterpolation=ah;Du.prototype.InterpolantFactoryMethodLinear=void 0;Du.prototype.InterpolantFactoryMethodSmooth=void 0;class yu extends ao{}yu.prototype.ValueTypeName="vector";class Dy{constructor(e="",t=-1,i=[],r=y_){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=xs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(bL(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ao.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],c=[];l.push((a+s-1)%s,a,(a+1)%s),c.push(0,1,0);const u=vL(l);l=ZS(l,1,u),c=ZS(c,1,u),!r&&l[0]===0&&(l.push(s),c.push(c[0])),o.push(new mu(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.name.match(s);if(u&&u.length>1){const d=u[1];let h=r[d];h||(r[d]=h=[]),h.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,h,f,p,g){if(f.length!==0){const y=[],m=[];B5(f,y,m,p),y.length!==0&&g.push(new d(h,y,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const h=c[d].keys;if(!(!h||h.length===0))if(h[0].morphTargets){const f={};let p;for(p=0;p<h.length;p++)if(h[p].morphTargets)for(let g=0;g<h[p].morphTargets.length;g++)f[h[p].morphTargets[g]]=-1;for(const g in f){const y=[],m=[];for(let v=0;v!==h[p].morphTargets.length;++v){const x=h[p];y.push(x.time),m.push(x.morphTarget===g?1:0)}r.push(new mu(".morphTargetInfluence["+g+"]",y,m))}l=f.length*o}else{const f=".bones["+t[d].name+"]";i(yu,f+".position",h,"pos",r),i(gu,f+".quaternion",h,"rot",r),i(yu,f+".scale",h,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function AL(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return mu;case"vector":case"vector2":case"vector3":case"vector4":return yu;case"color":return U5;case"quaternion":return gu;case"bool":case"boolean":return Lu;case"string":return Du}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function bL(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=AL(n.type);if(n.times===void 0){const t=[],i=[];B5(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const wa={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class TL{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,h=c.length;d<h;d+=2){const f=c[d],p=c[d+1];if(f.global&&(f.lastIndex=0),f.test(u))return p}return null}}}const wL=new TL;class Fu{constructor(e){this.manager=e!==void 0?e:wL,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Fu.DEFAULT_MATERIAL_NAME="__DEFAULT";const vo={};class CL extends Error{constructor(e,t){super(e),this.response=t}}class z5 extends Fu{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=wa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(vo[e]!==void 0){vo[e].push({onLoad:t,onProgress:i,onError:r});return}vo[e]=[],vo[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=vo[e],d=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=h?parseInt(h):0,p=f!==0;let g=0;const y=new ReadableStream({start(m){v();function v(){d.read().then(({done:x,value:_})=>{if(x)m.close();else{g+=_.byteLength;const S=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:f});for(let E=0,A=u.length;E<A;E++){const R=u[E];R.onProgress&&R.onProgress(S)}m.enqueue(_),v()}},x=>{m.error(x)})}}});return new Response(y)}else throw new CL('fetch for "'.concat(c.url,'" responded with ').concat(c.status,": ").concat(c.statusText),c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),h=d&&d[1]?d[1].toLowerCase():void 0,f=new TextDecoder(h);return c.arrayBuffer().then(p=>f.decode(p))}}}).then(c=>{wa.add(e,c);const u=vo[e];delete vo[e];for(let d=0,h=u.length;d<h;d++){const f=u[d];f.onLoad&&f.onLoad(c)}}).catch(c=>{const u=vo[e];if(u===void 0)throw this.manager.itemError(e),c;delete vo[e];for(let d=0,h=u.length;d<h;d++){const f=u[d];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class EL extends Fu{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=wa.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=ch("img");function l(){u(),wa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(d){u(),r&&r(d),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class ML extends Fu{constructor(e){super(e)}load(e,t,i,r){const s=new Wn,o=new EL(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class w_ extends nn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new gt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const Ig=new Xe,JS=new Y,eA=new Y;class C_{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new qe(512,512),this.map=null,this.mapPass=null,this.matrix=new Xe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new S_,this._frameExtents=new qe(1,1),this._viewportCount=1,this._viewports=[new Mt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;JS.setFromMatrixPosition(e.matrixWorld),t.position.copy(JS),eA.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(eA),t.updateMatrixWorld(),Ig.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ig),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Ig)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class RL extends C_{constructor(){super(new Ki(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=hu*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class IL extends w_{constructor(e,t,i=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(nn.DEFAULT_UP),this.updateMatrix(),this.target=new nn,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new RL}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const tA=new Xe,ld=new Y,Ng=new Y;class NL extends C_{constructor(){super(new Ki(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new qe(4,2),this._viewportCount=6,this._viewports=[new Mt(2,1,1,1),new Mt(0,1,1,1),new Mt(3,1,1,1),new Mt(1,1,1,1),new Mt(3,0,1,1),new Mt(1,0,1,1)],this._cubeDirections=[new Y(1,0,0),new Y(-1,0,0),new Y(0,0,1),new Y(0,0,-1),new Y(0,1,0),new Y(0,-1,0)],this._cubeUps=[new Y(0,1,0),new Y(0,1,0),new Y(0,1,0),new Y(0,1,0),new Y(0,0,1),new Y(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),ld.setFromMatrixPosition(e.matrixWorld),i.position.copy(ld),Ng.copy(i.position),Ng.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Ng),i.updateMatrixWorld(),r.makeTranslation(-ld.x,-ld.y,-ld.z),tA.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(tA)}}class PL extends w_{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new NL}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Ou extends P5{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class LL extends C_{constructor(){super(new Ou(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DL extends w_{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(nn.DEFAULT_UP),this.updateMatrix(),this.target=new nn,this.shadow=new LL}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class kd{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch(i){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class FL extends ki{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class OL extends Fu{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=wa.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return wa.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),wa.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});wa.add(e,l),s.manager.itemStart(e)}}class BL extends Ki{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class kL{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=nA(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=nA();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function nA(){return performance.now()}class UL{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)i[s+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(i,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Qt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Qt.multiplyQuaternionsFlat(e,o,e,t,e,i),Qt.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const E_="\\[\\]\\.:\\/",zL=new RegExp("["+E_+"]","g"),M_="[^"+E_+"]",VL="[^"+E_.replace("\\.","")+"]",HL=/((?:WC+[\/:])*)/.source.replace("WC",M_),$L=/(WCOD+)?/.source.replace("WCOD",VL),GL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",M_),WL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",M_),QL=new RegExp("^"+HL+$L+GL+WL+"$"),jL=["material","materials","bones","map"];class qL{constructor(e,t,i){const r=i||en.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class en{constructor(e,t,i){this.path=t,this.parsedPath=i||en.parseTrackName(t),this.node=en.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new en.Composite(e,t,i):new en(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(zL,"")}static parseTrackName(e){const t=QL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);jL.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=i(a.children);if(l)return l}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=en.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?a=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}en.Composite=qL;en.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};en.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};en.prototype.GetterByBindingType=[en.prototype._getValue_direct,en.prototype._getValue_array,en.prototype._getValue_arrayElement,en.prototype._getValue_toArray];en.prototype.SetterByBindingTypeAndVersioning=[[en.prototype._setValue_direct,en.prototype._setValue_direct_setNeedsUpdate,en.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[en.prototype._setValue_array,en.prototype._setValue_array_setNeedsUpdate,en.prototype._setValue_array_setMatrixWorldNeedsUpdate],[en.prototype._setValue_arrayElement,en.prototype._setValue_arrayElement_setNeedsUpdate,en.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[en.prototype._setValue_fromArray,en.prototype._setValue_fromArray_setNeedsUpdate,en.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class XL{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Lc,endingEnd:Lc};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=zl,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case nP:for(let u=0,d=l.length;u!==d;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case y_:default:for(let u=0,d=l.length;u!==d;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===tP;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===Jr){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Dc,r.endingEnd=Dc):(e?r.endingStart=this.zeroSlopeAtStart?Dc:Lc:r.endingStart=am,t?r.endingEnd=this.zeroSlopeAtEnd?Dc:Lc:r.endingEnd=am)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const KL=new Float32Array(1);class YL extends ro{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let d=0;d!==s;++d){const h=r[d],f=h.name;let p=u[f];if(p!==void 0)++p.referenceCount,o[d]=p;else{if(p=o[d],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}const g=t&&t._propertyBindings[d].binding.parsedPath;p=new UL(en.create(i,f,g),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[d]=p}a[d].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const d=a.actionByRoot,h=(e._localRoot||this._root).uuid;delete d[h],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new k5(new Float32Array(2),new Float32Array(2),1,KL),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?Dy.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=y_),l!==void 0){const d=l.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const u=new XL(this,o,t,i);return this._bindAction(u,c),this._addInactiveAction(u,a,s),u}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?Dy.findByName(i,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];this._deactivateAction(c);const u=c._cacheIndex,d=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,d._cacheIndex=u,t[u]=d,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class ZL extends x_{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class iA{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Nt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Nt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class R_{constructor(e,t,i,r){R_.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=i,s[3]=r,this}}function rA(n,e,t,i){const r=JL(i);switch(t){case g5:return n*e;case v5:return n*e;case _5:return n*e*2;case m_:return n*e/r.components*r.byteLength;case Jm:return n*e/r.components*r.byteLength;case oh:return n*e*2/r.components*r.byteLength;case g_:return n*e*2/r.components*r.byteLength;case y5:return n*e*3/r.components*r.byteLength;case Di:return n*e*4/r.components*r.byteLength;case wo:return n*e*4/r.components*r.byteLength;case Tp:case wp:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Cp:case Ep:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case ay:case cy:return Math.max(n,16)*Math.max(e,8)/4;case oy:case ly:return Math.max(n,8)*Math.max(e,8)/2;case uy:case dy:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case hy:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case fy:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case py:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case my:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case gy:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case yy:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case vy:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case _y:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case xy:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Sy:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Ay:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case by:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ty:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case wy:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case Cy:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Mp:case Ey:case My:return Math.ceil(n/4)*Math.ceil(e/4)*16;case x5:case Ry:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Iy:case Ny:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error("Unable to determine texture byte length for ".concat(t," format."))}function JL(n){switch(n){case Js:case f5:return{byteLength:1,components:1};case sh:case p5:case Ts:return{byteLength:2,components:1};case f_:case p_:return{byteLength:2,components:4};case Ni:case Zm:case ir:return{byteLength:4,components:1};case m5:return{byteLength:4,components:3}}throw new Error("Unknown texture type ".concat(n,"."))}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:d_}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=d_);/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/function V5(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function eD(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,d=c.byteLength,h=n.createBuffer();n.bindBuffer(l,h),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:d}}function i(a,l,c){const u=l.array,d=l.updateRanges;if(n.bindBuffer(c,a),d.length===0)n.bufferSubData(c,0,u);else{d.sort((f,p)=>f.start-p.start);let h=0;for(let f=1;f<d.length;f++){const p=d[h],g=d[f];g.start<=p.start+p.count+1?p.count=Math.max(p.count,g.start+g.count-p.start):(++h,d[h]=g)}d.length=h+1;for(let f=0,p=d.length;f<p;f++){const g=d[f];n.bufferSubData(c,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=e.get(a);l&&(n.deleteBuffer(l.buffer),e.delete(a))}function o(a,l){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const u=e.get(a);(!u||u.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}const c=e.get(a);if(c===void 0)e.set(a,t(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(c.buffer,a,l),c.version=a.version}}return{get:r,remove:s,update:o}}var tD="#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",nD="#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",iD="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",rD="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",sD="#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",oD="#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aD="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",lD="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",cD="#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",uD="#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",dD="vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",hD="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",fD="float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",pD="#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",mD="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",gD="#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",yD="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",vD="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",_D="#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",xD="#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",SD="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",AD="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",bD="#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",TD="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",wD="#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",CD="vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",ED="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",MD="#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",RD="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",ID="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",ND="gl_FragColor = linearToOutputTexel( gl_FragColor );",PD="vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n 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 );\n}",LD="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",DD="#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",FD="#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",OD="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",BD="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",kD="#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",UD="#ifdef USE_FOG\n varying float vFogDepth;\n#endif",zD="#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",VD="#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",HD="#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",$D="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",GD="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",WD="varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",QD="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",jD="#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",qD="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",XD="varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",KD="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",YD="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",ZD="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",JD="struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",eF="\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",tF="#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",nF="#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",iF="#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",rF="#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",sF="#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",oF="#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",aF="#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",lF="#ifdef USE_MAP\n uniform sampler2D map;\n#endif",cF="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",uF="#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",dF="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",hF="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",fF="#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",pF="#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",mF="#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",gF="#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",yF="#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",vF="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",_F="#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",xF="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",SF="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",AF="#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",bF="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",TF="#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",wF="#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",CF="#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",EF="#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",MF="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",RF="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",IF="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",NF="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",PF="#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",LF="#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",DF="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",FF="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",OF="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",BF="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",kF="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",UF="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",zF="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",VF="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",HF="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",$F="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",GF="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",WF="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",QF="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",jF="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",qF="#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",XF="#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",KF="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",YF="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",ZF="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",JF="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif";const e7="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",t7="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",n7="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",i7="#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",r7="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",s7="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",o7="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",a7="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",l7="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",c7="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",u7="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",d7="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",h7="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",f7="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",p7="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",m7="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",g7="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",y7="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",v7="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",_7="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",x7="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",S7="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",A7="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",b7="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",T7="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",w7="#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",C7="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",E7="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",M7="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",R7="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",I7="#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",N7="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",P7="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",L7="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",It={alphahash_fragment:tD,alphahash_pars_fragment:nD,alphamap_fragment:iD,alphamap_pars_fragment:rD,alphatest_fragment:sD,alphatest_pars_fragment:oD,aomap_fragment:aD,aomap_pars_fragment:lD,batching_pars_vertex:cD,batching_vertex:uD,begin_vertex:dD,beginnormal_vertex:hD,bsdfs:fD,iridescence_fragment:pD,bumpmap_pars_fragment:mD,clipping_planes_fragment:gD,clipping_planes_pars_fragment:yD,clipping_planes_pars_vertex:vD,clipping_planes_vertex:_D,color_fragment:xD,color_pars_fragment:SD,color_pars_vertex:AD,color_vertex:bD,common:TD,cube_uv_reflection_fragment:wD,defaultnormal_vertex:CD,displacementmap_pars_vertex:ED,displacementmap_vertex:MD,emissivemap_fragment:RD,emissivemap_pars_fragment:ID,colorspace_fragment:ND,colorspace_pars_fragment:PD,envmap_fragment:LD,envmap_common_pars_fragment:DD,envmap_pars_fragment:FD,envmap_pars_vertex:OD,envmap_physical_pars_fragment:jD,envmap_vertex:BD,fog_vertex:kD,fog_pars_vertex:UD,fog_fragment:zD,fog_pars_fragment:VD,gradientmap_pars_fragment:HD,lightmap_pars_fragment:$D,lights_lambert_fragment:GD,lights_lambert_pars_fragment:WD,lights_pars_begin:QD,lights_toon_fragment:qD,lights_toon_pars_fragment:XD,lights_phong_fragment:KD,lights_phong_pars_fragment:YD,lights_physical_fragment:ZD,lights_physical_pars_fragment:JD,lights_fragment_begin:eF,lights_fragment_maps:tF,lights_fragment_end:nF,logdepthbuf_fragment:iF,logdepthbuf_pars_fragment:rF,logdepthbuf_pars_vertex:sF,logdepthbuf_vertex:oF,map_fragment:aF,map_pars_fragment:lF,map_particle_fragment:cF,map_particle_pars_fragment:uF,metalnessmap_fragment:dF,metalnessmap_pars_fragment:hF,morphinstance_vertex:fF,morphcolor_vertex:pF,morphnormal_vertex:mF,morphtarget_pars_vertex:gF,morphtarget_vertex:yF,normal_fragment_begin:vF,normal_fragment_maps:_F,normal_pars_fragment:xF,normal_pars_vertex:SF,normal_vertex:AF,normalmap_pars_fragment:bF,clearcoat_normal_fragment_begin:TF,clearcoat_normal_fragment_maps:wF,clearcoat_pars_fragment:CF,iridescence_pars_fragment:EF,opaque_fragment:MF,packing:RF,premultiplied_alpha_fragment:IF,project_vertex:NF,dithering_fragment:PF,dithering_pars_fragment:LF,roughnessmap_fragment:DF,roughnessmap_pars_fragment:FF,shadowmap_pars_fragment:OF,shadowmap_pars_vertex:BF,shadowmap_vertex:kF,shadowmask_pars_fragment:UF,skinbase_vertex:zF,skinning_pars_vertex:VF,skinning_vertex:HF,skinnormal_vertex:$F,specularmap_fragment:GF,specularmap_pars_fragment:WF,tonemapping_fragment:QF,tonemapping_pars_fragment:jF,transmission_fragment:qF,transmission_pars_fragment:XF,uv_pars_fragment:KF,uv_pars_vertex:YF,uv_vertex:ZF,worldpos_vertex:JF,background_vert:e7,background_frag:t7,backgroundCube_vert:n7,backgroundCube_frag:i7,cube_vert:r7,cube_frag:s7,depth_vert:o7,depth_frag:a7,distanceRGBA_vert:l7,distanceRGBA_frag:c7,equirect_vert:u7,equirect_frag:d7,linedashed_vert:h7,linedashed_frag:f7,meshbasic_vert:p7,meshbasic_frag:m7,meshlambert_vert:g7,meshlambert_frag:y7,meshmatcap_vert:v7,meshmatcap_frag:_7,meshnormal_vert:x7,meshnormal_frag:S7,meshphong_vert:A7,meshphong_frag:b7,meshphysical_vert:T7,meshphysical_frag:w7,meshtoon_vert:C7,meshtoon_frag:E7,points_vert:M7,points_frag:R7,shadow_vert:I7,shadow_frag:N7,sprite_vert:P7,sprite_frag:L7},tt={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new mt},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new mt}},envmap:{envMap:{value:null},envMapRotation:{value:new mt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new mt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new mt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new mt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new mt},normalScale:{value:new qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new mt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new mt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new mt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new mt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(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 gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0},uvTransform:{value:new mt}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new qe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new mt},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0}}},Us={basic:{uniforms:Gi([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.fog]),vertexShader:It.meshbasic_vert,fragmentShader:It.meshbasic_frag},lambert:{uniforms:Gi([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,tt.lights,{emissive:{value:new gt(0)}}]),vertexShader:It.meshlambert_vert,fragmentShader:It.meshlambert_frag},phong:{uniforms:Gi([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,tt.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:It.meshphong_vert,fragmentShader:It.meshphong_frag},standard:{uniforms:Gi([tt.common,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.roughnessmap,tt.metalnessmap,tt.fog,tt.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag},toon:{uniforms:Gi([tt.common,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.gradientmap,tt.fog,tt.lights,{emissive:{value:new gt(0)}}]),vertexShader:It.meshtoon_vert,fragmentShader:It.meshtoon_frag},matcap:{uniforms:Gi([tt.common,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,{matcap:{value:null}}]),vertexShader:It.meshmatcap_vert,fragmentShader:It.meshmatcap_frag},points:{uniforms:Gi([tt.points,tt.fog]),vertexShader:It.points_vert,fragmentShader:It.points_frag},dashed:{uniforms:Gi([tt.common,tt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:It.linedashed_vert,fragmentShader:It.linedashed_frag},depth:{uniforms:Gi([tt.common,tt.displacementmap]),vertexShader:It.depth_vert,fragmentShader:It.depth_frag},normal:{uniforms:Gi([tt.common,tt.bumpmap,tt.normalmap,tt.displacementmap,{opacity:{value:1}}]),vertexShader:It.meshnormal_vert,fragmentShader:It.meshnormal_frag},sprite:{uniforms:Gi([tt.sprite,tt.fog]),vertexShader:It.sprite_vert,fragmentShader:It.sprite_frag},background:{uniforms:{uvTransform:{value:new mt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:It.background_vert,fragmentShader:It.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new mt}},vertexShader:It.backgroundCube_vert,fragmentShader:It.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:It.cube_vert,fragmentShader:It.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:It.equirect_vert,fragmentShader:It.equirect_frag},distanceRGBA:{uniforms:Gi([tt.common,tt.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:It.distanceRGBA_vert,fragmentShader:It.distanceRGBA_frag},shadow:{uniforms:Gi([tt.lights,tt.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:It.shadow_vert,fragmentShader:It.shadow_frag}};Us.physical={uniforms:Gi([Us.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new mt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new mt},clearcoatNormalScale:{value:new qe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new mt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new mt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new mt},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new mt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new mt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new mt},transmissionSamplerSize:{value:new qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new mt},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new mt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new mt},anisotropyVector:{value:new qe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new mt}}]),vertexShader:It.meshphysical_vert,fragmentShader:It.meshphysical_frag};const zf={r:0,b:0,g:0},tl=new ws,D7=new Xe;function F7(n,e,t,i,r,s,o){const a=new gt(0);let l=s===!0?0:1,c,u,d=null,h=0,f=null;function p(x){let _=x.isScene===!0?x.background:null;return _&&_.isTexture&&(_=(x.backgroundBlurriness>0?t:e).get(_)),_}function g(x){let _=!1;const S=p(x);S===null?m(a,l):S&&S.isColor&&(m(S,1),_=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||_)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(x,_){const S=p(_);S&&(S.isCubeTexture||S.mapping===Ym)?(u===void 0&&(u=new pn(new Pu(1,1,1),new Pr({name:"BackgroundCubeMaterial",uniforms:fu(Us.backgroundCube.uniforms),vertexShader:Us.backgroundCube.vertexShader,fragmentShader:Us.backgroundCube.fragmentShader,side:Fi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,A,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),tl.copy(_.backgroundRotation),tl.x*=-1,tl.y*=-1,tl.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(tl.y*=-1,tl.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(D7.makeRotationFromEuler(tl)),u.material.toneMapped=wt.getTransfer(S.colorSpace)!==Zt,(d!==S||h!==S.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,d=S,h=S.version,f=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new pn(new pu(2,2),new Pr({name:"BackgroundMaterial",uniforms:fu(Us.background.uniforms),vertexShader:Us.background.vertexShader,fragmentShader:Us.background.fragmentShader,side:bs,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,c.material.toneMapped=wt.getTransfer(S.colorSpace)!==Zt,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(d!==S||h!==S.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,d=S,h=S.version,f=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function m(x,_){x.getRGB(zf,N5(n)),i.buffers.color.setClear(zf.r,zf.g,zf.b,_,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,_=1){a.set(x),l=_,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:g,addToRenderList:y,dispose:v}}function O7(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=h(null);let s=r,o=!1;function a(M,I,L,k,T){let F=!1;const V=d(k,L,I);s!==V&&(s=V,c(s.object)),F=f(M,k,L,T),F&&p(M,k,L,T),T!==null&&e.update(T,n.ELEMENT_ARRAY_BUFFER),(F||o)&&(o=!1,_(M,I,L,k),T!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(T).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function d(M,I,L){const k=L.wireframe===!0;let T=i[M.id];T===void 0&&(T={},i[M.id]=T);let F=T[I.id];F===void 0&&(F={},T[I.id]=F);let V=F[k];return V===void 0&&(V=h(l()),F[k]=V),V}function h(M){const I=[],L=[],k=[];for(let T=0;T<t;T++)I[T]=0,L[T]=0,k[T]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:L,attributeDivisors:k,object:M,attributes:{},index:null}}function f(M,I,L,k){const T=s.attributes,F=I.attributes;let V=0;const Q=L.getAttributes();for(const ee in Q)if(Q[ee].location>=0){const he=T[ee];let ie=F[ee];if(ie===void 0&&(ee==="instanceMatrix"&&M.instanceMatrix&&(ie=M.instanceMatrix),ee==="instanceColor"&&M.instanceColor&&(ie=M.instanceColor)),he===void 0||he.attribute!==ie||ie&&he.data!==ie.data)return!0;V++}return s.attributesNum!==V||s.index!==k}function p(M,I,L,k){const T={},F=I.attributes;let V=0;const Q=L.getAttributes();for(const ee in Q)if(Q[ee].location>=0){let he=F[ee];he===void 0&&(ee==="instanceMatrix"&&M.instanceMatrix&&(he=M.instanceMatrix),ee==="instanceColor"&&M.instanceColor&&(he=M.instanceColor));const ie={};ie.attribute=he,he&&he.data&&(ie.data=he.data),T[ee]=ie,V++}s.attributes=T,s.attributesNum=V,s.index=k}function g(){const M=s.newAttributes;for(let I=0,L=M.length;I<L;I++)M[I]=0}function y(M){m(M,0)}function m(M,I){const L=s.newAttributes,k=s.enabledAttributes,T=s.attributeDivisors;L[M]=1,k[M]===0&&(n.enableVertexAttribArray(M),k[M]=1),T[M]!==I&&(n.vertexAttribDivisor(M,I),T[M]=I)}function v(){const M=s.newAttributes,I=s.enabledAttributes;for(let L=0,k=I.length;L<k;L++)I[L]!==M[L]&&(n.disableVertexAttribArray(L),I[L]=0)}function x(M,I,L,k,T,F,V){V===!0?n.vertexAttribIPointer(M,I,L,T,F):n.vertexAttribPointer(M,I,L,k,T,F)}function _(M,I,L,k){g();const T=k.attributes,F=L.getAttributes(),V=I.defaultAttributeValues;for(const Q in F){const ee=F[Q];if(ee.location>=0){let se=T[Q];if(se===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(se=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(se=M.instanceColor)),se!==void 0){const he=se.normalized,ie=se.itemSize,re=e.get(se);if(re===void 0)continue;const be=re.buffer,le=re.type,fe=re.bytesPerElement,Te=le===n.INT||le===n.UNSIGNED_INT||se.gpuType===Zm;if(se.isInterleavedBufferAttribute){const Ce=se.data,Ie=Ce.stride,ze=se.offset;if(Ce.isInstancedInterleavedBuffer){for(let Be=0;Be<ee.locationSize;Be++)m(ee.location+Be,Ce.meshPerAttribute);M.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=Ce.meshPerAttribute*Ce.count)}else for(let Be=0;Be<ee.locationSize;Be++)y(ee.location+Be);n.bindBuffer(n.ARRAY_BUFFER,be);for(let Be=0;Be<ee.locationSize;Be++)x(ee.location+Be,ie/ee.locationSize,le,he,Ie*fe,(ze+ie/ee.locationSize*Be)*fe,Te)}else{if(se.isInstancedBufferAttribute){for(let Ce=0;Ce<ee.locationSize;Ce++)m(ee.location+Ce,se.meshPerAttribute);M.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=se.meshPerAttribute*se.count)}else for(let Ce=0;Ce<ee.locationSize;Ce++)y(ee.location+Ce);n.bindBuffer(n.ARRAY_BUFFER,be);for(let Ce=0;Ce<ee.locationSize;Ce++)x(ee.location+Ce,ie/ee.locationSize,le,he,ie*fe,ie/ee.locationSize*Ce*fe,Te)}}else if(V!==void 0){const he=V[Q];if(he!==void 0)switch(he.length){case 2:n.vertexAttrib2fv(ee.location,he);break;case 3:n.vertexAttrib3fv(ee.location,he);break;case 4:n.vertexAttrib4fv(ee.location,he);break;default:n.vertexAttrib1fv(ee.location,he)}}}}v()}function S(){R();for(const M in i){const I=i[M];for(const L in I){const k=I[L];for(const T in k)u(k[T].object),delete k[T];delete I[L]}delete i[M]}}function E(M){if(i[M.id]===void 0)return;const I=i[M.id];for(const L in I){const k=I[L];for(const T in k)u(k[T].object),delete k[T];delete I[L]}delete i[M.id]}function A(M){for(const I in i){const L=i[I];if(L[M.id]===void 0)continue;const k=L[M.id];for(const T in k)u(k[T].object),delete k[T];delete L[M.id]}}function R(){w(),o=!0,s!==r&&(s=r,c(s.object))}function w(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:R,resetDefaultState:w,dispose:S,releaseStatesOfGeometry:E,releaseStatesOfProgram:A,initAttributes:g,enableAttribute:y,disableUnusedAttributes:v}}function B7(n,e,t){let i;function r(c){i=c}function s(c,u){n.drawArrays(i,c,u),t.update(u,i,1)}function o(c,u,d){d!==0&&(n.drawArraysInstanced(i,c,u,d),t.update(u,i,d))}function a(c,u,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,c,0,u,0,d);let f=0;for(let p=0;p<d;p++)f+=u[p];t.update(f,i,1)}function l(c,u,d,h){if(d===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let p=0;p<c.length;p++)o(c[p],u[p],h[p]);else{f.multiDrawArraysInstancedWEBGL(i,c,0,u,0,h,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g]*h[g];t.update(p,i,1)}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function k7(n,e,t,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(A){return!(A!==Di&&i.convert(A)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(A){const R=A===Ts&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==Js&&i.convert(A)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==ir&&!R)}function l(A){if(A==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=t.logarithmicDepthBuffer===!0,h=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),_=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=p>0,E=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:h,maxTextures:f,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:y,maxAttributes:m,maxVertexUniforms:v,maxVaryings:x,maxFragmentUniforms:_,vertexTextures:S,maxSamples:E}}function U7(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Co,a=new mt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,h){const f=d.length!==0||h||i!==0||r;return r=h,i=d.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,h){t=u(d,h,0)},this.setState=function(d,h,f){const p=d.clippingPlanes,g=d.clipIntersection,y=d.clipShadows,m=n.get(d);if(!r||p===null||p.length===0||s&&!y)s?u(null):c();else{const v=s?0:i,x=v*4;let _=m.clippingState||null;l.value=_,_=u(p,h,x,f);for(let S=0;S!==x;++S)_[S]=t[S];m.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=v}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,h,f,p){const g=d!==null?d.length:0;let y=null;if(g!==0){if(y=l.value,p!==!0||y===null){const m=f+g*4,v=h.matrixWorldInverse;a.getNormalMatrix(v),(y===null||y.length<m)&&(y=new Float32Array(m));for(let x=0,_=f;x!==g;++x,_+=4)o.copy(d[x]).applyMatrix4(v,a),o.normal.toArray(y,_),y[_+3]=o.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,y}}function z7(n){let e=new WeakMap;function t(o,a){return a===ry?o.mapping=kl:a===sy&&(o.mapping=Ul),o}function i(o){if(o&&o.isTexture){const a=o.mapping;if(a===ry||a===sy)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=new nL(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const Fc=4,sA=[.125,.215,.35,.446,.526,.582],fl=20,Pg=new Ou,oA=new gt;let Lg=null,Dg=0,Fg=0,Og=!1;const dl=(1+Math.sqrt(5))/2,yc=1/dl,aA=[new Y(-dl,yc,0),new Y(dl,yc,0),new Y(-yc,0,dl),new Y(yc,0,dl),new Y(0,dl,-yc),new Y(0,dl,yc),new Y(-1,1,-1),new Y(1,1,-1),new Y(-1,1,1),new Y(1,1,1)];let lA=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Lg=this._renderer.getRenderTarget(),Dg=this._renderer.getActiveCubeFace(),Fg=this._renderer.getActiveMipmapLevel(),Og=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=dA(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=uA(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Lg,Dg,Fg),this._renderer.xr.enabled=Og,e.scissorTest=!1,Vf(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===kl||e.mapping===Ul?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Lg=this._renderer.getRenderTarget(),Dg=this._renderer.getActiveCubeFace(),Fg=this._renderer.getActiveMipmapLevel(),Og=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:Rr,minFilter:Rr,generateMipmaps:!1,type:Ts,format:Di,colorSpace:Bi,depthBuffer:!1},r=cA(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=cA(e,t,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=V7(s)),this._blurMaterial=H7(s,e,t)}return r}_compileMaterial(e){const t=new pn(this._lodPlanes[0],e);this._renderer.compile(t,Pg)}_sceneToCubeUV(e,t,i,r){const a=new Ki(90,1,t,i),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,h=u.toneMapping;u.getClearColor(oA),u.toneMapping=_s,u.autoClear=!1;const f=new Yr({name:"PMREM.Background",side:Fi,depthWrite:!1,depthTest:!1}),p=new pn(new Pu,f);let g=!1;const y=e.background;y?y.isColor&&(f.color.copy(y),e.background=null,g=!0):(f.color.copy(oA),g=!0);for(let m=0;m<6;m++){const v=m%3;v===0?(a.up.set(0,l[m],0),a.lookAt(c[m],0,0)):v===1?(a.up.set(0,0,l[m]),a.lookAt(0,c[m],0)):(a.up.set(0,l[m],0),a.lookAt(0,0,c[m]));const x=this._cubeSize;Vf(r,v*x,m>2?x:0,x,x),u.setRenderTarget(r),g&&u.render(p,a),u.render(e,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=h,u.autoClear=d,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===kl||e.mapping===Ul;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=dA()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=uA());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new pn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Vf(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Pg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=aA[(r-s-1)%aA.length];this._blur(e,s-1,s,o,a)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,d=new pn(this._lodPlanes[r],c),h=c.uniforms,f=this._sizeLods[i]-1,p=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*fl-1),g=s/p,y=isFinite(s)?1+Math.floor(u*g):fl;y>fl&&console.warn("sigmaRadians, ".concat(s,", is too large and will clip, as it requested ").concat(y," samples when the maximum is set to ").concat(fl));const m=[];let v=0;for(let A=0;A<fl;++A){const R=A/g,w=Math.exp(-R*R/2);m.push(w),A===0?v+=w:A<y&&(v+=2*w)}for(let A=0;A<m.length;A++)m[A]=m[A]/v;h.envMap.value=e.texture,h.samples.value=y,h.weights.value=m,h.latitudinal.value=o==="latitudinal",a&&(h.poleAxis.value=a);const{_lodMax:x}=this;h.dTheta.value=p,h.mipInt.value=x-i;const _=this._sizeLods[r],S=3*_*(r>x-Fc?r-x+Fc:0),E=4*(this._cubeSize-_);Vf(t,S,E,3*_,2*_),l.setRenderTarget(t),l.render(d,Pg)}};function V7(n){const e=[],t=[],i=[];let r=n;const s=n-Fc+1+sA.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let l=1/a;o>n-Fc?l=sA[o-n+Fc-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,d=1+c,h=[u,u,d,u,d,d,u,u,d,d,u,d],f=6,p=6,g=3,y=2,m=1,v=new Float32Array(g*p*f),x=new Float32Array(y*p*f),_=new Float32Array(m*p*f);for(let E=0;E<f;E++){const A=E%3*2/3-1,R=E>2?0:-1,w=[A,R,0,A+2/3,R,0,A+2/3,R+1,0,A,R,0,A+2/3,R+1,0,A,R+1,0];v.set(w,g*p*E),x.set(h,y*p*E);const M=[E,E,E,E,E,E];_.set(M,m*p*E)}const S=new ki;S.setAttribute("position",new xi(v,g)),S.setAttribute("uv",new xi(x,y)),S.setAttribute("faceIndex",new xi(_,m)),e.push(S),r>Fc&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function cA(n,e,t){const i=new Fa(n,e,t);return i.texture.mapping=Ym,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Vf(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function H7(n,e,t){const i=new Float32Array(fl),r=new Y(0,1,0);return new Pr({name:"SphericalGaussianBlur",defines:{n:fl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:"".concat(n,".0")},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:I_(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",blending:Ia,depthTest:!1,depthWrite:!1})}function uA(){return new Pr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:I_(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include <common>\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",blending:Ia,depthTest:!1,depthWrite:!1})}function dA(){return new Pr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:I_(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",blending:Ia,depthTest:!1,depthWrite:!1})}function I_(){return"\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n "}function $7(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===ry||l===sy,u=l===kl||l===Ul;if(c||u){let d=e.get(a);const h=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return t===null&&(t=new lA(n)),d=c?t.fromEquirectangular(a,d):t.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),d.texture;if(d!==void 0)return d.texture;{const f=a.image;return c&&f&&f.height>0||u&&f&&r(f)?(t===null&&(t=new lA(n)),d=c?t.fromEquirectangular(a):t.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",s),d.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function G7(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(i){const r=t(i);return r===null&&Ec("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function W7(n,e,t,i){const r={},s=new WeakMap;function o(d){const h=d.target;h.index!==null&&e.remove(h.index);for(const p in h.attributes)e.remove(h.attributes[p]);h.removeEventListener("dispose",o),delete r[h.id];const f=s.get(h);f&&(e.remove(f),s.delete(h)),i.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,t.memory.geometries--}function a(d,h){return r[h.id]===!0||(h.addEventListener("dispose",o),r[h.id]=!0,t.memory.geometries++),h}function l(d){const h=d.attributes;for(const f in h)e.update(h[f],n.ARRAY_BUFFER)}function c(d){const h=[],f=d.index,p=d.attributes.position;let g=0;if(f!==null){const v=f.array;g=f.version;for(let x=0,_=v.length;x<_;x+=3){const S=v[x+0],E=v[x+1],A=v[x+2];h.push(S,E,E,A,A,S)}}else if(p!==void 0){const v=p.array;g=p.version;for(let x=0,_=v.length/3-1;x<_;x+=3){const S=x+0,E=x+1,A=x+2;h.push(S,E,E,A,A,S)}}else return;const y=new(w5(h)?I5:R5)(h,1);y.version=g;const m=s.get(d);m&&e.remove(m),s.set(d,y)}function u(d){const h=s.get(d);if(h){const f=d.index;f!==null&&h.version<f.version&&c(d)}else c(d);return s.get(d)}return{get:a,update:l,getWireframeAttribute:u}}function Q7(n,e,t){let i;function r(h){i=h}let s,o;function a(h){s=h.type,o=h.bytesPerElement}function l(h,f){n.drawElements(i,f,s,h*o),t.update(f,i,1)}function c(h,f,p){p!==0&&(n.drawElementsInstanced(i,f,s,h*o,p),t.update(f,i,p))}function u(h,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,f,0,s,h,0,p);let y=0;for(let m=0;m<p;m++)y+=f[m];t.update(y,i,1)}function d(h,f,p,g){if(p===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let m=0;m<h.length;m++)c(h[m]/o,f[m],g[m]);else{y.multiDrawElementsInstancedWEBGL(i,f,0,s,h,0,g,0,p);let m=0;for(let v=0;v<p;v++)m+=f[v]*g[v];t.update(m,i,1)}}this.setMode=r,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=d}function j7(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function q7(n,e,t){const i=new WeakMap,r=new Mt;function s(o,a,l){const c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=u!==void 0?u.length:0;let h=i.get(a);if(h===void 0||h.count!==d){let w=function(){A.dispose(),i.delete(a),a.removeEventListener("dispose",w)};h!==void 0&&h.texture.dispose();const f=a.morphAttributes.position!==void 0,p=a.morphAttributes.normal!==void 0,g=a.morphAttributes.color!==void 0,y=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],v=a.morphAttributes.color||[];let x=0;f===!0&&(x=1),p===!0&&(x=2),g===!0&&(x=3);let _=a.attributes.position.count*x,S=1;_>e.maxTextureSize&&(S=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const E=new Float32Array(_*S*4*d),A=new __(E,_,S,d);A.type=ir,A.needsUpdate=!0;const R=x*4;for(let M=0;M<d;M++){const I=y[M],L=m[M],k=v[M],T=_*S*4*M;for(let F=0;F<I.count;F++){const V=F*R;f===!0&&(r.fromBufferAttribute(I,F),E[T+V+0]=r.x,E[T+V+1]=r.y,E[T+V+2]=r.z,E[T+V+3]=0),p===!0&&(r.fromBufferAttribute(L,F),E[T+V+4]=r.x,E[T+V+5]=r.y,E[T+V+6]=r.z,E[T+V+7]=0),g===!0&&(r.fromBufferAttribute(k,F),E[T+V+8]=r.x,E[T+V+9]=r.y,E[T+V+10]=r.z,E[T+V+11]=k.itemSize===4?r.w:1)}}h={count:d,texture:A,size:new qe(_,S)},i.set(a,h),a.addEventListener("dispose",w)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let f=0;for(let g=0;g<c.length;g++)f+=c[g];const p=a.morphTargetsRelative?1:1-f;l.getUniforms().setValue(n,"morphTargetBaseInfluence",p),l.getUniforms().setValue(n,"morphTargetInfluences",c)}l.getUniforms().setValue(n,"morphTargetsTexture",h.texture,t),l.getUniforms().setValue(n,"morphTargetsTextureSize",h.size)}return{update:s}}function X7(n,e,t,i){let r=new WeakMap;function s(l){const c=i.render.frame,u=l.geometry,d=e.get(l,u);if(r.get(d)!==c&&(e.update(d),r.set(d,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==c&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const h=l.skeleton;r.get(h)!==c&&(h.update(),r.set(h,c))}return d}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}const H5=new Wn,hA=new Ua(1,1),$5=new __,G5=new OP,W5=new L5,fA=[],pA=[],mA=new Float32Array(16),gA=new Float32Array(9),yA=new Float32Array(4);function Bu(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=fA[r];if(s===void 0&&(s=new Float32Array(r),fA[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ei(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function ti(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function n0(n,e){let t=pA[e];t===void 0&&(t=new Int32Array(e),pA[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function K7(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function Y7(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ei(t,e))return;n.uniform2fv(this.addr,e),ti(t,e)}}function Z7(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(ei(t,e))return;n.uniform3fv(this.addr,e),ti(t,e)}}function J7(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ei(t,e))return;n.uniform4fv(this.addr,e),ti(t,e)}}function eO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ei(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),ti(t,e)}else{if(ei(t,i))return;yA.set(i),n.uniformMatrix2fv(this.addr,!1,yA),ti(t,i)}}function tO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ei(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),ti(t,e)}else{if(ei(t,i))return;gA.set(i),n.uniformMatrix3fv(this.addr,!1,gA),ti(t,i)}}function nO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(ei(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),ti(t,e)}else{if(ei(t,i))return;mA.set(i),n.uniformMatrix4fv(this.addr,!1,mA),ti(t,i)}}function iO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function rO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ei(t,e))return;n.uniform2iv(this.addr,e),ti(t,e)}}function sO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ei(t,e))return;n.uniform3iv(this.addr,e),ti(t,e)}}function oO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ei(t,e))return;n.uniform4iv(this.addr,e),ti(t,e)}}function aO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function lO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ei(t,e))return;n.uniform2uiv(this.addr,e),ti(t,e)}}function cO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ei(t,e))return;n.uniform3uiv(this.addr,e),ti(t,e)}}function uO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ei(t,e))return;n.uniform4uiv(this.addr,e),ti(t,e)}}function dO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r);let s;this.type===n.SAMPLER_2D_SHADOW?(hA.compareFunction=T5,s=hA):s=H5,t.setTexture2D(e||s,r)}function hO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||G5,r)}function fO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||W5,r)}function pO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||$5,r)}function mO(n){switch(n){case 5126:return K7;case 35664:return Y7;case 35665:return Z7;case 35666:return J7;case 35674:return eO;case 35675:return tO;case 35676:return nO;case 5124:case 35670:return iO;case 35667:case 35671:return rO;case 35668:case 35672:return sO;case 35669:case 35673:return oO;case 5125:return aO;case 36294:return lO;case 36295:return cO;case 36296:return uO;case 35678:case 36198:case 36298:case 36306:case 35682:return dO;case 35679:case 36299:case 36307:return hO;case 35680:case 36300:case 36308:case 36293:return fO;case 36289:case 36303:case 36311:case 36292:return pO}}function gO(n,e){n.uniform1fv(this.addr,e)}function yO(n,e){const t=Bu(e,this.size,2);n.uniform2fv(this.addr,t)}function vO(n,e){const t=Bu(e,this.size,3);n.uniform3fv(this.addr,t)}function _O(n,e){const t=Bu(e,this.size,4);n.uniform4fv(this.addr,t)}function xO(n,e){const t=Bu(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function SO(n,e){const t=Bu(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function AO(n,e){const t=Bu(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function bO(n,e){n.uniform1iv(this.addr,e)}function TO(n,e){n.uniform2iv(this.addr,e)}function wO(n,e){n.uniform3iv(this.addr,e)}function CO(n,e){n.uniform4iv(this.addr,e)}function EO(n,e){n.uniform1uiv(this.addr,e)}function MO(n,e){n.uniform2uiv(this.addr,e)}function RO(n,e){n.uniform3uiv(this.addr,e)}function IO(n,e){n.uniform4uiv(this.addr,e)}function NO(n,e,t){const i=this.cache,r=e.length,s=n0(t,r);ei(i,s)||(n.uniform1iv(this.addr,s),ti(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||H5,s[o])}function PO(n,e,t){const i=this.cache,r=e.length,s=n0(t,r);ei(i,s)||(n.uniform1iv(this.addr,s),ti(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||G5,s[o])}function LO(n,e,t){const i=this.cache,r=e.length,s=n0(t,r);ei(i,s)||(n.uniform1iv(this.addr,s),ti(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||W5,s[o])}function DO(n,e,t){const i=this.cache,r=e.length,s=n0(t,r);ei(i,s)||(n.uniform1iv(this.addr,s),ti(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||$5,s[o])}function FO(n){switch(n){case 5126:return gO;case 35664:return yO;case 35665:return vO;case 35666:return _O;case 35674:return xO;case 35675:return SO;case 35676:return AO;case 5124:case 35670:return bO;case 35667:case 35671:return TO;case 35668:case 35672:return wO;case 35669:case 35673:return CO;case 5125:return EO;case 36294:return MO;case 36295:return RO;case 36296:return IO;case 35678:case 36198:case 36298:case 36306:case 35682:return NO;case 35679:case 36299:case 36307:return PO;case 35680:case 36300:case 36308:case 36293:return LO;case 36289:case 36303:case 36311:case 36292:return DO}}class OO{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=mO(t.type)}}class BO{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=FO(t.type)}}class kO{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],i)}}}const Bg=/(\w+)(\])?(\[|\.)?/g;function vA(n,e){n.seq.push(e),n.map[e.id]=e}function UO(n,e,t){const i=n.name,r=i.length;for(Bg.lastIndex=0;;){const s=Bg.exec(i),o=Bg.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){vA(t,c===void 0?new OO(a,n,e):new BO(a,n,e));break}else{let d=t.map[a];d===void 0&&(d=new kO(a),vA(t,d)),t=d}}}class Rp{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);UO(s,o,this)}}setValue(e,t,i,r){const s=this.map[t];s!==void 0&&s.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&i.push(o)}return i}}function _A(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}const zO=37297;let VO=0;function HO(n,e){const t=n.split("\n"),i=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;i.push("".concat(a===e?">":" "," ").concat(a,": ").concat(t[o]))}return i.join("\n")}const xA=new mt;function $O(n){wt._getMatrix(xA,wt.workingColorSpace,n);const e="mat3( ".concat(xA.elements.map(t=>t.toFixed(4))," )");switch(wt.getTransfer(n)){case cm:return[e,"LinearTransferOETF"];case Zt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function SA(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+"\n\n"+r+"\n\n"+HO(n.getShaderSource(e),o)}else return r}function GO(n,e){const t=$O(e);return["vec4 ".concat(n,"( vec4 value ) {")," return ".concat(t[1],"( vec4( value.rgb * ").concat(t[0],", value.a ) );"),"}"].join("\n")}function WO(n,e){let t;switch(e){case QN:t="Linear";break;case jN:t="Reinhard";break;case qN:t="Cineon";break;case XN:t="ACESFilmic";break;case YN:t="AgX";break;case ZN:t="Neutral";break;case KN:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Hf=new Y;function QO(){wt.getLuminanceCoefficients(Hf);const n=Hf.x.toFixed(4),e=Hf.y.toFixed(4),t=Hf.z.toFixed(4);return["float luminance( const in vec3 rgb ) {"," const vec3 weights = vec3( ".concat(n,", ").concat(e,", ").concat(t," );")," return dot( weights, rgb );","}"].join("\n")}function jO(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Td).join("\n")}function qO(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join("\n")}function XO(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const s=n.getActiveAttrib(e,r),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function Td(n){return n!==""}function AA(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function bA(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const KO=/^[ \t]*#include +<([\w\d./]+)>/gm;function Fy(n){return n.replace(KO,ZO)}const YO=new Map;function ZO(n,e){let t=It[e];if(t===void 0){const i=YO.get(e);if(i!==void 0)t=It[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Fy(t)}const JO=/#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 TA(n){return n.replace(JO,eB)}function eB(n,e,t,i){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function wA(n){let e="precision ".concat(n.precision," float;\n precision ").concat(n.precision," int;\n precision ").concat(n.precision," sampler2D;\n precision ").concat(n.precision," samplerCube;\n precision ").concat(n.precision," sampler3D;\n precision ").concat(n.precision," sampler2DArray;\n precision ").concat(n.precision," sampler2DShadow;\n precision ").concat(n.precision," samplerCubeShadow;\n precision ").concat(n.precision," sampler2DArrayShadow;\n precision ").concat(n.precision," isampler2D;\n precision ").concat(n.precision," isampler3D;\n precision ").concat(n.precision," isamplerCube;\n precision ").concat(n.precision," isampler2DArray;\n precision ").concat(n.precision," usampler2D;\n precision ").concat(n.precision," usampler3D;\n precision ").concat(n.precision," usamplerCube;\n precision ").concat(n.precision," usampler2DArray;\n ");return n.precision==="highp"?e+="\n#define HIGH_PRECISION":n.precision==="mediump"?e+="\n#define MEDIUM_PRECISION":n.precision==="lowp"&&(e+="\n#define LOW_PRECISION"),e}function tB(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===c5?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===CN?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Ar&&(e="SHADOWMAP_TYPE_VSM"),e}function nB(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case kl:case Ul:e="ENVMAP_TYPE_CUBE";break;case Ym:e="ENVMAP_TYPE_CUBE_UV";break}return e}function iB(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Ul:e="ENVMAP_MODE_REFRACTION";break}return e}function rB(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case d5:e="ENVMAP_BLENDING_MULTIPLY";break;case GN:e="ENVMAP_BLENDING_MIX";break;case WN:e="ENVMAP_BLENDING_ADD";break}return e}function sB(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function oB(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=tB(t),c=nB(t),u=iB(t),d=rB(t),h=sB(t),f=jO(t),p=qO(s),g=r.createProgram();let y,m,v=t.glslVersion?"#version "+t.glslVersion+"\n":"";t.isRawShaderMaterial?(y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Td).join("\n"),y.length>0&&(y+="\n"),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Td).join("\n"),m.length>0&&(m+="\n")):(y=[wA(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(Td).join("\n"),m=[wA(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==_s?"#define TONE_MAPPING":"",t.toneMapping!==_s?It.tonemapping_pars_fragment:"",t.toneMapping!==_s?WO("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",It.colorspace_pars_fragment,GO("linearToOutputTexel",t.outputColorSpace),QO(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"","\n"].filter(Td).join("\n")),o=Fy(o),o=AA(o,t),o=bA(o,t),a=Fy(a),a=AA(a,t),a=bA(a,t),o=TA(o),a=TA(a),t.isRawShaderMaterial!==!0&&(v="#version 300 es\n",y=[f,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,m=["#define varying in",t.glslVersion===_S?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===_S?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+m);const x=v+y+o,_=v+m+a,S=_A(r,r.VERTEX_SHADER,x),E=_A(r,r.FRAGMENT_SHADER,_);r.attachShader(g,S),r.attachShader(g,E),t.index0AttributeName!==void 0?r.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(g,0,"position"),r.linkProgram(g);function A(I){if(n.debug.checkShaderErrors){const L=r.getProgramInfoLog(g).trim(),k=r.getShaderInfoLog(S).trim(),T=r.getShaderInfoLog(E).trim();let F=!0,V=!0;if(r.getProgramParameter(g,r.LINK_STATUS)===!1)if(F=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,g,S,E);else{const Q=SA(r,S,"vertex"),ee=SA(r,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(g,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+I.name+"\nMaterial Type: "+I.type+"\n\nProgram Info Log: "+L+"\n"+Q+"\n"+ee)}else L!==""?console.warn("THREE.WebGLProgram: Program Info Log:",L):(k===""||T==="")&&(V=!1);V&&(I.diagnostics={runnable:F,programLog:L,vertexShader:{log:k,prefix:y},fragmentShader:{log:T,prefix:m}})}r.deleteShader(S),r.deleteShader(E),R=new Rp(r,g),w=XO(r,g)}let R;this.getUniforms=function(){return R===void 0&&A(this),R};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(g,zO)),M},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=VO++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=E,this}let aB=0;class lB{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new cB(e),t.set(e,i)),i}}class cB{constructor(e){this.id=aB++,this.code=e,this.usedTimes=0}}function uB(n,e,t,i,r,s,o){const a=new E5,l=new lB,c=new Set,u=[],d=r.logarithmicDepthBuffer,h=r.vertexTextures;let f=r.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(w){return c.add(w),w===0?"uv":"uv".concat(w)}function y(w,M,I,L,k){const T=L.fog,F=k.geometry,V=w.isMeshStandardMaterial?L.environment:null,Q=(w.isMeshStandardMaterial?t:e).get(w.envMap||V),ee=Q&&Q.mapping===Ym?Q.image.height:null,se=p[w.type];w.precision!==null&&(f=r.getMaxPrecision(w.precision),f!==w.precision&&console.warn("THREE.WebGLProgram.getParameters:",w.precision,"not supported, using",f,"instead."));const he=F.morphAttributes.position||F.morphAttributes.normal||F.morphAttributes.color,ie=he!==void 0?he.length:0;let re=0;F.morphAttributes.position!==void 0&&(re=1),F.morphAttributes.normal!==void 0&&(re=2),F.morphAttributes.color!==void 0&&(re=3);let be,le,fe,Te;if(se){const sn=Us[se];be=sn.vertexShader,le=sn.fragmentShader}else be=w.vertexShader,le=w.fragmentShader,l.update(w),fe=l.getVertexShaderID(w),Te=l.getFragmentShaderID(w);const Ce=n.getRenderTarget(),Ie=n.state.buffers.depth.getReversed(),ze=k.isInstancedMesh===!0,Be=k.isBatchedMesh===!0,it=!!w.map,te=!!w.matcap,ne=!!Q,b=!!w.aoMap,oe=!!w.lightMap,J=!!w.bumpMap,H=!!w.normalMap,P=!!w.displacementMap,U=!!w.emissiveMap,j=!!w.metalnessMap,B=!!w.roughnessMap,D=w.anisotropy>0,W=w.clearcoat>0,G=w.dispersion>0,X=w.iridescence>0,ue=w.sheen>0,z=w.transmission>0,C=D&&!!w.anisotropyMap,N=W&&!!w.clearcoatMap,q=W&&!!w.clearcoatNormalMap,Z=W&&!!w.clearcoatRoughnessMap,$=X&&!!w.iridescenceMap,ae=X&&!!w.iridescenceThicknessMap,ke=ue&&!!w.sheenColorMap,Le=ue&&!!w.sheenRoughnessMap,Ve=!!w.specularMap,Je=!!w.specularColorMap,st=!!w.specularIntensityMap,pe=z&&!!w.transmissionMap,Ze=z&&!!w.thicknessMap,we=!!w.gradientMap,De=!!w.alphaMap,Ke=w.alphaTest>0,et=!!w.alphaHash,_t=!!w.extensions;let hn=_s;w.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(hn=n.toneMapping);const Ti={shaderID:se,shaderType:w.type,shaderName:w.name,vertexShader:be,fragmentShader:le,defines:w.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:f,batching:Be,batchingColor:Be&&k._colorsTexture!==null,instancing:ze,instancingColor:ze&&k.instanceColor!==null,instancingMorph:ze&&k.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:Ce===null?n.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:Bi,alphaToCoverage:!!w.alphaToCoverage,map:it,matcap:te,envMap:ne,envMapMode:ne&&Q.mapping,envMapCubeUVHeight:ee,aoMap:b,lightMap:oe,bumpMap:J,normalMap:H,displacementMap:h&&P,emissiveMap:U,normalMapObjectSpace:H&&w.normalMapType===A5,normalMapTangentSpace:H&&w.normalMapType===lm,metalnessMap:j,roughnessMap:B,anisotropy:D,anisotropyMap:C,clearcoat:W,clearcoatMap:N,clearcoatNormalMap:q,clearcoatRoughnessMap:Z,dispersion:G,iridescence:X,iridescenceMap:$,iridescenceThicknessMap:ae,sheen:ue,sheenColorMap:ke,sheenRoughnessMap:Le,specularMap:Ve,specularColorMap:Je,specularIntensityMap:st,transmission:z,transmissionMap:pe,thicknessMap:Ze,gradientMap:we,opaque:w.transparent===!1&&w.blending===zo&&w.alphaToCoverage===!1,alphaMap:De,alphaTest:Ke,alphaHash:et,combine:w.combine,mapUv:it&&g(w.map.channel),aoMapUv:b&&g(w.aoMap.channel),lightMapUv:oe&&g(w.lightMap.channel),bumpMapUv:J&&g(w.bumpMap.channel),normalMapUv:H&&g(w.normalMap.channel),displacementMapUv:P&&g(w.displacementMap.channel),emissiveMapUv:U&&g(w.emissiveMap.channel),metalnessMapUv:j&&g(w.metalnessMap.channel),roughnessMapUv:B&&g(w.roughnessMap.channel),anisotropyMapUv:C&&g(w.anisotropyMap.channel),clearcoatMapUv:N&&g(w.clearcoatMap.channel),clearcoatNormalMapUv:q&&g(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Z&&g(w.clearcoatRoughnessMap.channel),iridescenceMapUv:$&&g(w.iridescenceMap.channel),iridescenceThicknessMapUv:ae&&g(w.iridescenceThicknessMap.channel),sheenColorMapUv:ke&&g(w.sheenColorMap.channel),sheenRoughnessMapUv:Le&&g(w.sheenRoughnessMap.channel),specularMapUv:Ve&&g(w.specularMap.channel),specularColorMapUv:Je&&g(w.specularColorMap.channel),specularIntensityMapUv:st&&g(w.specularIntensityMap.channel),transmissionMapUv:pe&&g(w.transmissionMap.channel),thicknessMapUv:Ze&&g(w.thicknessMap.channel),alphaMapUv:De&&g(w.alphaMap.channel),vertexTangents:!!F.attributes.tangent&&(H||D),vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!F.attributes.color&&F.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!F.attributes.uv&&(it||De),fog:!!T,useFog:w.fog===!0,fogExp2:!!T&&T.isFogExp2,flatShading:w.flatShading===!0,sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:Ie,skinning:k.isSkinnedMesh===!0,morphTargets:F.morphAttributes.position!==void 0,morphNormals:F.morphAttributes.normal!==void 0,morphColors:F.morphAttributes.color!==void 0,morphTargetsCount:ie,morphTextureStride:re,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:o.numPlanes,numClipIntersection:o.numIntersection,dithering:w.dithering,shadowMapEnabled:n.shadowMap.enabled&&I.length>0,shadowMapType:n.shadowMap.type,toneMapping:hn,decodeVideoTexture:it&&w.map.isVideoTexture===!0&&wt.getTransfer(w.map.colorSpace)===Zt,decodeVideoTextureEmissive:U&&w.emissiveMap.isVideoTexture===!0&&wt.getTransfer(w.emissiveMap.colorSpace)===Zt,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===Cr,flipSided:w.side===Fi,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionClipCullDistance:_t&&w.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(_t&&w.extensions.multiDraw===!0||Be)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return Ti.vertexUv1s=c.has(1),Ti.vertexUv2s=c.has(2),Ti.vertexUv3s=c.has(3),c.clear(),Ti}function m(w){const M=[];if(w.shaderID?M.push(w.shaderID):(M.push(w.customVertexShaderID),M.push(w.customFragmentShaderID)),w.defines!==void 0)for(const I in w.defines)M.push(I),M.push(w.defines[I]);return w.isRawShaderMaterial===!1&&(v(M,w),x(M,w),M.push(n.outputColorSpace)),M.push(w.customProgramCacheKey),M.join()}function v(w,M){w.push(M.precision),w.push(M.outputColorSpace),w.push(M.envMapMode),w.push(M.envMapCubeUVHeight),w.push(M.mapUv),w.push(M.alphaMapUv),w.push(M.lightMapUv),w.push(M.aoMapUv),w.push(M.bumpMapUv),w.push(M.normalMapUv),w.push(M.displacementMapUv),w.push(M.emissiveMapUv),w.push(M.metalnessMapUv),w.push(M.roughnessMapUv),w.push(M.anisotropyMapUv),w.push(M.clearcoatMapUv),w.push(M.clearcoatNormalMapUv),w.push(M.clearcoatRoughnessMapUv),w.push(M.iridescenceMapUv),w.push(M.iridescenceThicknessMapUv),w.push(M.sheenColorMapUv),w.push(M.sheenRoughnessMapUv),w.push(M.specularMapUv),w.push(M.specularColorMapUv),w.push(M.specularIntensityMapUv),w.push(M.transmissionMapUv),w.push(M.thicknessMapUv),w.push(M.combine),w.push(M.fogExp2),w.push(M.sizeAttenuation),w.push(M.morphTargetsCount),w.push(M.morphAttributeCount),w.push(M.numDirLights),w.push(M.numPointLights),w.push(M.numSpotLights),w.push(M.numSpotLightMaps),w.push(M.numHemiLights),w.push(M.numRectAreaLights),w.push(M.numDirLightShadows),w.push(M.numPointLightShadows),w.push(M.numSpotLightShadows),w.push(M.numSpotLightShadowsWithMaps),w.push(M.numLightProbes),w.push(M.shadowMapType),w.push(M.toneMapping),w.push(M.numClippingPlanes),w.push(M.numClipIntersection),w.push(M.depthPacking)}function x(w,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),w.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),w.push(a.mask)}function _(w){const M=p[w.type];let I;if(M){const L=Us[M];I=ZP.clone(L.uniforms)}else I=w.uniforms;return I}function S(w,M){let I;for(let L=0,k=u.length;L<k;L++){const T=u[L];if(T.cacheKey===M){I=T,++I.usedTimes;break}}return I===void 0&&(I=new oB(n,M,w,s),u.push(I)),I}function E(w){if(--w.usedTimes===0){const M=u.indexOf(w);u[M]=u[u.length-1],u.pop(),w.destroy()}}function A(w){l.remove(w)}function R(){l.dispose()}return{getParameters:y,getProgramCacheKey:m,getUniforms:_,acquireProgram:S,releaseProgram:E,releaseShaderCache:A,programs:u,dispose:R}}function dB(){let n=new WeakMap;function e(o){return n.has(o)}function t(o){let a=n.get(o);return a===void 0&&(a={},n.set(o,a)),a}function i(o){n.delete(o)}function r(o,a,l){n.get(o)[a]=l}function s(){n=new WeakMap}return{has:e,get:t,remove:i,update:r,dispose:s}}function hB(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function CA(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function EA(){const n=[];let e=0;const t=[],i=[],r=[];function s(){e=0,t.length=0,i.length=0,r.length=0}function o(d,h,f,p,g,y){let m=n[e];return m===void 0?(m={id:d.id,object:d,geometry:h,material:f,groupOrder:p,renderOrder:d.renderOrder,z:g,group:y},n[e]=m):(m.id=d.id,m.object=d,m.geometry=h,m.material=f,m.groupOrder=p,m.renderOrder=d.renderOrder,m.z=g,m.group=y),e++,m}function a(d,h,f,p,g,y){const m=o(d,h,f,p,g,y);f.transmission>0?i.push(m):f.transparent===!0?r.push(m):t.push(m)}function l(d,h,f,p,g,y){const m=o(d,h,f,p,g,y);f.transmission>0?i.unshift(m):f.transparent===!0?r.unshift(m):t.unshift(m)}function c(d,h){t.length>1&&t.sort(d||hB),i.length>1&&i.sort(h||CA),r.length>1&&r.sort(h||CA)}function u(){for(let d=e,h=n.length;d<h;d++){const f=n[d];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:i,transparent:r,init:s,push:a,unshift:l,finish:u,sort:c}}function fB(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new EA,n.set(i,[o])):r>=s.length?(o=new EA,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function pB(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Y,color:new gt};break;case"SpotLight":t={position:new Y,direction:new Y,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Y,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Y,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new Y,halfWidth:new Y,halfHeight:new Y};break}return n[e.id]=t,t}}}function mB(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let gB=0;function yB(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function vB(n){const e=new pB,t=mB(),i={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++)i.probe.push(new Y);const r=new Y,s=new Xe,o=new Xe;function a(c){let u=0,d=0,h=0;for(let w=0;w<9;w++)i.probe[w].set(0,0,0);let f=0,p=0,g=0,y=0,m=0,v=0,x=0,_=0,S=0,E=0,A=0;c.sort(yB);for(let w=0,M=c.length;w<M;w++){const I=c[w],L=I.color,k=I.intensity,T=I.distance,F=I.shadow&&I.shadow.map?I.shadow.map.texture:null;if(I.isAmbientLight)u+=L.r*k,d+=L.g*k,h+=L.b*k;else if(I.isLightProbe){for(let V=0;V<9;V++)i.probe[V].addScaledVector(I.sh.coefficients[V],k);A++}else if(I.isDirectionalLight){const V=e.get(I);if(V.color.copy(I.color).multiplyScalar(I.intensity),I.castShadow){const Q=I.shadow,ee=t.get(I);ee.shadowIntensity=Q.intensity,ee.shadowBias=Q.bias,ee.shadowNormalBias=Q.normalBias,ee.shadowRadius=Q.radius,ee.shadowMapSize=Q.mapSize,i.directionalShadow[f]=ee,i.directionalShadowMap[f]=F,i.directionalShadowMatrix[f]=I.shadow.matrix,v++}i.directional[f]=V,f++}else if(I.isSpotLight){const V=e.get(I);V.position.setFromMatrixPosition(I.matrixWorld),V.color.copy(L).multiplyScalar(k),V.distance=T,V.coneCos=Math.cos(I.angle),V.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),V.decay=I.decay,i.spot[g]=V;const Q=I.shadow;if(I.map&&(i.spotLightMap[S]=I.map,S++,Q.updateMatrices(I),I.castShadow&&E++),i.spotLightMatrix[g]=Q.matrix,I.castShadow){const ee=t.get(I);ee.shadowIntensity=Q.intensity,ee.shadowBias=Q.bias,ee.shadowNormalBias=Q.normalBias,ee.shadowRadius=Q.radius,ee.shadowMapSize=Q.mapSize,i.spotShadow[g]=ee,i.spotShadowMap[g]=F,_++}g++}else if(I.isRectAreaLight){const V=e.get(I);V.color.copy(L).multiplyScalar(k),V.halfWidth.set(I.width*.5,0,0),V.halfHeight.set(0,I.height*.5,0),i.rectArea[y]=V,y++}else if(I.isPointLight){const V=e.get(I);if(V.color.copy(I.color).multiplyScalar(I.intensity),V.distance=I.distance,V.decay=I.decay,I.castShadow){const Q=I.shadow,ee=t.get(I);ee.shadowIntensity=Q.intensity,ee.shadowBias=Q.bias,ee.shadowNormalBias=Q.normalBias,ee.shadowRadius=Q.radius,ee.shadowMapSize=Q.mapSize,ee.shadowCameraNear=Q.camera.near,ee.shadowCameraFar=Q.camera.far,i.pointShadow[p]=ee,i.pointShadowMap[p]=F,i.pointShadowMatrix[p]=I.shadow.matrix,x++}i.point[p]=V,p++}else if(I.isHemisphereLight){const V=e.get(I);V.skyColor.copy(I.color).multiplyScalar(k),V.groundColor.copy(I.groundColor).multiplyScalar(k),i.hemi[m]=V,m++}}y>0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=tt.LTC_FLOAT_1,i.rectAreaLTC2=tt.LTC_FLOAT_2):(i.rectAreaLTC1=tt.LTC_HALF_1,i.rectAreaLTC2=tt.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=h;const R=i.hash;(R.directionalLength!==f||R.pointLength!==p||R.spotLength!==g||R.rectAreaLength!==y||R.hemiLength!==m||R.numDirectionalShadows!==v||R.numPointShadows!==x||R.numSpotShadows!==_||R.numSpotMaps!==S||R.numLightProbes!==A)&&(i.directional.length=f,i.spot.length=g,i.rectArea.length=y,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=_+S-E,i.spotLightMap.length=S,i.numSpotLightShadowsWithMaps=E,i.numLightProbes=A,R.directionalLength=f,R.pointLength=p,R.spotLength=g,R.rectAreaLength=y,R.hemiLength=m,R.numDirectionalShadows=v,R.numPointShadows=x,R.numSpotShadows=_,R.numSpotMaps=S,R.numLightProbes=A,i.version=gB++)}function l(c,u){let d=0,h=0,f=0,p=0,g=0;const y=u.matrixWorldInverse;for(let m=0,v=c.length;m<v;m++){const x=c[m];if(x.isDirectionalLight){const _=i.directional[d];_.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),d++}else if(x.isSpotLight){const _=i.spot[f];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(y),_.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),f++}else if(x.isRectAreaLight){const _=i.rectArea[p];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(y),o.identity(),s.copy(x.matrixWorld),s.premultiply(y),o.extractRotation(s),_.halfWidth.set(x.width*.5,0,0),_.halfHeight.set(0,x.height*.5,0),_.halfWidth.applyMatrix4(o),_.halfHeight.applyMatrix4(o),p++}else if(x.isPointLight){const _=i.point[h];_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(y),h++}else if(x.isHemisphereLight){const _=i.hemi[g];_.direction.setFromMatrixPosition(x.matrixWorld),_.direction.transformDirection(y),g++}}}return{setup:a,setupView:l,state:i}}function MA(n){const e=new vB(n),t=[],i=[];function r(u){c.camera=u,t.length=0,i.length=0}function s(u){t.push(u)}function o(u){i.push(u)}function a(){e.setup(t)}function l(u){e.setupView(t,u)}const c={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function _B(n){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new MA(n),e.set(r,[a])):s>=o.length?(a=new MA(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const xB="void main() {\n gl_Position = vec4( position, 1.0 );\n}",SB="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function AB(n,e,t){let i=new S_;const r=new qe,s=new qe,o=new Mt,a=new mL({depthPacking:sP}),l=new gL,c={},u=t.maxTextureSize,d={[bs]:Fi,[Fi]:bs,[Cr]:Cr},h=new Pr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new qe},radius:{value:4}},vertexShader:xB,fragmentShader:SB}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const p=new ki;p.setAttribute("position",new xi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new pn(p,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=c5;let m=this.type;this.render=function(E,A,R){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||E.length===0)return;const w=n.getRenderTarget(),M=n.getActiveCubeFace(),I=n.getActiveMipmapLevel(),L=n.state;L.setBlending(Ia),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);const k=m!==Ar&&this.type===Ar,T=m===Ar&&this.type!==Ar;for(let F=0,V=E.length;F<V;F++){const Q=E[F],ee=Q.shadow;if(ee===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(ee.autoUpdate===!1&&ee.needsUpdate===!1)continue;r.copy(ee.mapSize);const se=ee.getFrameExtents();if(r.multiply(se),s.copy(ee.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/se.x),r.x=s.x*se.x,ee.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/se.y),r.y=s.y*se.y,ee.mapSize.y=s.y)),ee.map===null||k===!0||T===!0){const ie=this.type!==Ar?{minFilter:_i,magFilter:_i}:{};ee.map!==null&&ee.map.dispose(),ee.map=new Fa(r.x,r.y,ie),ee.map.texture.name=Q.name+".shadowMap",ee.camera.updateProjectionMatrix()}n.setRenderTarget(ee.map),n.clear();const he=ee.getViewportCount();for(let ie=0;ie<he;ie++){const re=ee.getViewport(ie);o.set(s.x*re.x,s.y*re.y,s.x*re.z,s.y*re.w),L.viewport(o),ee.updateMatrices(Q,ie),i=ee.getFrustum(),_(A,R,ee.camera,Q,this.type)}ee.isPointLightShadow!==!0&&this.type===Ar&&v(ee,R),ee.needsUpdate=!1}m=this.type,y.needsUpdate=!1,n.setRenderTarget(w,M,I)};function v(E,A){const R=e.update(g);h.defines.VSM_SAMPLES!==E.blurSamples&&(h.defines.VSM_SAMPLES=E.blurSamples,f.defines.VSM_SAMPLES=E.blurSamples,h.needsUpdate=!0,f.needsUpdate=!0),E.mapPass===null&&(E.mapPass=new Fa(r.x,r.y)),h.uniforms.shadow_pass.value=E.map.texture,h.uniforms.resolution.value=E.mapSize,h.uniforms.radius.value=E.radius,n.setRenderTarget(E.mapPass),n.clear(),n.renderBufferDirect(A,null,R,h,g,null),f.uniforms.shadow_pass.value=E.mapPass.texture,f.uniforms.resolution.value=E.mapSize,f.uniforms.radius.value=E.radius,n.setRenderTarget(E.map),n.clear(),n.renderBufferDirect(A,null,R,f,g,null)}function x(E,A,R,w){let M=null;const I=R.isPointLight===!0?E.customDistanceMaterial:E.customDepthMaterial;if(I!==void 0)M=I;else if(M=R.isPointLight===!0?l:a,n.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0){const L=M.uuid,k=A.uuid;let T=c[L];T===void 0&&(T={},c[L]=T);let F=T[k];F===void 0&&(F=M.clone(),T[k]=F,A.addEventListener("dispose",S)),M=F}if(M.visible=A.visible,M.wireframe=A.wireframe,w===Ar?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,R.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const L=n.properties.get(M);L.light=R}return M}function _(E,A,R,w,M){if(E.visible===!1)return;if(E.layers.test(A.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&M===Ar)&&(!E.frustumCulled||i.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,E.matrixWorld);const k=e.update(E),T=E.material;if(Array.isArray(T)){const F=k.groups;for(let V=0,Q=F.length;V<Q;V++){const ee=F[V],se=T[ee.materialIndex];if(se&&se.visible){const he=x(E,se,w,M);E.onBeforeShadow(n,E,A,R,k,he,ee),n.renderBufferDirect(R,null,k,he,E,ee),E.onAfterShadow(n,E,A,R,k,he,ee)}}}else if(T.visible){const F=x(E,T,w,M);E.onBeforeShadow(n,E,A,R,k,F,null),n.renderBufferDirect(R,null,k,F,E,null),E.onAfterShadow(n,E,A,R,k,F,null)}}const L=E.children;for(let k=0,T=L.length;k<T;k++)_(L[k],A,R,w,M)}function S(E){E.target.removeEventListener("dispose",S);for(const R in c){const w=c[R],M=E.target.uuid;M in w&&(w[M].dispose(),delete w[M])}}}const bB={[Y1]:Z1,[J1]:ny,[ey]:iy,[lu]:ty,[Z1]:Y1,[ny]:J1,[iy]:ey,[ty]:lu};function TB(n,e){function t(){let pe=!1;const Ze=new Mt;let we=null;const De=new Mt(0,0,0,0);return{setMask:function(Ke){we!==Ke&&!pe&&(n.colorMask(Ke,Ke,Ke,Ke),we=Ke)},setLocked:function(Ke){pe=Ke},setClear:function(Ke,et,_t,hn,Ti){Ti===!0&&(Ke*=hn,et*=hn,_t*=hn),Ze.set(Ke,et,_t,hn),De.equals(Ze)===!1&&(n.clearColor(Ke,et,_t,hn),De.copy(Ze))},reset:function(){pe=!1,we=null,De.set(-1,0,0,0)}}}function i(){let pe=!1,Ze=!1,we=null,De=null,Ke=null;return{setReversed:function(et){if(Ze!==et){const _t=e.get("EXT_clip_control");Ze?_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.ZERO_TO_ONE_EXT):_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.NEGATIVE_ONE_TO_ONE_EXT);const hn=Ke;Ke=null,this.setClear(hn)}Ze=et},getReversed:function(){return Ze},setTest:function(et){et?Ce(n.DEPTH_TEST):Ie(n.DEPTH_TEST)},setMask:function(et){we!==et&&!pe&&(n.depthMask(et),we=et)},setFunc:function(et){if(Ze&&(et=bB[et]),De!==et){switch(et){case Y1:n.depthFunc(n.NEVER);break;case Z1:n.depthFunc(n.ALWAYS);break;case J1:n.depthFunc(n.LESS);break;case lu:n.depthFunc(n.LEQUAL);break;case ey:n.depthFunc(n.EQUAL);break;case ty:n.depthFunc(n.GEQUAL);break;case ny:n.depthFunc(n.GREATER);break;case iy:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}De=et}},setLocked:function(et){pe=et},setClear:function(et){Ke!==et&&(Ze&&(et=1-et),n.clearDepth(et),Ke=et)},reset:function(){pe=!1,we=null,De=null,Ke=null,Ze=!1}}}function r(){let pe=!1,Ze=null,we=null,De=null,Ke=null,et=null,_t=null,hn=null,Ti=null;return{setTest:function(sn){pe||(sn?Ce(n.STENCIL_TEST):Ie(n.STENCIL_TEST))},setMask:function(sn){Ze!==sn&&!pe&&(n.stencilMask(sn),Ze=sn)},setFunc:function(sn,os,uo){(we!==sn||De!==os||Ke!==uo)&&(n.stencilFunc(sn,os,uo),we=sn,De=os,Ke=uo)},setOp:function(sn,os,uo){(et!==sn||_t!==os||hn!==uo)&&(n.stencilOp(sn,os,uo),et=sn,_t=os,hn=uo)},setLocked:function(sn){pe=sn},setClear:function(sn){Ti!==sn&&(n.clearStencil(sn),Ti=sn)},reset:function(){pe=!1,Ze=null,we=null,De=null,Ke=null,et=null,_t=null,hn=null,Ti=null}}}const s=new t,o=new i,a=new r,l=new WeakMap,c=new WeakMap;let u={},d={},h=new WeakMap,f=[],p=null,g=!1,y=null,m=null,v=null,x=null,_=null,S=null,E=null,A=new gt(0,0,0),R=0,w=!1,M=null,I=null,L=null,k=null,T=null;const F=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,Q=0;const ee=n.getParameter(n.VERSION);ee.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(ee)[1]),V=Q>=1):ee.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]),V=Q>=2);let se=null,he={};const ie=n.getParameter(n.SCISSOR_BOX),re=n.getParameter(n.VIEWPORT),be=new Mt().fromArray(ie),le=new Mt().fromArray(re);function fe(pe,Ze,we,De){const Ke=new Uint8Array(4),et=n.createTexture();n.bindTexture(pe,et),n.texParameteri(pe,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(pe,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let _t=0;_t<we;_t++)pe===n.TEXTURE_3D||pe===n.TEXTURE_2D_ARRAY?n.texImage3D(Ze,0,n.RGBA,1,1,De,0,n.RGBA,n.UNSIGNED_BYTE,Ke):n.texImage2D(Ze+_t,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Ke);return et}const Te={};Te[n.TEXTURE_2D]=fe(n.TEXTURE_2D,n.TEXTURE_2D,1),Te[n.TEXTURE_CUBE_MAP]=fe(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),Te[n.TEXTURE_2D_ARRAY]=fe(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Te[n.TEXTURE_3D]=fe(n.TEXTURE_3D,n.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),a.setClear(0),Ce(n.DEPTH_TEST),o.setFunc(lu),J(!1),H(fS),Ce(n.CULL_FACE),b(Ia);function Ce(pe){u[pe]!==!0&&(n.enable(pe),u[pe]=!0)}function Ie(pe){u[pe]!==!1&&(n.disable(pe),u[pe]=!1)}function ze(pe,Ze){return d[pe]!==Ze?(n.bindFramebuffer(pe,Ze),d[pe]=Ze,pe===n.DRAW_FRAMEBUFFER&&(d[n.FRAMEBUFFER]=Ze),pe===n.FRAMEBUFFER&&(d[n.DRAW_FRAMEBUFFER]=Ze),!0):!1}function Be(pe,Ze){let we=f,De=!1;if(pe){we=h.get(Ze),we===void 0&&(we=[],h.set(Ze,we));const Ke=pe.textures;if(we.length!==Ke.length||we[0]!==n.COLOR_ATTACHMENT0){for(let et=0,_t=Ke.length;et<_t;et++)we[et]=n.COLOR_ATTACHMENT0+et;we.length=Ke.length,De=!0}}else we[0]!==n.BACK&&(we[0]=n.BACK,De=!0);De&&n.drawBuffers(we)}function it(pe){return p!==pe?(n.useProgram(pe),p=pe,!0):!1}const te={[hl]:n.FUNC_ADD,[EN]:n.FUNC_SUBTRACT,[MN]:n.FUNC_REVERSE_SUBTRACT};te[RN]=n.MIN,te[IN]=n.MAX;const ne={[NN]:n.ZERO,[PN]:n.ONE,[LN]:n.SRC_COLOR,[ih]:n.SRC_ALPHA,[UN]:n.SRC_ALPHA_SATURATE,[BN]:n.DST_COLOR,[FN]:n.DST_ALPHA,[DN]:n.ONE_MINUS_SRC_COLOR,[rh]:n.ONE_MINUS_SRC_ALPHA,[kN]:n.ONE_MINUS_DST_COLOR,[ON]:n.ONE_MINUS_DST_ALPHA,[zN]:n.CONSTANT_COLOR,[VN]:n.ONE_MINUS_CONSTANT_COLOR,[HN]:n.CONSTANT_ALPHA,[$N]:n.ONE_MINUS_CONSTANT_ALPHA};function b(pe,Ze,we,De,Ke,et,_t,hn,Ti,sn){if(pe===Ia){g===!0&&(Ie(n.BLEND),g=!1);return}if(g===!1&&(Ce(n.BLEND),g=!0),pe!==u5){if(pe!==y||sn!==w){if((m!==hl||_!==hl)&&(n.blendEquation(n.FUNC_ADD),m=hl,_=hl),sn)switch(pe){case zo:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case pS:n.blendFunc(n.ONE,n.ONE);break;case mS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case gS:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",pe);break}else switch(pe){case zo:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case pS:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case mS:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case gS:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",pe);break}v=null,x=null,S=null,E=null,A.set(0,0,0),R=0,y=pe,w=sn}return}Ke=Ke||Ze,et=et||we,_t=_t||De,(Ze!==m||Ke!==_)&&(n.blendEquationSeparate(te[Ze],te[Ke]),m=Ze,_=Ke),(we!==v||De!==x||et!==S||_t!==E)&&(n.blendFuncSeparate(ne[we],ne[De],ne[et],ne[_t]),v=we,x=De,S=et,E=_t),(hn.equals(A)===!1||Ti!==R)&&(n.blendColor(hn.r,hn.g,hn.b,Ti),A.copy(hn),R=Ti),y=pe,w=!1}function oe(pe,Ze){pe.side===Cr?Ie(n.CULL_FACE):Ce(n.CULL_FACE);let we=pe.side===Fi;Ze&&(we=!we),J(we),pe.blending===zo&&pe.transparent===!1?b(Ia):b(pe.blending,pe.blendEquation,pe.blendSrc,pe.blendDst,pe.blendEquationAlpha,pe.blendSrcAlpha,pe.blendDstAlpha,pe.blendColor,pe.blendAlpha,pe.premultipliedAlpha),o.setFunc(pe.depthFunc),o.setTest(pe.depthTest),o.setMask(pe.depthWrite),s.setMask(pe.colorWrite);const De=pe.stencilWrite;a.setTest(De),De&&(a.setMask(pe.stencilWriteMask),a.setFunc(pe.stencilFunc,pe.stencilRef,pe.stencilFuncMask),a.setOp(pe.stencilFail,pe.stencilZFail,pe.stencilZPass)),U(pe.polygonOffset,pe.polygonOffsetFactor,pe.polygonOffsetUnits),pe.alphaToCoverage===!0?Ce(n.SAMPLE_ALPHA_TO_COVERAGE):Ie(n.SAMPLE_ALPHA_TO_COVERAGE)}function J(pe){M!==pe&&(pe?n.frontFace(n.CW):n.frontFace(n.CCW),M=pe)}function H(pe){pe!==TN?(Ce(n.CULL_FACE),pe!==I&&(pe===fS?n.cullFace(n.BACK):pe===wN?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Ie(n.CULL_FACE),I=pe}function P(pe){pe!==L&&(V&&n.lineWidth(pe),L=pe)}function U(pe,Ze,we){pe?(Ce(n.POLYGON_OFFSET_FILL),(k!==Ze||T!==we)&&(n.polygonOffset(Ze,we),k=Ze,T=we)):Ie(n.POLYGON_OFFSET_FILL)}function j(pe){pe?Ce(n.SCISSOR_TEST):Ie(n.SCISSOR_TEST)}function B(pe){pe===void 0&&(pe=n.TEXTURE0+F-1),se!==pe&&(n.activeTexture(pe),se=pe)}function D(pe,Ze,we){we===void 0&&(se===null?we=n.TEXTURE0+F-1:we=se);let De=he[we];De===void 0&&(De={type:void 0,texture:void 0},he[we]=De),(De.type!==pe||De.texture!==Ze)&&(se!==we&&(n.activeTexture(we),se=we),n.bindTexture(pe,Ze||Te[pe]),De.type=pe,De.texture=Ze)}function W(){const pe=he[se];pe!==void 0&&pe.type!==void 0&&(n.bindTexture(pe.type,null),pe.type=void 0,pe.texture=void 0)}function G(){try{n.compressedTexImage2D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function X(){try{n.compressedTexImage3D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function ue(){try{n.texSubImage2D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function z(){try{n.texSubImage3D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function C(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function N(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function q(){try{n.texStorage2D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function Z(){try{n.texStorage3D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function $(){try{n.texImage2D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function ae(){try{n.texImage3D.apply(n,arguments)}catch(pe){console.error("THREE.WebGLState:",pe)}}function ke(pe){be.equals(pe)===!1&&(n.scissor(pe.x,pe.y,pe.z,pe.w),be.copy(pe))}function Le(pe){le.equals(pe)===!1&&(n.viewport(pe.x,pe.y,pe.z,pe.w),le.copy(pe))}function Ve(pe,Ze){let we=c.get(Ze);we===void 0&&(we=new WeakMap,c.set(Ze,we));let De=we.get(pe);De===void 0&&(De=n.getUniformBlockIndex(Ze,pe.name),we.set(pe,De))}function Je(pe,Ze){const De=c.get(Ze).get(pe);l.get(Ze)!==De&&(n.uniformBlockBinding(Ze,De,pe.__bindingPointIndex),l.set(Ze,De))}function st(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),o.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),u={},se=null,he={},d={},h=new WeakMap,f=[],p=null,g=!1,y=null,m=null,v=null,x=null,_=null,S=null,E=null,A=new gt(0,0,0),R=0,w=!1,M=null,I=null,L=null,k=null,T=null,be.set(0,0,n.canvas.width,n.canvas.height),le.set(0,0,n.canvas.width,n.canvas.height),s.reset(),o.reset(),a.reset()}return{buffers:{color:s,depth:o,stencil:a},enable:Ce,disable:Ie,bindFramebuffer:ze,drawBuffers:Be,useProgram:it,setBlending:b,setMaterial:oe,setFlipSided:J,setCullFace:H,setLineWidth:P,setPolygonOffset:U,setScissorTest:j,activeTexture:B,bindTexture:D,unbindTexture:W,compressedTexImage2D:G,compressedTexImage3D:X,texImage2D:$,texImage3D:ae,updateUBOMapping:Ve,uniformBlockBinding:Je,texStorage2D:q,texStorage3D:Z,texSubImage2D:ue,texSubImage3D:z,compressedTexSubImage2D:C,compressedTexSubImage3D:N,scissor:ke,viewport:Le,reset:st}}function wB(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new qe,u=new WeakMap;let d;const h=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(B){}function p(B,D){return f?new OffscreenCanvas(B,D):ch("canvas")}function g(B,D,W){let G=1;const X=j(B);if((X.width>W||X.height>W)&&(G=W/Math.max(X.width,X.height)),G<1)if(typeof HTMLImageElement<"u"&&B instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&B instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&B instanceof ImageBitmap||typeof VideoFrame<"u"&&B instanceof VideoFrame){const ue=Math.floor(G*X.width),z=Math.floor(G*X.height);d===void 0&&(d=p(ue,z));const C=D?p(ue,z):d;return C.width=ue,C.height=z,C.getContext("2d").drawImage(B,0,0,ue,z),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+X.width+"x"+X.height+") to ("+ue+"x"+z+")."),C}else return"data"in B&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+X.width+"x"+X.height+")."),B;return B}function y(B){return B.generateMipmaps}function m(B){n.generateMipmap(B)}function v(B){return B.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:B.isWebGL3DRenderTarget?n.TEXTURE_3D:B.isWebGLArrayRenderTarget||B.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(B,D,W,G,X=!1){if(B!==null){if(n[B]!==void 0)return n[B];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+B+"'")}let ue=D;if(D===n.RED&&(W===n.FLOAT&&(ue=n.R32F),W===n.HALF_FLOAT&&(ue=n.R16F),W===n.UNSIGNED_BYTE&&(ue=n.R8)),D===n.RED_INTEGER&&(W===n.UNSIGNED_BYTE&&(ue=n.R8UI),W===n.UNSIGNED_SHORT&&(ue=n.R16UI),W===n.UNSIGNED_INT&&(ue=n.R32UI),W===n.BYTE&&(ue=n.R8I),W===n.SHORT&&(ue=n.R16I),W===n.INT&&(ue=n.R32I)),D===n.RG&&(W===n.FLOAT&&(ue=n.RG32F),W===n.HALF_FLOAT&&(ue=n.RG16F),W===n.UNSIGNED_BYTE&&(ue=n.RG8)),D===n.RG_INTEGER&&(W===n.UNSIGNED_BYTE&&(ue=n.RG8UI),W===n.UNSIGNED_SHORT&&(ue=n.RG16UI),W===n.UNSIGNED_INT&&(ue=n.RG32UI),W===n.BYTE&&(ue=n.RG8I),W===n.SHORT&&(ue=n.RG16I),W===n.INT&&(ue=n.RG32I)),D===n.RGB_INTEGER&&(W===n.UNSIGNED_BYTE&&(ue=n.RGB8UI),W===n.UNSIGNED_SHORT&&(ue=n.RGB16UI),W===n.UNSIGNED_INT&&(ue=n.RGB32UI),W===n.BYTE&&(ue=n.RGB8I),W===n.SHORT&&(ue=n.RGB16I),W===n.INT&&(ue=n.RGB32I)),D===n.RGBA_INTEGER&&(W===n.UNSIGNED_BYTE&&(ue=n.RGBA8UI),W===n.UNSIGNED_SHORT&&(ue=n.RGBA16UI),W===n.UNSIGNED_INT&&(ue=n.RGBA32UI),W===n.BYTE&&(ue=n.RGBA8I),W===n.SHORT&&(ue=n.RGBA16I),W===n.INT&&(ue=n.RGBA32I)),D===n.RGB&&W===n.UNSIGNED_INT_5_9_9_9_REV&&(ue=n.RGB9_E5),D===n.RGBA){const z=X?cm:wt.getTransfer(G);W===n.FLOAT&&(ue=n.RGBA32F),W===n.HALF_FLOAT&&(ue=n.RGBA16F),W===n.UNSIGNED_BYTE&&(ue=z===Zt?n.SRGB8_ALPHA8:n.RGBA8),W===n.UNSIGNED_SHORT_4_4_4_4&&(ue=n.RGBA4),W===n.UNSIGNED_SHORT_5_5_5_1&&(ue=n.RGB5_A1)}return(ue===n.R16F||ue===n.R32F||ue===n.RG16F||ue===n.RG32F||ue===n.RGBA16F||ue===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ue}function _(B,D){let W;return B?D===null||D===Ni||D===uu?W=n.DEPTH24_STENCIL8:D===ir?W=n.DEPTH32F_STENCIL8:D===sh&&(W=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):D===null||D===Ni||D===uu?W=n.DEPTH_COMPONENT24:D===ir?W=n.DEPTH_COMPONENT32F:D===sh&&(W=n.DEPTH_COMPONENT16),W}function S(B,D){return y(B)===!0||B.isFramebufferTexture&&B.minFilter!==_i&&B.minFilter!==Rr?Math.log2(Math.max(D.width,D.height))+1:B.mipmaps!==void 0&&B.mipmaps.length>0?B.mipmaps.length:B.isCompressedTexture&&Array.isArray(B.image)?D.mipmaps.length:1}function E(B){const D=B.target;D.removeEventListener("dispose",E),R(D),D.isVideoTexture&&u.delete(D)}function A(B){const D=B.target;D.removeEventListener("dispose",A),M(D)}function R(B){const D=i.get(B);if(D.__webglInit===void 0)return;const W=B.source,G=h.get(W);if(G){const X=G[D.__cacheKey];X.usedTimes--,X.usedTimes===0&&w(B),Object.keys(G).length===0&&h.delete(W)}i.remove(B)}function w(B){const D=i.get(B);n.deleteTexture(D.__webglTexture);const W=B.source,G=h.get(W);delete G[D.__cacheKey],o.memory.textures--}function M(B){const D=i.get(B);if(B.depthTexture&&(B.depthTexture.dispose(),i.remove(B.depthTexture)),B.isWebGLCubeRenderTarget)for(let G=0;G<6;G++){if(Array.isArray(D.__webglFramebuffer[G]))for(let X=0;X<D.__webglFramebuffer[G].length;X++)n.deleteFramebuffer(D.__webglFramebuffer[G][X]);else n.deleteFramebuffer(D.__webglFramebuffer[G]);D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer[G])}else{if(Array.isArray(D.__webglFramebuffer))for(let G=0;G<D.__webglFramebuffer.length;G++)n.deleteFramebuffer(D.__webglFramebuffer[G]);else n.deleteFramebuffer(D.__webglFramebuffer);if(D.__webglDepthbuffer&&n.deleteRenderbuffer(D.__webglDepthbuffer),D.__webglMultisampledFramebuffer&&n.deleteFramebuffer(D.__webglMultisampledFramebuffer),D.__webglColorRenderbuffer)for(let G=0;G<D.__webglColorRenderbuffer.length;G++)D.__webglColorRenderbuffer[G]&&n.deleteRenderbuffer(D.__webglColorRenderbuffer[G]);D.__webglDepthRenderbuffer&&n.deleteRenderbuffer(D.__webglDepthRenderbuffer)}const W=B.textures;for(let G=0,X=W.length;G<X;G++){const ue=i.get(W[G]);ue.__webglTexture&&(n.deleteTexture(ue.__webglTexture),o.memory.textures--),i.remove(W[G])}i.remove(B)}let I=0;function L(){I=0}function k(){const B=I;return B>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+B+" texture units while this GPU supports only "+r.maxTextures),I+=1,B}function T(B){const D=[];return D.push(B.wrapS),D.push(B.wrapT),D.push(B.wrapR||0),D.push(B.magFilter),D.push(B.minFilter),D.push(B.anisotropy),D.push(B.internalFormat),D.push(B.format),D.push(B.type),D.push(B.generateMipmaps),D.push(B.premultiplyAlpha),D.push(B.flipY),D.push(B.unpackAlignment),D.push(B.colorSpace),D.join()}function F(B,D){const W=i.get(B);if(B.isVideoTexture&&P(B),B.isRenderTargetTexture===!1&&B.version>0&&W.__version!==B.version){const G=B.image;if(G===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(G.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(W,B,D);return}}t.bindTexture(n.TEXTURE_2D,W.__webglTexture,n.TEXTURE0+D)}function V(B,D){const W=i.get(B);if(B.version>0&&W.__version!==B.version){le(W,B,D);return}t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture,n.TEXTURE0+D)}function Q(B,D){const W=i.get(B);if(B.version>0&&W.__version!==B.version){le(W,B,D);return}t.bindTexture(n.TEXTURE_3D,W.__webglTexture,n.TEXTURE0+D)}function ee(B,D){const W=i.get(B);if(B.version>0&&W.__version!==B.version){fe(W,B,D);return}t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+D)}const se={[cu]:n.REPEAT,[Aa]:n.CLAMP_TO_EDGE,[om]:n.MIRRORED_REPEAT},he={[_i]:n.NEAREST,[h5]:n.NEAREST_MIPMAP_NEAREST,[bd]:n.NEAREST_MIPMAP_LINEAR,[Rr]:n.LINEAR,[bp]:n.LINEAR_MIPMAP_NEAREST,[Hs]:n.LINEAR_MIPMAP_LINEAR},ie={[oP]:n.NEVER,[dP]:n.ALWAYS,[b5]:n.LESS,[T5]:n.LEQUAL,[aP]:n.EQUAL,[uP]:n.GEQUAL,[lP]:n.GREATER,[cP]:n.NOTEQUAL};function re(B,D){if(D.type===ir&&e.has("OES_texture_float_linear")===!1&&(D.magFilter===Rr||D.magFilter===bp||D.magFilter===bd||D.magFilter===Hs||D.minFilter===Rr||D.minFilter===bp||D.minFilter===bd||D.minFilter===Hs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(B,n.TEXTURE_WRAP_S,se[D.wrapS]),n.texParameteri(B,n.TEXTURE_WRAP_T,se[D.wrapT]),(B===n.TEXTURE_3D||B===n.TEXTURE_2D_ARRAY)&&n.texParameteri(B,n.TEXTURE_WRAP_R,se[D.wrapR]),n.texParameteri(B,n.TEXTURE_MAG_FILTER,he[D.magFilter]),n.texParameteri(B,n.TEXTURE_MIN_FILTER,he[D.minFilter]),D.compareFunction&&(n.texParameteri(B,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(B,n.TEXTURE_COMPARE_FUNC,ie[D.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(D.magFilter===_i||D.minFilter!==bd&&D.minFilter!==Hs||D.type===ir&&e.has("OES_texture_float_linear")===!1)return;if(D.anisotropy>1||i.get(D).__currentAnisotropy){const W=e.get("EXT_texture_filter_anisotropic");n.texParameterf(B,W.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,r.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy}}}function be(B,D){let W=!1;B.__webglInit===void 0&&(B.__webglInit=!0,D.addEventListener("dispose",E));const G=D.source;let X=h.get(G);X===void 0&&(X={},h.set(G,X));const ue=T(D);if(ue!==B.__cacheKey){X[ue]===void 0&&(X[ue]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,W=!0),X[ue].usedTimes++;const z=X[B.__cacheKey];z!==void 0&&(X[B.__cacheKey].usedTimes--,z.usedTimes===0&&w(D)),B.__cacheKey=ue,B.__webglTexture=X[ue].texture}return W}function le(B,D,W){let G=n.TEXTURE_2D;(D.isDataArrayTexture||D.isCompressedArrayTexture)&&(G=n.TEXTURE_2D_ARRAY),D.isData3DTexture&&(G=n.TEXTURE_3D);const X=be(B,D),ue=D.source;t.bindTexture(G,B.__webglTexture,n.TEXTURE0+W);const z=i.get(ue);if(ue.version!==z.__version||X===!0){t.activeTexture(n.TEXTURE0+W);const C=wt.getPrimaries(wt.workingColorSpace),N=D.colorSpace===Vs?null:wt.getPrimaries(D.colorSpace),q=D.colorSpace===Vs||C===N?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,q);let Z=g(D.image,!1,r.maxTextureSize);Z=U(D,Z);const $=s.convert(D.format,D.colorSpace),ae=s.convert(D.type);let ke=x(D.internalFormat,$,ae,D.colorSpace,D.isVideoTexture);re(G,D);let Le;const Ve=D.mipmaps,Je=D.isVideoTexture!==!0,st=z.__version===void 0||X===!0,pe=ue.dataReady,Ze=S(D,Z);if(D.isDepthTexture)ke=_(D.format===du,D.type),st&&(Je?t.texStorage2D(n.TEXTURE_2D,1,ke,Z.width,Z.height):t.texImage2D(n.TEXTURE_2D,0,ke,Z.width,Z.height,0,$,ae,null));else if(D.isDataTexture)if(Ve.length>0){Je&&st&&t.texStorage2D(n.TEXTURE_2D,Ze,ke,Ve[0].width,Ve[0].height);for(let we=0,De=Ve.length;we<De;we++)Le=Ve[we],Je?pe&&t.texSubImage2D(n.TEXTURE_2D,we,0,0,Le.width,Le.height,$,ae,Le.data):t.texImage2D(n.TEXTURE_2D,we,ke,Le.width,Le.height,0,$,ae,Le.data);D.generateMipmaps=!1}else Je?(st&&t.texStorage2D(n.TEXTURE_2D,Ze,ke,Z.width,Z.height),pe&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Z.width,Z.height,$,ae,Z.data)):t.texImage2D(n.TEXTURE_2D,0,ke,Z.width,Z.height,0,$,ae,Z.data);else if(D.isCompressedTexture)if(D.isCompressedArrayTexture){Je&&st&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ze,ke,Ve[0].width,Ve[0].height,Z.depth);for(let we=0,De=Ve.length;we<De;we++)if(Le=Ve[we],D.format!==Di)if($!==null)if(Je){if(pe)if(D.layerUpdates.size>0){const Ke=rA(Le.width,Le.height,D.format,D.type);for(const et of D.layerUpdates){const _t=Le.data.subarray(et*Ke/Le.data.BYTES_PER_ELEMENT,(et+1)*Ke/Le.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,we,0,0,et,Le.width,Le.height,1,$,_t)}D.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,we,0,0,0,Le.width,Le.height,Z.depth,$,Le.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,we,ke,Le.width,Le.height,Z.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Je?pe&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,we,0,0,0,Le.width,Le.height,Z.depth,$,ae,Le.data):t.texImage3D(n.TEXTURE_2D_ARRAY,we,ke,Le.width,Le.height,Z.depth,0,$,ae,Le.data)}else{Je&&st&&t.texStorage2D(n.TEXTURE_2D,Ze,ke,Ve[0].width,Ve[0].height);for(let we=0,De=Ve.length;we<De;we++)Le=Ve[we],D.format!==Di?$!==null?Je?pe&&t.compressedTexSubImage2D(n.TEXTURE_2D,we,0,0,Le.width,Le.height,$,Le.data):t.compressedTexImage2D(n.TEXTURE_2D,we,ke,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Je?pe&&t.texSubImage2D(n.TEXTURE_2D,we,0,0,Le.width,Le.height,$,ae,Le.data):t.texImage2D(n.TEXTURE_2D,we,ke,Le.width,Le.height,0,$,ae,Le.data)}else if(D.isDataArrayTexture)if(Je){if(st&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ze,ke,Z.width,Z.height,Z.depth),pe)if(D.layerUpdates.size>0){const we=rA(Z.width,Z.height,D.format,D.type);for(const De of D.layerUpdates){const Ke=Z.data.subarray(De*we/Z.data.BYTES_PER_ELEMENT,(De+1)*we/Z.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,De,Z.width,Z.height,1,$,ae,Ke)}D.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Z.width,Z.height,Z.depth,$,ae,Z.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,ke,Z.width,Z.height,Z.depth,0,$,ae,Z.data);else if(D.isData3DTexture)Je?(st&&t.texStorage3D(n.TEXTURE_3D,Ze,ke,Z.width,Z.height,Z.depth),pe&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Z.width,Z.height,Z.depth,$,ae,Z.data)):t.texImage3D(n.TEXTURE_3D,0,ke,Z.width,Z.height,Z.depth,0,$,ae,Z.data);else if(D.isFramebufferTexture){if(st)if(Je)t.texStorage2D(n.TEXTURE_2D,Ze,ke,Z.width,Z.height);else{let we=Z.width,De=Z.height;for(let Ke=0;Ke<Ze;Ke++)t.texImage2D(n.TEXTURE_2D,Ke,ke,we,De,0,$,ae,null),we>>=1,De>>=1}}else if(Ve.length>0){if(Je&&st){const we=j(Ve[0]);t.texStorage2D(n.TEXTURE_2D,Ze,ke,we.width,we.height)}for(let we=0,De=Ve.length;we<De;we++)Le=Ve[we],Je?pe&&t.texSubImage2D(n.TEXTURE_2D,we,0,0,$,ae,Le):t.texImage2D(n.TEXTURE_2D,we,ke,$,ae,Le);D.generateMipmaps=!1}else if(Je){if(st){const we=j(Z);t.texStorage2D(n.TEXTURE_2D,Ze,ke,we.width,we.height)}pe&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,$,ae,Z)}else t.texImage2D(n.TEXTURE_2D,0,ke,$,ae,Z);y(D)&&m(G),z.__version=ue.version,D.onUpdate&&D.onUpdate(D)}B.__version=D.version}function fe(B,D,W){if(D.image.length!==6)return;const G=be(B,D),X=D.source;t.bindTexture(n.TEXTURE_CUBE_MAP,B.__webglTexture,n.TEXTURE0+W);const ue=i.get(X);if(X.version!==ue.__version||G===!0){t.activeTexture(n.TEXTURE0+W);const z=wt.getPrimaries(wt.workingColorSpace),C=D.colorSpace===Vs?null:wt.getPrimaries(D.colorSpace),N=D.colorSpace===Vs||z===C?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,N);const q=D.isCompressedTexture||D.image[0].isCompressedTexture,Z=D.image[0]&&D.image[0].isDataTexture,$=[];for(let De=0;De<6;De++)!q&&!Z?$[De]=g(D.image[De],!0,r.maxCubemapSize):$[De]=Z?D.image[De].image:D.image[De],$[De]=U(D,$[De]);const ae=$[0],ke=s.convert(D.format,D.colorSpace),Le=s.convert(D.type),Ve=x(D.internalFormat,ke,Le,D.colorSpace),Je=D.isVideoTexture!==!0,st=ue.__version===void 0||G===!0,pe=X.dataReady;let Ze=S(D,ae);re(n.TEXTURE_CUBE_MAP,D);let we;if(q){Je&&st&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Ze,Ve,ae.width,ae.height);for(let De=0;De<6;De++){we=$[De].mipmaps;for(let Ke=0;Ke<we.length;Ke++){const et=we[Ke];D.format!==Di?ke!==null?Je?pe&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke,0,0,et.width,et.height,ke,et.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke,Ve,et.width,et.height,0,et.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Je?pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke,0,0,et.width,et.height,ke,Le,et.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke,Ve,et.width,et.height,0,ke,Le,et.data)}}}else{if(we=D.mipmaps,Je&&st){we.length>0&&Ze++;const De=j($[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ze,Ve,De.width,De.height)}for(let De=0;De<6;De++)if(Z){Je?pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,0,0,$[De].width,$[De].height,ke,Le,$[De].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,Ve,$[De].width,$[De].height,0,ke,Le,$[De].data);for(let Ke=0;Ke<we.length;Ke++){const _t=we[Ke].image[De].image;Je?pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke+1,0,0,_t.width,_t.height,ke,Le,_t.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke+1,Ve,_t.width,_t.height,0,ke,Le,_t.data)}}else{Je?pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,0,0,ke,Le,$[De]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,Ve,ke,Le,$[De]);for(let Ke=0;Ke<we.length;Ke++){const et=we[Ke];Je?pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke+1,0,0,ke,Le,et.image[De]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+De,Ke+1,Ve,ke,Le,et.image[De])}}}y(D)&&m(n.TEXTURE_CUBE_MAP),ue.__version=X.version,D.onUpdate&&D.onUpdate(D)}B.__version=D.version}function Te(B,D,W,G,X,ue){const z=s.convert(W.format,W.colorSpace),C=s.convert(W.type),N=x(W.internalFormat,z,C,W.colorSpace),q=i.get(D),Z=i.get(W);if(Z.__renderTarget=D,!q.__hasExternalTextures){const $=Math.max(1,D.width>>ue),ae=Math.max(1,D.height>>ue);X===n.TEXTURE_3D||X===n.TEXTURE_2D_ARRAY?t.texImage3D(X,ue,N,$,ae,D.depth,0,z,C,null):t.texImage2D(X,ue,N,$,ae,0,z,C,null)}t.bindFramebuffer(n.FRAMEBUFFER,B),H(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,G,X,Z.__webglTexture,0,J(D)):(X===n.TEXTURE_2D||X>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,G,X,Z.__webglTexture,ue),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ce(B,D,W){if(n.bindRenderbuffer(n.RENDERBUFFER,B),D.depthBuffer){const G=D.depthTexture,X=G&&G.isDepthTexture?G.type:null,ue=_(D.stencilBuffer,X),z=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,C=J(D);H(D)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,C,ue,D.width,D.height):W?n.renderbufferStorageMultisample(n.RENDERBUFFER,C,ue,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,ue,D.width,D.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,z,n.RENDERBUFFER,B)}else{const G=D.textures;for(let X=0;X<G.length;X++){const ue=G[X],z=s.convert(ue.format,ue.colorSpace),C=s.convert(ue.type),N=x(ue.internalFormat,z,C,ue.colorSpace),q=J(D);W&&H(D)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,q,N,D.width,D.height):H(D)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,q,N,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,N,D.width,D.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function Ie(B,D){if(D&&D.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,B),!(D.depthTexture&&D.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const G=i.get(D.depthTexture);G.__renderTarget=D,(!G.__webglTexture||D.depthTexture.image.width!==D.width||D.depthTexture.image.height!==D.height)&&(D.depthTexture.image.width=D.width,D.depthTexture.image.height=D.height,D.depthTexture.needsUpdate=!0),F(D.depthTexture,0);const X=G.__webglTexture,ue=J(D);if(D.depthTexture.format===Ml)H(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,X,0,ue):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,X,0);else if(D.depthTexture.format===du)H(D)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,X,0,ue):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,X,0);else throw new Error("Unknown depthTexture format")}function ze(B){const D=i.get(B),W=B.isWebGLCubeRenderTarget===!0;if(D.__boundDepthTexture!==B.depthTexture){const G=B.depthTexture;if(D.__depthDisposeCallback&&D.__depthDisposeCallback(),G){const X=()=>{delete D.__boundDepthTexture,delete D.__depthDisposeCallback,G.removeEventListener("dispose",X)};G.addEventListener("dispose",X),D.__depthDisposeCallback=X}D.__boundDepthTexture=G}if(B.depthTexture&&!D.__autoAllocateDepthBuffer){if(W)throw new Error("target.depthTexture not supported in Cube render targets");Ie(D.__webglFramebuffer,B)}else if(W){D.__webglDepthbuffer=[];for(let G=0;G<6;G++)if(t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer[G]),D.__webglDepthbuffer[G]===void 0)D.__webglDepthbuffer[G]=n.createRenderbuffer(),Ce(D.__webglDepthbuffer[G],B,!1);else{const X=B.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=D.__webglDepthbuffer[G];n.bindRenderbuffer(n.RENDERBUFFER,ue),n.framebufferRenderbuffer(n.FRAMEBUFFER,X,n.RENDERBUFFER,ue)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer),D.__webglDepthbuffer===void 0)D.__webglDepthbuffer=n.createRenderbuffer(),Ce(D.__webglDepthbuffer,B,!1);else{const G=B.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,X=D.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,X),n.framebufferRenderbuffer(n.FRAMEBUFFER,G,n.RENDERBUFFER,X)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Be(B,D,W){const G=i.get(B);D!==void 0&&Te(G.__webglFramebuffer,B,B.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),W!==void 0&&ze(B)}function it(B){const D=B.texture,W=i.get(B),G=i.get(D);B.addEventListener("dispose",A);const X=B.textures,ue=B.isWebGLCubeRenderTarget===!0,z=X.length>1;if(z||(G.__webglTexture===void 0&&(G.__webglTexture=n.createTexture()),G.__version=D.version,o.memory.textures++),ue){W.__webglFramebuffer=[];for(let C=0;C<6;C++)if(D.mipmaps&&D.mipmaps.length>0){W.__webglFramebuffer[C]=[];for(let N=0;N<D.mipmaps.length;N++)W.__webglFramebuffer[C][N]=n.createFramebuffer()}else W.__webglFramebuffer[C]=n.createFramebuffer()}else{if(D.mipmaps&&D.mipmaps.length>0){W.__webglFramebuffer=[];for(let C=0;C<D.mipmaps.length;C++)W.__webglFramebuffer[C]=n.createFramebuffer()}else W.__webglFramebuffer=n.createFramebuffer();if(z)for(let C=0,N=X.length;C<N;C++){const q=i.get(X[C]);q.__webglTexture===void 0&&(q.__webglTexture=n.createTexture(),o.memory.textures++)}if(B.samples>0&&H(B)===!1){W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let C=0;C<X.length;C++){const N=X[C];W.__webglColorRenderbuffer[C]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,W.__webglColorRenderbuffer[C]);const q=s.convert(N.format,N.colorSpace),Z=s.convert(N.type),$=x(N.internalFormat,q,Z,N.colorSpace,B.isXRRenderTarget===!0),ae=J(B);n.renderbufferStorageMultisample(n.RENDERBUFFER,ae,$,B.width,B.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+C,n.RENDERBUFFER,W.__webglColorRenderbuffer[C])}n.bindRenderbuffer(n.RENDERBUFFER,null),B.depthBuffer&&(W.__webglDepthRenderbuffer=n.createRenderbuffer(),Ce(W.__webglDepthRenderbuffer,B,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(ue){t.bindTexture(n.TEXTURE_CUBE_MAP,G.__webglTexture),re(n.TEXTURE_CUBE_MAP,D);for(let C=0;C<6;C++)if(D.mipmaps&&D.mipmaps.length>0)for(let N=0;N<D.mipmaps.length;N++)Te(W.__webglFramebuffer[C][N],B,D,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+C,N);else Te(W.__webglFramebuffer[C],B,D,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+C,0);y(D)&&m(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(z){for(let C=0,N=X.length;C<N;C++){const q=X[C],Z=i.get(q);t.bindTexture(n.TEXTURE_2D,Z.__webglTexture),re(n.TEXTURE_2D,q),Te(W.__webglFramebuffer,B,q,n.COLOR_ATTACHMENT0+C,n.TEXTURE_2D,0),y(q)&&m(n.TEXTURE_2D)}t.unbindTexture()}else{let C=n.TEXTURE_2D;if((B.isWebGL3DRenderTarget||B.isWebGLArrayRenderTarget)&&(C=B.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(C,G.__webglTexture),re(C,D),D.mipmaps&&D.mipmaps.length>0)for(let N=0;N<D.mipmaps.length;N++)Te(W.__webglFramebuffer[N],B,D,n.COLOR_ATTACHMENT0,C,N);else Te(W.__webglFramebuffer,B,D,n.COLOR_ATTACHMENT0,C,0);y(D)&&m(C),t.unbindTexture()}B.depthBuffer&&ze(B)}function te(B){const D=B.textures;for(let W=0,G=D.length;W<G;W++){const X=D[W];if(y(X)){const ue=v(B),z=i.get(X).__webglTexture;t.bindTexture(ue,z),m(ue),t.unbindTexture()}}}const ne=[],b=[];function oe(B){if(B.samples>0){if(H(B)===!1){const D=B.textures,W=B.width,G=B.height;let X=n.COLOR_BUFFER_BIT;const ue=B.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,z=i.get(B),C=D.length>1;if(C)for(let N=0;N<D.length;N++)t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+N,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,z.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+N,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,z.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,z.__webglFramebuffer);for(let N=0;N<D.length;N++){if(B.resolveDepthBuffer&&(B.depthBuffer&&(X|=n.DEPTH_BUFFER_BIT),B.stencilBuffer&&B.resolveStencilBuffer&&(X|=n.STENCIL_BUFFER_BIT)),C){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,z.__webglColorRenderbuffer[N]);const q=i.get(D[N]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,q,0)}n.blitFramebuffer(0,0,W,G,0,0,W,G,X,n.NEAREST),l===!0&&(ne.length=0,b.length=0,ne.push(n.COLOR_ATTACHMENT0+N),B.depthBuffer&&B.resolveDepthBuffer===!1&&(ne.push(ue),b.push(ue),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,b)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,ne))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),C)for(let N=0;N<D.length;N++){t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+N,n.RENDERBUFFER,z.__webglColorRenderbuffer[N]);const q=i.get(D[N]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,z.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+N,n.TEXTURE_2D,q,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,z.__webglMultisampledFramebuffer)}else if(B.depthBuffer&&B.resolveDepthBuffer===!1&&l){const D=B.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[D])}}}function J(B){return Math.min(r.maxSamples,B.samples)}function H(B){const D=i.get(B);return B.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&D.__useRenderToTexture!==!1}function P(B){const D=o.render.frame;u.get(B)!==D&&(u.set(B,D),B.update())}function U(B,D){const W=B.colorSpace,G=B.format,X=B.type;return B.isCompressedTexture===!0||B.isVideoTexture===!0||W!==Bi&&W!==Vs&&(wt.getTransfer(W)===Zt?(G!==Di||X!==Js)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),D}function j(B){return typeof HTMLImageElement<"u"&&B instanceof HTMLImageElement?(c.width=B.naturalWidth||B.width,c.height=B.naturalHeight||B.height):typeof VideoFrame<"u"&&B instanceof VideoFrame?(c.width=B.displayWidth,c.height=B.displayHeight):(c.width=B.width,c.height=B.height),c}this.allocateTextureUnit=k,this.resetTextureUnits=L,this.setTexture2D=F,this.setTexture2DArray=V,this.setTexture3D=Q,this.setTextureCube=ee,this.rebindTextures=Be,this.setupRenderTarget=it,this.updateRenderTargetMipmap=te,this.updateMultisampleRenderTarget=oe,this.setupDepthRenderbuffer=ze,this.setupFrameBufferTexture=Te,this.useMultisampledRTT=H}function Q5(n,e){function t(i,r=Vs){let s;const o=wt.getTransfer(r);if(i===Js)return n.UNSIGNED_BYTE;if(i===f_)return n.UNSIGNED_SHORT_4_4_4_4;if(i===p_)return n.UNSIGNED_SHORT_5_5_5_1;if(i===m5)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===f5)return n.BYTE;if(i===p5)return n.SHORT;if(i===sh)return n.UNSIGNED_SHORT;if(i===Zm)return n.INT;if(i===Ni)return n.UNSIGNED_INT;if(i===ir)return n.FLOAT;if(i===Ts)return n.HALF_FLOAT;if(i===g5)return n.ALPHA;if(i===y5)return n.RGB;if(i===Di)return n.RGBA;if(i===v5)return n.LUMINANCE;if(i===_5)return n.LUMINANCE_ALPHA;if(i===Ml)return n.DEPTH_COMPONENT;if(i===du)return n.DEPTH_STENCIL;if(i===m_)return n.RED;if(i===Jm)return n.RED_INTEGER;if(i===oh)return n.RG;if(i===g_)return n.RG_INTEGER;if(i===wo)return n.RGBA_INTEGER;if(i===Tp||i===wp||i===Cp||i===Ep)if(o===Zt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Tp)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===wp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Cp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Ep)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Tp)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===wp)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Cp)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Ep)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===oy||i===ay||i===ly||i===cy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===oy)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===ay)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===ly)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===cy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===uy||i===dy||i===hy)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===uy||i===dy)return o===Zt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===hy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===fy||i===py||i===my||i===gy||i===yy||i===vy||i===_y||i===xy||i===Sy||i===Ay||i===by||i===Ty||i===wy||i===Cy)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===fy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===py)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===my)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===gy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===yy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===vy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===_y)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===xy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Sy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Ay)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===by)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ty)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===wy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Cy)return o===Zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Mp||i===Ey||i===My)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Mp)return o===Zt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Ey)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===My)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===x5||i===Ry||i===Iy||i===Ny)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Mp)return s.COMPRESSED_RED_RGTC1_EXT;if(i===Ry)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Iy)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Ny)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===uu?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const CB="\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}",EB="\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}";class MB{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Wn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Pr({vertexShader:CB,fragmentShader:EB,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new pn(new pu(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class RB extends ro{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,h=null,f=null,p=null;const g=new MB,y=t.getContextAttributes();let m=null,v=null;const x=[],_=[],S=new qe;let E=null;const A=new Ki;A.viewport=new Mt;const R=new Ki;R.viewport=new Mt;const w=[A,R],M=new BL;let I=null,L=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let fe=x[le];return fe===void 0&&(fe=new wg,x[le]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(le){let fe=x[le];return fe===void 0&&(fe=new wg,x[le]=fe),fe.getGripSpace()},this.getHand=function(le){let fe=x[le];return fe===void 0&&(fe=new wg,x[le]=fe),fe.getHandSpace()};function k(le){const fe=_.indexOf(le.inputSource);if(fe===-1)return;const Te=x[fe];Te!==void 0&&(Te.update(le.inputSource,le.frame,c||o),Te.dispatchEvent({type:le.type,data:le.inputSource}))}function T(){r.removeEventListener("select",k),r.removeEventListener("selectstart",k),r.removeEventListener("selectend",k),r.removeEventListener("squeeze",k),r.removeEventListener("squeezestart",k),r.removeEventListener("squeezeend",k),r.removeEventListener("end",T),r.removeEventListener("inputsourceschange",F);for(let le=0;le<x.length;le++){const fe=_[le];fe!==null&&(_[le]=null,x[le].disconnect(fe))}I=null,L=null,g.reset(),e.setRenderTarget(m),f=null,h=null,d=null,r=null,v=null,be.stop(),i.isPresenting=!1,e.setPixelRatio(E),e.setSize(S.width,S.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(le){s=le,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(le){a=le,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(le){c=le},this.getBaseLayer=function(){return h!==null?h:f},this.getBinding=function(){return d},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(le){if(r=le,r!==null){if(m=e.getRenderTarget(),r.addEventListener("select",k),r.addEventListener("selectstart",k),r.addEventListener("selectend",k),r.addEventListener("squeeze",k),r.addEventListener("squeezestart",k),r.addEventListener("squeezeend",k),r.addEventListener("end",T),r.addEventListener("inputsourceschange",F),y.xrCompatible!==!0&&await t.makeXRCompatible(),E=e.getPixelRatio(),e.getSize(S),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Te=null,Ce=null,Ie=null;y.depth&&(Ie=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Te=y.stencil?du:Ml,Ce=y.stencil?uu:Ni);const ze={colorFormat:t.RGBA8,depthFormat:Ie,scaleFactor:s};d=new XRWebGLBinding(r,t),h=d.createProjectionLayer(ze),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),v=new Fa(h.textureWidth,h.textureHeight,{format:Di,type:Js,depthTexture:new Ua(h.textureWidth,h.textureHeight,Ce,void 0,void 0,void 0,void 0,void 0,void 0,Te),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1})}else{const Te={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(r,t,Te),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),v=new Fa(f.framebufferWidth,f.framebufferHeight,{format:Di,type:Js,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil})}v.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),be.setContext(r),be.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function F(le){for(let fe=0;fe<le.removed.length;fe++){const Te=le.removed[fe],Ce=_.indexOf(Te);Ce>=0&&(_[Ce]=null,x[Ce].disconnect(Te))}for(let fe=0;fe<le.added.length;fe++){const Te=le.added[fe];let Ce=_.indexOf(Te);if(Ce===-1){for(let ze=0;ze<x.length;ze++)if(ze>=_.length){_.push(Te),Ce=ze;break}else if(_[ze]===null){_[ze]=Te,Ce=ze;break}if(Ce===-1)break}const Ie=x[Ce];Ie&&Ie.connect(Te)}}const V=new Y,Q=new Y;function ee(le,fe,Te){V.setFromMatrixPosition(fe.matrixWorld),Q.setFromMatrixPosition(Te.matrixWorld);const Ce=V.distanceTo(Q),Ie=fe.projectionMatrix.elements,ze=Te.projectionMatrix.elements,Be=Ie[14]/(Ie[10]-1),it=Ie[14]/(Ie[10]+1),te=(Ie[9]+1)/Ie[5],ne=(Ie[9]-1)/Ie[5],b=(Ie[8]-1)/Ie[0],oe=(ze[8]+1)/ze[0],J=Be*b,H=Be*oe,P=Ce/(-b+oe),U=P*-b;if(fe.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(U),le.translateZ(P),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert(),Ie[10]===-1)le.projectionMatrix.copy(fe.projectionMatrix),le.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const j=Be+P,B=it+P,D=J-U,W=H+(Ce-U),G=te*it/B*j,X=ne*it/B*j;le.projectionMatrix.makePerspective(D,W,G,X,j,B),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}}function se(le,fe){fe===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(fe.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(r===null)return;let fe=le.near,Te=le.far;g.texture!==null&&(g.depthNear>0&&(fe=g.depthNear),g.depthFar>0&&(Te=g.depthFar)),M.near=R.near=A.near=fe,M.far=R.far=A.far=Te,(I!==M.near||L!==M.far)&&(r.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,L=M.far),A.layers.mask=le.layers.mask|2,R.layers.mask=le.layers.mask|4,M.layers.mask=A.layers.mask|R.layers.mask;const Ce=le.parent,Ie=M.cameras;se(M,Ce);for(let ze=0;ze<Ie.length;ze++)se(Ie[ze],Ce);Ie.length===2?ee(M,A,R):M.projectionMatrix.copy(A.projectionMatrix),he(le,M,Ce)};function he(le,fe,Te){Te===null?le.matrix.copy(fe.matrixWorld):(le.matrix.copy(Te.matrixWorld),le.matrix.invert(),le.matrix.multiply(fe.matrixWorld)),le.matrix.decompose(le.position,le.quaternion,le.scale),le.updateMatrixWorld(!0),le.projectionMatrix.copy(fe.projectionMatrix),le.projectionMatrixInverse.copy(fe.projectionMatrixInverse),le.isPerspectiveCamera&&(le.fov=hu*2*Math.atan(1/le.projectionMatrix.elements[5]),le.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(h===null&&f===null))return l},this.setFoveation=function(le){l=le,h!==null&&(h.fixedFoveation=le),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=le)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(M)};let ie=null;function re(le,fe){if(u=fe.getViewerPose(c||o),p=fe,u!==null){const Te=u.views;f!==null&&(e.setRenderTargetFramebuffer(v,f.framebuffer),e.setRenderTarget(v));let Ce=!1;Te.length!==M.cameras.length&&(M.cameras.length=0,Ce=!0);for(let Be=0;Be<Te.length;Be++){const it=Te[Be];let te=null;if(f!==null)te=f.getViewport(it);else{const b=d.getViewSubImage(h,it);te=b.viewport,Be===0&&(e.setRenderTargetTextures(v,b.colorTexture,h.ignoreDepthValues?void 0:b.depthStencilTexture),e.setRenderTarget(v))}let ne=w[Be];ne===void 0&&(ne=new Ki,ne.layers.enable(Be),ne.viewport=new Mt,w[Be]=ne),ne.matrix.fromArray(it.transform.matrix),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale),ne.projectionMatrix.fromArray(it.projectionMatrix),ne.projectionMatrixInverse.copy(ne.projectionMatrix).invert(),ne.viewport.set(te.x,te.y,te.width,te.height),Be===0&&(M.matrix.copy(ne.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),Ce===!0&&M.cameras.push(ne)}const Ie=r.enabledFeatures;if(Ie&&Ie.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&d){const Be=d.getDepthInformation(Te[0]);Be&&Be.isValid&&Be.texture&&g.init(e,Be,r.renderState)}}for(let Te=0;Te<x.length;Te++){const Ce=_[Te],Ie=x[Te];Ce!==null&&Ie!==void 0&&Ie.update(Ce,fe,c||o)}ie&&ie(le,fe),fe.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:fe}),p=null}const be=new V5;be.setAnimationLoop(re),this.setAnimationLoop=function(le){ie=le},this.dispose=function(){}}}const nl=new ws,IB=new Xe;function NB(n,e){function t(y,m){y.matrixAutoUpdate===!0&&y.updateMatrix(),m.value.copy(y.matrix)}function i(y,m){m.color.getRGB(y.fogColor.value,N5(n)),m.isFog?(y.fogNear.value=m.near,y.fogFar.value=m.far):m.isFogExp2&&(y.fogDensity.value=m.density)}function r(y,m,v,x,_){m.isMeshBasicMaterial||m.isMeshLambertMaterial?s(y,m):m.isMeshToonMaterial?(s(y,m),d(y,m)):m.isMeshPhongMaterial?(s(y,m),u(y,m)):m.isMeshStandardMaterial?(s(y,m),h(y,m),m.isMeshPhysicalMaterial&&f(y,m,_)):m.isMeshMatcapMaterial?(s(y,m),p(y,m)):m.isMeshDepthMaterial?s(y,m):m.isMeshDistanceMaterial?(s(y,m),g(y,m)):m.isMeshNormalMaterial?s(y,m):m.isLineBasicMaterial?(o(y,m),m.isLineDashedMaterial&&a(y,m)):m.isPointsMaterial?l(y,m,v,x):m.isSpriteMaterial?c(y,m):m.isShadowMaterial?(y.color.value.copy(m.color),y.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(y,m){y.opacity.value=m.opacity,m.color&&y.diffuse.value.copy(m.color),m.emissive&&y.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.bumpMap&&(y.bumpMap.value=m.bumpMap,t(m.bumpMap,y.bumpMapTransform),y.bumpScale.value=m.bumpScale,m.side===Fi&&(y.bumpScale.value*=-1)),m.normalMap&&(y.normalMap.value=m.normalMap,t(m.normalMap,y.normalMapTransform),y.normalScale.value.copy(m.normalScale),m.side===Fi&&y.normalScale.value.negate()),m.displacementMap&&(y.displacementMap.value=m.displacementMap,t(m.displacementMap,y.displacementMapTransform),y.displacementScale.value=m.displacementScale,y.displacementBias.value=m.displacementBias),m.emissiveMap&&(y.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,y.emissiveMapTransform)),m.specularMap&&(y.specularMap.value=m.specularMap,t(m.specularMap,y.specularMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest);const v=e.get(m),x=v.envMap,_=v.envMapRotation;x&&(y.envMap.value=x,nl.copy(_),nl.x*=-1,nl.y*=-1,nl.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(nl.y*=-1,nl.z*=-1),y.envMapRotation.value.setFromMatrix4(IB.makeRotationFromEuler(nl)),y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=m.reflectivity,y.ior.value=m.ior,y.refractionRatio.value=m.refractionRatio),m.lightMap&&(y.lightMap.value=m.lightMap,y.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,y.lightMapTransform)),m.aoMap&&(y.aoMap.value=m.aoMap,y.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,y.aoMapTransform))}function o(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform))}function a(y,m){y.dashSize.value=m.dashSize,y.totalSize.value=m.dashSize+m.gapSize,y.scale.value=m.scale}function l(y,m,v,x){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.size.value=m.size*v,y.scale.value=x*.5,m.map&&(y.map.value=m.map,t(m.map,y.uvTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function c(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.rotation.value=m.rotation,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function u(y,m){y.specular.value.copy(m.specular),y.shininess.value=Math.max(m.shininess,1e-4)}function d(y,m){m.gradientMap&&(y.gradientMap.value=m.gradientMap)}function h(y,m){y.metalness.value=m.metalness,m.metalnessMap&&(y.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,y.metalnessMapTransform)),y.roughness.value=m.roughness,m.roughnessMap&&(y.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,y.roughnessMapTransform)),m.envMap&&(y.envMapIntensity.value=m.envMapIntensity)}function f(y,m,v){y.ior.value=m.ior,m.sheen>0&&(y.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),y.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(y.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,y.sheenColorMapTransform)),m.sheenRoughnessMap&&(y.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,y.sheenRoughnessMapTransform))),m.clearcoat>0&&(y.clearcoat.value=m.clearcoat,y.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(y.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,y.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(y.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Fi&&y.clearcoatNormalScale.value.negate())),m.dispersion>0&&(y.dispersion.value=m.dispersion),m.iridescence>0&&(y.iridescence.value=m.iridescence,y.iridescenceIOR.value=m.iridescenceIOR,y.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(y.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,y.iridescenceMapTransform)),m.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),m.transmission>0&&(y.transmission.value=m.transmission,y.transmissionSamplerMap.value=v.texture,y.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(y.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,y.transmissionMapTransform)),y.thickness.value=m.thickness,m.thicknessMap&&(y.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=m.attenuationDistance,y.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(y.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(y.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=m.specularIntensity,y.specularColor.value.copy(m.specularColor),m.specularColorMap&&(y.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,y.specularColorMapTransform)),m.specularIntensityMap&&(y.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,y.specularIntensityMapTransform))}function p(y,m){m.matcap&&(y.matcap.value=m.matcap)}function g(y,m){const v=e.get(m).light;y.referencePosition.value.setFromMatrixPosition(v.matrixWorld),y.nearDistance.value=v.shadow.camera.near,y.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function PB(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(v,x){const _=x.program;i.uniformBlockBinding(v,_)}function c(v,x){let _=r[v.id];_===void 0&&(p(v),_=u(v),r[v.id]=_,v.addEventListener("dispose",y));const S=x.program;i.updateUBOMapping(v,S);const E=e.render.frame;s[v.id]!==E&&(h(v),s[v.id]=E)}function u(v){const x=d();v.__bindingPointIndex=x;const _=n.createBuffer(),S=v.__size,E=v.usage;return n.bindBuffer(n.UNIFORM_BUFFER,_),n.bufferData(n.UNIFORM_BUFFER,S,E),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,_),_}function d(){for(let v=0;v<a;v++)if(o.indexOf(v)===-1)return o.push(v),v;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(v){const x=r[v.id],_=v.uniforms,S=v.__cache;n.bindBuffer(n.UNIFORM_BUFFER,x);for(let E=0,A=_.length;E<A;E++){const R=Array.isArray(_[E])?_[E]:[_[E]];for(let w=0,M=R.length;w<M;w++){const I=R[w];if(f(I,E,w,S)===!0){const L=I.__offset,k=Array.isArray(I.value)?I.value:[I.value];let T=0;for(let F=0;F<k.length;F++){const V=k[F],Q=g(V);typeof V=="number"||typeof V=="boolean"?(I.__data[0]=V,n.bufferSubData(n.UNIFORM_BUFFER,L+T,I.__data)):V.isMatrix3?(I.__data[0]=V.elements[0],I.__data[1]=V.elements[1],I.__data[2]=V.elements[2],I.__data[3]=0,I.__data[4]=V.elements[3],I.__data[5]=V.elements[4],I.__data[6]=V.elements[5],I.__data[7]=0,I.__data[8]=V.elements[6],I.__data[9]=V.elements[7],I.__data[10]=V.elements[8],I.__data[11]=0):(V.toArray(I.__data,T),T+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,L,I.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function f(v,x,_,S){const E=v.value,A=x+"_"+_;if(S[A]===void 0)return typeof E=="number"||typeof E=="boolean"?S[A]=E:S[A]=E.clone(),!0;{const R=S[A];if(typeof E=="number"||typeof E=="boolean"){if(R!==E)return S[A]=E,!0}else if(R.equals(E)===!1)return R.copy(E),!0}return!1}function p(v){const x=v.uniforms;let _=0;const S=16;for(let A=0,R=x.length;A<R;A++){const w=Array.isArray(x[A])?x[A]:[x[A]];for(let M=0,I=w.length;M<I;M++){const L=w[M],k=Array.isArray(L.value)?L.value:[L.value];for(let T=0,F=k.length;T<F;T++){const V=k[T],Q=g(V),ee=_%S,se=ee%Q.boundary,he=ee+se;_+=se,he!==0&&S-he<Q.storage&&(_+=S-he),L.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),L.__offset=_,_+=Q.storage}}}const E=_%S;return E>0&&(_+=S-E),v.__size=_,v.__cache={},this}function g(v){const x={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(x.boundary=4,x.storage=4):v.isVector2?(x.boundary=8,x.storage=8):v.isVector3||v.isColor?(x.boundary=16,x.storage=12):v.isVector4?(x.boundary=16,x.storage=16):v.isMatrix3?(x.boundary=48,x.storage=48):v.isMatrix4?(x.boundary=64,x.storage=64):v.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",v),x}function y(v){const x=v.target;x.removeEventListener("dispose",y);const _=o.indexOf(x.__bindingPointIndex);o.splice(_,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const v in r)n.deleteBuffer(r[v]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}class LB{constructor(e={}){const{canvas:t=MP(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let f;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=i.getContextAttributes().alpha}else f=o;const p=new Uint32Array(4),g=new Int32Array(4);let y=null,m=null;const v=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=fi,this.toneMapping=_s,this.toneMappingExposure=1;const _=this;let S=!1,E=0,A=0,R=null,w=-1,M=null;const I=new Mt,L=new Mt;let k=null;const T=new gt(0);let F=0,V=t.width,Q=t.height,ee=1,se=null,he=null;const ie=new Mt(0,0,V,Q),re=new Mt(0,0,V,Q);let be=!1;const le=new S_;let fe=!1,Te=!1;this.transmissionResolutionScale=1;const Ce=new Xe,Ie=new Xe,ze=new Y,Be=new Mt,it={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let te=!1;function ne(){return R===null?ee:1}let b=i;function oe(K,ge){return t.getContext(K,ge)}try{const K={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r".concat(d_)),t.addEventListener("webglcontextlost",De,!1),t.addEventListener("webglcontextrestored",Ke,!1),t.addEventListener("webglcontextcreationerror",et,!1),b===null){const ge="webgl2";if(b=oe(ge,K),b===null)throw oe(ge)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(K){throw console.error("THREE.WebGLRenderer: "+K.message),K}let J,H,P,U,j,B,D,W,G,X,ue,z,C,N,q,Z,$,ae,ke,Le,Ve,Je,st,pe;function Ze(){J=new G7(b),J.init(),Je=new Q5(b,J),H=new k7(b,J,e,Je),P=new TB(b,J),H.reverseDepthBuffer&&h&&P.buffers.depth.setReversed(!0),U=new j7(b),j=new dB,B=new wB(b,J,P,j,H,Je,U),D=new z7(_),W=new $7(_),G=new eD(b),st=new O7(b,G),X=new W7(b,G,U,st),ue=new X7(b,X,G,U),ke=new q7(b,H,B),Z=new U7(j),z=new uB(_,D,W,J,H,st,Z),C=new NB(_,j),N=new fB,q=new _B(J),ae=new F7(_,D,W,P,ue,f,l),$=new AB(_,ue,H),pe=new PB(b,U,H,P),Le=new B7(b,J,U),Ve=new Q7(b,J,U),U.programs=z.programs,_.capabilities=H,_.extensions=J,_.properties=j,_.renderLists=N,_.shadowMap=$,_.state=P,_.info=U}Ze();const we=new RB(_,b);this.xr=we,this.getContext=function(){return b},this.getContextAttributes=function(){return b.getContextAttributes()},this.forceContextLoss=function(){const K=J.get("WEBGL_lose_context");K&&K.loseContext()},this.forceContextRestore=function(){const K=J.get("WEBGL_lose_context");K&&K.restoreContext()},this.getPixelRatio=function(){return ee},this.setPixelRatio=function(K){K!==void 0&&(ee=K,this.setSize(V,Q,!1))},this.getSize=function(K){return K.set(V,Q)},this.setSize=function(K,ge,Se=!0){if(we.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}V=K,Q=ge,t.width=Math.floor(K*ee),t.height=Math.floor(ge*ee),Se===!0&&(t.style.width=K+"px",t.style.height=ge+"px"),this.setViewport(0,0,K,ge)},this.getDrawingBufferSize=function(K){return K.set(V*ee,Q*ee).floor()},this.setDrawingBufferSize=function(K,ge,Se){V=K,Q=ge,ee=Se,t.width=Math.floor(K*Se),t.height=Math.floor(ge*Se),this.setViewport(0,0,K,ge)},this.getCurrentViewport=function(K){return K.copy(I)},this.getViewport=function(K){return K.copy(ie)},this.setViewport=function(K,ge,Se,Ae){K.isVector4?ie.set(K.x,K.y,K.z,K.w):ie.set(K,ge,Se,Ae),P.viewport(I.copy(ie).multiplyScalar(ee).round())},this.getScissor=function(K){return K.copy(re)},this.setScissor=function(K,ge,Se,Ae){K.isVector4?re.set(K.x,K.y,K.z,K.w):re.set(K,ge,Se,Ae),P.scissor(L.copy(re).multiplyScalar(ee).round())},this.getScissorTest=function(){return be},this.setScissorTest=function(K){P.setScissorTest(be=K)},this.setOpaqueSort=function(K){se=K},this.setTransparentSort=function(K){he=K},this.getClearColor=function(K){return K.copy(ae.getClearColor())},this.setClearColor=function(){ae.setClearColor.apply(ae,arguments)},this.getClearAlpha=function(){return ae.getClearAlpha()},this.setClearAlpha=function(){ae.setClearAlpha.apply(ae,arguments)},this.clear=function(K=!0,ge=!0,Se=!0){let Ae=0;if(K){let ye=!1;if(R!==null){const $e=R.texture.format;ye=$e===wo||$e===g_||$e===Jm}if(ye){const $e=R.texture.type,nt=$e===Js||$e===Ni||$e===sh||$e===uu||$e===f_||$e===p_,ot=ae.getClearColor(),at=ae.getClearAlpha(),At=ot.r,Tt=ot.g,ht=ot.b;nt?(p[0]=At,p[1]=Tt,p[2]=ht,p[3]=at,b.clearBufferuiv(b.COLOR,0,p)):(g[0]=At,g[1]=Tt,g[2]=ht,g[3]=at,b.clearBufferiv(b.COLOR,0,g))}else Ae|=b.COLOR_BUFFER_BIT}ge&&(Ae|=b.DEPTH_BUFFER_BIT),Se&&(Ae|=b.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),b.clear(Ae)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",De,!1),t.removeEventListener("webglcontextrestored",Ke,!1),t.removeEventListener("webglcontextcreationerror",et,!1),ae.dispose(),N.dispose(),q.dispose(),j.dispose(),D.dispose(),W.dispose(),ue.dispose(),st.dispose(),pe.dispose(),z.dispose(),we.dispose(),we.removeEventListener("sessionstart",u2),we.removeEventListener("sessionend",d2),Qa.stop()};function De(K){K.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Ke(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const K=U.autoReset,ge=$.enabled,Se=$.autoUpdate,Ae=$.needsUpdate,ye=$.type;Ze(),U.autoReset=K,$.enabled=ge,$.autoUpdate=Se,$.needsUpdate=Ae,$.type=ye}function et(K){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",K.statusMessage)}function _t(K){const ge=K.target;ge.removeEventListener("dispose",_t),hn(ge)}function hn(K){Ti(K),j.remove(K)}function Ti(K){const ge=j.get(K).programs;ge!==void 0&&(ge.forEach(function(Se){z.releaseProgram(Se)}),K.isShaderMaterial&&z.releaseShaderCache(K))}this.renderBufferDirect=function(K,ge,Se,Ae,ye,$e){ge===null&&(ge=it);const nt=ye.isMesh&&ye.matrixWorld.determinant()<0,ot=oI(K,ge,Se,Ae,ye);P.setMaterial(Ae,nt);let at=Se.index,At=1;if(Ae.wireframe===!0){if(at=X.getWireframeAttribute(Se),at===void 0)return;At=2}const Tt=Se.drawRange,ht=Se.attributes.position;let Ut=Tt.start*At,Xt=(Tt.start+Tt.count)*At;$e!==null&&(Ut=Math.max(Ut,$e.start*At),Xt=Math.min(Xt,($e.start+$e.count)*At)),at!==null?(Ut=Math.max(Ut,0),Xt=Math.min(Xt,at.count)):ht!=null&&(Ut=Math.max(Ut,0),Xt=Math.min(Xt,ht.count));const Un=Xt-Ut;if(Un<0||Un===1/0)return;st.setup(ye,Ae,ot,Se,at);let Cn,Vt=Le;if(at!==null&&(Cn=G.get(at),Vt=Ve,Vt.setIndex(Cn)),ye.isMesh)Ae.wireframe===!0?(P.setLineWidth(Ae.wireframeLinewidth*ne()),Vt.setMode(b.LINES)):Vt.setMode(b.TRIANGLES);else if(ye.isLine){let pt=Ae.linewidth;pt===void 0&&(pt=1),P.setLineWidth(pt*ne()),ye.isLineSegments?Vt.setMode(b.LINES):ye.isLineLoop?Vt.setMode(b.LINE_LOOP):Vt.setMode(b.LINE_STRIP)}else ye.isPoints?Vt.setMode(b.POINTS):ye.isSprite&&Vt.setMode(b.TRIANGLES);if(ye.isBatchedMesh)if(ye._multiDrawInstances!==null)Vt.renderMultiDrawInstances(ye._multiDrawStarts,ye._multiDrawCounts,ye._multiDrawCount,ye._multiDrawInstances);else if(J.get("WEBGL_multi_draw"))Vt.renderMultiDraw(ye._multiDrawStarts,ye._multiDrawCounts,ye._multiDrawCount);else{const pt=ye._multiDrawStarts,di=ye._multiDrawCounts,Kt=ye._multiDrawCount,as=at?G.get(at).bytesPerElement:1,Kl=j.get(Ae).currentProgram.getUniforms();for(let dr=0;dr<Kt;dr++)Kl.setValue(b,"_gl_DrawID",dr),Vt.render(pt[dr]/as,di[dr])}else if(ye.isInstancedMesh)Vt.renderInstances(Ut,Un,ye.count);else if(Se.isInstancedBufferGeometry){const pt=Se._maxInstanceCount!==void 0?Se._maxInstanceCount:1/0,di=Math.min(Se.instanceCount,pt);Vt.renderInstances(Ut,Un,di)}else Vt.render(Ut,Un)};function sn(K,ge,Se){K.transparent===!0&&K.side===Cr&&K.forceSinglePass===!1?(K.side=Fi,K.needsUpdate=!0,lf(K,ge,Se),K.side=bs,K.needsUpdate=!0,lf(K,ge,Se),K.side=Cr):lf(K,ge,Se)}this.compile=function(K,ge,Se=null){Se===null&&(Se=K),m=q.get(Se),m.init(ge),x.push(m),Se.traverseVisible(function(ye){ye.isLight&&ye.layers.test(ge.layers)&&(m.pushLight(ye),ye.castShadow&&m.pushShadow(ye))}),K!==Se&&K.traverseVisible(function(ye){ye.isLight&&ye.layers.test(ge.layers)&&(m.pushLight(ye),ye.castShadow&&m.pushShadow(ye))}),m.setupLights();const Ae=new Set;return K.traverse(function(ye){if(!(ye.isMesh||ye.isPoints||ye.isLine||ye.isSprite))return;const $e=ye.material;if($e)if(Array.isArray($e))for(let nt=0;nt<$e.length;nt++){const ot=$e[nt];sn(ot,Se,ye),Ae.add(ot)}else sn($e,Se,ye),Ae.add($e)}),x.pop(),m=null,Ae},this.compileAsync=function(K,ge,Se=null){const Ae=this.compile(K,ge,Se);return new Promise(ye=>{function $e(){if(Ae.forEach(function(nt){j.get(nt).currentProgram.isReady()&&Ae.delete(nt)}),Ae.size===0){ye(K);return}setTimeout($e,10)}J.get("KHR_parallel_shader_compile")!==null?$e():setTimeout($e,10)})};let os=null;function uo(K){os&&os(K)}function u2(){Qa.stop()}function d2(){Qa.start()}const Qa=new V5;Qa.setAnimationLoop(uo),typeof self<"u"&&Qa.setContext(self),this.setAnimationLoop=function(K){os=K,we.setAnimationLoop(K),K===null?Qa.stop():Qa.start()},we.addEventListener("sessionstart",u2),we.addEventListener("sessionend",d2),this.render=function(K,ge){if(ge!==void 0&&ge.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),ge.parent===null&&ge.matrixWorldAutoUpdate===!0&&ge.updateMatrixWorld(),we.enabled===!0&&we.isPresenting===!0&&(we.cameraAutoUpdate===!0&&we.updateCamera(ge),ge=we.getCamera()),K.isScene===!0&&K.onBeforeRender(_,K,ge,R),m=q.get(K,x.length),m.init(ge),x.push(m),Ie.multiplyMatrices(ge.projectionMatrix,ge.matrixWorldInverse),le.setFromProjectionMatrix(Ie),Te=this.localClippingEnabled,fe=Z.init(this.clippingPlanes,Te),y=N.get(K,v.length),y.init(),v.push(y),we.enabled===!0&&we.isPresenting===!0){const $e=_.xr.getDepthSensingMesh();$e!==null&&B0($e,ge,-1/0,_.sortObjects)}B0(K,ge,0,_.sortObjects),y.finish(),_.sortObjects===!0&&y.sort(se,he),te=we.enabled===!1||we.isPresenting===!1||we.hasDepthSensing()===!1,te&&ae.addToRenderList(y,K),this.info.render.frame++,fe===!0&&Z.beginShadows();const Se=m.state.shadowsArray;$.render(Se,K,ge),fe===!0&&Z.endShadows(),this.info.autoReset===!0&&this.info.reset();const Ae=y.opaque,ye=y.transmissive;if(m.setupLights(),ge.isArrayCamera){const $e=ge.cameras;if(ye.length>0)for(let nt=0,ot=$e.length;nt<ot;nt++){const at=$e[nt];f2(Ae,ye,K,at)}te&&ae.render(K);for(let nt=0,ot=$e.length;nt<ot;nt++){const at=$e[nt];h2(y,K,at,at.viewport)}}else ye.length>0&&f2(Ae,ye,K,ge),te&&ae.render(K),h2(y,K,ge);R!==null&&A===0&&(B.updateMultisampleRenderTarget(R),B.updateRenderTargetMipmap(R)),K.isScene===!0&&K.onAfterRender(_,K,ge),st.resetDefaultState(),w=-1,M=null,x.pop(),x.length>0?(m=x[x.length-1],fe===!0&&Z.setGlobalState(_.clippingPlanes,m.state.camera)):m=null,v.pop(),v.length>0?y=v[v.length-1]:y=null};function B0(K,ge,Se,Ae){if(K.visible===!1)return;if(K.layers.test(ge.layers)){if(K.isGroup)Se=K.renderOrder;else if(K.isLOD)K.autoUpdate===!0&&K.update(ge);else if(K.isLight)m.pushLight(K),K.castShadow&&m.pushShadow(K);else if(K.isSprite){if(!K.frustumCulled||le.intersectsSprite(K)){Ae&&Be.setFromMatrixPosition(K.matrixWorld).applyMatrix4(Ie);const nt=ue.update(K),ot=K.material;ot.visible&&y.push(K,nt,ot,Se,Be.z,null)}}else if((K.isMesh||K.isLine||K.isPoints)&&(!K.frustumCulled||le.intersectsObject(K))){const nt=ue.update(K),ot=K.material;if(Ae&&(K.boundingSphere!==void 0?(K.boundingSphere===null&&K.computeBoundingSphere(),Be.copy(K.boundingSphere.center)):(nt.boundingSphere===null&&nt.computeBoundingSphere(),Be.copy(nt.boundingSphere.center)),Be.applyMatrix4(K.matrixWorld).applyMatrix4(Ie)),Array.isArray(ot)){const at=nt.groups;for(let At=0,Tt=at.length;At<Tt;At++){const ht=at[At],Ut=ot[ht.materialIndex];Ut&&Ut.visible&&y.push(K,nt,Ut,Se,Be.z,ht)}}else ot.visible&&y.push(K,nt,ot,Se,Be.z,null)}}const $e=K.children;for(let nt=0,ot=$e.length;nt<ot;nt++)B0($e[nt],ge,Se,Ae)}function h2(K,ge,Se,Ae){const ye=K.opaque,$e=K.transmissive,nt=K.transparent;m.setupLightsView(Se),fe===!0&&Z.setGlobalState(_.clippingPlanes,Se),Ae&&P.viewport(I.copy(Ae)),ye.length>0&&af(ye,ge,Se),$e.length>0&&af($e,ge,Se),nt.length>0&&af(nt,ge,Se),P.buffers.depth.setTest(!0),P.buffers.depth.setMask(!0),P.buffers.color.setMask(!0),P.setPolygonOffset(!1)}function f2(K,ge,Se,Ae){if((Se.isScene===!0?Se.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[Ae.id]===void 0&&(m.state.transmissionRenderTarget[Ae.id]=new Fa(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")||J.has("EXT_color_buffer_float")?Ts:Js,minFilter:Hs,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wt.workingColorSpace}));const $e=m.state.transmissionRenderTarget[Ae.id],nt=Ae.viewport||I;$e.setSize(nt.z*_.transmissionResolutionScale,nt.w*_.transmissionResolutionScale);const ot=_.getRenderTarget();_.setRenderTarget($e),_.getClearColor(T),F=_.getClearAlpha(),F<1&&_.setClearColor(16777215,.5),_.clear(),te&&ae.render(Se);const at=_.toneMapping;_.toneMapping=_s;const At=Ae.viewport;if(Ae.viewport!==void 0&&(Ae.viewport=void 0),m.setupLightsView(Ae),fe===!0&&Z.setGlobalState(_.clippingPlanes,Ae),af(K,Se,Ae),B.updateMultisampleRenderTarget($e),B.updateRenderTargetMipmap($e),J.has("WEBGL_multisampled_render_to_texture")===!1){let Tt=!1;for(let ht=0,Ut=ge.length;ht<Ut;ht++){const Xt=ge[ht],Un=Xt.object,Cn=Xt.geometry,Vt=Xt.material,pt=Xt.group;if(Vt.side===Cr&&Un.layers.test(Ae.layers)){const di=Vt.side;Vt.side=Fi,Vt.needsUpdate=!0,p2(Un,Se,Ae,Cn,Vt,pt),Vt.side=di,Vt.needsUpdate=!0,Tt=!0}}Tt===!0&&(B.updateMultisampleRenderTarget($e),B.updateRenderTargetMipmap($e))}_.setRenderTarget(ot),_.setClearColor(T,F),At!==void 0&&(Ae.viewport=At),_.toneMapping=at}function af(K,ge,Se){const Ae=ge.isScene===!0?ge.overrideMaterial:null;for(let ye=0,$e=K.length;ye<$e;ye++){const nt=K[ye],ot=nt.object,at=nt.geometry,At=Ae===null?nt.material:Ae,Tt=nt.group;ot.layers.test(Se.layers)&&p2(ot,ge,Se,at,At,Tt)}}function p2(K,ge,Se,Ae,ye,$e){K.onBeforeRender(_,ge,Se,Ae,ye,$e),K.modelViewMatrix.multiplyMatrices(Se.matrixWorldInverse,K.matrixWorld),K.normalMatrix.getNormalMatrix(K.modelViewMatrix),ye.onBeforeRender(_,ge,Se,Ae,K,$e),ye.transparent===!0&&ye.side===Cr&&ye.forceSinglePass===!1?(ye.side=Fi,ye.needsUpdate=!0,_.renderBufferDirect(Se,ge,Ae,ye,K,$e),ye.side=bs,ye.needsUpdate=!0,_.renderBufferDirect(Se,ge,Ae,ye,K,$e),ye.side=Cr):_.renderBufferDirect(Se,ge,Ae,ye,K,$e),K.onAfterRender(_,ge,Se,Ae,ye,$e)}function lf(K,ge,Se){ge.isScene!==!0&&(ge=it);const Ae=j.get(K),ye=m.state.lights,$e=m.state.shadowsArray,nt=ye.state.version,ot=z.getParameters(K,ye.state,$e,ge,Se),at=z.getProgramCacheKey(ot);let At=Ae.programs;Ae.environment=K.isMeshStandardMaterial?ge.environment:null,Ae.fog=ge.fog,Ae.envMap=(K.isMeshStandardMaterial?W:D).get(K.envMap||Ae.environment),Ae.envMapRotation=Ae.environment!==null&&K.envMap===null?ge.environmentRotation:K.envMapRotation,At===void 0&&(K.addEventListener("dispose",_t),At=new Map,Ae.programs=At);let Tt=At.get(at);if(Tt!==void 0){if(Ae.currentProgram===Tt&&Ae.lightsStateVersion===nt)return g2(K,ot),Tt}else ot.uniforms=z.getUniforms(K),K.onBeforeCompile(ot,_),Tt=z.acquireProgram(ot,at),At.set(at,Tt),Ae.uniforms=ot.uniforms;const ht=Ae.uniforms;return(!K.isShaderMaterial&&!K.isRawShaderMaterial||K.clipping===!0)&&(ht.clippingPlanes=Z.uniform),g2(K,ot),Ae.needsLights=lI(K),Ae.lightsStateVersion=nt,Ae.needsLights&&(ht.ambientLightColor.value=ye.state.ambient,ht.lightProbe.value=ye.state.probe,ht.directionalLights.value=ye.state.directional,ht.directionalLightShadows.value=ye.state.directionalShadow,ht.spotLights.value=ye.state.spot,ht.spotLightShadows.value=ye.state.spotShadow,ht.rectAreaLights.value=ye.state.rectArea,ht.ltc_1.value=ye.state.rectAreaLTC1,ht.ltc_2.value=ye.state.rectAreaLTC2,ht.pointLights.value=ye.state.point,ht.pointLightShadows.value=ye.state.pointShadow,ht.hemisphereLights.value=ye.state.hemi,ht.directionalShadowMap.value=ye.state.directionalShadowMap,ht.directionalShadowMatrix.value=ye.state.directionalShadowMatrix,ht.spotShadowMap.value=ye.state.spotShadowMap,ht.spotLightMatrix.value=ye.state.spotLightMatrix,ht.spotLightMap.value=ye.state.spotLightMap,ht.pointShadowMap.value=ye.state.pointShadowMap,ht.pointShadowMatrix.value=ye.state.pointShadowMatrix),Ae.currentProgram=Tt,Ae.uniformsList=null,Tt}function m2(K){if(K.uniformsList===null){const ge=K.currentProgram.getUniforms();K.uniformsList=Rp.seqWithValue(ge.seq,K.uniforms)}return K.uniformsList}function g2(K,ge){const Se=j.get(K);Se.outputColorSpace=ge.outputColorSpace,Se.batching=ge.batching,Se.batchingColor=ge.batchingColor,Se.instancing=ge.instancing,Se.instancingColor=ge.instancingColor,Se.instancingMorph=ge.instancingMorph,Se.skinning=ge.skinning,Se.morphTargets=ge.morphTargets,Se.morphNormals=ge.morphNormals,Se.morphColors=ge.morphColors,Se.morphTargetsCount=ge.morphTargetsCount,Se.numClippingPlanes=ge.numClippingPlanes,Se.numIntersection=ge.numClipIntersection,Se.vertexAlphas=ge.vertexAlphas,Se.vertexTangents=ge.vertexTangents,Se.toneMapping=ge.toneMapping}function oI(K,ge,Se,Ae,ye){ge.isScene!==!0&&(ge=it),B.resetTextureUnits();const $e=ge.fog,nt=Ae.isMeshStandardMaterial?ge.environment:null,ot=R===null?_.outputColorSpace:R.isXRRenderTarget===!0?R.texture.colorSpace:Bi,at=(Ae.isMeshStandardMaterial?W:D).get(Ae.envMap||nt),At=Ae.vertexColors===!0&&!!Se.attributes.color&&Se.attributes.color.itemSize===4,Tt=!!Se.attributes.tangent&&(!!Ae.normalMap||Ae.anisotropy>0),ht=!!Se.morphAttributes.position,Ut=!!Se.morphAttributes.normal,Xt=!!Se.morphAttributes.color;let Un=_s;Ae.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(Un=_.toneMapping);const Cn=Se.morphAttributes.position||Se.morphAttributes.normal||Se.morphAttributes.color,Vt=Cn!==void 0?Cn.length:0,pt=j.get(Ae),di=m.state.lights;if(fe===!0&&(Te===!0||K!==M)){const zi=K===M&&Ae.id===w;Z.setState(Ae,K,zi)}let Kt=!1;Ae.version===pt.__version?(pt.needsLights&&pt.lightsStateVersion!==di.state.version||pt.outputColorSpace!==ot||ye.isBatchedMesh&&pt.batching===!1||!ye.isBatchedMesh&&pt.batching===!0||ye.isBatchedMesh&&pt.batchingColor===!0&&ye.colorTexture===null||ye.isBatchedMesh&&pt.batchingColor===!1&&ye.colorTexture!==null||ye.isInstancedMesh&&pt.instancing===!1||!ye.isInstancedMesh&&pt.instancing===!0||ye.isSkinnedMesh&&pt.skinning===!1||!ye.isSkinnedMesh&&pt.skinning===!0||ye.isInstancedMesh&&pt.instancingColor===!0&&ye.instanceColor===null||ye.isInstancedMesh&&pt.instancingColor===!1&&ye.instanceColor!==null||ye.isInstancedMesh&&pt.instancingMorph===!0&&ye.morphTexture===null||ye.isInstancedMesh&&pt.instancingMorph===!1&&ye.morphTexture!==null||pt.envMap!==at||Ae.fog===!0&&pt.fog!==$e||pt.numClippingPlanes!==void 0&&(pt.numClippingPlanes!==Z.numPlanes||pt.numIntersection!==Z.numIntersection)||pt.vertexAlphas!==At||pt.vertexTangents!==Tt||pt.morphTargets!==ht||pt.morphNormals!==Ut||pt.morphColors!==Xt||pt.toneMapping!==Un||pt.morphTargetsCount!==Vt)&&(Kt=!0):(Kt=!0,pt.__version=Ae.version);let as=pt.currentProgram;Kt===!0&&(as=lf(Ae,ge,ye));let Kl=!1,dr=!1,Xu=!1;const Sn=as.getUniforms(),Ur=pt.uniforms;if(P.useProgram(as.program)&&(Kl=!0,dr=!0,Xu=!0),Ae.id!==w&&(w=Ae.id,dr=!0),Kl||M!==K){P.buffers.depth.getReversed()?(Ce.copy(K.projectionMatrix),IP(Ce),NP(Ce),Sn.setValue(b,"projectionMatrix",Ce)):Sn.setValue(b,"projectionMatrix",K.projectionMatrix),Sn.setValue(b,"viewMatrix",K.matrixWorldInverse);const nr=Sn.map.cameraPosition;nr!==void 0&&nr.setValue(b,ze.setFromMatrixPosition(K.matrixWorld)),H.logarithmicDepthBuffer&&Sn.setValue(b,"logDepthBufFC",2/(Math.log(K.far+1)/Math.LN2)),(Ae.isMeshPhongMaterial||Ae.isMeshToonMaterial||Ae.isMeshLambertMaterial||Ae.isMeshBasicMaterial||Ae.isMeshStandardMaterial||Ae.isShaderMaterial)&&Sn.setValue(b,"isOrthographic",K.isOrthographicCamera===!0),M!==K&&(M=K,dr=!0,Xu=!0)}if(ye.isSkinnedMesh){Sn.setOptional(b,ye,"bindMatrix"),Sn.setOptional(b,ye,"bindMatrixInverse");const zi=ye.skeleton;zi&&(zi.boneTexture===null&&zi.computeBoneTexture(),Sn.setValue(b,"boneTexture",zi.boneTexture,B))}ye.isBatchedMesh&&(Sn.setOptional(b,ye,"batchingTexture"),Sn.setValue(b,"batchingTexture",ye._matricesTexture,B),Sn.setOptional(b,ye,"batchingIdTexture"),Sn.setValue(b,"batchingIdTexture",ye._indirectTexture,B),Sn.setOptional(b,ye,"batchingColorTexture"),ye._colorsTexture!==null&&Sn.setValue(b,"batchingColorTexture",ye._colorsTexture,B));const zr=Se.morphAttributes;if((zr.position!==void 0||zr.normal!==void 0||zr.color!==void 0)&&ke.update(ye,Se,as),(dr||pt.receiveShadow!==ye.receiveShadow)&&(pt.receiveShadow=ye.receiveShadow,Sn.setValue(b,"receiveShadow",ye.receiveShadow)),Ae.isMeshGouraudMaterial&&Ae.envMap!==null&&(Ur.envMap.value=at,Ur.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Ae.isMeshStandardMaterial&&Ae.envMap===null&&ge.environment!==null&&(Ur.envMapIntensity.value=ge.environmentIntensity),dr&&(Sn.setValue(b,"toneMappingExposure",_.toneMappingExposure),pt.needsLights&&aI(Ur,Xu),$e&&Ae.fog===!0&&C.refreshFogUniforms(Ur,$e),C.refreshMaterialUniforms(Ur,Ae,ee,Q,m.state.transmissionRenderTarget[K.id]),Rp.upload(b,m2(pt),Ur,B)),Ae.isShaderMaterial&&Ae.uniformsNeedUpdate===!0&&(Rp.upload(b,m2(pt),Ur,B),Ae.uniformsNeedUpdate=!1),Ae.isSpriteMaterial&&Sn.setValue(b,"center",ye.center),Sn.setValue(b,"modelViewMatrix",ye.modelViewMatrix),Sn.setValue(b,"normalMatrix",ye.normalMatrix),Sn.setValue(b,"modelMatrix",ye.matrixWorld),Ae.isShaderMaterial||Ae.isRawShaderMaterial){const zi=Ae.uniformsGroups;for(let nr=0,k0=zi.length;nr<k0;nr++){const ja=zi[nr];pe.update(ja,as),pe.bind(ja,as)}}return as}function aI(K,ge){K.ambientLightColor.needsUpdate=ge,K.lightProbe.needsUpdate=ge,K.directionalLights.needsUpdate=ge,K.directionalLightShadows.needsUpdate=ge,K.pointLights.needsUpdate=ge,K.pointLightShadows.needsUpdate=ge,K.spotLights.needsUpdate=ge,K.spotLightShadows.needsUpdate=ge,K.rectAreaLights.needsUpdate=ge,K.hemisphereLights.needsUpdate=ge}function lI(K){return K.isMeshLambertMaterial||K.isMeshToonMaterial||K.isMeshPhongMaterial||K.isMeshStandardMaterial||K.isShadowMaterial||K.isShaderMaterial&&K.lights===!0}this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(K,ge,Se){j.get(K.texture).__webglTexture=ge,j.get(K.depthTexture).__webglTexture=Se;const Ae=j.get(K);Ae.__hasExternalTextures=!0,Ae.__autoAllocateDepthBuffer=Se===void 0,Ae.__autoAllocateDepthBuffer||J.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Ae.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(K,ge){const Se=j.get(K);Se.__webglFramebuffer=ge,Se.__useDefaultFramebuffer=ge===void 0};const cI=b.createFramebuffer();this.setRenderTarget=function(K,ge=0,Se=0){R=K,E=ge,A=Se;let Ae=!0,ye=null,$e=!1,nt=!1;if(K){const at=j.get(K);if(at.__useDefaultFramebuffer!==void 0)P.bindFramebuffer(b.FRAMEBUFFER,null),Ae=!1;else if(at.__webglFramebuffer===void 0)B.setupRenderTarget(K);else if(at.__hasExternalTextures)B.rebindTextures(K,j.get(K.texture).__webglTexture,j.get(K.depthTexture).__webglTexture);else if(K.depthBuffer){const ht=K.depthTexture;if(at.__boundDepthTexture!==ht){if(ht!==null&&j.has(ht)&&(K.width!==ht.image.width||K.height!==ht.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");B.setupDepthRenderbuffer(K)}}const At=K.texture;(At.isData3DTexture||At.isDataArrayTexture||At.isCompressedArrayTexture)&&(nt=!0);const Tt=j.get(K).__webglFramebuffer;K.isWebGLCubeRenderTarget?(Array.isArray(Tt[ge])?ye=Tt[ge][Se]:ye=Tt[ge],$e=!0):K.samples>0&&B.useMultisampledRTT(K)===!1?ye=j.get(K).__webglMultisampledFramebuffer:Array.isArray(Tt)?ye=Tt[Se]:ye=Tt,I.copy(K.viewport),L.copy(K.scissor),k=K.scissorTest}else I.copy(ie).multiplyScalar(ee).floor(),L.copy(re).multiplyScalar(ee).floor(),k=be;if(Se!==0&&(ye=cI),P.bindFramebuffer(b.FRAMEBUFFER,ye)&&Ae&&P.drawBuffers(K,ye),P.viewport(I),P.scissor(L),P.setScissorTest(k),$e){const at=j.get(K.texture);b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_CUBE_MAP_POSITIVE_X+ge,at.__webglTexture,Se)}else if(nt){const at=j.get(K.texture),At=ge;b.framebufferTextureLayer(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,at.__webglTexture,Se,At)}else if(K!==null&&Se!==0){const at=j.get(K.texture);b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,at.__webglTexture,Se)}w=-1},this.readRenderTargetPixels=function(K,ge,Se,Ae,ye,$e,nt){if(!(K&&K.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ot=j.get(K).__webglFramebuffer;if(K.isWebGLCubeRenderTarget&&nt!==void 0&&(ot=ot[nt]),ot){P.bindFramebuffer(b.FRAMEBUFFER,ot);try{const at=K.texture,At=at.format,Tt=at.type;if(!H.textureFormatReadable(At)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!H.textureTypeReadable(Tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ge>=0&&ge<=K.width-Ae&&Se>=0&&Se<=K.height-ye&&b.readPixels(ge,Se,Ae,ye,Je.convert(At),Je.convert(Tt),$e)}finally{const at=R!==null?j.get(R).__webglFramebuffer:null;P.bindFramebuffer(b.FRAMEBUFFER,at)}}},this.readRenderTargetPixelsAsync=async function(K,ge,Se,Ae,ye,$e,nt){if(!(K&&K.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ot=j.get(K).__webglFramebuffer;if(K.isWebGLCubeRenderTarget&&nt!==void 0&&(ot=ot[nt]),ot){const at=K.texture,At=at.format,Tt=at.type;if(!H.textureFormatReadable(At))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!H.textureTypeReadable(Tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(ge>=0&&ge<=K.width-Ae&&Se>=0&&Se<=K.height-ye){P.bindFramebuffer(b.FRAMEBUFFER,ot);const ht=b.createBuffer();b.bindBuffer(b.PIXEL_PACK_BUFFER,ht),b.bufferData(b.PIXEL_PACK_BUFFER,$e.byteLength,b.STREAM_READ),b.readPixels(ge,Se,Ae,ye,Je.convert(At),Je.convert(Tt),0);const Ut=R!==null?j.get(R).__webglFramebuffer:null;P.bindFramebuffer(b.FRAMEBUFFER,Ut);const Xt=b.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0);return b.flush(),await RP(b,Xt,4),b.bindBuffer(b.PIXEL_PACK_BUFFER,ht),b.getBufferSubData(b.PIXEL_PACK_BUFFER,0,$e),b.deleteBuffer(ht),b.deleteSync(Xt),$e}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(K,ge=null,Se=0){K.isTexture!==!0&&(Ec("WebGLRenderer: copyFramebufferToTexture function signature has changed."),ge=arguments[0]||null,K=arguments[1]);const Ae=Math.pow(2,-Se),ye=Math.floor(K.image.width*Ae),$e=Math.floor(K.image.height*Ae),nt=ge!==null?ge.x:0,ot=ge!==null?ge.y:0;B.setTexture2D(K,0),b.copyTexSubImage2D(b.TEXTURE_2D,Se,0,0,nt,ot,ye,$e),P.unbindTexture()};const uI=b.createFramebuffer(),dI=b.createFramebuffer();this.copyTextureToTexture=function(K,ge,Se=null,Ae=null,ye=0,$e=null){K.isTexture!==!0&&(Ec("WebGLRenderer: copyTextureToTexture function signature has changed."),Ae=arguments[0]||null,K=arguments[1],ge=arguments[2],$e=arguments[3]||0,Se=null),$e===null&&(ye!==0?(Ec("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),$e=ye,ye=0):$e=0);let nt,ot,at,At,Tt,ht,Ut,Xt,Un;const Cn=K.isCompressedTexture?K.mipmaps[$e]:K.image;if(Se!==null)nt=Se.max.x-Se.min.x,ot=Se.max.y-Se.min.y,at=Se.isBox3?Se.max.z-Se.min.z:1,At=Se.min.x,Tt=Se.min.y,ht=Se.isBox3?Se.min.z:0;else{const zr=Math.pow(2,-ye);nt=Math.floor(Cn.width*zr),ot=Math.floor(Cn.height*zr),K.isDataArrayTexture?at=Cn.depth:K.isData3DTexture?at=Math.floor(Cn.depth*zr):at=1,At=0,Tt=0,ht=0}Ae!==null?(Ut=Ae.x,Xt=Ae.y,Un=Ae.z):(Ut=0,Xt=0,Un=0);const Vt=Je.convert(ge.format),pt=Je.convert(ge.type);let di;ge.isData3DTexture?(B.setTexture3D(ge,0),di=b.TEXTURE_3D):ge.isDataArrayTexture||ge.isCompressedArrayTexture?(B.setTexture2DArray(ge,0),di=b.TEXTURE_2D_ARRAY):(B.setTexture2D(ge,0),di=b.TEXTURE_2D),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,ge.flipY),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ge.premultiplyAlpha),b.pixelStorei(b.UNPACK_ALIGNMENT,ge.unpackAlignment);const Kt=b.getParameter(b.UNPACK_ROW_LENGTH),as=b.getParameter(b.UNPACK_IMAGE_HEIGHT),Kl=b.getParameter(b.UNPACK_SKIP_PIXELS),dr=b.getParameter(b.UNPACK_SKIP_ROWS),Xu=b.getParameter(b.UNPACK_SKIP_IMAGES);b.pixelStorei(b.UNPACK_ROW_LENGTH,Cn.width),b.pixelStorei(b.UNPACK_IMAGE_HEIGHT,Cn.height),b.pixelStorei(b.UNPACK_SKIP_PIXELS,At),b.pixelStorei(b.UNPACK_SKIP_ROWS,Tt),b.pixelStorei(b.UNPACK_SKIP_IMAGES,ht);const Sn=K.isDataArrayTexture||K.isData3DTexture,Ur=ge.isDataArrayTexture||ge.isData3DTexture;if(K.isDepthTexture){const zr=j.get(K),zi=j.get(ge),nr=j.get(zr.__renderTarget),k0=j.get(zi.__renderTarget);P.bindFramebuffer(b.READ_FRAMEBUFFER,nr.__webglFramebuffer),P.bindFramebuffer(b.DRAW_FRAMEBUFFER,k0.__webglFramebuffer);for(let ja=0;ja<at;ja++)Sn&&(b.framebufferTextureLayer(b.READ_FRAMEBUFFER,b.COLOR_ATTACHMENT0,j.get(K).__webglTexture,ye,ht+ja),b.framebufferTextureLayer(b.DRAW_FRAMEBUFFER,b.COLOR_ATTACHMENT0,j.get(ge).__webglTexture,$e,Un+ja)),b.blitFramebuffer(At,Tt,nt,ot,Ut,Xt,nt,ot,b.DEPTH_BUFFER_BIT,b.NEAREST);P.bindFramebuffer(b.READ_FRAMEBUFFER,null),P.bindFramebuffer(b.DRAW_FRAMEBUFFER,null)}else if(ye!==0||K.isRenderTargetTexture||j.has(K)){const zr=j.get(K),zi=j.get(ge);P.bindFramebuffer(b.READ_FRAMEBUFFER,uI),P.bindFramebuffer(b.DRAW_FRAMEBUFFER,dI);for(let nr=0;nr<at;nr++)Sn?b.framebufferTextureLayer(b.READ_FRAMEBUFFER,b.COLOR_ATTACHMENT0,zr.__webglTexture,ye,ht+nr):b.framebufferTexture2D(b.READ_FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,zr.__webglTexture,ye),Ur?b.framebufferTextureLayer(b.DRAW_FRAMEBUFFER,b.COLOR_ATTACHMENT0,zi.__webglTexture,$e,Un+nr):b.framebufferTexture2D(b.DRAW_FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,zi.__webglTexture,$e),ye!==0?b.blitFramebuffer(At,Tt,nt,ot,Ut,Xt,nt,ot,b.COLOR_BUFFER_BIT,b.NEAREST):Ur?b.copyTexSubImage3D(di,$e,Ut,Xt,Un+nr,At,Tt,nt,ot):b.copyTexSubImage2D(di,$e,Ut,Xt,At,Tt,nt,ot);P.bindFramebuffer(b.READ_FRAMEBUFFER,null),P.bindFramebuffer(b.DRAW_FRAMEBUFFER,null)}else Ur?K.isDataTexture||K.isData3DTexture?b.texSubImage3D(di,$e,Ut,Xt,Un,nt,ot,at,Vt,pt,Cn.data):ge.isCompressedArrayTexture?b.compressedTexSubImage3D(di,$e,Ut,Xt,Un,nt,ot,at,Vt,Cn.data):b.texSubImage3D(di,$e,Ut,Xt,Un,nt,ot,at,Vt,pt,Cn):K.isDataTexture?b.texSubImage2D(b.TEXTURE_2D,$e,Ut,Xt,nt,ot,Vt,pt,Cn.data):K.isCompressedTexture?b.compressedTexSubImage2D(b.TEXTURE_2D,$e,Ut,Xt,Cn.width,Cn.height,Vt,Cn.data):b.texSubImage2D(b.TEXTURE_2D,$e,Ut,Xt,nt,ot,Vt,pt,Cn);b.pixelStorei(b.UNPACK_ROW_LENGTH,Kt),b.pixelStorei(b.UNPACK_IMAGE_HEIGHT,as),b.pixelStorei(b.UNPACK_SKIP_PIXELS,Kl),b.pixelStorei(b.UNPACK_SKIP_ROWS,dr),b.pixelStorei(b.UNPACK_SKIP_IMAGES,Xu),$e===0&&ge.generateMipmaps&&b.generateMipmap(di),P.unbindTexture()},this.copyTextureToTexture3D=function(K,ge,Se=null,Ae=null,ye=0){return K.isTexture!==!0&&(Ec("WebGLRenderer: copyTextureToTexture3D function signature has changed."),Se=arguments[0]||null,Ae=arguments[1]||null,K=arguments[2],ge=arguments[3],ye=arguments[4]||0),Ec('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(K,ge,Se,Ae,ye)},this.initRenderTarget=function(K){j.get(K).__webglFramebuffer===void 0&&B.setupRenderTarget(K)},this.initTexture=function(K){K.isCubeTexture?B.setTextureCube(K,0):K.isData3DTexture?B.setTexture3D(K,0):K.isDataArrayTexture||K.isCompressedArrayTexture?B.setTexture2DArray(K,0):B.setTexture2D(K,0),P.unbindTexture()},this.resetState=function(){E=0,A=0,R=null,P.reset(),st.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ir}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=wt._getDrawingBufferColorSpace(e),t.unpackColorSpace=wt._getUnpackColorSpace()}}class Ft{}xe(Ft,"DefaultSplatSortDistanceMapPrecision",16),xe(Ft,"MemoryPageSize",65536),xe(Ft,"BytesPerFloat",4),xe(Ft,"BytesPerInt",4),xe(Ft,"MaxScenes",32),xe(Ft,"ProgressiveLoadSectionSize",262144),xe(Ft,"ProgressiveLoadSectionDelayDuration",15),xe(Ft,"SphericalHarmonics8BitCompressionRange",3);const DB=Ft.SphericalHarmonics8BitCompressionRange,ua=DB/2,jn=uh.toHalfFloat.bind(uh),N_=uh.fromHalfFloat.bind(uh),An=(n,e,t=!1,i,r)=>{if(e===0)return n;if(e===1||e===2&&!t)return uh.fromHalfFloat(n);if(e===2)return P_(n,i,r)},Ud=(n,e,t)=>{n=gi(n,e,t);const i=t-e;return gi(Math.floor((n-e)/i*255),0,255)},P_=(n,e,t)=>{const i=t-e;return n/255*i+e},j5=(n,e,t)=>Ud(N_(n,e,t)),FB=(n,e,t)=>jn(P_(n,e,t)),Yt=(n,e,t,i=!1)=>t===0?n.getFloat32(e*4,!0):t===1||t===2&&!i?n.getUint16(e*2,!0):n.getUint8(e,!0),OB=function(){const n=e=>e;return function(e,t,i,r=!1){if(t===i)return e;let s=n;return t===2&&r?i===1?s=FB:i==0&&(s=P_):t===2||t===1?i===0?s=N_:i==2&&(r?s=j5:s=n):t===0&&(i===1?s=jn:i==2&&(r?s=Ud:s=jn)),s(e)}}(),vc=(n,e,t,i,r=0)=>{const s=new Uint8Array(n,e),o=new Uint8Array(t,i);for(let a=0;a<r;a++)o[a]=s[a]},Oe=class Oe{constructor(e,t=!0){xe(this,"getSplatScaleAndRotation",function(){const e=new Xe,t=new Xe,i=new Xe,r=new Y,s=new Y,o=new Qt;return function(a,l,c,u,d){const h=this.globalSplatIndexToSectionMap[a],f=this.sections[h],p=a-f.splatCountOffset,g=f.bytesPerSplat*p+Oe.CompressionLevels[this.compressionLevel].ScaleOffsetBytes,y=new DataView(this.bufferData,f.dataBase+g);s.set(An(Yt(y,0,this.compressionLevel),this.compressionLevel),An(Yt(y,1,this.compressionLevel),this.compressionLevel),An(Yt(y,2,this.compressionLevel),this.compressionLevel)),d&&(d.x!==void 0&&(s.x=d.x),d.y!==void 0&&(s.y=d.y),d.z!==void 0&&(s.z=d.z)),o.set(An(Yt(y,4,this.compressionLevel),this.compressionLevel),An(Yt(y,5,this.compressionLevel),this.compressionLevel),An(Yt(y,6,this.compressionLevel),this.compressionLevel),An(Yt(y,3,this.compressionLevel),this.compressionLevel)),u?(e.makeScale(s.x,s.y,s.z),t.makeRotationFromQuaternion(o),i.copy(e).multiply(t).multiply(u),i.decompose(r,c,l)):(l.copy(s),c.copy(o))}}());xe(this,"fillSplatScaleRotationArray",function(){const e=new Xe,t=new Xe,i=new Xe,r=new Y,s=new Qt,o=new Y,a=l=>{const c=l.w<0?-1:1;l.x*=c,l.y*=c,l.z*=c,l.w*=c};return function(l,c,u,d,h,f,p,g){const y=this.splatCount;d=d||0,h=h||y-1,f===void 0&&(f=d);const m=(v,x)=>OB(v,x,p);for(let v=d;v<=h;v++){const x=this.globalSplatIndexToSectionMap[v],_=this.sections[x],S=v-_.splatCountOffset,E=_.bytesPerSplat*S+Oe.CompressionLevels[this.compressionLevel].ScaleOffsetBytes,A=(v-d+f)*Oe.ScaleComponentCount,R=(v-d+f)*Oe.RotationComponentCount,w=new DataView(this.bufferData,_.dataBase+E),M=g&&g.x!==void 0?g.x:Yt(w,0,this.compressionLevel),I=g&&g.y!==void 0?g.y:Yt(w,1,this.compressionLevel),L=g&&g.z!==void 0?g.z:Yt(w,2,this.compressionLevel),k=Yt(w,3,this.compressionLevel),T=Yt(w,4,this.compressionLevel),F=Yt(w,5,this.compressionLevel),V=Yt(w,6,this.compressionLevel);r.set(An(M,this.compressionLevel),An(I,this.compressionLevel),An(L,this.compressionLevel)),s.set(An(T,this.compressionLevel),An(F,this.compressionLevel),An(V,this.compressionLevel),An(k,this.compressionLevel)).normalize(),u&&(o.set(0,0,0),e.makeScale(r.x,r.y,r.z),t.makeRotationFromQuaternion(s),i.identity().premultiply(e).premultiply(t),i.premultiply(u),i.decompose(o,s,r),s.normalize()),a(s),l&&(l[A]=m(r.x,0),l[A+1]=m(r.y,0),l[A+2]=m(r.z,0)),c&&(c[R]=m(s.x,0),c[R+1]=m(s.y,0),c[R+2]=m(s.z,0),c[R+3]=m(s.w,0))}}}());xe(this,"fillSphericalHarmonicsArray",function(){for(let T=0;T<15;T++)new Y;const e=new mt,t=new Xe,i=new Y,r=new Y,s=new Qt,o=[],a=[],l=[],c=[],u=[],d=[],h=[],f=[],p=[],g=[],y=[],m=[],v=[],x=[],_=[],S=[],E=[],A=[],R=T=>T,w=(T,F,V,Q)=>{T[0]=F,T[1]=V,T[2]=Q},M=(T,F,V,Q,ee)=>{T[0]=Yt(F,Q,ee,!0),T[1]=Yt(F,Q+V,ee,!0),T[2]=Yt(F,Q+V+V,ee,!0)},I=(T,F)=>{F[0]=T[0],F[1]=T[1],F[2]=T[2]},L=(T,F,V,Q)=>{F[V]=Q(T[0]),F[V+1]=Q(T[1]),F[V+2]=Q(T[2])},k=(T,F,V,Q,ee)=>(F[0]=An(T[0],V,!0,Q,ee),F[1]=An(T[1],V,!0,Q,ee),F[2]=An(T[2],V,!0,Q,ee),F);return function(T,F,V,Q,ee,se,he){const ie=this.splatCount;Q=Q||0,ee=ee||ie-1,se===void 0&&(se=Q),V&&F>=1&&(t.copy(V),t.decompose(i,s,r),s.normalize(),t.makeRotationFromQuaternion(s),e.setFromMatrix4(t),w(o,e.elements[4],-e.elements[7],e.elements[1]),w(a,-e.elements[5],e.elements[8],-e.elements[2]),w(l,e.elements[3],-e.elements[6],e.elements[0]));const re=le=>j5(le,this.minSphericalHarmonicsCoeff,this.maxSphericalHarmonicsCoeff),be=le=>Ud(le,this.minSphericalHarmonicsCoeff,this.maxSphericalHarmonicsCoeff);for(let le=Q;le<=ee;le++){const fe=this.globalSplatIndexToSectionMap[le],Te=this.sections[fe];F=Math.min(F,Te.sphericalHarmonicsDegree);const Ce=Gc(F),Ie=le-Te.splatCountOffset,ze=Te.bytesPerSplat*Ie+Oe.CompressionLevels[this.compressionLevel].SphericalHarmonicsOffsetBytes,Be=new DataView(this.bufferData,Te.dataBase+ze),it=(le-Q+se)*Ce;let te=V?0:this.compressionLevel,ne=R;te!==he&&(te===1?he===0?ne=N_:he==2&&(ne=re):te===0&&(he===1?ne=jn:he==2&&(ne=be)));const b=this.minSphericalHarmonicsCoeff,oe=this.maxSphericalHarmonicsCoeff;F>=1&&(M(p,Be,3,0,this.compressionLevel),M(g,Be,3,1,this.compressionLevel),M(y,Be,3,2,this.compressionLevel),V?(k(p,p,this.compressionLevel,b,oe),k(g,g,this.compressionLevel,b,oe),k(y,y,this.compressionLevel,b,oe),Oe.rotateSphericalHarmonics3(p,g,y,o,a,l,x,_,S)):(I(p,x),I(g,_),I(y,S)),L(x,T,it,ne),L(_,T,it+3,ne),L(S,T,it+6,ne),F>=2&&(M(p,Be,5,9,this.compressionLevel),M(g,Be,5,10,this.compressionLevel),M(y,Be,5,11,this.compressionLevel),M(m,Be,5,12,this.compressionLevel),M(v,Be,5,13,this.compressionLevel),V?(k(p,p,this.compressionLevel,b,oe),k(g,g,this.compressionLevel,b,oe),k(y,y,this.compressionLevel,b,oe),k(m,m,this.compressionLevel,b,oe),k(v,v,this.compressionLevel,b,oe),Oe.rotateSphericalHarmonics5(p,g,y,m,v,o,a,l,c,u,d,h,f,x,_,S,E,A)):(I(p,x),I(g,_),I(y,S),I(m,E),I(v,A)),L(x,T,it+9,ne),L(_,T,it+12,ne),L(S,T,it+15,ne),L(E,T,it+18,ne),L(A,T,it+21,ne)))}}}());this.constructFromBuffer(e,t)}getSplatCount(){return this.splatCount}getMaxSplatCount(){return this.maxSplatCount}getMinSphericalHarmonicsDegree(){let e=0;for(let t=0;t<this.sections.length;t++){const i=this.sections[t];(t===0||i.sphericalHarmonicsDegree<e)&&(e=i.sphericalHarmonicsDegree)}return e}getBucketIndex(e,t){let i;const r=e.fullBucketCount*e.bucketSize;if(t<r)i=Math.floor(t/e.bucketSize);else{let s=r;i=e.fullBucketCount;let o=0;for(;s<e.splatCount;){let a=e.partiallyFilledBucketLengths[o];if(t>=s&&t<s+a)break;s+=a,i++,o++}}return i}getSplatCenter(e,t,i,r){const s=this.globalSplatIndexToSectionMap[t],o=this.sections[s],a=t-o.splatCountOffset,l=o.bytesPerSplat*a,c=new DataView(this.bufferData,o.dataBase+l),u=Yt(c,0,this.compressionLevel),d=Yt(c,1,this.compressionLevel),h=Yt(c,2,this.compressionLevel);if(this.compressionLevel>=1){const p=this.getBucketIndex(o,a)*Oe.BucketStorageSizeFloats,g=o.compressionScaleFactor,y=o.compressionScaleRange;i.x=(u-y)*g+o.bucketArray[p],i.y=(d-y)*g+o.bucketArray[p+1],i.z=(h-y)*g+o.bucketArray[p+2]}else i.x=u,i.y=d,i.z=h;i.x+=e[t*3+0],i.y+=e[t*3+1],i.z+=e[t*3+2],r&&i.applyMatrix4(r)}getSplatColor(e,t){const i=this.globalSplatIndexToSectionMap[e],r=this.sections[i],s=e-r.splatCountOffset,o=r.bytesPerSplat*s+Oe.CompressionLevels[this.compressionLevel].ColorOffsetBytes,a=new Uint8Array(this.bufferData,r.dataBase+o,4);t.set(a[0],a[1],a[2],a[3])}fillSplatCenterArray(e,t,i,r,s,o){const a=this.splatCount;r=r||0,s=s||a-1,o===void 0&&(o=r);const l=new Y;for(let c=r;c<=s;c++){const u=this.globalSplatIndexToSectionMap[c],d=this.sections[u],h=c-d.splatCountOffset,f=(c-r+o)*Oe.CenterComponentCount,p=d.bytesPerSplat*h,g=new DataView(this.bufferData,d.dataBase+p),y=Yt(g,0,this.compressionLevel),m=Yt(g,1,this.compressionLevel),v=Yt(g,2,this.compressionLevel);if(this.compressionLevel>=1){const _=this.getBucketIndex(d,h)*Oe.BucketStorageSizeFloats,S=d.compressionScaleFactor,E=d.compressionScaleRange;l.x=(y-E)*S+d.bucketArray[_],l.y=(m-E)*S+d.bucketArray[_+1],l.z=(v-E)*S+d.bucketArray[_+2]}else l.x=y,l.y=m,l.z=v;i&&l.applyMatrix4(i),t[f]=l.x+e[c*3+0],t[f+1]=l.y+e[c*3+1],t[f+2]=l.z+e[c*3+2]}}fillSplatCovarianceArray(e,t,i,r,s,o){const a=this.splatCount,l=new Y,c=new Qt;i=i||0,r=r||a-1,s===void 0&&(s=i);for(let u=i;u<=r;u++){const d=this.globalSplatIndexToSectionMap[u],h=this.sections[d],f=u-h.splatCountOffset,p=(u-i+s)*Oe.CovarianceComponentCount,g=h.bytesPerSplat*f+Oe.CompressionLevels[this.compressionLevel].ScaleOffsetBytes,y=new DataView(this.bufferData,h.dataBase+g);l.set(An(Yt(y,0,this.compressionLevel),this.compressionLevel),An(Yt(y,1,this.compressionLevel),this.compressionLevel),An(Yt(y,2,this.compressionLevel),this.compressionLevel)),c.set(An(Yt(y,4,this.compressionLevel),this.compressionLevel),An(Yt(y,5,this.compressionLevel),this.compressionLevel),An(Yt(y,6,this.compressionLevel),this.compressionLevel),An(Yt(y,3,this.compressionLevel),this.compressionLevel)),Oe.computeCovariance(l,c,t,e,p,o)}}fillSplatColorArray(e,t,i,r,s){const o=this.splatCount;i=i||0,r=r||o-1,s===void 0&&(s=i);for(let a=i;a<=r;a++){const l=this.globalSplatIndexToSectionMap[a],c=this.sections[l],u=a-c.splatCountOffset,d=(a-i+s)*Oe.ColorComponentCount,h=c.bytesPerSplat*u+Oe.CompressionLevels[this.compressionLevel].ColorOffsetBytes,f=new Uint8Array(this.bufferData,c.dataBase+h);let p=f[3];p=p>=t?p:0,e[d]=f[0],e[d+1]=f[1],e[d+2]=f[2],e[d+3]=p}}static parseHeader(e){const t=new Uint8Array(e,0,Oe.HeaderSizeBytes),i=new Uint16Array(e,0,Oe.HeaderSizeBytes/2),r=new Uint32Array(e,0,Oe.HeaderSizeBytes/4),s=new Float32Array(e,0,Oe.HeaderSizeBytes/4),o=t[0],a=t[1],l=r[1],c=r[2],u=r[3],d=r[4],h=i[10],f=new Y(s[6],s[7],s[8]),p=s[9]||-ua,g=s[10]||ua;return{versionMajor:o,versionMinor:a,maxSectionCount:l,sectionCount:c,maxSplatCount:u,splatCount:d,compressionLevel:h,sceneCenter:f,minSphericalHarmonicsCoeff:p,maxSphericalHarmonicsCoeff:g}}static writeHeaderCountsToBuffer(e,t,i){const r=new Uint32Array(i,0,Oe.HeaderSizeBytes/4);r[2]=e,r[4]=t}static writeHeaderToBuffer(e,t){const i=new Uint8Array(t,0,Oe.HeaderSizeBytes),r=new Uint16Array(t,0,Oe.HeaderSizeBytes/2),s=new Uint32Array(t,0,Oe.HeaderSizeBytes/4),o=new Float32Array(t,0,Oe.HeaderSizeBytes/4);i[0]=e.versionMajor,i[1]=e.versionMinor,i[2]=0,i[3]=0,s[1]=e.maxSectionCount,s[2]=e.sectionCount,s[3]=e.maxSplatCount,s[4]=e.splatCount,r[10]=e.compressionLevel,o[6]=e.sceneCenter.x,o[7]=e.sceneCenter.y,o[8]=e.sceneCenter.z,o[9]=e.minSphericalHarmonicsCoeff||-ua,o[10]=e.maxSphericalHarmonicsCoeff||ua}static parseSectionHeaders(e,t,i=0,r){const s=e.compressionLevel,o=e.maxSectionCount,a=new Uint16Array(t,i,o*Oe.SectionHeaderSizeBytes/2),l=new Uint32Array(t,i,o*Oe.SectionHeaderSizeBytes/4),c=new Float32Array(t,i,o*Oe.SectionHeaderSizeBytes/4),u=[];let d=0,h=d/2,f=d/4,p=Oe.HeaderSizeBytes+e.maxSectionCount*Oe.SectionHeaderSizeBytes,g=0;for(let y=0;y<o;y++){const m=l[f+1],v=l[f+2],x=l[f+3],_=c[f+4],S=_/2,E=a[h+10],A=l[f+6]||Oe.CompressionLevels[s].ScaleRange,R=l[f+8],w=l[f+9],M=w*4,I=E*x+M,L=a[h+20],{bytesPerSplat:k}=Oe.calculateComponentStorage(s,L),T=k*m,F=T+I,V={bytesPerSplat:k,splatCountOffset:g,splatCount:r?m:0,maxSplatCount:m,bucketSize:v,bucketCount:x,bucketBlockSize:_,halfBucketBlockSize:S,bucketStorageSizeBytes:E,bucketsStorageSizeBytes:I,splatDataStorageSizeBytes:T,storageSizeBytes:F,compressionScaleRange:A,compressionScaleFactor:S/A,base:p,bucketsBase:p+M,dataBase:p+I,fullBucketCount:R,partiallyFilledBucketCount:w,sphericalHarmonicsDegree:L};u[y]=V,p+=F,d+=Oe.SectionHeaderSizeBytes,h=d/2,f=d/4,g+=m}return u}static writeSectionHeaderToBuffer(e,t,i,r=0){const s=new Uint16Array(i,r,Oe.SectionHeaderSizeBytes/2),o=new Uint32Array(i,r,Oe.SectionHeaderSizeBytes/4),a=new Float32Array(i,r,Oe.SectionHeaderSizeBytes/4);o[0]=e.splatCount,o[1]=e.maxSplatCount,o[2]=t>=1?e.bucketSize:0,o[3]=t>=1?e.bucketCount:0,a[4]=t>=1?e.bucketBlockSize:0,s[10]=t>=1?Oe.BucketStorageSizeBytes:0,o[6]=t>=1?e.compressionScaleRange:0,o[7]=e.storageSizeBytes,o[8]=t>=1?e.fullBucketCount:0,o[9]=t>=1?e.partiallyFilledBucketCount:0,s[20]=e.sphericalHarmonicsDegree}static writeSectionHeaderSplatCountToBuffer(e,t,i=0){const r=new Uint32Array(t,i,Oe.SectionHeaderSizeBytes/4);r[0]=e}constructFromBuffer(e,t){this.bufferData=e,this.globalSplatIndexToLocalSplatIndexMap=[],this.globalSplatIndexToSectionMap=[];const i=Oe.parseHeader(this.bufferData);this.versionMajor=i.versionMajor,this.versionMinor=i.versionMinor,this.maxSectionCount=i.maxSectionCount,this.sectionCount=t?i.maxSectionCount:0,this.maxSplatCount=i.maxSplatCount,this.splatCount=t?i.maxSplatCount:0,this.compressionLevel=i.compressionLevel,this.sceneCenter=new Y().copy(i.sceneCenter),this.minSphericalHarmonicsCoeff=i.minSphericalHarmonicsCoeff,this.maxSphericalHarmonicsCoeff=i.maxSphericalHarmonicsCoeff,this.sections=Oe.parseSectionHeaders(i,this.bufferData,Oe.HeaderSizeBytes,t),this.linkBufferArrays(),this.buildMaps()}static calculateComponentStorage(e,t){const i=Oe.CompressionLevels[e].BytesPerCenter,r=Oe.CompressionLevels[e].BytesPerScale,s=Oe.CompressionLevels[e].BytesPerRotation,o=Oe.CompressionLevels[e].BytesPerColor,a=Gc(t),l=Oe.CompressionLevels[e].BytesPerSphericalHarmonicsComponent*a,c=i+r+s+o+l;return{bytesPerCenter:i,bytesPerScale:r,bytesPerRotation:s,bytesPerColor:o,sphericalHarmonicsComponentsPerSplat:a,sphericalHarmonicsBytesPerSplat:l,bytesPerSplat:c}}linkBufferArrays(){for(let e=0;e<this.maxSectionCount;e++){const t=this.sections[e];t.bucketArray=new Float32Array(this.bufferData,t.bucketsBase,t.bucketCount*Oe.BucketStorageSizeFloats),t.partiallyFilledBucketCount>0&&(t.partiallyFilledBucketLengths=new Uint32Array(this.bufferData,t.base,t.partiallyFilledBucketCount))}}buildMaps(){let e=0;for(let t=0;t<this.maxSectionCount;t++){const i=this.sections[t];for(let r=0;r<i.maxSplatCount;r++){const s=e+r;this.globalSplatIndexToLocalSplatIndexMap[s]=r,this.globalSplatIndexToSectionMap[s]=t}e+=i.maxSplatCount}}updateLoadedCounts(e,t){Oe.writeHeaderCountsToBuffer(e,t,this.bufferData),this.sectionCount=e,this.splatCount=t}updateSectionLoadedCounts(e,t){const i=Oe.HeaderSizeBytes+Oe.SectionHeaderSizeBytes*e;Oe.writeSectionHeaderSplatCountToBuffer(t,this.bufferData,i),this.sections[e].splatCount=t}static generateFromUncompressedSplatArrays(e,t,i,r,s,o,a=[]){let l=0;for(let S=0;S<e.length;S++){const E=e[S];l=Math.max(E.sphericalHarmonicsDegree,l)}let c,u;for(let S=0;S<e.length;S++){const E=e[S];for(let A=0;A<E.splats.length;A++){const R=E.splats[A];for(let w=lt.OFFSET.FRC0;w<lt.OFFSET.FRC23&&w<R.length;w++)(!c||R[w]<c)&&(c=R[w]),(!u||R[w]>u)&&(u=R[w])}}c=c||-ua,u=u||ua;const{bytesPerSplat:d}=Oe.calculateComponentStorage(i,l),h=Oe.CompressionLevels[i].ScaleRange,f=[],p=[];let g=0;for(let S=0;S<e.length;S++){const E=e[S],A=new lt(l);for(let fe=0;fe<E.splatCount;fe++){const Te=E.splats[fe];(Te[lt.OFFSET.OPACITY]||0)>=t&&A.addSplat(Te)}const R=a[S]||{},w=(R.blockSizeFactor||1)*(s||Oe.BucketBlockSize),M=Math.ceil((R.bucketSizeFactor||1)*(o||Oe.BucketSize)),I=Oe.computeBucketsForUncompressedSplatArray(A,w,M),L=I.fullBuckets.length,k=I.partiallyFullBuckets.map(fe=>fe.splats.length),T=k.length,F=[...I.fullBuckets,...I.partiallyFullBuckets],V=A.splats.length*d,Q=T*4,ee=i>=1?F.length*Oe.BucketStorageSizeBytes+Q:0,se=V+ee,he=new ArrayBuffer(se),ie=h/(w*.5),re=new Y;let be=0;for(let fe=0;fe<F.length;fe++){const Te=F[fe];re.fromArray(Te.center);for(let Ce=0;Ce<Te.splats.length;Ce++){let Ie=Te.splats[Ce];const ze=A.splats[Ie],Be=ee+be*d;Oe.writeSplatDataToSectionBuffer(ze,he,Be,i,l,re,ie,h,c,u),be++}}if(g+=be,i>=1){const fe=new Uint32Array(he,0,k.length*4);for(let Ce=0;Ce<k.length;Ce++)fe[Ce]=k[Ce];const Te=new Float32Array(he,Q,F.length*Oe.BucketStorageSizeFloats);for(let Ce=0;Ce<F.length;Ce++){const Ie=F[Ce],ze=Ce*3;Te[ze]=Ie.center[0],Te[ze+1]=Ie.center[1],Te[ze+2]=Ie.center[2]}}f.push(he);const le=new ArrayBuffer(Oe.SectionHeaderSizeBytes);Oe.writeSectionHeaderToBuffer({maxSplatCount:be,splatCount:be,bucketSize:M,bucketCount:F.length,bucketBlockSize:w,compressionScaleRange:h,storageSizeBytes:se,fullBucketCount:L,partiallyFilledBucketCount:T,sphericalHarmonicsDegree:l},i,le,0),p.push(le)}let y=0;for(let S of f)y+=S.byteLength;const m=Oe.HeaderSizeBytes+Oe.SectionHeaderSizeBytes*f.length+y,v=new ArrayBuffer(m);Oe.writeHeaderToBuffer({versionMajor:0,versionMinor:1,maxSectionCount:f.length,sectionCount:f.length,maxSplatCount:g,splatCount:g,compressionLevel:i,sceneCenter:r,minSphericalHarmonicsCoeff:c,maxSphericalHarmonicsCoeff:u},v);let x=Oe.HeaderSizeBytes;for(let S of p)new Uint8Array(v,x,Oe.SectionHeaderSizeBytes).set(new Uint8Array(S)),x+=Oe.SectionHeaderSizeBytes;for(let S of f)new Uint8Array(v,x,S.byteLength).set(new Uint8Array(S)),x+=S.byteLength;return new Oe(v)}static computeBucketsForUncompressedSplatArray(e,t,i){let r=e.splatCount;const s=t/2,o=new Y,a=new Y;for(let g=0;g<r;g++){const y=e.splats[g],m=[y[lt.OFFSET.X],y[lt.OFFSET.Y],y[lt.OFFSET.Z]];(g===0||m[0]<o.x)&&(o.x=m[0]),(g===0||m[0]>a.x)&&(a.x=m[0]),(g===0||m[1]<o.y)&&(o.y=m[1]),(g===0||m[1]>a.y)&&(a.y=m[1]),(g===0||m[2]<o.z)&&(o.z=m[2]),(g===0||m[2]>a.z)&&(a.z=m[2])}const l=new Y().copy(a).sub(o),c=Math.ceil(l.y/t),u=Math.ceil(l.z/t),d=new Y,h=[],f={};for(let g=0;g<r;g++){const y=e.splats[g],m=[y[lt.OFFSET.X],y[lt.OFFSET.Y],y[lt.OFFSET.Z]],v=Math.floor((m[0]-o.x)/t),x=Math.floor((m[1]-o.y)/t),_=Math.floor((m[2]-o.z)/t);d.x=v*t+o.x+s,d.y=x*t+o.y+s,d.z=_*t+o.z+s;const S=v*(c*u)+x*u+_;let E=f[S];E||(f[S]=E={splats:[],center:d.toArray()}),E.splats.push(g),E.splats.length>=i&&(h.push(E),f[S]=null)}const p=[];for(let g in f)if(f.hasOwnProperty(g)){const y=f[g];y&&p.push(y)}return{fullBuckets:h,partiallyFullBuckets:p}}};xe(Oe,"CurrentMajorVersion",0),xe(Oe,"CurrentMinorVersion",1),xe(Oe,"CenterComponentCount",3),xe(Oe,"ScaleComponentCount",3),xe(Oe,"RotationComponentCount",4),xe(Oe,"ColorComponentCount",4),xe(Oe,"CovarianceComponentCount",6),xe(Oe,"SplatScaleOffsetFloat",3),xe(Oe,"SplatRotationOffsetFloat",6),xe(Oe,"CompressionLevels",{0:{BytesPerCenter:12,BytesPerScale:12,BytesPerRotation:16,BytesPerColor:4,ScaleOffsetBytes:12,RotationffsetBytes:24,ColorOffsetBytes:40,SphericalHarmonicsOffsetBytes:44,ScaleRange:1,BytesPerSphericalHarmonicsComponent:4,SphericalHarmonicsOffsetFloat:11,SphericalHarmonicsDegrees:{0:{BytesPerSplat:44},1:{BytesPerSplat:80},2:{BytesPerSplat:140}}},1:{BytesPerCenter:6,BytesPerScale:6,BytesPerRotation:8,BytesPerColor:4,ScaleOffsetBytes:6,RotationffsetBytes:12,ColorOffsetBytes:20,SphericalHarmonicsOffsetBytes:24,ScaleRange:32767,BytesPerSphericalHarmonicsComponent:2,SphericalHarmonicsOffsetFloat:12,SphericalHarmonicsDegrees:{0:{BytesPerSplat:24},1:{BytesPerSplat:42},2:{BytesPerSplat:72}}},2:{BytesPerCenter:6,BytesPerScale:6,BytesPerRotation:8,BytesPerColor:4,ScaleOffsetBytes:6,RotationffsetBytes:12,ColorOffsetBytes:20,SphericalHarmonicsOffsetBytes:24,ScaleRange:32767,BytesPerSphericalHarmonicsComponent:1,SphericalHarmonicsOffsetFloat:12,SphericalHarmonicsDegrees:{0:{BytesPerSplat:24},1:{BytesPerSplat:33},2:{BytesPerSplat:48}}}}),xe(Oe,"CovarianceSizeFloats",6),xe(Oe,"HeaderSizeBytes",4096),xe(Oe,"SectionHeaderSizeBytes",1024),xe(Oe,"BucketStorageSizeBytes",12),xe(Oe,"BucketStorageSizeFloats",3),xe(Oe,"BucketBlockSize",5),xe(Oe,"BucketSize",256),xe(Oe,"computeCovariance",function(){const e=new Xe,t=new mt,i=new mt,r=new mt,s=new mt,o=new mt,a=new mt;return function(l,c,u,d,h=0,f){e.makeScale(l.x,l.y,l.z),t.setFromMatrix4(e),e.makeRotationFromQuaternion(c),i.setFromMatrix4(e),r.copy(i).multiply(t),s.copy(r).transpose().premultiply(r),u&&(o.setFromMatrix4(u),a.copy(o).transpose(),s.multiply(a),s.premultiply(o)),f>=1?(d[h]=jn(s.elements[0]),d[h+1]=jn(s.elements[3]),d[h+2]=jn(s.elements[6]),d[h+3]=jn(s.elements[4]),d[h+4]=jn(s.elements[7]),d[h+5]=jn(s.elements[8])):(d[h]=s.elements[0],d[h+1]=s.elements[3],d[h+2]=s.elements[6],d[h+3]=s.elements[4],d[h+4]=s.elements[7],d[h+5]=s.elements[8])}}()),xe(Oe,"dot3",(e,t,i,r,s)=>{s[0]=s[1]=s[2]=0;const o=r[0],a=r[1],l=r[2];Oe.addInto3(e[0]*o,e[1]*o,e[2]*o,s),Oe.addInto3(t[0]*a,t[1]*a,t[2]*a,s),Oe.addInto3(i[0]*l,i[1]*l,i[2]*l,s)}),xe(Oe,"addInto3",(e,t,i,r)=>{r[0]=r[0]+e,r[1]=r[1]+t,r[2]=r[2]+i}),xe(Oe,"dot5",(e,t,i,r,s,o,a)=>{a[0]=a[1]=a[2]=0;const l=o[0],c=o[1],u=o[2],d=o[3],h=o[4];Oe.addInto3(e[0]*l,e[1]*l,e[2]*l,a),Oe.addInto3(t[0]*c,t[1]*c,t[2]*c,a),Oe.addInto3(i[0]*u,i[1]*u,i[2]*u,a),Oe.addInto3(r[0]*d,r[1]*d,r[2]*d,a),Oe.addInto3(s[0]*h,s[1]*h,s[2]*h,a)}),xe(Oe,"rotateSphericalHarmonics3",(e,t,i,r,s,o,a,l,c)=>{Oe.dot3(e,t,i,r,a),Oe.dot3(e,t,i,s,l),Oe.dot3(e,t,i,o,c)}),xe(Oe,"rotateSphericalHarmonics5",(e,t,i,r,s,o,a,l,c,u,d,h,f,p,g,y,m,v)=>{const x=Math.sqrt(.25),_=Math.sqrt(3/4),S=Math.sqrt(1/3),E=Math.sqrt(4/3),A=Math.sqrt(1/12);c[0]=x*(l[2]*o[0]+l[0]*o[2]+(o[2]*l[0]+o[0]*l[2])),c[1]=l[1]*o[0]+o[1]*l[0],c[2]=_*(l[1]*o[1]+o[1]*l[1]),c[3]=l[1]*o[2]+o[1]*l[2],c[4]=x*(l[2]*o[2]-l[0]*o[0]+(o[2]*l[2]-o[0]*l[0])),Oe.dot5(e,t,i,r,s,c,p),u[0]=x*(a[2]*o[0]+a[0]*o[2]+(o[2]*a[0]+o[0]*a[2])),u[1]=a[1]*o[0]+o[1]*a[0],u[2]=_*(a[1]*o[1]+o[1]*a[1]),u[3]=a[1]*o[2]+o[1]*a[2],u[4]=x*(a[2]*o[2]-a[0]*o[0]+(o[2]*a[2]-o[0]*a[0])),Oe.dot5(e,t,i,r,s,u,g),d[0]=S*(a[2]*a[0]+a[0]*a[2])+-A*(l[2]*l[0]+l[0]*l[2]+(o[2]*o[0]+o[0]*o[2])),d[1]=E*a[1]*a[0]+-S*(l[1]*l[0]+o[1]*o[0]),d[2]=a[1]*a[1]+-x*(l[1]*l[1]+o[1]*o[1]),d[3]=E*a[1]*a[2]+-S*(l[1]*l[2]+o[1]*o[2]),d[4]=S*(a[2]*a[2]-a[0]*a[0])+-A*(l[2]*l[2]-l[0]*l[0]+(o[2]*o[2]-o[0]*o[0])),Oe.dot5(e,t,i,r,s,d,y),h[0]=x*(a[2]*l[0]+a[0]*l[2]+(l[2]*a[0]+l[0]*a[2])),h[1]=a[1]*l[0]+l[1]*a[0],h[2]=_*(a[1]*l[1]+l[1]*a[1]),h[3]=a[1]*l[2]+l[1]*a[2],h[4]=x*(a[2]*l[2]-a[0]*l[0]+(l[2]*a[2]-l[0]*a[0])),Oe.dot5(e,t,i,r,s,h,m),f[0]=x*(l[2]*l[0]+l[0]*l[2]-(o[2]*o[0]+o[0]*o[2])),f[1]=l[1]*l[0]-o[1]*o[0],f[2]=_*(l[1]*l[1]-o[1]*o[1]),f[3]=l[1]*l[2]-o[1]*o[2],f[4]=x*(l[2]*l[2]-l[0]*l[0]-(o[2]*o[2]-o[0]*o[0])),Oe.dot5(e,t,i,r,s,f,v)}),xe(Oe,"writeSplatDataToSectionBuffer",function(){const e=new ArrayBuffer(12),t=new ArrayBuffer(12),i=new ArrayBuffer(16),r=new ArrayBuffer(4),s=new ArrayBuffer(256),o=new Qt,a=new Y,l=new Y,{X:c,Y:u,Z:d,SCALE0:h,SCALE1:f,SCALE2:p,ROTATION0:g,ROTATION1:y,ROTATION2:m,ROTATION3:v,FDC0:x,FDC1:_,FDC2:S,OPACITY:E,FRC0:A,FRC9:R}=lt.OFFSET,w=(M,I,L)=>{const k=L*2+1;return M=Math.round(M*I)+L,gi(M,0,k)};return function(M,I,L,k,T,F,V,Q,ee=-ua,se=ua){const he=Gc(T),ie=Oe.CompressionLevels[k].BytesPerCenter,re=Oe.CompressionLevels[k].BytesPerScale,be=Oe.CompressionLevels[k].BytesPerRotation,le=Oe.CompressionLevels[k].BytesPerColor,fe=L,Te=fe+ie,Ce=Te+re,Ie=Ce+be,ze=Ie+le;if(M[g]!==void 0?(o.set(M[g],M[y],M[m],M[v]),o.normalize()):o.set(1,0,0,0),M[h]!==void 0?a.set(M[h]||0,M[f]||0,M[p]||0):a.set(0,0,0),k===0){const it=new Float32Array(I,fe,Oe.CenterComponentCount),te=new Float32Array(I,Ce,Oe.RotationComponentCount),ne=new Float32Array(I,Te,Oe.ScaleComponentCount);if(te.set([o.x,o.y,o.z,o.w]),ne.set([a.x,a.y,a.z]),it.set([M[c],M[u],M[d]]),T>0){const b=new Float32Array(I,ze,he);if(T>=1){for(let oe=0;oe<9;oe++)b[oe]=M[A+oe]||0;if(T>=2)for(let oe=0;oe<15;oe++)b[oe+9]=M[R+oe]||0}}}else{const it=new Uint16Array(e,0,Oe.CenterComponentCount),te=new Uint16Array(i,0,Oe.RotationComponentCount),ne=new Uint16Array(t,0,Oe.ScaleComponentCount);if(te.set([jn(o.x),jn(o.y),jn(o.z),jn(o.w)]),ne.set([jn(a.x),jn(a.y),jn(a.z)]),l.set(M[c],M[u],M[d]).sub(F),l.x=w(l.x,V,Q),l.y=w(l.y,V,Q),l.z=w(l.z,V,Q),it.set([l.x,l.y,l.z]),T>0){const b=k===1?Uint16Array:Uint8Array,oe=k===1?2:1,J=new b(s,0,he);if(T>=1){for(let P=0;P<9;P++){const U=M[A+P]||0;J[P]=k===1?jn(U):Ud(U,ee,se)}const H=9*oe;if(vc(J.buffer,0,I,ze,H),T>=2){for(let P=0;P<15;P++){const U=M[R+P]||0;J[P+9]=k===1?jn(U):Ud(U,ee,se)}vc(J.buffer,H,I,ze+H,15*oe)}}}vc(it.buffer,0,I,fe,6),vc(ne.buffer,0,I,Te,6),vc(te.buffer,0,I,Ce,8)}const Be=new Uint8ClampedArray(r,0,4);Be.set([M[x]||0,M[_]||0,M[S]||0]),Be[3]=M[E]||0,vc(Be.buffer,0,I,Ie,4)}}());let ct=Oe;const RA=new Uint8Array([112,108,121,10]),IA=new Uint8Array([10,101,110,100,95,104,101,97,100,101,114,10]),kg="end_header",Ug=new Map([["char",Int8Array],["uchar",Uint8Array],["short",Int16Array],["ushort",Uint16Array],["int",Int32Array],["uint",Uint32Array],["float",Float32Array],["double",Float64Array]]),$s=(n,e)=>{const t=(1<<e)-1;return(n&t)/t},NA=(n,e)=>{n.x=$s(e>>>21,11),n.y=$s(e>>>11,10),n.z=$s(e,11)},BB=(n,e)=>{n.x=$s(e>>>24,8),n.y=$s(e>>>16,8),n.z=$s(e>>>8,8),n.w=$s(e,8)},kB=(n,e)=>{const t=1/(Math.sqrt(2)*.5),i=($s(e>>>20,10)-.5)*t,r=($s(e>>>10,10)-.5)*t,s=($s(e,10)-.5)*t,o=Math.sqrt(1-(i*i+r*r+s*s));switch(e>>>30){case 0:n.set(o,i,r,s);break;case 1:n.set(i,o,r,s);break;case 2:n.set(i,r,o,s);break;case 3:n.set(i,r,s,o);break}},_c=(n,e,t)=>n*(1-t)+e*t,Ei=(n,e)=>{var t;return(t=n.properties.find(i=>i.name===e&&i.storage))==null?void 0:t.storage},Mi=class Mi{static decodeHeaderText(e){let t,i,r;const s=e.split("\n").filter(l=>!l.startsWith("comment "));let o=0,a=!1;for(let l=1;l<s.length;++l){const c=s[l].split(" ");switch(c[0]){case"format":if(c[1]!=="binary_little_endian")throw new Error("Unsupported ply format");break;case"element":t={name:c[1],count:parseInt(c[2],10),properties:[],storageSizeBytes:0},t.name==="chunk"?i=t:t.name==="vertex"&&(r=t);break;case"property":{if(!Ug.has(c[1]))throw new Error("Unrecognized property data type '".concat(c[1],"' in ply header"));const u=Ug.get(c[1]),d=u.BYTES_PER_ELEMENT*t.count;t.name==="vertex"&&(o+=u.BYTES_PER_ELEMENT),t.properties.push({type:c[1],name:c[2],storage:null,byteSize:u.BYTES_PER_ELEMENT,storageSizeByes:d}),t.storageSizeBytes+=d;break}case kg:a=!0;break;default:throw new Error("Unrecognized header value '".concat(c[0],"' in ply header"))}if(a)break}return{chunkElement:i,vertexElement:r,bytesPerSplat:o,headerSizeBytes:e.indexOf(kg)+kg.length+1,sphericalHarmonicsDegree:0}}static decodeHeader(e){const t=(u,d)=>{const h=u.length-d.length;let f,p;for(f=0;f<=h;++f){for(p=0;p<d.length&&u[f+p]===d[p];++p);if(p===d.length)return f}return-1},i=(u,d)=>{if(u.length<d.length)return!1;for(let h=0;h<d.length;++h)if(u[h]!==d[h])return!1;return!0};let r=new Uint8Array(e),s;if(r.length>=RA.length&&!i(r,RA))throw new Error("Invalid PLY header");if(s=t(r,IA),s===-1)throw new Error("End of PLY header not found");const o=new TextDecoder("ascii").decode(r.slice(0,s)),{chunkElement:a,vertexElement:l,bytesPerSplat:c}=Mi.decodeHeaderText(o);return{headerSizeBytes:s+IA.length,bytesPerSplat:c,chunkElement:a,vertexElement:l}}static readElementData(e,t,i,r,s,o=null){let a=t instanceof DataView?t:new DataView(t);r=r||0,s=s||e.count-1;for(let l=r;l<=s;++l)for(let c=0;c<e.properties.length;++c){const u=e.properties[c],d=Ug.get(u.type),h=d.BYTES_PER_ELEMENT*e.count;if((!u.storage||u.storage.byteLength<h)&&(!o||o(u.name))&&(u.storage=new d(e.count)),u.storage)switch(u.type){case"char":u.storage[l]=a.getInt8(i);break;case"uchar":u.storage[l]=a.getUint8(i);break;case"short":u.storage[l]=a.getInt16(i,!0);break;case"ushort":u.storage[l]=a.getUint16(i,!0);break;case"int":u.storage[l]=a.getInt32(i,!0);break;case"uint":u.storage[l]=a.getUint32(i,!0);break;case"float":u.storage[l]=a.getFloat32(i,!0);break;case"double":u.storage[l]=a.getFloat64(i,!0);break}i+=u.byteSize}return i}static readPly(e,t=null){const i=Mi.decodeHeader(e);let r=Mi.readElementData(i.chunkElement,e,i.headerSizeBytes,null,null,t);return Mi.readElementData(i.vertexElement,e,r,null,null,t),{chunkElement:i.chunkElement,vertexElement:i.vertexElement}}static getElementStorageArrays(e,t){const i=Ei(e,"min_x"),r=Ei(e,"min_y"),s=Ei(e,"min_z"),o=Ei(e,"max_x"),a=Ei(e,"max_y"),l=Ei(e,"max_z"),c=Ei(e,"min_scale_x"),u=Ei(e,"min_scale_y"),d=Ei(e,"min_scale_z"),h=Ei(e,"max_scale_x"),f=Ei(e,"max_scale_y"),p=Ei(e,"max_scale_z"),g=Ei(t,"packed_position"),y=Ei(t,"packed_rotation"),m=Ei(t,"packed_scale"),v=Ei(t,"packed_color");return{positionExtremes:{minX:i,maxX:o,minY:r,maxY:a,minZ:s,maxZ:l},scaleExtremes:{minScaleX:c,maxScaleX:h,minScaleY:u,maxScaleY:f,minScaleZ:d,maxScaleZ:p},position:g,rotation:y,scale:m,color:v}}static parseToUncompressedSplatBufferSection(e,t,i,r,s,o,a,l,c,u=null){Mi.readElementData(t,o,a,i,r,u);const d=ct.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat,{positionExtremes:h,scaleExtremes:f,position:p,rotation:g,scale:y,color:m}=Mi.getElementStorageArrays(e,t),v=lt.createSplat();for(let x=i;x<=r;++x){Mi.decompressSplat(x,s,p,h,y,f,g,m,v);const _=x*d+c;ct.writeSplatDataToSectionBuffer(v,l,_,0,0)}}static parseToUncompressedSplatArraySection(e,t,i,r,s,o,a,l,c=null){Mi.readElementData(t,o,a,i,r,c);const{positionExtremes:u,scaleExtremes:d,position:h,rotation:f,scale:p,color:g}=Mi.getElementStorageArrays(e,t);for(let y=i;y<=r;++y){const m=lt.createSplat();Mi.decompressSplat(y,s,h,u,p,d,f,g,m),l.addSplat(m)}}static parseToUncompressedSplatArray(e){const{chunkElement:t,vertexElement:i}=Mi.readPly(e),r=new lt,{positionExtremes:s,scaleExtremes:o,position:a,rotation:l,scale:c,color:u}=Mi.getElementStorageArrays(t,i);for(let h=0;h<i.count;++h){r.addDefaultSplat();const f=r.getSplat(r.splatCount-1);Mi.decompressSplat(h,0,a,s,c,o,l,u,f)}return new Xe().identity(),r}};xe(Mi,"decompressSplat",function(){const e=new Y,t=new Qt,i=new Y,r=new Mt,s=lt.OFFSET;return function(o,a,l,c,u,d,h,f,p){p=p||lt.createSplat();const g=Math.floor((a+o)/256);return NA(e,l[o]),kB(t,h[o]),NA(i,u[o]),BB(r,f[o]),p[s.X]=_c(c.minX[g],c.maxX[g],e.x),p[s.Y]=_c(c.minY[g],c.maxY[g],e.y),p[s.Z]=_c(c.minZ[g],c.maxZ[g],e.z),p[s.ROTATION0]=t.x,p[s.ROTATION1]=t.y,p[s.ROTATION2]=t.z,p[s.ROTATION3]=t.w,p[s.SCALE0]=Math.exp(_c(d.minScaleX[g],d.maxScaleX[g],i.x)),p[s.SCALE1]=Math.exp(_c(d.minScaleY[g],d.maxScaleY[g],i.y)),p[s.SCALE2]=Math.exp(_c(d.minScaleZ[g],d.maxScaleZ[g],i.z)),p[s.FDC0]=gi(Math.floor(r.x*255),0,255),p[s.FDC1]=gi(Math.floor(r.y*255),0,255),p[s.FDC2]=gi(Math.floor(r.z*255),0,255),p[s.OPACITY]=gi(Math.floor(r.w*255),0,255),p}}());let Sl=Mi;const Na={INRIAV1:0,INRIAV2:1,PlayCanvasCompressed:2},[q5,L_,D_,F_,O_,B_,k_]=[0,1,2,3,4,5,6],PA={double:q5,int:L_,uint:D_,float:F_,short:O_,ushort:B_,uchar:k_},UB={[q5]:8,[L_]:4,[D_]:4,[F_]:4,[O_]:2,[B_]:2,[k_]:1},_r=class _r{constructor(){}decodeSectionHeader(e,t,i=0){const r=[];let s=!1,o=-1,a=0,l=!1,c=null;const u=[],d=[],h=[],f={};for(let m=i;m<e.length;m++){const v=e[m].trim();if(v.startsWith("element"))if(s){o--;break}else{s=!0,i=m,o=m;const x=v.split(" ");let _=0;for(let S of x){const E=S.trim();E.length>0&&(_++,_===2?c=E:_===3&&(a=parseInt(E)))}}else if(v.startsWith("property")){const x=v.match(/(\w+)\s+(\w+)\s+(\w+)/);if(x){const _=x[2],S=x[3];h.push(S);const E=t[S];f[S]=_;const A=PA[_];E!==void 0&&(u.push(E),d[E]=A)}}if(v===_r.HeaderEndToken){l=!0;break}s&&(r.push(v),o++)}const p=[];let g=0;for(let m of h){const v=f[m];if(f.hasOwnProperty(m)){const x=t[m];x!==void 0&&(p[x]=g)}g+=UB[PA[v]]}const y=this.decodeSphericalHarmonicsFromSectionHeader(h,t);return{headerLines:r,headerStartLine:i,headerEndLine:o,fieldTypes:d,fieldIds:u,fieldOffsets:p,bytesPerVertex:g,vertexCount:a,dataSizeBytes:g*a,endOfHeader:l,sectionName:c,sphericalHarmonicsDegree:y.degree,sphericalHarmonicsCoefficientsPerChannel:y.coefficientsPerChannel,sphericalHarmonicsDegree1Fields:y.degree1Fields,sphericalHarmonicsDegree2Fields:y.degree2Fields}}decodeSphericalHarmonicsFromSectionHeader(e,t){let i=0,r=0;for(let l of e)l.startsWith("f_rest")&&i++;r=i/3;let s=0;r>=3&&(s=1),r>=8&&(s=2);let o=[],a=[];for(let l=0;l<3;l++){if(s>=1)for(let c=0;c<3;c++)o.push(t["f_rest_"+(c+r*l)]);if(s>=2)for(let c=0;c<5;c++)a.push(t["f_rest_"+(c+r*l+3)])}return{degree:s,coefficientsPerChannel:r,degree1Fields:o,degree2Fields:a}}static getHeaderSectionNames(e){const t=[];for(let i of e)if(i.startsWith("element")){const r=i.split(" ");let s=0;for(let o of r){const a=o.trim();a.length>0&&(s++,s===2&&t.push(a))}}return t}static checkTextForEndHeader(e){return!!e.includes(_r.HeaderEndToken)}static checkBufferForEndHeader(e,t,i,r){const s=new Uint8Array(e,Math.max(0,t-i),i),o=r.decode(s);return _r.checkTextForEndHeader(o)}static extractHeaderFromBufferToText(e){const t=new TextDecoder;let i=0,r="";const s=100;for(;;){if(i+s>=e.byteLength)throw new Error("End of file reached while searching for end of header");const o=new Uint8Array(e,i,s);if(r+=t.decode(o),i+=s,_r.checkBufferForEndHeader(e,i,s*2,t))break}return r}readHeaderFromBuffer(e){const t=new TextDecoder;let i=0,r="";const s=100;for(;;){if(i+s>=e.byteLength)throw new Error("End of file reached while searching for end of header");const o=new Uint8Array(e,i,s);if(r+=t.decode(o),i+=s,_r.checkBufferForEndHeader(e,i,s*2,t))break}return r}static convertHeaderTextToLines(e){const t=e.split("\n"),i=[];for(let r=0;r<t.length;r++){const s=t[r].trim();if(i.push(s),s===_r.HeaderEndToken)break}return i}static determineHeaderFormatFromHeaderText(e){const t=_r.convertHeaderTextToLines(e);let i=Na.INRIAV1;for(let r=0;r<t.length;r++){const s=t[r].trim();if(s.startsWith("element chunk")||s.match(/[A-Za-z]*packed_[A-Za-z]*/))i=Na.PlayCanvasCompressed;else if(s.startsWith("element codebook_centers"))i=Na.INRIAV2;else if(s===_r.HeaderEndToken)break}return i}static determineHeaderFormatFromPlyBuffer(e){const t=_r.extractHeaderFromBufferToText(e);return _r.determineHeaderFormatFromHeaderText(t)}static readVertex(e,t,i,r,s,o,a=!0){const l=i*t.bytesPerVertex+r,c=t.fieldOffsets,u=t.fieldTypes;for(let d of s){const h=u[d];h===F_?o[d]=e.getFloat32(l+c[d],!0):h===O_?o[d]=e.getInt16(l+c[d],!0):h===B_?o[d]=e.getUint16(l+c[d],!0):h===L_?o[d]=e.getInt32(l+c[d],!0):h===D_?o[d]=e.getUint32(l+c[d],!0):h===k_&&(a?o[d]=e.getUint8(l+c[d])/255:o[d]=e.getUint8(l+c[d]))}}};xe(_r,"HeaderEndToken","end_header");let pi=_r;const X5=["scale_0","scale_1","scale_2","rot_0","rot_1","rot_2","rot_3","x","y","z","f_dc_0","f_dc_1","f_dc_2","opacity","red","green","blue","f_rest_0"],zB=X5.map((n,e)=>e),[LA,VB,HB,$B,GB,WB,QB,jB,qB,XB,DA,KB,YB,FA,OA,ZB,JB,ek]=zB,_l=class _l{constructor(){this.plyParserutils=new pi}decodeHeaderLines(e){let t=0;e.forEach(u=>{u.includes("f_rest_")&&t++});let i=0;t>=45?i=45:t>=24?i=24:t>=9&&(i=9);let s=Array.from(Array(Math.max(i-1,0))).map((u,d)=>"f_rest_".concat(d+1));const o=[...X5,...s],a=o.map((u,d)=>d),l=a.reduce((u,d)=>(u[o[d]]=d,u),{}),c=this.plyParserutils.decodeSectionHeader(e,l,0);return c.splatCount=c.vertexCount,c.bytesPerSplat=c.bytesPerVertex,c.fieldsToReadIndexes=a,c}decodeHeaderText(e){const t=pi.convertHeaderTextToLines(e),i=this.decodeHeaderLines(t);return i.headerText=e,i.headerSizeBytes=e.indexOf(pi.HeaderEndToken)+pi.HeaderEndToken.length+1,i}decodeHeaderFromBuffer(e){const t=this.plyParserutils.readHeaderFromBuffer(e);return this.decodeHeaderText(t)}findSplatData(e,t){return new DataView(e,t.headerSizeBytes)}parseToUncompressedSplatBufferSection(e,t,i,r,s,o,a,l=0){l=Math.min(l,e.sphericalHarmonicsDegree);const c=ct.CompressionLevels[0].SphericalHarmonicsDegrees[l].BytesPerSplat;for(let u=t;u<=i;u++){const d=_l.parseToUncompressedSplat(r,u,e,s,l),h=u*c+a;ct.writeSplatDataToSectionBuffer(d,o,h,0,l)}}parseToUncompressedSplatArraySection(e,t,i,r,s,o,a=0){a=Math.min(a,e.sphericalHarmonicsDegree);for(let l=t;l<=i;l++){const c=_l.parseToUncompressedSplat(r,l,e,s,a);o.addSplat(c)}}decodeSectionSplatData(e,t,i,r){r=Math.min(r,i.sphericalHarmonicsDegree);const s=new lt(r);for(let o=0;o<t;o++){const a=_l.parseToUncompressedSplat(e,o,i,0,r);s.addSplat(a)}return s}static readSplat(e,t,i,r,s){return pi.readVertex(e,t,i,r,t.fieldsToReadIndexes,s,!0)}parseToUncompressedSplatArray(e,t=0){const i=this.decodeHeaderFromBuffer(e),r=i.splatCount,s=this.findSplatData(e,i);return this.decodeSectionSplatData(s,r,i,t)}};xe(_l,"parseToUncompressedSplat",function(){let e=[];const t=new Qt,i=lt.OFFSET.X,r=lt.OFFSET.Y,s=lt.OFFSET.Z,o=lt.OFFSET.SCALE0,a=lt.OFFSET.SCALE1,l=lt.OFFSET.SCALE2,c=lt.OFFSET.ROTATION0,u=lt.OFFSET.ROTATION1,d=lt.OFFSET.ROTATION2,h=lt.OFFSET.ROTATION3,f=lt.OFFSET.FDC0,p=lt.OFFSET.FDC1,g=lt.OFFSET.FDC2,y=lt.OFFSET.OPACITY,m=[];for(let v=0;v<45;v++)m[v]=lt.OFFSET.FRC0+v;return function(v,x,_,S=0,E=0){E=Math.min(E,_.sphericalHarmonicsDegree),_l.readSplat(v,_,x,S,e);const A=lt.createSplat(E);if(e[LA]!==void 0?(A[o]=Math.exp(e[LA]),A[a]=Math.exp(e[VB]),A[l]=Math.exp(e[HB])):(A[o]=.01,A[a]=.01,A[l]=.01),e[DA]!==void 0?(A[f]=e[DA]*255,A[p]=e[KB]*255,A[g]=e[YB]*255):e[OA]!==void 0?(A[f]=e[OA]*255,A[p]=e[ZB]*255,A[g]=e[JB]*255):(A[f]=0,A[p]=0,A[g]=0),e[FA]!==void 0&&(A[y]=1/(1+Math.exp(-e[FA]))*255),A[f]=gi(Math.floor(A[f]),0,255),A[p]=gi(Math.floor(A[p]),0,255),A[g]=gi(Math.floor(A[g]),0,255),A[y]=gi(Math.floor(A[y]),0,255),E>=1&&e[ek]!==void 0){for(let R=0;R<9;R++)A[m[R]]=e[_.sphericalHarmonicsDegree1Fields[R]];if(E>=2)for(let R=0;R<15;R++)A[m[9+R]]=e[_.sphericalHarmonicsDegree2Fields[R]]}return t.set(e[$B],e[GB],e[WB],e[QB]),t.normalize(),A[c]=t.x,A[u]=t.y,A[d]=t.z,A[h]=t.w,A[i]=e[jB],A[r]=e[qB],A[s]=e[XB],A}}());let pm=_l;const K5=["features_dc","features_rest_0","features_rest_1","features_rest_2","features_rest_3","features_rest_4","features_rest_5","features_rest_6","features_rest_7","features_rest_8","features_rest_9","features_rest_10","features_rest_11","features_rest_12","features_rest_13","features_rest_14","opacity","scaling","rotation_re","rotation_im"],$f=K5.map((n,e)=>e),[Gf,tk,nk,BA,Wf,ik,zg]=[0,1,4,16,17,18,19],Y5=["scale_0","scale_1","scale_2","rot_0","rot_1","rot_2","rot_3","x","y","z","f_dc_0","f_dc_1","f_dc_2","opacity","red","green","blue","f_rest_0","f_rest_1","f_rest_2","f_rest_3","f_rest_4","f_rest_5","f_rest_6","f_rest_7","f_rest_8","f_rest_9","f_rest_10","f_rest_11","f_rest_12","f_rest_13","f_rest_14","f_rest_15","f_rest_16","f_rest_17","f_rest_18","f_rest_19","f_rest_20","f_rest_21","f_rest_22","f_rest_23","f_rest_24","f_rest_25","f_rest_26","f_rest_27","f_rest_28","f_rest_29","f_rest_30","f_rest_31","f_rest_32","f_rest_33","f_rest_34","f_rest_35","f_rest_36","f_rest_37","f_rest_38","f_rest_39","f_rest_40","f_rest_41","f_rest_42","f_rest_43","f_rest_44","f_rest_45"],Oy=Y5.map((n,e)=>e),[kA,rk,sk,ok,ak,lk,ck,uk,dk,hk,By,Z5,J5,UA]=Oy,zA=By,fk=Z5,pk=J5,Qf=n=>{const e=(31744&n)>>10,t=1023&n;return(n>>15?-1:1)*(e?e===31?t?NaN:1/0:Math.pow(2,e-15)*(1+t/1024):t/1024*6103515625e-14)},qd=class qd{constructor(){this.plyParserutils=new pi}decodeSectionHeadersFromHeaderLines(e){const t=Oy.reduce((u,d)=>(u[Y5[d]]=d,u),{}),i=$f.reduce((u,d)=>(u[K5[d]]=d,u),{}),r=pi.getHeaderSectionNames(e);let s;for(let u=0;u<r.length;u++)r[u]==="codebook_centers"&&(s=u);let o=0,a=!1;const l=[];let c=0;for(;!a;){let u;c===s?u=this.plyParserutils.decodeSectionHeader(e,i,o):u=this.plyParserutils.decodeSectionHeader(e,t,o),a=u.endOfHeader,o=u.headerEndLine+1,a||(u.splatCount=u.vertexCount,u.bytesPerSplat=u.bytesPerVertex),l.push(u),c++}return l}decodeSectionHeadersFromHeaderText(e){const t=pi.convertHeaderTextToLines(e);return this.decodeSectionHeadersFromHeaderLines(t)}getSplatCountFromSectionHeaders(e){let t=0;for(let i of e)i.sectionName!=="codebook_centers"&&(t+=i.vertexCount);return t}decodeHeaderFromHeaderText(e){const t=e.indexOf(pi.HeaderEndToken)+pi.HeaderEndToken.length+1,i=this.decodeSectionHeadersFromHeaderText(e),r=this.getSplatCountFromSectionHeaders(i);return{headerSizeBytes:t,sectionHeaders:i,splatCount:r}}decodeHeaderFromBuffer(e){const t=this.plyParserutils.readHeaderFromBuffer(e);return this.decodeHeaderFromHeaderText(t)}findVertexData(e,t,i){let r=t.headerSizeBytes;for(let s=0;s<i&&s<t.sectionHeaders.length;s++){const o=t.sectionHeaders[s];r+=o.dataSizeBytes}return new DataView(e,r,t.sectionHeaders[i].dataSizeBytes)}decodeCodeBook(e,t){const i=[],r=[];for(let s=0;s<t.vertexCount;s++){pi.readVertex(e,t,s,0,$f,i);for(let o of $f){const a=$f[o];let l=r[a];l||(r[a]=l=[]),l.push(i[o])}}for(let s=0;s<r.length;s++){const o=r[s],a=.28209479177387814;for(let l=0;l<o.length;l++){const c=Qf(o[l]);s===BA?o[l]=Math.round(1/(1+Math.exp(-c))*255):s===Gf?o[l]=Math.round((.5+a*c)*255):s===Wf?o[l]=Math.exp(c):o[l]=c}}return r}decodeSectionSplatData(e,t,i,r,s){s=Math.min(s,i.sphericalHarmonicsDegree);const o=new lt(s);for(let a=0;a<t;a++){const l=qd.parseToUncompressedSplat(e,a,i,r,0,s);o.addSplat(l)}return o}static readSplat(e,t,i,r,s){return pi.readVertex(e,t,i,r,Oy,s,!1)}parseToUncompressedSplatArray(e,t=0){const i=[],r=this.decodeHeaderFromBuffer(e,t);let s;for(let a=0;a<r.sectionHeaders.length;a++){const l=r.sectionHeaders[a];if(l.sectionName==="codebook_centers"){const c=this.findVertexData(e,r,a);s=this.decodeCodeBook(c,l)}}for(let a=0;a<r.sectionHeaders.length;a++){const l=r.sectionHeaders[a];if(l.sectionName!=="codebook_centers"){const c=l.vertexCount,u=this.findVertexData(e,r,a),d=this.decodeSectionSplatData(u,c,l,s,t);i.push(d)}}const o=new lt(t);for(let a of i)for(let l of a.splats)o.addSplat(l);return o}};xe(qd,"parseToUncompressedSplat",function(){let e=[];const t=new Qt,i=lt.OFFSET.X,r=lt.OFFSET.Y,s=lt.OFFSET.Z,o=lt.OFFSET.SCALE0,a=lt.OFFSET.SCALE1,l=lt.OFFSET.SCALE2,c=lt.OFFSET.ROTATION0,u=lt.OFFSET.ROTATION1,d=lt.OFFSET.ROTATION2,h=lt.OFFSET.ROTATION3,f=lt.OFFSET.FDC0,p=lt.OFFSET.FDC1,g=lt.OFFSET.FDC2,y=lt.OFFSET.OPACITY,m=[];for(let v=0;v<45;v++)m[v]=lt.OFFSET.FRC0+v;return function(v,x,_,S,E=0,A=0){A=Math.min(A,_.sphericalHarmonicsDegree),qd.readSplat(v,_,x,E,e);const R=lt.createSplat(A);if(e[kA]!==void 0?(R[o]=S[Wf][e[kA]],R[a]=S[Wf][e[rk]],R[l]=S[Wf][e[sk]]):(R[o]=.01,R[a]=.01,R[l]=.01),e[By]!==void 0?(R[f]=S[Gf][e[By]],R[p]=S[Gf][e[Z5]],R[g]=S[Gf][e[J5]]):e[zA]!==void 0?(R[f]=e[zA]*255,R[p]=e[fk]*255,R[g]=e[pk]*255):(R[f]=0,R[p]=0,R[g]=0),e[UA]!==void 0&&(R[y]=S[BA][e[UA]]),R[f]=gi(Math.floor(R[f]),0,255),R[p]=gi(Math.floor(R[p]),0,255),R[g]=gi(Math.floor(R[g]),0,255),R[y]=gi(Math.floor(R[y]),0,255),A>=1&&_.sphericalHarmonicsDegree>=1){for(let k=0;k<9;k++){const T=S[tk+k%3];R[m[k]]=T[e[_.sphericalHarmonicsDegree1Fields[k]]]}if(A>=2&&_.sphericalHarmonicsDegree>=2)for(let k=0;k<15;k++){const T=S[nk+k%5];R[m[9+k]]=T[e[_.sphericalHarmonicsDegree2Fields[k]]]}}const w=S[ik][e[ok]],M=S[zg][e[ak]],I=S[zg][e[lk]],L=S[zg][e[ck]];return t.set(w,M,I,L),t.normalize(),R[c]=t.x,R[u]=t.y,R[d]=t.z,R[h]=t.w,R[i]=Qf(e[uk]),R[r]=Qf(e[dk]),R[s]=Qf(e[hk]),R}}());let ky=qd;class mk{static parseToUncompressedSplatArray(e,t=0){const i=pi.determineHeaderFormatFromPlyBuffer(e);if(i===Na.PlayCanvasCompressed)return Sl.parseToUncompressedSplatArray(e);if(i===Na.INRIAV1)return new pm().parseToUncompressedSplatArray(e,t);if(i===Na.INRIAV2)return new ky().parseToUncompressedSplatArray(e,t)}}class U_{constructor(e,t,i,r){this.sectionCount=e,this.sectionFilters=t,this.groupingParameters=i,this.partitionGenerator=r}partitionUncompressedSplatArray(e){let t,i,r;if(this.partitionGenerator){const o=this.partitionGenerator(e);t=o.groupingParameters,i=o.sectionCount,r=o.sectionFilters}else t=this.groupingParameters,i=this.sectionCount,r=this.sectionFilters;const s=[];for(let o=0;o<i;o++){const a=new lt(e.sphericalHarmonicsDegree),l=r[o];for(let c=0;c<e.splatCount;c++)l(c)&&a.addSplat(e.splats[c]);s.push(a)}return{splatArrays:s,parameters:t}}static getStandardPartitioner(e=0,t=new Y,i=ct.BucketBlockSize,r=ct.BucketSize){const s=o=>{const a=lt.OFFSET.X,l=lt.OFFSET.Y,c=lt.OFFSET.Z;e<=0&&(e=o.splatCount);const u=new Y,d=.5,h=m=>{m.x=Math.floor(m.x/d)*d,m.y=Math.floor(m.y/d)*d,m.z=Math.floor(m.z/d)*d};o.splats.forEach(m=>{u.set(m[a],m[l],m[c]).sub(t),h(u),m.centerDist=u.lengthSq()}),o.splats.sort((m,v)=>{let x=m.centerDist,_=v.centerDist;return x>_?1:-1});const f=[],p=[];e=Math.min(o.splatCount,e);const g=Math.ceil(o.splatCount/e);let y=0;for(let m=0;m<g;m++){let v=y;f.push(x=>x>=v&&x<v+e),p.push({blocksSize:i,bucketSize:r}),y+=e}return{sectionCount:f.length,sectionFilters:f,groupingParameters:p}};return new U_(void 0,void 0,void 0,s)}}class i0{constructor(e,t,i,r,s,o,a){this.splatPartitioner=e,this.alphaRemovalThreshold=t,this.compressionLevel=i,this.sectionSize=r,this.sceneCenter=s?new Y().copy(s):void 0,this.blockSize=o,this.bucketSize=a}generateFromUncompressedSplatArray(e){const t=this.splatPartitioner.partitionUncompressedSplatArray(e);return ct.generateFromUncompressedSplatArrays(t.splatArrays,this.alphaRemovalThreshold,this.compressionLevel,this.sceneCenter,this.blockSize,this.bucketSize,t.parameters)}static getStandardGenerator(e=1,t=1,i=0,r=new Y,s=ct.BucketBlockSize,o=ct.BucketSize){const a=U_.getStandardPartitioner(i,r,s,o);return new i0(a,e,t,i,r,s,o)}}const Kn={Downloading:0,Processing:1,Done:2};class z_ extends Error{constructor(e){super(e)}}const Mn={DirectToSplatBuffer:0,DirectToSplatArray:1,DownloadBeforeProcessing:2};function VA(n,e){let t=0;for(let r of n)t+=r.sizeBytes;(!e||e.byteLength<t)&&(e=new ArrayBuffer(t));let i=0;for(let r of n)new Uint8Array(e,i,r.sizeBytes).set(r.data),i+=r.sizeBytes;return e}function HA(n,e,t,i,r,s,o,a){return e?i0.getStandardGenerator(t,i,r,s,o,a).generateFromUncompressedSplatArray(n):ct.generateFromUncompressedSplatArrays([n],t,0,new Y)}class V_{static loadFromURL(e,t,i,r,s,o,a=!0,l=0,c,u,d,h,f){let p=i?Mn.DirectToSplatBuffer:Mn.DirectToSplatArray;a&&(p=Mn.DirectToSplatArray);const g=Ft.ProgressiveLoadSectionSize,y=ct.HeaderSizeBytes+ct.SectionHeaderSizeBytes,m=1;let v,x,_,S,E=0,A=0,R=!1,w=!1,M=!1;const I=c_();let L=0,k=0,T=0,F="",V=null,Q=[],ee;const se=new TextDecoder,he=new pm,ie=(re,be,le)=>{const fe=re>=100;if(le&&(Q.push({data:le,sizeBytes:le.byteLength,startBytes:T,endBytes:T+le.byteLength}),T+=le.byteLength),p===Mn.DownloadBeforeProcessing)fe&&I.resolve(Q);else{if(R){if(M&&!w){const Te=V.headerSizeBytes+V.chunkElement.storageSizeBytes;S=VA(Q,S),S.byteLength>=Te&&(Sl.readElementData(V.chunkElement,S,V.headerSizeBytes),L=Te,k=Te,w=!0)}}else if(F+=se.decode(le),pi.checkTextForEndHeader(F)){const Te=pi.determineHeaderFormatFromHeaderText(F);if(Te===Na.INRIAV1)V=he.decodeHeaderText(F),E=V.splatCount,w=!0,M=!1;else if(Te===Na.PlayCanvasCompressed)V=Sl.decodeHeaderText(F),E=V.vertexElement.count,M=!0;else{if(i)throw new z_("PlyLoader.loadFromURL() -> Selected Ply format cannot be directly loaded.");p=Mn.DownloadBeforeProcessing;return}l=Math.min(l,V.sphericalHarmonicsDegree);const Ce=ct.CompressionLevels[0].SphericalHarmonicsDegrees[l],Ie=y+Ce.BytesPerSplat*E;p===Mn.DirectToSplatBuffer?(x=new ArrayBuffer(Ie),ct.writeHeaderToBuffer({versionMajor:ct.CurrentMajorVersion,versionMinor:ct.CurrentMinorVersion,maxSectionCount:m,sectionCount:m,maxSplatCount:E,splatCount:A,compressionLevel:0,sceneCenter:new Y},x)):ee=new lt(l),L=V.headerSizeBytes,k=V.headerSizeBytes,R=!0}if(R&&w){if(Q.length>0&&(v=VA(Q,v),T-L>g||fe)){const Ce=T-k,Ie=Math.floor(Ce/V.bytesPerSplat),ze=Ie*V.bytesPerSplat,Be=Ce-ze,it=A+Ie,te=k-Q[0].startBytes,ne=new DataView(v,te,ze),b=ct.CompressionLevels[0].SphericalHarmonicsDegrees[l],oe=A*b.BytesPerSplat+y;if(p===Mn.DirectToSplatBuffer?M?Sl.parseToUncompressedSplatBufferSection(V.chunkElement,V.vertexElement,0,Ie-1,A,ne,0,x,oe):he.parseToUncompressedSplatBufferSection(V,0,Ie-1,ne,0,x,oe,l):M?Sl.parseToUncompressedSplatArraySection(V.chunkElement,V.vertexElement,0,Ie-1,A,ne,0,ee):he.parseToUncompressedSplatArraySection(V,0,Ie-1,ne,0,ee,l),A=it,p===Mn.DirectToSplatBuffer&&(_||(ct.writeSectionHeaderToBuffer({maxSplatCount:E,splatCount:A,bucketSize:0,bucketCount:0,bucketBlockSize:0,compressionScaleRange:0,storageSizeBytes:0,fullBucketCount:0,partiallyFilledBucketCount:0,sphericalHarmonicsDegree:l},0,x,ct.HeaderSizeBytes),_=new ct(x,!1)),_.updateLoadedCounts(1,A),r&&r(_,fe)),L+=g,k+=ze,Be===0)Q=[];else{let J=[],H=0;for(let P=Q.length-1;P>=0;P--){const U=Q[P];if(H+=U.sizeBytes,J.unshift(U),H>=Be)break}Q=J}}fe&&(p===Mn.DirectToSplatBuffer?I.resolve(_):I.resolve(ee))}}t&&t(re,be,Kn.Downloading)};return t&&t(0,"0%",Kn.Downloading),l_(e,ie,!1,c).then(()=>(t&&t(0,"0%",Kn.Processing),I.promise.then(re=>{if(t&&t(100,"100%",Kn.Done),p===Mn.DownloadBeforeProcessing){const be=Q.map(le=>le.data);return new Blob(be).arrayBuffer().then(le=>V_.loadFromFileData(le,s,o,a,l,u,d,h,f))}else return p===Mn.DirectToSplatBuffer?re:ms(()=>HA(re,a,s,o,u,d,h,f))})))}static loadFromFileData(e,t,i,r,s=0,o,a,l,c){return ms(()=>mk.parseToUncompressedSplatArray(e,s)).then(u=>HA(u,r,t,i,o,a,l,c))}}const on=class on{static parseToUncompressedSplatBufferSection(e,t,i,r,s,o){const a=ct.CompressionLevels[0].BytesPerCenter,l=ct.CompressionLevels[0].BytesPerScale,c=ct.CompressionLevels[0].BytesPerRotation,u=ct.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat;for(let d=e;d<=t;d++){const h=d*on.RowSizeBytes+r,f=new Float32Array(i,h,3),p=new Float32Array(i,h+on.CenterSizeBytes,3),g=new Uint8Array(i,h+on.CenterSizeBytes+on.ScaleSizeBytes,4),y=new Uint8Array(i,h+on.CenterSizeBytes+on.ScaleSizeBytes+on.RotationSizeBytes,4),m=new Qt((y[1]-128)/128,(y[2]-128)/128,(y[3]-128)/128,(y[0]-128)/128);m.normalize();const v=d*u+o,x=new Float32Array(s,v,3),_=new Float32Array(s,v+a,3),S=new Float32Array(s,v+a+l,4),E=new Uint8Array(s,v+a+l+c,4);x[0]=f[0],x[1]=f[1],x[2]=f[2],_[0]=p[0],_[1]=p[1],_[2]=p[2],S[0]=m.w,S[1]=m.x,S[2]=m.y,S[3]=m.z,E[0]=g[0],E[1]=g[1],E[2]=g[2],E[3]=g[3]}}static parseToUncompressedSplatArraySection(e,t,i,r,s){for(let o=e;o<=t;o++){const a=o*on.RowSizeBytes+r,l=new Float32Array(i,a,3),c=new Float32Array(i,a+on.CenterSizeBytes,3),u=new Uint8Array(i,a+on.CenterSizeBytes+on.ScaleSizeBytes,4),d=new Uint8Array(i,a+on.CenterSizeBytes+on.ScaleSizeBytes+on.RotationSizeBytes,4),h=new Qt((d[1]-128)/128,(d[2]-128)/128,(d[3]-128)/128,(d[0]-128)/128);h.normalize(),s.addSplatFromComonents(l[0],l[1],l[2],c[0],c[1],c[2],h.w,h.x,h.y,h.z,u[0],u[1],u[2],u[3])}}static parseStandardSplatToUncompressedSplatArray(e){const t=e.byteLength/on.RowSizeBytes,i=new lt;for(let r=0;r<t;r++){const s=r*on.RowSizeBytes,o=new Float32Array(e,s,3),a=new Float32Array(e,s+on.CenterSizeBytes,3),l=new Uint8Array(e,s+on.CenterSizeBytes+on.ScaleSizeBytes,4),c=new Uint8Array(e,s+on.CenterSizeBytes+on.ScaleSizeBytes+on.ColorSizeBytes,4),u=new Qt((c[1]-128)/128,(c[2]-128)/128,(c[3]-128)/128,(c[0]-128)/128);u.normalize(),i.addSplatFromComonents(o[0],o[1],o[2],a[0],a[1],a[2],u.w,u.x,u.y,u.z,l[0],l[1],l[2],l[3])}return i}};xe(on,"RowSizeBytes",32),xe(on,"CenterSizeBytes",12),xe(on,"ScaleSizeBytes",12),xe(on,"RotationSizeBytes",4),xe(on,"ColorSizeBytes",4);let pl=on;function $A(n,e,t,i,r,s,o,a){return e?i0.getStandardGenerator(t,i,r,s,o,a).generateFromUncompressedSplatArray(n):ct.generateFromUncompressedSplatArrays([n],t,0,new Y)}class H_{static loadFromURL(e,t,i,r,s,o,a=!0,l,c,u,d,h){let f=i?Mn.DirectToSplatBuffer:Mn.DirectToSplatArray;a&&(f=Mn.DirectToSplatArray);const p=ct.HeaderSizeBytes+ct.SectionHeaderSizeBytes,g=Ft.ProgressiveLoadSectionSize,y=1;let m,v,x,_=0,S=0,E;const A=c_();let R=0,w=0,M=[];const I=(L,k,T,F)=>{const V=L>=100;if(T&&M.push(T),f===Mn.DownloadBeforeProcessing){V&&A.resolve(M);return}if(!F){if(i)throw new z_("Cannon directly load .splat because no file size info is available.");f=Mn.DownloadBeforeProcessing;return}if(!m){_=F/pl.RowSizeBytes,m=new ArrayBuffer(F);const Q=ct.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat,ee=p+Q*_;f===Mn.DirectToSplatBuffer?(v=new ArrayBuffer(ee),ct.writeHeaderToBuffer({versionMajor:ct.CurrentMajorVersion,versionMinor:ct.CurrentMinorVersion,maxSectionCount:y,sectionCount:y,maxSplatCount:_,splatCount:S,compressionLevel:0,sceneCenter:new Y},v)):E=new lt(0)}if(T){new Uint8Array(m,w,T.byteLength).set(new Uint8Array(T)),w+=T.byteLength;const Q=w-R;if(Q>g||V){const se=(V?Q:g)/pl.RowSizeBytes,he=S+se;f===Mn.DirectToSplatBuffer?pl.parseToUncompressedSplatBufferSection(S,he-1,m,0,v,p):pl.parseToUncompressedSplatArraySection(S,he-1,m,0,E),S=he,f===Mn.DirectToSplatBuffer&&(x||(ct.writeSectionHeaderToBuffer({maxSplatCount:_,splatCount:S,bucketSize:0,bucketCount:0,bucketBlockSize:0,compressionScaleRange:0,storageSizeBytes:0,fullBucketCount:0,partiallyFilledBucketCount:0},0,v,ct.HeaderSizeBytes),x=new ct(v,!1)),x.updateLoadedCounts(1,S),r&&r(x,V)),R+=g}}V&&(f===Mn.DirectToSplatBuffer?A.resolve(x):A.resolve(E)),t&&t(L,k,Kn.Downloading)};return t&&t(0,"0%",Kn.Downloading),l_(e,I,!1,l).then(()=>(t&&t(0,"0%",Kn.Processing),A.promise.then(L=>(t&&t(100,"100%",Kn.Done),f===Mn.DownloadBeforeProcessing?new Blob(M).arrayBuffer().then(k=>H_.loadFromFileData(k,s,o,a,c,u,d,h)):f===Mn.DirectToSplatBuffer?L:ms(()=>$A(L,a,s,o,c,u,d,h))))))}static loadFromFileData(e,t,i,r,s,o,a,l){return ms(()=>{const c=pl.parseStandardSplatToUncompressedSplatArray(e);return $A(c,r,t,i,s,o,a,l)})}}const zc=class zc{static checkVersion(e){const t=ct.CurrentMajorVersion,i=ct.CurrentMinorVersion,r=ct.parseHeader(e);if(r.versionMajor===t&&r.versionMinor>=i||r.versionMajor>t)return!0;throw new Error("KSplat version not supported: v".concat(r.versionMajor,".").concat(r.versionMinor,". ")+"Minimum required: v".concat(t,".").concat(i))}static loadFromURL(e,t,i,r,s){let o,a,l,c,u=!1,d=!1,h,f=[],p=!1,g=!1,y=0,m=0,v=0,x=!1,_=!1,S=!1,E=[];const A=c_(),R=()=>{!u&&!d&&y>=ct.HeaderSizeBytes&&(d=!0,new Blob(E).arrayBuffer().then(F=>{l=new ArrayBuffer(ct.HeaderSizeBytes),new Uint8Array(l).set(new Uint8Array(F,0,ct.HeaderSizeBytes)),zc.checkVersion(l),d=!1,u=!0,c=ct.parseHeader(l),window.setTimeout(()=>{I()},1)}))};let w=0;const M=()=>{w===0&&(w++,window.setTimeout(()=>{w--,L()},1))},I=()=>{const T=()=>{g=!0,new Blob(E).arrayBuffer().then(V=>{g=!1,p=!0,h=new ArrayBuffer(c.maxSectionCount*ct.SectionHeaderSizeBytes),new Uint8Array(h).set(new Uint8Array(V,ct.HeaderSizeBytes,c.maxSectionCount*ct.SectionHeaderSizeBytes)),f=ct.parseSectionHeaders(c,h,0,!1);let Q=0;for(let se=0;se<c.maxSectionCount;se++)Q+=f[se].storageSizeBytes;const ee=ct.HeaderSizeBytes+c.maxSectionCount*ct.SectionHeaderSizeBytes+Q;if(!o){o=new ArrayBuffer(ee);let se=0;for(let he=0;he<E.length;he++){const ie=E[he];new Uint8Array(o,se,ie.byteLength).set(new Uint8Array(ie)),se+=ie.byteLength}}v=ct.HeaderSizeBytes+ct.SectionHeaderSizeBytes*c.maxSectionCount;for(let se=0;se<=f.length&&se<c.maxSectionCount;se++)v+=f[se].storageSizeBytes;M()})};!g&&!p&&u&&y>=ct.HeaderSizeBytes+ct.SectionHeaderSizeBytes*c.maxSectionCount&&T()},L=()=>{if(S)return;S=!0;const T=()=>{if(S=!1,p){if(_)return;if(x=y>=v,y-m>Ft.ProgressiveLoadSectionSize||x){m+=Ft.ProgressiveLoadSectionSize,_=m>=v,a||(a=new ct(o,!1));const V=ct.HeaderSizeBytes+ct.SectionHeaderSizeBytes*c.maxSectionCount;let Q=0,ee=0,se=0;for(let re=0;re<c.maxSectionCount;re++){const be=f[re],le=Q+be.partiallyFilledBucketCount*4+be.bucketStorageSizeBytes*be.bucketCount,fe=V+le;if(m>=fe){ee++;const Te=m-fe,ze=ct.CompressionLevels[c.compressionLevel].SphericalHarmonicsDegrees[be.sphericalHarmonicsDegree].BytesPerSplat;let Be=Math.floor(Te/ze);Be=Math.min(Be,be.maxSplatCount),se+=Be,a.updateLoadedCounts(ee,se),a.updateSectionLoadedCounts(re,Be)}else break;Q+=be.storageSizeBytes}r(a,_);const he=m/v*100,ie=he.toFixed(2)+"%";t&&t(he,ie,Kn.Downloading),_?A.resolve(a):L()}}};window.setTimeout(T,Ft.ProgressiveLoadSectionDelayDuration)};return l_(e,(T,F,V)=>{V&&(E.push(V),o&&new Uint8Array(o,y,V.byteLength).set(new Uint8Array(V)),y+=V.byteLength),i?(R(),I(),L()):t&&t(T,F,Kn.Downloading)},!i,s).then(T=>(t&&t(0,"0%",Kn.Processing),(i?A.promise:zc.loadFromFileData(T)).then(V=>(t&&t(100,"100%",Kn.Done),V))))}static loadFromFileData(e){return ms(()=>(zc.checkVersion(e),new ct(e)))}};xe(zc,"downloadFile",function(){let e;return function(t,i){const r=new Blob([t.bufferData],{type:"application/octet-stream"});e||(e=document.createElement("a"),document.body.appendChild(e)),e.download=i,e.href=URL.createObjectURL(r),e.click()}}());let Uy=zc;const zs={Splat:0,KSplat:1,Ply:2},GA=n=>n.endsWith(".ply")?zs.Ply:n.endsWith(".splat")?zs.Splat:n.endsWith(".ksplat")?zs.KSplat:null,WA={type:"change"},Vg={type:"start"},QA={type:"end"},jf=new Oh,jA=new Co,gk=Math.cos(70*Ta.DEG2RAD);class qf extends ro{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Y,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-Math.PI/72,this.maxAzimuthAngle=Math.PI/72,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!1,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"KeyA",UP:"KeyW",RIGHT:"KeyD",BOTTOM:"KeyS"},this.mouseButtons={LEFT:tc.ROTATE,MIDDLE:tc.DOLLY,RIGHT:tc.PAN},this.touches={ONE:nc.ROTATE,TWO:nc.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=$=>{$.addEventListener("keydown",G),this._domElementKeyEvents=$},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",G),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,this.clearDampedRotation(),this.clearDampedPan(),i.object.updateProjectionMatrix(),i.dispatchEvent(WA),i.update(),s=r.NONE},this.clearDampedRotation=function(){l.theta=0,l.phi=0},this.clearDampedPan=function(){u.set(0,0,0)},this.update=function(){const $=new Y,ae=new Qt().setFromUnitVectors(e.up,new Y(0,1,0)),ke=ae.clone().invert(),Le=new Y,Ve=new Qt,Je=new Y,st=2*Math.PI;return function(){ae.setFromUnitVectors(e.up,new Y(0,1,0)),ke.copy(ae).invert();const Ze=i.object.position;$.copy(Ze).sub(i.target),$.applyQuaternion(ae),a.setFromVector3($),i.autoRotate&&s===r.NONE&&I(w()),i.enableDamping?(a.theta+=l.theta*i.dampingFactor,a.phi+=l.phi*i.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let we=i.minAzimuthAngle,De=i.maxAzimuthAngle;isFinite(we)&&isFinite(De)&&(we<-Math.PI?we+=st:we>Math.PI&&(we-=st),De<-Math.PI?De+=st:De>Math.PI&&(De-=st),we<=De?a.theta=Math.max(we,Math.min(De,a.theta)):a.theta=a.theta>(we+De)/2?Math.max(we,a.theta):Math.min(De,a.theta)),a.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,a.phi)),a.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(u,i.dampingFactor):i.target.add(u),i.zoomToCursor&&E||i.object.isOrthographicCamera?a.radius=se(a.radius):a.radius=se(a.radius*c),$.setFromSpherical(a),$.applyQuaternion(ke),Ze.copy(i.target).add($),i.object.lookAt(i.target),i.enableDamping===!0?(l.theta*=1-i.dampingFactor,l.phi*=1-i.dampingFactor,u.multiplyScalar(1-i.dampingFactor)):(l.set(0,0,0),u.set(0,0,0));let Ke=!1;if(i.zoomToCursor&&E){let et=null;if(i.object.isPerspectiveCamera){const _t=$.length();et=se(_t*c);const hn=_t-et;i.object.position.addScaledVector(_,hn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const _t=new Y(S.x,S.y,0);_t.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),Ke=!0;const hn=new Y(S.x,S.y,0);hn.unproject(i.object),i.object.position.sub(hn).add(_t),i.object.updateMatrixWorld(),et=$.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;et!==null&&(this.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(et).add(i.object.position):(jf.origin.copy(i.object.position),jf.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(jf.direction))<gk?e.lookAt(i.target):(jA.setFromNormalAndCoplanarPoint(i.object.up,i.target),jf.intersectPlane(jA,i.target))))}else i.object.isOrthographicCamera&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),Ke=!0);return c=1,E=!1,Ke||Le.distanceToSquared(i.object.position)>o||8*(1-Ve.dot(i.object.quaternion))>o||Je.distanceToSquared(i.target)>0?(i.dispatchEvent(WA),Le.copy(i.object.position),Ve.copy(i.object.quaternion),Je.copy(i.target),Ke=!1,!0):!1}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",z),i.domElement.removeEventListener("pointerdown",P),i.domElement.removeEventListener("pointercancel",j),i.domElement.removeEventListener("wheel",W),i.domElement.removeEventListener("pointermove",U),i.domElement.removeEventListener("pointerup",j),i._domElementKeyEvents!==null&&(i._domElementKeyEvents.removeEventListener("keydown",G),i._domElementKeyEvents=null)};const i=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=r.NONE;const o=1e-6,a=new iA,l=new iA;let c=1;const u=new Y,d=new qe,h=new qe,f=new qe,p=new qe,g=new qe,y=new qe,m=new qe,v=new qe,x=new qe,_=new Y,S=new qe;let E=!1;const A=[],R={};function w(){return 2*Math.PI/60/60*i.autoRotateSpeed}function M(){return Math.pow(.95,i.zoomSpeed)}function I($){l.theta-=$}function L($){l.phi-=$}const k=function(){const $=new Y;return function(ke,Le){$.setFromMatrixColumn(Le,0),$.multiplyScalar(-ke),u.add($)}}(),T=function(){const $=new Y;return function(ke,Le){i.screenSpacePanning===!0?$.setFromMatrixColumn(Le,1):($.setFromMatrixColumn(Le,0),$.crossVectors(i.object.up,$)),$.multiplyScalar(ke),u.add($)}}(),F=function(){const $=new Y;return function(ke,Le){const Ve=i.domElement;if(i.object.isPerspectiveCamera){const Je=i.object.position;$.copy(Je).sub(i.target);let st=$.length();st*=Math.tan(i.object.fov/2*Math.PI/180),k(2*ke*st/Ve.clientHeight,i.object.matrix),T(2*Le*st/Ve.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(k(ke*(i.object.right-i.object.left)/i.object.zoom/Ve.clientWidth,i.object.matrix),T(Le*(i.object.top-i.object.bottom)/i.object.zoom/Ve.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function V($){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c/=$:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Q($){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c*=$:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ee($){if(!i.zoomToCursor)return;E=!0;const ae=i.domElement.getBoundingClientRect(),ke=$.clientX-ae.left,Le=$.clientY-ae.top,Ve=ae.width,Je=ae.height;S.x=ke/Ve*2-1,S.y=-(Le/Je)*2+1,_.set(S.x,S.y,1).unproject(e).sub(e.position).normalize()}function se($){return Math.max(i.minDistance,Math.min(i.maxDistance,$))}function he($){d.set($.clientX,$.clientY)}function ie($){ee($),m.set($.clientX,$.clientY)}function re($){p.set($.clientX,$.clientY)}function be($){h.set($.clientX,$.clientY),f.subVectors(h,d).multiplyScalar(i.rotateSpeed);const ae=i.domElement;I(2*Math.PI*f.x/ae.clientHeight),L(2*Math.PI*f.y/ae.clientHeight),d.copy(h),i.update()}function le($){v.set($.clientX,$.clientY),x.subVectors(v,m),x.y>0?V(M()):x.y<0&&Q(M()),m.copy(v),i.update()}function fe($){g.set($.clientX,$.clientY),y.subVectors(g,p).multiplyScalar(i.panSpeed),F(y.x,y.y),p.copy(g),i.update()}function Te($){ee($),$.deltaY<0?Q(M()):$.deltaY>0&&V(M()),i.update()}function Ce($){let ae=!1;switch($.code){case i.keys.UP:$.ctrlKey||$.metaKey||$.shiftKey?L(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):F(0,i.keyPanSpeed),ae=!0;break;case i.keys.BOTTOM:$.ctrlKey||$.metaKey||$.shiftKey?L(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):F(0,-i.keyPanSpeed),ae=!0;break;case i.keys.LEFT:$.ctrlKey||$.metaKey||$.shiftKey?I(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):F(i.keyPanSpeed,0),ae=!0;break;case i.keys.RIGHT:$.ctrlKey||$.metaKey||$.shiftKey?I(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):F(-i.keyPanSpeed,0),ae=!0;break}ae&&($.preventDefault(),i.update())}function Ie(){if(A.length===1)d.set(A[0].pageX,A[0].pageY);else{const $=.5*(A[0].pageX+A[1].pageX),ae=.5*(A[0].pageY+A[1].pageY);d.set($,ae)}}function ze(){if(A.length===1)p.set(A[0].pageX,A[0].pageY);else{const $=.5*(A[0].pageX+A[1].pageX),ae=.5*(A[0].pageY+A[1].pageY);p.set($,ae)}}function Be(){const $=A[0].pageX-A[1].pageX,ae=A[0].pageY-A[1].pageY,ke=Math.sqrt($*$+ae*ae);m.set(0,ke)}function it(){i.enableZoom&&Be(),i.enablePan&&ze()}function te(){i.enableZoom&&Be(),i.enableRotate&&Ie()}function ne($){if(A.length==1)h.set($.pageX,$.pageY);else{const ke=Z($),Le=.5*($.pageX+ke.x),Ve=.5*($.pageY+ke.y);h.set(Le,Ve)}f.subVectors(h,d).multiplyScalar(i.rotateSpeed);const ae=i.domElement;I(2*Math.PI*f.x/ae.clientHeight),L(2*Math.PI*f.y/ae.clientHeight),d.copy(h)}function b($){if(A.length===1)g.set($.pageX,$.pageY);else{const ae=Z($),ke=.5*($.pageX+ae.x),Le=.5*($.pageY+ae.y);g.set(ke,Le)}y.subVectors(g,p).multiplyScalar(i.panSpeed),F(y.x,y.y),p.copy(g)}function oe($){const ae=Z($),ke=$.pageX-ae.x,Le=$.pageY-ae.y,Ve=Math.sqrt(ke*ke+Le*Le);v.set(0,Ve),x.set(0,Math.pow(v.y/m.y,i.zoomSpeed)),V(x.y),m.copy(v)}function J($){i.enableZoom&&oe($),i.enablePan&&b($)}function H($){i.enableZoom&&oe($),i.enableRotate&&ne($)}function P($){i.enabled!==!1&&(A.length===0&&(i.domElement.setPointerCapture($.pointerId),i.domElement.addEventListener("pointermove",U),i.domElement.addEventListener("pointerup",j)),C($),$.pointerType==="touch"?X($):B($))}function U($){i.enabled!==!1&&($.pointerType==="touch"?ue($):D($))}function j($){N($),A.length===0&&(i.domElement.releasePointerCapture($.pointerId),i.domElement.removeEventListener("pointermove",U),i.domElement.removeEventListener("pointerup",j)),i.dispatchEvent(QA),s=r.NONE}function B($){let ae;switch($.button){case 0:ae=i.mouseButtons.LEFT;break;case 1:ae=i.mouseButtons.MIDDLE;break;case 2:ae=i.mouseButtons.RIGHT;break;default:ae=-1}switch(ae){case tc.DOLLY:if(i.enableZoom===!1)return;ie($),s=r.DOLLY;break;case tc.ROTATE:if($.ctrlKey||$.metaKey||$.shiftKey){if(i.enablePan===!1)return;re($),s=r.PAN}else{if(i.enableRotate===!1)return;he($),s=r.ROTATE}break;case tc.PAN:if($.ctrlKey||$.metaKey||$.shiftKey){if(i.enableRotate===!1)return;he($),s=r.ROTATE}else{if(i.enablePan===!1)return;re($),s=r.PAN}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(Vg)}function D($){switch(s){case r.ROTATE:if(i.enableRotate===!1)return;be($);break;case r.DOLLY:if(i.enableZoom===!1)return;le($);break;case r.PAN:if(i.enablePan===!1)return;fe($);break}}function W($){i.enabled===!1||i.enableZoom===!1||s!==r.NONE||($.preventDefault(),i.dispatchEvent(Vg),Te($),i.dispatchEvent(QA))}function G($){i.enabled===!1||i.enablePan===!1||Ce($)}function X($){switch(q($),A.length){case 1:switch(i.touches.ONE){case nc.ROTATE:if(i.enableRotate===!1)return;Ie(),s=r.TOUCH_ROTATE;break;case nc.PAN:if(i.enablePan===!1)return;ze(),s=r.TOUCH_PAN;break;default:s=r.NONE}break;case 2:switch(i.touches.TWO){case nc.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;it(),s=r.TOUCH_DOLLY_PAN;break;case nc.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;te(),s=r.TOUCH_DOLLY_ROTATE;break;default:s=r.NONE}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(Vg)}function ue($){switch(q($),s){case r.TOUCH_ROTATE:if(i.enableRotate===!1)return;ne($),i.update();break;case r.TOUCH_PAN:if(i.enablePan===!1)return;b($),i.update();break;case r.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;J($),i.update();break;case r.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;H($),i.update();break;default:s=r.NONE}}function z($){i.enabled!==!1&&$.preventDefault()}function C($){A.push($)}function N($){delete R[$.pointerId];for(let ae=0;ae<A.length;ae++)if(A[ae].pointerId==$.pointerId){A.splice(ae,1);return}}function q($){let ae=R[$.pointerId];ae===void 0&&(ae=new qe,R[$.pointerId]=ae),ae.set($.pageX,$.pageY)}function Z($){const ae=$.pointerId===A[0].pointerId?A[1]:A[0];return R[ae.pointerId]}i.domElement.addEventListener("contextmenu",z),i.domElement.addEventListener("pointerdown",P),i.domElement.addEventListener("pointercancel",j),i.domElement.addEventListener("wheel",W,{passive:!1}),this.update()}}const yk=(n,e,t,i,r)=>{const s=performance.now();let o=n.style.display==="none"?0:parseFloat(n.style.opacity);isNaN(o)&&(o=1);const a=window.setInterval(()=>{const c=performance.now()-s;let u=Math.min(c/i,1);u>.999&&(u=1);let d;e?(d=(1-u)*o,d<1e-4&&(d=0)):d=(1-o)*u+o,d>0?(n.style.display=t,n.style.opacity=d):n.style.display="none",u>=1&&(r&&r(),window.clearInterval(a))},16);return a},vk=500,Bm=class Bm{constructor(e,t){this.taskIDGen=0,this.elementID=Bm.elementIDGen++,this.tasks=[],this.message=e||"Loading...",this.container=t||document.body,this.spinnerContainerOuter=document.createElement("div"),this.spinnerContainerOuter.className="spinnerOuterContainer".concat(this.elementID),this.spinnerContainerOuter.style.display="none",this.spinnerContainerPrimary=document.createElement("div"),this.spinnerContainerPrimary.className="spinnerContainerPrimary".concat(this.elementID),this.spinnerPrimary=document.createElement("div"),this.spinnerPrimary.classList.add("spinner".concat(this.elementID),"spinnerPrimary".concat(this.elementID)),this.messageContainerPrimary=document.createElement("div"),this.messageContainerPrimary.classList.add("messageContainer".concat(this.elementID),"messageContainerPrimary".concat(this.elementID)),this.messageContainerPrimary.innerHTML=this.message,this.spinnerContainerMin=document.createElement("div"),this.spinnerContainerMin.className="spinnerContainerMin".concat(this.elementID),this.spinnerMin=document.createElement("div"),this.spinnerMin.classList.add("spinner".concat(this.elementID),"spinnerMin".concat(this.elementID)),this.messageContainerMin=document.createElement("div"),this.messageContainerMin.classList.add("messageContainer".concat(this.elementID),"messageContainerMin".concat(this.elementID)),this.messageContainerMin.innerHTML=this.message,this.spinnerContainerPrimary.appendChild(this.spinnerPrimary),this.spinnerContainerPrimary.appendChild(this.messageContainerPrimary),this.spinnerContainerOuter.appendChild(this.spinnerContainerPrimary),this.spinnerContainerMin.appendChild(this.spinnerMin),this.spinnerContainerMin.appendChild(this.messageContainerMin),this.spinnerContainerOuter.appendChild(this.spinnerContainerMin);const i=document.createElement("style");i.innerHTML="\n\n .spinnerOuterContainer".concat(this.elementID," {\n width: 100%;\n height: 100%;\n margin: 0;\n top: 0;\n left: 0;\n position: absolute;\n pointer-events: none;\n }\n\n .messageContainer").concat(this.elementID," {\n height: 20px;\n font-family: arial;\n font-size: 12pt;\n color: #ffffff;\n text-align: center;\n vertical-align: middle;\n }\n\n .spinner").concat(this.elementID," {\n padding: 15px;\n background: #07e8d6;\n z-index:99999;\n \n aspect-ratio: 1;\n border-radius: 50%;\n --_m: \n conic-gradient(#0000,#000),\n linear-gradient(#000 0 0) content-box;\n -webkit-mask: var(--_m);\n mask: var(--_m);\n -webkit-mask-composite: source-out;\n mask-composite: subtract;\n box-sizing: border-box;\n animation: load 1s linear infinite;\n }\n\n .spinnerContainerPrimary").concat(this.elementID," {\n z-index:99999;\n background-color: rgba(128, 128, 128, 0.75);\n border: #666666 1px solid;\n border-radius: 5px;\n padding-top: 20px;\n padding-bottom: 10px;\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-80px, -80px);\n width: 180px;\n pointer-events: auto;\n }\n\n .spinnerPrimary").concat(this.elementID," {\n width: 120px;\n margin-left: 30px;\n }\n\n .messageContainerPrimary").concat(this.elementID," {\n padding-top: 15px;\n }\n\n .spinnerContainerMin").concat(this.elementID," {\n z-index:99999;\n background-color: rgba(128, 128, 128, 0.75);\n border: #666666 1px solid;\n border-radius: 5px;\n padding-top: 20px;\n padding-bottom: 15px;\n margin: 0;\n position: absolute;\n bottom: 50px;\n left: 50%;\n transform: translate(-50%, 0);\n display: flex;\n flex-direction: left;\n pointer-events: auto;\n min-width: 250px;\n }\n\n .messageContainerMin").concat(this.elementID," {\n margin-right: 15px;\n }\n\n .spinnerMin").concat(this.elementID," {\n width: 50px;\n height: 50px;\n margin-left: 15px;\n margin-right: 25px;\n }\n\n .messageContainerMin").concat(this.elementID," {\n padding-top: 15px;\n }\n \n @keyframes load {\n to{transform: rotate(1turn)}\n }\n\n "),this.spinnerContainerOuter.appendChild(i),this.container.appendChild(this.spinnerContainerOuter),this.setMinimized(!1,!0),this.fadeTransitions=[]}addTask(e){const t={message:e,id:this.taskIDGen++};return this.tasks.push(t),this.update(),t.id}removeTask(e){let t=0;for(let i of this.tasks){if(i.id===e){this.tasks.splice(t,1);break}t++}this.update()}removeAllTasks(){this.tasks=[],this.update()}setMessageForTask(e,t){for(let i of this.tasks)if(i.id===e){i.message=t;break}this.update()}update(){this.tasks.length>0?(this.show(),this.setMessage(this.tasks[this.tasks.length-1].message)):this.hide()}show(){this.spinnerContainerOuter.style.display="block",this.visible=!0}hide(){this.spinnerContainerOuter.style.display="none",this.visible=!1}setContainer(e){this.container&&this.spinnerContainerOuter.parentElement===this.container&&this.container.removeChild(this.spinnerContainerOuter),e&&(this.container=e,this.container.appendChild(this.spinnerContainerOuter),this.spinnerContainerOuter.style.zIndex=this.container.style.zIndex+1)}setMinimized(e,t){const i=(r,s,o,a,l)=>{o?r.style.display=s?a:"none":this.fadeTransitions[l]=yk(r,!s,a,vk,()=>{this.fadeTransitions[l]=null})};i(this.spinnerContainerPrimary,!e,t,"block",0),i(this.spinnerContainerMin,e,t,"flex",1),this.minimized=e}setMessage(e){this.messageContainerPrimary.innerHTML=e,this.messageContainerMin.innerHTML=e}};xe(Bm,"elementIDGen",0);let zy=Bm;class _k{constructor(e){this.idGen=0,this.tasks=[],this.container=e||document.body,this.progressBarContainerOuter=document.createElement("div"),this.progressBarContainerOuter.className="progressBarOuterContainer",this.progressBarContainerOuter.style.display="none",this.progressBarBox=document.createElement("div"),this.progressBarBox.className="progressBarBox",this.progressBarBackground=document.createElement("div"),this.progressBarBackground.className="progressBarBackground",this.progressBar=document.createElement("div"),this.progressBar.className="progressBar",this.progressBarBackground.appendChild(this.progressBar),this.progressBarBox.appendChild(this.progressBarBackground),this.progressBarContainerOuter.appendChild(this.progressBarBox);const t=document.createElement("style");t.innerHTML="\n\n .progressBarOuterContainer {\n width: 100%;\n height: 100%;\n margin: 0;\n top: 0;\n left: 0;\n position: absolute;\n pointer-events: none;\n }\n\n .progressBarBox {\n z-index:99999;\n padding: 7px 9px 5px 7px;\n background-color: rgba(190, 190, 190, 0.75);\n border: #555555 1px solid;\n border-radius: 15px;\n margin: 0;\n position: absolute;\n bottom: 50px;\n left: 50%;\n transform: translate(-50%, 0);\n width: 180px;\n height: 30px;\n pointer-events: auto;\n }\n\n .progressBarBackground {\n width: 100%;\n height: 25px;\n border-radius:10px;\n background-color: rgba(128, 128, 128, 0.75);\n border: #444444 1px solid;\n box-shadow: inset 0 0 10px #333333;\n }\n\n .progressBar {\n height: 25px;\n width: 0px;\n border-radius:10px;\n background-color: rgba(0, 200, 0, 0.75);\n box-shadow: inset 0 0 10px #003300;\n }\n\n ",this.progressBarContainerOuter.appendChild(t),this.container.appendChild(this.progressBarContainerOuter)}show(){this.progressBarContainerOuter.style.display="block"}hide(){this.progressBarContainerOuter.style.display="none"}setProgress(e){this.progressBar.style.width=e+"%"}setContainer(e){this.container&&this.progressBarContainerOuter.parentElement===this.container&&this.container.removeChild(this.progressBarContainerOuter),e&&(this.container=e,this.container.appendChild(this.progressBarContainerOuter),this.progressBarContainerOuter.style.zIndex=this.container.style.zIndex+1)}}const qA=new Y;class xk extends nn{constructor(e=new Y(0,0,1),t=new Y(0,0,0),i=1,r=.1,s=16776960,o=i*.2,a=o*.2){super(),this.type="ArrowHelper";const l=new hh(r,r,i,32);l.translate(0,i/2,0);const c=new hh(0,a,o,32);c.translate(0,i,0),this.position.copy(t),this.line=new pn(l,new Yr({color:s,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new pn(c,new Yr({color:s,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{qA.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(qA,t)}}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class zd{constructor(e){xe(this,"updateFocusMarker",function(){const e=new Y,t=new Xe,i=new Y;return function(r,s,o){t.copy(s.matrixWorld).invert(),e.copy(r).applyMatrix4(t),e.normalize().multiplyScalar(10),e.applyMatrix4(s.matrixWorld),i.copy(s.position).sub(r);const a=i.length();this.focusMarker.position.copy(r),this.focusMarker.scale.set(a,a,a),this.focusMarker.material.uniforms.realFocusPosition.value.copy(r),this.focusMarker.material.uniforms.viewport.value.copy(o),this.focusMarker.material.uniformsNeedUpdate=!0}}());xe(this,"positionAndOrientControlPlane",function(){const e=new Qt,t=new Y(0,1,0);return function(i,r){e.setFromUnitVectors(t,r),this.controlPlane.position.copy(i),this.controlPlane.quaternion.copy(e)}}());this.threeScene=e,this.splatRenderTarget=null,this.renderTargetCopyQuad=null,this.renderTargetCopyCamera=null,this.meshCursor=null,this.focusMarker=null,this.controlPlane=null,this.debugRoot=null,this.secondaryDebugRoot=null}updateSplatRenderTargetForRenderDimensions(e,t){this.destroySplatRendertarget(),this.splatRenderTarget=new Fa(e,t,{format:Di,stencilBuffer:!1,depthBuffer:!0}),this.splatRenderTarget.depthTexture=new Ua(e,t),this.splatRenderTarget.depthTexture.format=Ml,this.splatRenderTarget.depthTexture.type=Ni}destroySplatRendertarget(){this.splatRenderTarget&&(this.splatRenderTarget=null)}setupRenderTargetCopyObjects(){const e={sourceColorTexture:{type:"t",value:null},sourceDepthTexture:{type:"t",value:null}},t=new Pr({vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4( position.xy, 0.0, 1.0 ); \n }\n ",fragmentShader:"\n #include <common>\n #include <packing>\n varying vec2 vUv;\n uniform sampler2D sourceColorTexture;\n uniform sampler2D sourceDepthTexture;\n void main() {\n vec4 color = texture2D(sourceColorTexture, vUv);\n float fragDepth = texture2D(sourceDepthTexture, vUv).x;\n gl_FragDepth = fragDepth;\n gl_FragColor = vec4(color.rgb, color.a * 2.0);\n }\n ",uniforms:e,depthWrite:!1,depthTest:!1,transparent:!0,blending:u5,blendSrc:ih,blendSrcAlpha:ih,blendDst:rh,blendDstAlpha:rh});t.extensions.fragDepth=!0,this.renderTargetCopyQuad=new pn(new pu(2,2),t),this.renderTargetCopyCamera=new Ou(-1,1,1,-1,0,1)}destroyRenderTargetCopyObjects(){this.renderTargetCopyQuad&&(Cc(this.renderTargetCopyQuad),this.renderTargetCopyQuad=null)}setupMeshCursor(){if(!this.meshCursor){const e=new b_(.5,1.5,32),t=new Yr({color:16777215}),i=new pn(e,t);i.rotation.set(0,0,Math.PI),i.position.set(0,1,0);const r=new pn(e,t);r.position.set(0,-1,0);const s=new pn(e,t);s.rotation.set(0,0,Math.PI/2),s.position.set(1,0,0);const o=new pn(e,t);o.rotation.set(0,0,-Math.PI/2),o.position.set(-1,0,0),this.meshCursor=new nn,this.meshCursor.add(i),this.meshCursor.add(r),this.meshCursor.add(s),this.meshCursor.add(o),this.meshCursor.scale.set(.1,.1,.1),this.threeScene.add(this.meshCursor),this.meshCursor.visible=!1}}destroyMeshCursor(){this.meshCursor&&(Cc(this.meshCursor),this.threeScene.remove(this.meshCursor),this.meshCursor=null)}setMeshCursorVisibility(e){this.meshCursor.visible=e}getMeschCursorVisibility(){return this.meshCursor.visible}setMeshCursorPosition(e){this.meshCursor.position.copy(e)}positionAndOrientMeshCursor(e,t){this.meshCursor.position.copy(e),this.meshCursor.up.copy(t.up),this.meshCursor.lookAt(t.position)}setupFocusMarker(){if(!this.focusMarker){const e=new fm(.5,32,32),t=zd.buildFocusMarkerMaterial();t.depthTest=!1,t.depthWrite=!1,t.transparent=!0,this.focusMarker=new pn(e,t)}}destroyFocusMarker(){this.focusMarker&&(Cc(this.focusMarker),this.focusMarker=null)}setFocusMarkerVisibility(e){this.focusMarker.visible=e}setFocusMarkerOpacity(e){this.focusMarker.material.uniforms.opacity.value=e,this.focusMarker.material.uniformsNeedUpdate=!0}getFocusMarkerOpacity(){return this.focusMarker.material.uniforms.opacity.value}setupControlPlane(){if(!this.controlPlane){const e=new pu(1,1);e.rotateX(-Math.PI/2);const t=new Yr({color:16777215});t.transparent=!0,t.opacity=.6,t.depthTest=!1,t.depthWrite=!1,t.side=Cr;const i=new pn(e,t),r=new Y(0,1,0);r.normalize();const s=new Y(0,0,0),o=.5,a=.01,l=56576,c=new xk(r,s,o,a,l,.1,.03);this.controlPlane=new nn,this.controlPlane.add(i),this.controlPlane.add(c)}}destroyControlPlane(){this.controlPlane&&(Cc(this.controlPlane),this.controlPlane=null)}setControlPlaneVisibility(e){this.controlPlane.visible=e}addDebugMeshes(){this.debugRoot=this.createDebugMeshes(),this.secondaryDebugRoot=this.createSecondaryDebugMeshes(),this.threeScene.add(this.debugRoot),this.threeScene.add(this.secondaryDebugRoot)}destroyDebugMeshes(){for(let e of[this.debugRoot,this.secondaryDebugRoot])e&&(Cc(e),this.threeScene.remove(e));this.debugRoot=null,this.secondaryDebugRoot=null}createDebugMeshes(e){const t=new fm(1,32,32),i=new nn,r=(s,o)=>{let a=new pn(t,zd.buildDebugMaterial(s));a.renderOrder=e,i.add(a),a.position.fromArray(o)};return r(16711680,[-50,0,0]),r(16711680,[50,0,0]),r(65280,[0,0,-50]),r(65280,[0,0,50]),r(16755200,[5,0,5]),i}createSecondaryDebugMeshes(e){const t=new Pu(3,3,3),i=new nn;let r=12303291;const s=a=>{let l=new pn(t,zd.buildDebugMaterial(r));l.renderOrder=e,i.add(l),l.position.fromArray(a)};let o=10;return s([-o,0,-o]),s([-o,0,o]),s([o,0,-o]),s([o,0,o]),i}static buildDebugMaterial(e){const t="\n #include <common>\n varying float ndcDepth;\n\n void main() {\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position.xyz, 1.0);\n ndcDepth = gl_Position.z / gl_Position.w;\n gl_Position.x = gl_Position.x / gl_Position.w;\n gl_Position.y = gl_Position.y / gl_Position.w;\n gl_Position.z = 0.0;\n gl_Position.w = 1.0;\n \n }\n ",i="\n #include <common>\n uniform vec3 color;\n varying float ndcDepth;\n void main() {\n gl_FragDepth = (ndcDepth + 1.0) / 2.0;\n gl_FragColor = vec4(color.rgb, 0.0);\n }\n ",r={color:{type:"v3",value:new gt(e)}},s=new Pr({uniforms:r,vertexShader:t,fragmentShader:i,transparent:!1,depthTest:!0,depthWrite:!0,side:bs});return s.extensions.fragDepth=!0,s}static buildFocusMarkerMaterial(e){const t="\n #include <common>\n\n uniform vec2 viewport;\n uniform vec3 realFocusPosition;\n\n varying vec4 ndcPosition;\n varying vec4 ndcCenter;\n varying vec4 ndcFocusPosition;\n\n void main() {\n float radius = 0.01;\n\n vec4 viewPosition = modelViewMatrix * vec4(position.xyz, 1.0);\n vec4 viewCenter = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n\n vec4 viewFocusPosition = modelViewMatrix * vec4(realFocusPosition, 1.0);\n\n ndcPosition = projectionMatrix * viewPosition;\n ndcPosition = ndcPosition * vec4(1.0 / ndcPosition.w);\n ndcCenter = projectionMatrix * viewCenter;\n ndcCenter = ndcCenter * vec4(1.0 / ndcCenter.w);\n\n ndcFocusPosition = projectionMatrix * viewFocusPosition;\n ndcFocusPosition = ndcFocusPosition * vec4(1.0 / ndcFocusPosition.w);\n\n gl_Position = projectionMatrix * viewPosition;\n\n }\n ",i="\n #include <common>\n uniform vec3 color;\n uniform vec2 viewport;\n uniform float opacity;\n\n varying vec4 ndcPosition;\n varying vec4 ndcCenter;\n varying vec4 ndcFocusPosition;\n\n void main() {\n vec2 screenPosition = vec2(ndcPosition) * viewport;\n vec2 screenCenter = vec2(ndcCenter) * viewport;\n\n vec2 screenVec = screenPosition - screenCenter;\n\n float projectedRadius = length(screenVec);\n\n float lineWidth = 0.0005 * viewport.y;\n float aaRange = 0.0025 * viewport.y;\n float radius = 0.06 * viewport.y;\n float radDiff = abs(projectedRadius - radius) - lineWidth;\n float alpha = 1.0 - clamp(radDiff / 5.0, 0.0, 1.0); \n\n gl_FragColor = vec4(color.rgb, alpha * opacity);\n }\n ",r={color:{type:"v3",value:new gt(e)},realFocusPosition:{type:"v3",value:new Y},viewport:{type:"v2",value:new qe},opacity:{value:0}};return new Pr({uniforms:r,vertexShader:t,fragmentShader:i,transparent:!0,depthTest:!1,depthWrite:!1,side:bs})}dispose(){this.destroyMeshCursor(),this.destroyFocusMarker(),this.destroyDebugMeshes(),this.destroyControlPlane(),this.destroyRenderTargetCopyObjects(),this.destroySplatRendertarget()}}const Sk=new Y(1,0,0),Ak=new Y(0,1,0),bk=new Y(0,0,1);class Hg{constructor(e=new Y,t=new Y){xe(this,"intersectBox",function(){const e=new Y,t=[],i=[],r=[];return function(s,o){if(i[0]=this.origin.x,i[1]=this.origin.y,i[2]=this.origin.z,r[0]=this.direction.x,r[1]=this.direction.y,r[2]=this.direction.z,this.boxContainsPoint(s,this.origin,1e-4))return o&&(o.origin.copy(this.origin),o.normal.set(0,0,0),o.distance=-1),!0;for(let a=0;a<3;a++){if(r[a]==0)continue;const l=a==0?Sk:a==1?Ak:bk,c=r[a]<0?s.max:s.min;let u=-Math.sign(r[a]);t[0]=a==0?c.x:a==1?c.y:c.z;let d=t[0]-i[a];if(d*u<0){const h=(a+1)%3,f=(a+2)%3;if(t[2]=r[h]/r[a]*d+i[h],t[1]=r[f]/r[a]*d+i[f],e.set(t[a],t[f],t[h]),this.boxContainsPoint(s,e,1e-4))return o&&(o.origin.copy(e),o.normal.copy(l).multiplyScalar(u),o.distance=e.sub(this.origin).length()),!0}}return!1}}());xe(this,"intersectSphere",function(){const e=new Y;return function(t,i,r){e.copy(t).sub(this.origin);const s=e.dot(this.direction),o=s*s,l=e.dot(e)-o,c=i*i;if(l>c)return!1;const u=Math.sqrt(c-l),d=s-u,h=s+u;if(h<0)return!1;let f=d<0?h:d;return r&&(r.origin.copy(this.origin).addScaledVector(this.direction,f),r.normal.copy(r.origin).sub(t).normalize(),r.distance=f),!0}}());this.origin=new Y,this.direction=new Y,this.setParameters(e,t)}setParameters(e,t){this.origin.copy(e),this.direction.copy(t).normalize()}boxContainsPoint(e,t,i){return!(t.x<e.min.x-i||t.x>e.max.x+i||t.y<e.min.y-i||t.y>e.max.y+i||t.z<e.min.z-i||t.z>e.max.z+i)}}class $_{constructor(){this.origin=new Y,this.normal=new Y,this.distance=0,this.splatIndex=0}set(e,t,i,r){this.origin.copy(e),this.normal.copy(t),this.distance=i,this.splatIndex=r}clone(){const e=new $_;return e.origin.copy(this.origin),e.normal.copy(this.normal),e.distance=this.distance,e.splatIndex=this.splatIndex,e}}const Eo={ThreeD:0,TwoD:1};class Tk{constructor(e,t,i=!1){xe(this,"ndcCoords",new qe);xe(this,"setFromCameraAndScreenPosition",(e,t,i)=>{if(this.ndcCoords.x=t.x/i.x*2-1,this.ndcCoords.y=(i.y-t.y)/i.y*2-1,e.isPerspectiveCamera)this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(this.ndcCoords.x,this.ndcCoords.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e;else if(e.isOrthographicCamera)this.ray.origin.set(this.ndcCoords.x,this.ndcCoords.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e;else throw new Error("Raycaster::setFromCameraAndScreenPosition() -> Unsupported camera type")});xe(this,"intersectSplatMesh",function(){const e=new Xe,t=new Xe,i=new Xe,r=new Hg,s=new Y;return function(o,a=[]){const l=o.getSplatTree();if(l){for(let c=0;c<l.subTrees.length;c++){const u=l.subTrees[c];t.copy(o.matrixWorld),o.dynamicMode&&(o.getSceneTransform(c,i),t.multiply(i)),e.copy(t).invert(),r.origin.copy(this.ray.origin).applyMatrix4(e),r.direction.copy(this.ray.origin).add(this.ray.direction),r.direction.applyMatrix4(e).sub(r.origin).normalize();const d=[];u.rootNode&&this.castRayAtSplatTreeNode(r,l,u.rootNode,d),d.forEach(h=>{h.origin.applyMatrix4(t),h.normal.applyMatrix4(t).normalize(),h.distance=s.copy(h.origin).sub(this.ray.origin).length()}),a.push(...d)}return a.sort((c,u)=>c.distance>u.distance?1:-1),a}}}());xe(this,"castRayAtSplatTreeNode",function(){const e=new Mt,t=new Y,i=new Y,r=new Qt,s=new $_,o=1e-7,a=new Y(0,0,0),l=new Xe,c=new Xe,u=new Xe,d=new Xe,h=new Xe,f=new Hg;return function(p,g,y,m=[]){if(p.intersectBox(y.boundingBox)){if(y.data&&y.data.indexes&&y.data.indexes.length>0)for(let v=0;v<y.data.indexes.length;v++){const x=y.data.indexes[v],_=g.splatMesh.getSceneIndexForSplat(x);if(g.splatMesh.getScene(_).visible&&(g.splatMesh.getSplatColor(x,e),g.splatMesh.getSplatCenter(x,t),g.splatMesh.getSplatScaleAndRotation(x,i,r),!(i.x<=o||i.y<=o||g.splatMesh.splatRenderMode===Eo.ThreeD&&i.z<=o)))if(this.raycastAgainstTrueSplatEllipsoid){c.makeScale(i.x,i.y,i.z),u.makeRotationFromQuaternion(r);const E=Math.log10(e.w)*2;if(l.makeScale(E,E,E),h.copy(l).multiply(u).multiply(c),d.copy(h).invert(),f.origin.copy(p.origin).sub(t).applyMatrix4(d),f.direction.copy(p.origin).add(p.direction).sub(t),f.direction.applyMatrix4(d).sub(f.origin).normalize(),f.intersectSphere(a,1,s)){const A=s.clone();A.splatIndex=x,A.origin.applyMatrix4(h).add(t),m.push(A)}}else{let E=i.x+i.y,A=2;if(g.splatMesh.splatRenderMode===Eo.ThreeD&&(E+=i.z,A=3),E=E/A,p.intersectSphere(t,E,s)){const R=s.clone();R.splatIndex=x,m.push(R)}}}if(y.children&&y.children.length>0)for(let v of y.children)this.castRayAtSplatTreeNode(p,g,v,m);return m}}}());this.ray=new Hg(e,t),this.raycastAgainstTrueSplatEllipsoid=i}}class Qc{static buildVertexShaderBase(e=!1,t=!1,i=0,r="",s=!0){let o="";return s==!0?o+="#define USE_FLAME":o+="#define USE_SKINNING",o+="\n precision highp float;\n #include <common>\n\n attribute uint splatIndex;\n uniform highp usampler2D flameModelTexture;\n uniform highp usampler2D boneTexture;\n uniform highp usampler2D boneWeightTexture;\n\n\n uniform highp usampler2D centersColorsTexture;\n uniform highp sampler2D sphericalHarmonicsTexture;\n uniform highp sampler2D sphericalHarmonicsTextureR;\n uniform highp sampler2D sphericalHarmonicsTextureG;\n uniform highp sampler2D sphericalHarmonicsTextureB;\n\n uniform highp usampler2D sceneIndexesTexture;\n uniform vec2 sceneIndexesTextureSize;\n uniform int sceneCount;\n uniform int gaussianSplatCount;\n uniform int bsCount;\n uniform float headBoneIndex;\n #ifdef USE_SKINNING\n attribute vec4 skinIndex;\n attribute vec4 skinWeight;\n #endif\n ",t&&(o+="\n uniform float sceneOpacity[".concat(Ft.MaxScenes,"];\n uniform int sceneVisibility[").concat(Ft.MaxScenes,"];\n ")),e&&(o+="\n uniform highp mat4 transforms[".concat(Ft.MaxScenes,"];\n ")),o+="\n ".concat(r,"\n uniform vec2 focal;\n uniform float orthoZoom;\n uniform int orthographicMode;\n uniform int pointCloudModeEnabled;\n uniform float inverseFocalAdjustment;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 centersColorsTextureSize;\n uniform vec2 flameModelTextureSize;\n uniform vec2 boneWeightTextureSize;\n uniform vec2 boneTextureSize;\n\n uniform int sphericalHarmonicsDegree;\n uniform vec2 sphericalHarmonicsTextureSize;\n uniform int sphericalHarmonics8BitMode;\n uniform int sphericalHarmonicsMultiTextureMode;\n uniform float visibleRegionRadius;\n uniform float visibleRegionFadeStartRadius;\n uniform float firstRenderTime;\n uniform float currentTime;\n uniform int fadeInComplete;\n uniform vec3 sceneCenter;\n uniform float splatScale;\n uniform float sphericalHarmonics8BitCompressionRangeMin[").concat(Ft.MaxScenes,"];\n uniform float sphericalHarmonics8BitCompressionRangeMax[").concat(Ft.MaxScenes,"];\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying vec2 vSplatIndex;\n #ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture0;\n mat4 getBoneMatrix0( const in float i ) {\n int size = textureSize( boneTexture0, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture0, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture0, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture0, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture0, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n #endif\n\n mat3 quaternionToRotationMatrix(float x, float y, float z, float w) {\n float s = 1.0 / sqrt(w * w + x * x + y * y + z * z);\n \n return mat3(\n 1. - 2. * (y * y + z * z),\n 2. * (x * y + w * z),\n 2. * (x * z - w * y),\n 2. * (x * y - w * z),\n 1. - 2. * (x * x + z * z),\n 2. * (y * z + w * x),\n 2. * (x * z + w * y),\n 2. * (y * z - w * x),\n 1. - 2. * (x * x + y * y)\n );\n }\n\n const float sqrt8 = sqrt(8.0);\n const float minAlpha = 1.0 / 255.0;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n int internal = 1;//show a gaussian splatting point every internal points.\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n float getRealIndex(int sIndex, int reducedFactor) {\n int remainder = sIndex % reducedFactor;\n\n if(remainder == int(0)) {\n return float(sIndex);\n }\n else\n {\n return float(sIndex - remainder);\n }\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(getRealIndex(int(splatIndex), internal)) * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getFlameDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset) + uint(gaussianSplatCount * bsCount)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getBoneWeightUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getBSFlameDataUV(in int bsInedex, in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset) + uint(gaussianSplatCount * bsInedex)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getDataUVF(in uint sIndex, in float stride, in uint offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(float(getRealIndex(int(sIndex), internal)) * stride) + offset) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n const float SH_C1 = 0.4886025119029199f;\n const float[5] SH_C2 = float[](1.0925484, -1.0925484, 0.3153916, -1.0925484, 0.5462742);\n\n mat4 getBoneMatrix( float i ) {\n float y = i;\n float x = 0.0;\n\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(i * 4.0) / boneTextureSize.x;//4\n samplerUV.y = float(floor(d)) / boneTextureSize.y;//5\n samplerUV.x = fract(d);\n\n vec4 v1 = uintBitsToFloat(texture( boneTexture, samplerUV ));\n vec4 v2 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 1.0 / boneTextureSize.x, samplerUV.y)));\n vec4 v3 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 2.0 / boneTextureSize.x, samplerUV.y) ));\n vec4 v4 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 3.0 / boneTextureSize.x, samplerUV.y)));\n\n return mat4( v1, v2, v3, v4 );\n }\n\n void main () {\n\n uint oddOffset = splatIndex & uint(0x00000001);\n uint doubleOddOffset = oddOffset * uint(2);\n bool isEven = oddOffset == uint(0);\n uint nearestEvenIndex = splatIndex - oddOffset;\n float fOddOffset = float(oddOffset);\n\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n // vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n\n uvec3 sampledCenter = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize)).gba;\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenter));\n\n vec2 flameTextureUV = getBSFlameDataUV(bsCount, 1, 0, flameModelTextureSize);\n uvec3 sampledflamePos = texture(flameModelTexture, flameTextureUV).rgb;\n // splatCenter += uintBitsToFloat(uvec3(sampledflamePos.rgb));\n\n for(int i = 0; i < bsCount; ++i) {\n vec2 flameBSTextureUV = getBSFlameDataUV(i, 1, 0, flameModelTextureSize);\n uvec3 sampledBSPos = texture(flameModelTexture, flameBSTextureUV).rgb;\n\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(i / 4 + 5 * 4) / boneTextureSize.x;//4\n samplerUV.y = float(floor(d)) / boneTextureSize.y;//32\n samplerUV.x = fract(d);\n\n vec4 bsWeight = uintBitsToFloat(texture(boneTexture, samplerUV));\n float weight = bsWeight.r;\n if(i % 4 == 1) {\n weight = bsWeight.g;\n }\n if(i % 4 == 2) {\n weight = bsWeight.b;\n }\n if(i % 4 == 3) {\n weight = bsWeight.a;\n }\n\n splatCenter = splatCenter + weight * uintBitsToFloat(sampledBSPos);\n }\n\n\n #ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix0( skinIndex.x );\n mat4 boneMatY = getBoneMatrix0( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix0( skinIndex.z );\n mat4 boneMatW = getBoneMatrix0( skinIndex.w );\n #endif\n #ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n // skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n #endif\n vec3 transformed = vec3(splatCenter.xyz);\n #ifdef USE_SKINNING\n // vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinVertex = vec4( transformed, 1.0 );\n\n vec4 skinned = vec4( 0.0 );\n // There is an offset between the Gaussian point and the mesh vertex,\n // which will cause defects in the skeletal animation driving the Gaussian point. \n //In order to circumvent this problem, only the head bone(index is 110 currently) is used to drive\n\n if (headBoneIndex >= 0.0)\n {\n mat4 boneMat = getBoneMatrix0( headBoneIndex );\n skinned += boneMat * skinVertex * 1.0;\n }\n\n // skinned += boneMatX * skinVertex * skinWeight.x;\n // skinned += boneMatY * skinVertex * skinWeight.y;\n // skinned += boneMatZ * skinVertex * skinWeight.z;\n // skinned += boneMatW * skinVertex * skinWeight.w;\n\n // transformed = ( bindMatrixInverse * skinned ).xyz;\n transformed = skinned.xyz;\n\n #endif\n splatCenter = transformed.xyz;\n\n #ifdef USE_FLAME\n mat4 boneMatX = getBoneMatrix( 0.0 );\n mat4 boneMatY = getBoneMatrix( 1.0 );\n mat4 boneMatZ = getBoneMatrix( 2.0 );\n mat4 boneMatW = getBoneMatrix( 3.0 ); \n mat4 boneMat0 = getBoneMatrix( 4.0 ); \n \n vec2 boneWeightUV0 = getBoneWeightUV(2, 0, boneWeightTextureSize);\n vec2 boneWeightUV1 = getBoneWeightUV(2, 1, boneWeightTextureSize);\n\n uvec4 sampledBoneMatrixValue = texture(boneWeightTexture, boneWeightUV0);\n uvec4 sampledBoneMatrixValue0 = texture(boneWeightTexture, boneWeightUV1);\n\n vec4 boneMatrixValue = uintBitsToFloat(sampledBoneMatrixValue);\n vec4 boneMatrixValue0 = uintBitsToFloat(sampledBoneMatrixValue0);\n\n vec4 skinVertex = vec4( splatCenter, 1.0 );\n vec4 skinned = vec4( 0.0 );\n float minWeight = min(boneMatrixValue.x,min(boneMatrixValue.y, min(boneMatrixValue.z, min(boneMatrixValue.w, boneMatrixValue0.x))));\n \n if(boneMatrixValue.x > 0.0 && boneMatrixValue.x > minWeight)\n skinned += boneMatX * skinVertex * boneMatrixValue.x;\n \n if(boneMatrixValue.y > 0.0 && boneMatrixValue.y > minWeight)\n skinned += boneMatY * skinVertex * boneMatrixValue.y;\n \n if(boneMatrixValue.z > 0.0 && boneMatrixValue.z > minWeight)\n skinned += boneMatZ * skinVertex * boneMatrixValue.z;\n \n if(boneMatrixValue.w > 0.0 && boneMatrixValue.w > minWeight)\n skinned += boneMatW * skinVertex * boneMatrixValue.w;\n \n if(boneMatrixValue0.x > 0.0 && boneMatrixValue0.x > minWeight)\n skinned += boneMat0 * skinVertex * boneMatrixValue0.x;\n \n splatCenter = skinned.xyz;\n #endif\n\n uint sceneIndex = uint(0);\n if (sceneCount > 1) {\n sceneIndex = texture(sceneIndexesTexture, getDataUV(1, 0, sceneIndexesTextureSize)).r;\n }\n "),t&&(o+="\n float splatOpacityFromScene = sceneOpacity[sceneIndex];\n int sceneVisible = sceneVisibility[sceneIndex];\n if (splatOpacityFromScene <= 0.01 || sceneVisible == 0) {\n gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n return;\n }\n "),e?o+="\n mat4 transform = transforms[sceneIndex];\n mat4 transformModelViewMatrix = viewMatrix * transform;\n #ifdef USE_SKINNING\n transformModelViewMatrix = transformModelViewMatrix * skinMatrix;\n #endif\n ":o+="mat4 transformModelViewMatrix = modelViewMatrix;",o+="\n float sh8BitCompressionRangeMinForScene = sphericalHarmonics8BitCompressionRangeMin[sceneIndex];\n float sh8BitCompressionRangeMaxForScene = sphericalHarmonics8BitCompressionRangeMax[sceneIndex];\n float sh8BitCompressionRangeForScene = sh8BitCompressionRangeMaxForScene - sh8BitCompressionRangeMinForScene;\n float sh8BitCompressionHalfRangeForScene = sh8BitCompressionRangeForScene / 2.0;\n vec3 vec8BitSHShift = vec3(sh8BitCompressionRangeMinForScene);\n\n vec4 viewCenter = transformModelViewMatrix * vec4(splatCenter, 1.0);\n\n vec4 clipCenter = projectionMatrix * viewCenter;\n\n float clip = 1.2 * clipCenter.w;\n if (clipCenter.z < -clip || clipCenter.x < -clip || clipCenter.x > clip || clipCenter.y < -clip || clipCenter.y > clip) {\n gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n return;\n }\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n vPosition = position.xy;\n vSplatIndex = vec2(splatIndex, splatIndex);\n\n vColor = uintToRGBAVec(sampledCenterColor.r);\n ",i>=1&&(o+=" \n if (sphericalHarmonicsDegree >= 1) {\n ",e?o+="\n vec3 worldViewDir = normalize(splatCenter - vec3(inverse(transform) * vec4(cameraPosition, 1.0)));\n ":o+="\n vec3 worldViewDir = normalize(splatCenter - cameraPosition);\n ",o+="\n vec3 sh1;\n vec3 sh2;\n vec3 sh3;\n ",i>=2&&(o+="\n vec3 sh4;\n vec3 sh5;\n vec3 sh6;\n vec3 sh7;\n vec3 sh8;\n "),i===1?o+="\n if (sphericalHarmonicsMultiTextureMode == 0) {\n vec2 shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset, sphericalHarmonicsTextureSize);\n vec4 sampledSH0123 = texture(sphericalHarmonicsTexture, shUV);\n shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(1), sphericalHarmonicsTextureSize);\n vec4 sampledSH4567 = texture(sphericalHarmonicsTexture, shUV);\n shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(2), sphericalHarmonicsTextureSize);\n vec4 sampledSH891011 = texture(sphericalHarmonicsTexture, shUV);\n sh1 = vec3(sampledSH0123.rgb) * (1.0 - fOddOffset) + vec3(sampledSH0123.ba, sampledSH4567.r) * fOddOffset;\n sh2 = vec3(sampledSH0123.a, sampledSH4567.rg) * (1.0 - fOddOffset) + vec3(sampledSH4567.gba) * fOddOffset;\n sh3 = vec3(sampledSH4567.ba, sampledSH891011.r) * (1.0 - fOddOffset) + vec3(sampledSH891011.rgb) * fOddOffset;\n } else {\n vec2 sampledSH01R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH01G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH01B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n sh1 = vec3(sampledSH01R.rg, sampledSH23R.r);\n sh2 = vec3(sampledSH01G.rg, sampledSH23G.r);\n sh3 = vec3(sampledSH01B.rg, sampledSH23B.r);\n }\n ":i===2&&(o+="\n vec4 sampledSH0123;\n vec4 sampledSH4567;\n vec4 sampledSH891011;\n\n vec4 sampledSH0123R;\n vec4 sampledSH0123G;\n vec4 sampledSH0123B;\n\n if (sphericalHarmonicsMultiTextureMode == 0) {\n sampledSH0123 = texture(sphericalHarmonicsTexture, getDataUV(6, 0, sphericalHarmonicsTextureSize));\n sampledSH4567 = texture(sphericalHarmonicsTexture, getDataUV(6, 1, sphericalHarmonicsTextureSize));\n sampledSH891011 = texture(sphericalHarmonicsTexture, getDataUV(6, 2, sphericalHarmonicsTextureSize));\n sh1 = sampledSH0123.rgb;\n sh2 = vec3(sampledSH0123.a, sampledSH4567.rg);\n sh3 = vec3(sampledSH4567.ba, sampledSH891011.r);\n } else {\n sampledSH0123R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sampledSH0123G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sampledSH0123B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sh1 = vec3(sampledSH0123R.rgb);\n sh2 = vec3(sampledSH0123G.rgb);\n sh3 = vec3(sampledSH0123B.rgb);\n }\n "),o+="\n if (sphericalHarmonics8BitMode == 1) {\n sh1 = sh1 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh2 = sh2 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh3 = sh3 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n }\n float x = worldViewDir.x;\n float y = worldViewDir.y;\n float z = worldViewDir.z;\n vColor.rgb += SH_C1 * (-sh1 * y + sh2 * z - sh3 * x);\n ",i>=2&&(o+="\n if (sphericalHarmonicsDegree >= 2) {\n float xx = x * x;\n float yy = y * y;\n float zz = z * z;\n float xy = x * y;\n float yz = y * z;\n float xz = x * z;\n ",i===2&&(o+="\n if (sphericalHarmonicsMultiTextureMode == 0) {\n vec4 sampledSH12131415 = texture(sphericalHarmonicsTexture, getDataUV(6, 3, sphericalHarmonicsTextureSize));\n vec4 sampledSH16171819 = texture(sphericalHarmonicsTexture, getDataUV(6, 4, sphericalHarmonicsTextureSize));\n vec4 sampledSH20212223 = texture(sphericalHarmonicsTexture, getDataUV(6, 5, sphericalHarmonicsTextureSize));\n sh4 = sampledSH891011.gba;\n sh5 = sampledSH12131415.rgb;\n sh6 = vec3(sampledSH12131415.a, sampledSH16171819.rg);\n sh7 = vec3(sampledSH16171819.ba, sampledSH20212223.r);\n sh8 = sampledSH20212223.gba;\n } else {\n vec4 sampledSH4567R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n vec4 sampledSH4567G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n vec4 sampledSH4567B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n sh4 = vec3(sampledSH0123R.a, sampledSH4567R.rg);\n sh5 = vec3(sampledSH4567R.ba, sampledSH0123G.a);\n sh6 = vec3(sampledSH4567G.rgb);\n sh7 = vec3(sampledSH4567G.a, sampledSH0123B.a, sampledSH4567B.r);\n sh8 = vec3(sampledSH4567B.gba);\n }\n "),o+="\n if (sphericalHarmonics8BitMode == 1) {\n sh4 = sh4 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh5 = sh5 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh6 = sh6 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh7 = sh7 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh8 = sh8 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n }\n\n vColor.rgb +=\n (SH_C2[0] * xy) * sh4 +\n (SH_C2[1] * yz) * sh5 +\n (SH_C2[2] * (2.0 * zz - xx - yy)) * sh6 +\n (SH_C2[3] * xz) * sh7 +\n (SH_C2[4] * (xx - yy)) * sh8;\n }\n "),o+="\n\n vColor.rgb = clamp(vColor.rgb, vec3(0.), vec3(1.));\n\n }\n\n "),o}static getVertexShaderFadeIn(){return"\n if (fadeInComplete == 0) {\n float opacityAdjust = 1.0;\n float centerDist = length(splatCenter - sceneCenter);\n float renderTime = max(currentTime - firstRenderTime, 0.0);\n\n float fadeDistance = 0.75;\n float distanceLoadFadeInFactor = step(visibleRegionFadeStartRadius, centerDist);\n distanceLoadFadeInFactor = (1.0 - distanceLoadFadeInFactor) +\n (1.0 - clamp((centerDist - visibleRegionFadeStartRadius) / fadeDistance, 0.0, 1.0)) *\n distanceLoadFadeInFactor;\n opacityAdjust *= distanceLoadFadeInFactor;\n vColor.a *= opacityAdjust;\n }\n "}static getUniforms(e=!1,t=!1,i=0,r=1,s=!1){const o={sceneCenter:{type:"v3",value:new Y},fadeInComplete:{type:"i",value:0},orthographicMode:{type:"i",value:0},visibleRegionFadeStartRadius:{type:"f",value:0},visibleRegionRadius:{type:"f",value:0},bindMatrix:{type:"m4",value:new Xe},bindMatrixInverse:{type:"m4",value:new Xe},currentTime:{type:"f",value:0},firstRenderTime:{type:"f",value:0},centersColorsTexture:{type:"t",value:null},flameModelTexture:{type:"t",value:null},boneTexture:{type:"t",value:null},boneTexture0:{type:"t",value:null},boneWeightTexture:{type:"t",value:null},sphericalHarmonicsTexture:{type:"t",value:null},sphericalHarmonicsTextureR:{type:"t",value:null},sphericalHarmonicsTextureG:{type:"t",value:null},sphericalHarmonicsTextureB:{type:"t",value:null},sphericalHarmonics8BitCompressionRangeMin:{type:"f",value:[]},sphericalHarmonics8BitCompressionRangeMax:{type:"f",value:[]},focal:{type:"v2",value:new qe},orthoZoom:{type:"f",value:1},inverseFocalAdjustment:{type:"f",value:1},viewport:{type:"v2",value:new qe},basisViewport:{type:"v2",value:new qe},debugColor:{type:"v3",value:new gt},centersColorsTextureSize:{type:"v2",value:new qe(1024,1024)},flameModelTextureSize:{type:"v2",value:new qe(4096,2048)},boneTextureSize:{type:"v2",value:new qe(4,32)},boneWeightTextureSize:{type:"v2",value:new qe(512,512)},sphericalHarmonicsDegree:{type:"i",value:i},sphericalHarmonicsTextureSize:{type:"v2",value:new qe(1024,1024)},sphericalHarmonics8BitMode:{type:"i",value:0},sphericalHarmonicsMultiTextureMode:{type:"i",value:0},splatScale:{type:"f",value:r},pointCloudModeEnabled:{type:"i",value:s?1:0},sceneIndexesTexture:{type:"t",value:null},sceneIndexesTextureSize:{type:"v2",value:new qe(1024,1024)},sceneCount:{type:"i",value:1},gaussianSplatCount:{type:"i",value:1},bsCount:{type:"i",value:1},headBoneIndex:{type:"f",value:-1}};for(let a=0;a<Ft.MaxScenes;a++)o.sphericalHarmonics8BitCompressionRangeMin.value.push(-3/2),o.sphericalHarmonics8BitCompressionRangeMax.value.push(Ft.SphericalHarmonics8BitCompressionRange/2);if(t){const a=[];for(let c=0;c<Ft.MaxScenes;c++)a.push(1);o.sceneOpacity={type:"f",value:a};const l=[];for(let c=0;c<Ft.MaxScenes;c++)l.push(1);o.sceneVisibility={type:"i",value:l}}if(e){const a=[];for(let l=0;l<Ft.MaxScenes;l++)a.push(new Xe);o.transforms={type:"mat4",value:a}}return o}}class mm{static build(e=!1,t=!1,i=!1,r=2048,s=1,o=!1,a=0,l=.3,c=!0){let d=Qc.buildVertexShaderBase(e,t,a,"\n uniform vec2 covariancesTextureSize;\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D covariancesTextureHalfFloat;\n uniform int covariancesAreHalfFloat;\n\n void fromCovarianceHalfFloatV4(uvec4 val, out vec4 first, out vec4 second) {\n vec2 r = unpackHalf2x16(val.r);\n vec2 g = unpackHalf2x16(val.g);\n vec2 b = unpackHalf2x16(val.b);\n\n first = vec4(r.x, r.y, g.x, g.y);\n second = vec4(b.x, b.y, 0.0, 0.0);\n }\n ",c);d+=mm.buildVertexShaderProjection(i,t,r,l);const h=mm.buildFragmentShader(),f=Qc.getUniforms(e,t,a,s,o);return f.covariancesTextureSize={type:"v2",value:new qe(1024,1024)},f.covariancesTexture={type:"t",value:null},f.covariancesTextureHalfFloat={type:"t",value:null},f.covariancesAreHalfFloat={type:"i",value:0},new Pr({uniforms:f,vertexShader:d,fragmentShader:h,transparent:!0,alphaTest:1,blending:zo,depthTest:!0,depthWrite:!1,side:Cr})}static buildVertexShaderProjection(e,t,i,r){let s="\n\n vec4 sampledCovarianceA;\n vec4 sampledCovarianceB;\n vec3 cov3D_M11_M12_M13;\n vec3 cov3D_M22_M23_M33;\n if (covariancesAreHalfFloat == 0) {\n sampledCovarianceA = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset,\n covariancesTextureSize));\n sampledCovarianceB = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset + uint(1),\n covariancesTextureSize));\n\n cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rgb) * (1.0 - fOddOffset) +\n vec3(sampledCovarianceA.ba, sampledCovarianceB.r) * fOddOffset;\n cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg) * (1.0 - fOddOffset) +\n vec3(sampledCovarianceB.gba) * fOddOffset;\n } else {\n uvec4 sampledCovarianceU = texture(covariancesTextureHalfFloat, getDataUV(1, 0, covariancesTextureSize));\n fromCovarianceHalfFloatV4(sampledCovarianceU, sampledCovarianceA, sampledCovarianceB);\n cov3D_M11_M12_M13 = sampledCovarianceA.rgb;\n cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg);\n }\n \n // Construct the 3D covariance matrix\n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n\n mat3 J;\n if (orthographicMode == 1) {\n // Since the projection is linear, we don't need an approximation\n J = transpose(mat3(orthoZoom, 0.0, 0.0,\n 0.0, orthoZoom, 0.0,\n 0.0, 0.0, 0.0));\n } else {\n // Construct the Jacobian of the affine approximation of the projection matrix. It will be used to transform the\n // 3D covariance matrix instead of using the actual projection matrix because that transformation would\n // require a non-linear component (perspective division) which would yield a non-gaussian result.\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n J = mat3(\n focal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n 0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n 0., 0., 0.\n );\n }\n\n // Concatenate the projection approximation with the model-view transformation\n mat3 W = transpose(mat3(transformModelViewMatrix));\n mat3 T = W * J;\n\n // Transform the 3D covariance matrix (Vrk) to compute the 2D covariance matrix\n mat3 cov2Dm = transpose(T) * Vrk * T;\n ";return e?s+="\n float detOrig = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n cov2Dm[0][0] += ".concat(r,";\n cov2Dm[1][1] += ").concat(r,";\n float detBlur = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n vColor.a *= sqrt(max(detOrig / detBlur, 0.0));\n if (vColor.a < minAlpha) return;\n "):s+="\n cov2Dm[0][0] += ".concat(r,";\n cov2Dm[1][1] += ").concat(r,";\n "),s+="\n\n // We are interested in the upper-left 2x2 portion of the projected 3D covariance matrix because\n // we only care about the X and Y values. We want the X-diagonal, cov2Dm[0][0],\n // the Y-diagonal, cov2Dm[1][1], and the correlation between the two cov2Dm[0][1]. We don't\n // need cov2Dm[1][0] because it is a symetric matrix.\n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n // We now need to solve for the eigen-values and eigen vectors of the 2D covariance matrix\n // so that we can determine the 2D basis for the splat. This is done using the method described\n // here: https://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n // After calculating the eigen-values and eigen-vectors, we calculate the basis for rendering the splat\n // by normalizing the eigen-vectors and then multiplying them by (sqrt(8) * sqrt(eigen-value)), which is\n // equal to scaling them by sqrt(8) standard deviations.\n //\n // This is a different approach than in the original work at INRIA. In that work they compute the\n // max extents of the projected splat in screen space to form a screen-space aligned bounding rectangle\n // which forms the geometry that is actually rasterized. The dimensions of that bounding box are 3.0\n // times the square root of the maximum eigen-value, or 3 standard deviations. They then use the inverse\n // 2D covariance matrix (called 'conic') in the CUDA rendering thread to determine fragment opacity by\n // calculating the full gaussian: exp(-0.5 * (X - mean) * conic * (X - mean)) * splat opacity\n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(max(0.1f, traceOver2 * traceOver2 - D));\n float eigenValue1 = traceOver2 + term2;\n float eigenValue2 = traceOver2 - term2;\n\n if (pointCloudModeEnabled == 1) {\n eigenValue1 = eigenValue2 = 0.2;\n }\n\n if (eigenValue2 <= 0.0) return;\n\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n // since the eigen vectors are orthogonal, we derive the second one from the first\n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n\n // We use sqrt(8) standard deviations instead of 3 to eliminate more of the splat with a very low opacity.\n vec2 basisVector1 = eigenVector1 * splatScale * min(sqrt8 * sqrt(eigenValue1), ".concat(parseInt(i),".0);\n vec2 basisVector2 = eigenVector2 * splatScale * min(sqrt8 * sqrt(eigenValue2), ").concat(parseInt(i),".0);\n "),t&&(s+="\n vColor.a *= splatOpacityFromScene;\n "),s+="\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) *\n basisViewport * 2.0 * inverseFocalAdjustment;\n\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n // Scale the position data we send to the fragment shader\n vPosition *= sqrt8;\n ",s+=Qc.getVertexShaderFadeIn(),s+="}",s}static buildFragmentShader(){let e="\n precision highp float;\n #include <common>\n \n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying vec2 vSplatIndex;\n\n ";return e+="\n void main () {\n // Compute the positional squared distance from the center of the splat to the current fragment.\n float A = dot(vPosition, vPosition);\n // Since the positional data in vPosition has been scaled by sqrt(8), the squared result will be\n // scaled by a factor of 8. If the squared result is larger than 8, it means it is outside the ellipse\n // defined by the rectangle formed by vPosition. It also means it's farther\n // away than sqrt(8) standard deviations from the mean.\n\n // if(vSplatIndex.x > 20000.0) discard;\n // if (A > 8.0) discard;\n vec3 color = vColor.rgb;\n\n // Since the rendered splat is scaled by sqrt(8), the inverse covariance matrix that is part of\n // the gaussian formula becomes the identity matrix. We're then left with (X - mean) * (X - mean),\n // and since 'mean' is zero, we have X * X, which is the same as A:\n float opacity = exp( -0.5*A) * vColor.a;\n if(opacity < 1.0 / 255.0)\n discard;\n\n // uint a = uint(255);\n // vec3 c = vec3(vSplatIndex.x / 256.0 / 256.0, float(uint(vSplatIndex.x / 256.0 )% a) / 256.0, float(uint(vSplatIndex.x)% a) / 256.0);\n // gl_FragColor = vec4(c, 1.0);\n gl_FragColor = vec4(color, opacity);\n\n\n }\n ",e}}class gm{static build(e=!1,t=!1,i=1,r=!1,s=0){let a=Qc.buildVertexShaderBase(e,t,s,"\n uniform vec2 scaleRotationsTextureSize;\n uniform highp sampler2D scaleRotationsTexture;\n varying mat3 vT;\n varying vec2 vQuadCenter;\n varying vec2 vFragCoord;\n ");a+=gm.buildVertexShaderProjection();const l=gm.buildFragmentShader(),c=Qc.getUniforms(e,t,s,i,r);return c.scaleRotationsTexture={type:"t",value:null},c.scaleRotationsTextureSize={type:"v2",value:new qe(1024,1024)},new Pr({uniforms:c,vertexShader:a,fragmentShader:l,transparent:!0,alphaTest:1,blending:zo,depthTest:!0,depthWrite:!1,side:Cr})}static buildVertexShaderProjection(){let e="\n\n vec4 scaleRotationA = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\n oddOffset, scaleRotationsTextureSize));\n vec4 scaleRotationB = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\n oddOffset + uint(1), scaleRotationsTextureSize));\n\n vec3 scaleRotation123 = vec3(scaleRotationA.rgb) * (1.0 - fOddOffset) +\n vec3(scaleRotationA.ba, scaleRotationB.r) * fOddOffset;\n vec3 scaleRotation456 = vec3(scaleRotationA.a, scaleRotationB.rg) * (1.0 - fOddOffset) +\n vec3(scaleRotationB.gba) * fOddOffset;\n\n float missingW = sqrt(1.0 - scaleRotation456.x * scaleRotation456.x - scaleRotation456.y *\n scaleRotation456.y - scaleRotation456.z * scaleRotation456.z);\n mat3 R = quaternionToRotationMatrix(scaleRotation456.r, scaleRotation456.g, scaleRotation456.b, missingW);\n mat3 S = mat3(scaleRotation123.r, 0.0, 0.0,\n 0.0, scaleRotation123.g, 0.0,\n 0.0, 0.0, scaleRotation123.b);\n \n mat3 L = R * S;\n\n mat3x4 splat2World = mat3x4(vec4(L[0], 0.0),\n vec4(L[1], 0.0),\n vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\n\n mat4 world2ndc = transpose(projectionMatrix * transformModelViewMatrix);\n\n mat3x4 ndc2pix = mat3x4(vec4(viewport.x / 2.0, 0.0, 0.0, (viewport.x - 1.0) / 2.0),\n vec4(0.0, viewport.y / 2.0, 0.0, (viewport.y - 1.0) / 2.0),\n vec4(0.0, 0.0, 0.0, 1.0));\n\n mat3 T = transpose(splat2World) * world2ndc * ndc2pix;\n vec3 normal = vec3(viewMatrix * vec4(L[0][2], L[1][2], L[2][2], 0.0));\n ";return e+="\n\n mat4 splat2World4 = mat4(vec4(L[0], 0.0),\n vec4(L[1], 0.0),\n vec4(L[2], 0.0),\n vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\n\n mat4 Tt = transpose(transpose(splat2World4) * world2ndc);\n\n vec4 tempPoint1 = Tt * vec4(1.0, 0.0, 0.0, 1.0);\n tempPoint1 /= tempPoint1.w;\n\n vec4 tempPoint2 = Tt * vec4(0.0, 1.0, 0.0, 1.0);\n tempPoint2 /= tempPoint2.w;\n\n vec4 center = Tt * vec4(0.0, 0.0, 0.0, 1.0);\n center /= center.w;\n\n vec2 basisVector1 = tempPoint1.xy - center.xy;\n vec2 basisVector2 = tempPoint2.xy - center.xy;\n\n vec2 basisVector1Screen = basisVector1 * 0.5 * viewport;\n vec2 basisVector2Screen = basisVector2 * 0.5 * viewport;\n\n const float minPix = 1.;\n if (length(basisVector1Screen) < minPix || length(basisVector2Screen) < minPix) {\n ".concat("\n vec3 T0 = vec3(T[0][0], T[0][1], T[0][2]);\n vec3 T1 = vec3(T[1][0], T[1][1], T[1][2]);\n vec3 T3 = vec3(T[2][0], T[2][1], T[2][2]);\n\n vec3 tempPoint = vec3(1.0, 1.0, -1.0);\n float distance = (T3.x * T3.x * tempPoint.x) + (T3.y * T3.y * tempPoint.y) + (T3.z * T3.z * tempPoint.z);\n vec3 f = (1.0 / distance) * tempPoint;\n if (abs(distance) < 0.00001) return;\n\n float pointImageX = (T0.x * T3.x * f.x) + (T0.y * T3.y * f.y) + (T0.z * T3.z * f.z);\n float pointImageY = (T1.x * T3.x * f.x) + (T1.y * T3.y * f.y) + (T1.z * T3.z * f.z);\n vec2 pointImage = vec2(pointImageX, pointImageY);\n\n float tempX = (T0.x * T0.x * f.x) + (T0.y * T0.y * f.y) + (T0.z * T0.z * f.z);\n float tempY = (T1.x * T1.x * f.x) + (T1.y * T1.y * f.y) + (T1.z * T1.z * f.z);\n vec2 temp = vec2(tempX, tempY);\n\n vec2 halfExtend = pointImage * pointImage - temp;\n vec2 extent = sqrt(max(vec2(0.0001), halfExtend));\n float radius = max(extent.x, extent.y);\n\n vec2 ndcOffset = ((position.xy * radius * 3.0) * basisViewport * 2.0);\n\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n vT = T;\n vQuadCenter = pointImage;\n vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\n ","\n } else {\n vec2 ndcOffset = vec2(position.x * basisVector1 + position.y * basisVector2) * 3.0 * inverseFocalAdjustment;\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n vT = T;\n vQuadCenter = center.xy;\n vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\n }\n "),e+=Qc.getVertexShaderFadeIn(),e+="}",e}static buildFragmentShader(){return"\n precision highp float;\n #include <common>\n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying mat3 vT;\n varying vec2 vQuadCenter;\n varying vec2 vFragCoord;\n\n void main () {\n\n const float FilterInvSquare = 2.0;\n const float near_n = 0.2;\n const float T = 1.0;\n\n vec2 xy = vQuadCenter;\n vec3 Tu = vT[0];\n vec3 Tv = vT[1];\n vec3 Tw = vT[2];\n vec3 k = vFragCoord.x * Tw - Tu;\n vec3 l = vFragCoord.y * Tw - Tv;\n vec3 p = cross(k, l);\n if (p.z == 0.0) discard;\n vec2 s = vec2(p.x / p.z, p.y / p.z);\n float rho3d = (s.x * s.x + s.y * s.y); \n vec2 d = vec2(xy.x - vFragCoord.x, xy.y - vFragCoord.y);\n float rho2d = FilterInvSquare * (d.x * d.x + d.y * d.y); \n\n // compute intersection and depth\n float rho = min(rho3d, rho2d);\n float depth = (rho3d <= rho2d) ? (s.x * Tw.x + s.y * Tw.y) + Tw.z : Tw.z; \n if (depth < near_n) discard;\n // vec4 nor_o = collected_normal_opacity[j];\n // float normal[3] = {nor_o.x, nor_o.y, nor_o.z};\n float opa = vColor.a;\n\n float power = -0.5f * rho;\n if (power > 0.0f) discard;\n\n // Eq. (2) from 3D Gaussian splatting paper.\n // Obtain alpha by multiplying with Gaussian opacity\n // and its exponential falloff from mean.\n // Avoid numerical instabilities (see paper appendix). \n float alpha = min(0.99f, opa * exp(power));\n if (alpha < 1.0f / 255.0f) discard;\n float test_T = T * (1.0 - alpha);\n if (test_T < 0.0001)discard;\n\n float w = alpha * T;\n gl_FragColor = vec4(vColor.rgb, w);\n }\n "}}class wk{static build(e){const t=new ki;t.setIndex([0,1,2,0,2,3]);const i=new Float32Array(4*3),r=new xi(i,3);t.setAttribute("position",r),r.setXYZ(0,-1,-1,0),r.setXYZ(1,-1,1,0),r.setXYZ(2,1,1,0),r.setXYZ(3,1,-1,0),r.needsUpdate=!0;const s=new FL().copy(t),o=new Uint32Array(e),a=new jo(o,1,!1);return a.setUsage(ba),s.setAttribute("splatIndex",a),s.instanceCount=0,s}}class Ck extends nn{constructor(e,t=new Y,i=new Qt,r=new Y(1,1,1),s=1,o=1,a=!0){super(),this.splatBuffer=e,this.position.copy(t),this.quaternion.copy(i),this.scale.copy(r),this.transform=new Xe,this.minimumAlpha=s,this.opacity=o,this.visible=a}copyTransformData(e){this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.transform.copy(e.transform)}updateTransform(e){e?(this.matrixWorldAutoUpdate&&this.updateWorldMatrix(!0,!1),this.transform.copy(this.matrixWorld)):(this.matrixAutoUpdate&&this.updateMatrix(),this.transform.copy(this.matrix))}}const km=class km{constructor(e,t,i,r){this.min=new Y().copy(e),this.max=new Y().copy(t),this.boundingBox=new rr(this.min,this.max),this.center=new Y().copy(this.max).sub(this.min).multiplyScalar(.5).add(this.min),this.depth=i,this.children=[],this.data=null,this.id=r||km.idGen++}};xe(km,"idGen",0);let Vy=km;class Vd{constructor(e,t){this.maxDepth=e,this.maxCentersPerNode=t,this.sceneDimensions=new Y,this.sceneMin=new Y,this.sceneMax=new Y,this.rootNode=null,this.nodesWithIndexes=[],this.splatMesh=null}static convertWorkerSubTreeNode(e){const t=new Y().fromArray(e.min),i=new Y().fromArray(e.max),r=new Vy(t,i,e.depth,e.id);if(e.data.indexes){r.data={indexes:[]};for(let s of e.data.indexes)r.data.indexes.push(s)}if(e.children)for(let s of e.children)r.children.push(Vd.convertWorkerSubTreeNode(s));return r}static convertWorkerSubTree(e,t){const i=new Vd(e.maxDepth,e.maxCentersPerNode);i.sceneMin=new Y().fromArray(e.sceneMin),i.sceneMax=new Y().fromArray(e.sceneMax),i.splatMesh=t,i.rootNode=Vd.convertWorkerSubTreeNode(e.rootNode);const r=(s,o)=>{s.children.length===0&&o(s);for(let a of s.children)r(a,o)};return i.nodesWithIndexes=[],r(i.rootNode,s=>{s.data&&s.data.indexes&&s.data.indexes.length>0&&i.nodesWithIndexes.push(s)}),i}}function Ek(n){let e=0;class t{constructor(l,c){this.min=[l[0],l[1],l[2]],this.max=[c[0],c[1],c[2]]}containsPoint(l){return l[0]>=this.min[0]&&l[0]<=this.max[0]&&l[1]>=this.min[1]&&l[1]<=this.max[1]&&l[2]>=this.min[2]&&l[2]<=this.max[2]}}class i{constructor(l,c){this.maxDepth=l,this.maxCentersPerNode=c,this.sceneDimensions=[],this.sceneMin=[],this.sceneMax=[],this.rootNode=null,this.addedIndexes={},this.nodesWithIndexes=[],this.splatMesh=null,this.disposed=!1}}class r{constructor(l,c,u,d){this.min=[l[0],l[1],l[2]],this.max=[c[0],c[1],c[2]],this.center=[(c[0]-l[0])*.5+l[0],(c[1]-l[1])*.5+l[1],(c[2]-l[2])*.5+l[2]],this.depth=u,this.children=[],this.data=null,this.id=d||e++}}processSplatTreeNode=function(a,l,c,u){const d=l.data.indexes.length;if(d<a.maxCentersPerNode||l.depth>a.maxDepth){const v=[];for(let x=0;x<l.data.indexes.length;x++)a.addedIndexes[l.data.indexes[x]]||(v.push(l.data.indexes[x]),a.addedIndexes[l.data.indexes[x]]=!0);l.data.indexes=v,l.data.indexes.sort((x,_)=>x>_?1:-1),a.nodesWithIndexes.push(l);return}const h=[l.max[0]-l.min[0],l.max[1]-l.min[1],l.max[2]-l.min[2]],f=[h[0]*.5,h[1]*.5,h[2]*.5],p=[l.min[0]+f[0],l.min[1]+f[1],l.min[2]+f[2]],g=[new t([p[0]-f[0],p[1],p[2]-f[2]],[p[0],p[1]+f[1],p[2]]),new t([p[0],p[1],p[2]-f[2]],[p[0]+f[0],p[1]+f[1],p[2]]),new t([p[0],p[1],p[2]],[p[0]+f[0],p[1]+f[1],p[2]+f[2]]),new t([p[0]-f[0],p[1],p[2]],[p[0],p[1]+f[1],p[2]+f[2]]),new t([p[0]-f[0],p[1]-f[1],p[2]-f[2]],[p[0],p[1],p[2]]),new t([p[0],p[1]-f[1],p[2]-f[2]],[p[0]+f[0],p[1],p[2]]),new t([p[0],p[1]-f[1],p[2]],[p[0]+f[0],p[1],p[2]+f[2]]),new t([p[0]-f[0],p[1]-f[1],p[2]],[p[0],p[1],p[2]+f[2]])],y=[];for(let v=0;v<g.length;v++)y[v]=[];const m=[0,0,0];for(let v=0;v<d;v++){const x=l.data.indexes[v],_=c[x];m[0]=u[_],m[1]=u[_+1],m[2]=u[_+2];for(let S=0;S<g.length;S++)g[S].containsPoint(m)&&y[S].push(x)}for(let v=0;v<g.length;v++){const x=new r(g[v].min,g[v].max,l.depth+1);x.data={indexes:y[v]},l.children.push(x)}l.data={};for(let v of l.children)processSplatTreeNode(a,v,c,u)};const s=(a,l,c)=>{const u=[0,0,0],d=[0,0,0],h=[],f=Math.floor(a.length/4);for(let g=0;g<f;g++){const y=g*4,m=a[y],v=a[y+1],x=a[y+2],_=Math.round(a[y+3]);(g===0||m<u[0])&&(u[0]=m),(g===0||m>d[0])&&(d[0]=m),(g===0||v<u[1])&&(u[1]=v),(g===0||v>d[1])&&(d[1]=v),(g===0||x<u[2])&&(u[2]=x),(g===0||x>d[2])&&(d[2]=x),h.push(_)}const p=new i(l,c);return p.sceneMin=u,p.sceneMax=d,p.rootNode=new r(p.sceneMin,p.sceneMax,0),p.rootNode.data={indexes:h},p};function o(a,l,c){const u=[];for(let h of a){const f=Math.floor(h.length/4);for(let p=0;p<f;p++){const g=p*4,y=Math.round(h[g+3]);u[y]=g}}const d=[];for(let h of a){const f=s(h,l,c);d.push(f),processSplatTreeNode(f,f.rootNode,u,h)}n.postMessage({subTrees:d})}n.onmessage=a=>{a.data.process&&o(a.data.process.centers,a.data.process.maxDepth,a.data.process.maxCentersPerNode)}}function Mk(n,e,t,i,r){n.postMessage({process:{centers:e,maxDepth:i,maxCentersPerNode:r}},t)}function Rk(){return new Worker(URL.createObjectURL(new Blob(["(",Ek.toString(),")(self)"],{type:"application/javascript"})))}class Ik{constructor(e,t){xe(this,"processSplatMesh",(e,t=()=>!0,i,r)=>{this.splatTreeWorker||(this.splatTreeWorker=Rk()),this.splatMesh=e,this.subTrees=[];const s=new Y,o=(a,l)=>{const c=new Float32Array(l*4);let u=0;for(let d=0;d<l;d++){const h=d+a;if(t(h)){e.getSplatCenter(h,s);const f=u*4;c[f]=s.x,c[f+1]=s.y,c[f+2]=s.z,c[f+3]=h,u++}}return c};return new Promise(a=>{const l=()=>this.disposed?(this.diposeSplatTreeWorker(),a(),!0):!1;i&&i(!1),ms(()=>{if(l())return;const c=[];if(e.dynamicMode){let u=0;for(let d=0;d<e.scenes.length;d++){const f=e.getScene(d).splatBuffer.getSplatCount(),p=o(u,f);c.push(p),u+=f}}else{const u=o(0,e.getSplatCount());c.push(u)}this.splatTreeWorker.onmessage=u=>{l()||u.data.subTrees&&(r&&r(!1),ms(()=>{if(!l()){for(let d of u.data.subTrees){const h=Vd.convertWorkerSubTree(d,e);this.subTrees.push(h)}this.diposeSplatTreeWorker(),r&&r(!0),ms(()=>{a()})}}))},ms(()=>{if(l())return;i&&i(!0);const u=c.map(d=>d.buffer);Mk(this.splatTreeWorker,c,u,this.maxDepth,this.maxCentersPerNode)})})})});this.maxDepth=e,this.maxCentersPerNode=t,this.subTrees=[],this.splatMesh=null}dispose(){this.diposeSplatTreeWorker(),this.disposed=!0}diposeSplatTreeWorker(){this.splatTreeWorker&&this.splatTreeWorker.terminate(),this.splatTreeWorker=null}countLeaves(){let e=0;return this.visitLeaves(()=>{e++}),e}visitLeaves(e){const t=(i,r)=>{i.children.length===0&&r(i);for(let s of i.children)t(s,r)};for(let i of this.subTrees)t(i.rootNode,e)}}function Nk(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function Pk(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(A){if(A==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_TEXTURE_SIZE),p=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),m=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),x=h>0,_=o||e.has("OES_texture_float"),S=x&&_,E=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:h,maxTextureSize:f,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:y,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:x,floatFragmentTextures:_,floatVertexTextures:S,maxSamples:E}}const Hd={Default:0,Instant:2},jc={None:0,Info:3},XA=new ki,Lk=new Yr,Xf=6,$g=4,Dk=4,Fk=4,Ok=6,Bk=8,Gg=4,cd=4,KA=1,kk=.012,Uk=.003,YA=1,ZA=16777216;class oi extends pn{constructor(t=Eo.ThreeD,i=!1,r=!1,s=!1,o=1,a=!0,l=!1,c=!1,u=1024,d=jc.None,h=0,f=1,p=.3){super(XA,Lk);xe(this,"buildSplatTree",(t=[],i,r)=>new Promise(s=>{this.disposeSplatTree(),this.baseSplatTree=new Ik(8,1e3);const o=performance.now(),a=new Mt;this.baseSplatTree.processSplatMesh(this,l=>{this.getSplatColor(l,a);const c=this.getSceneIndexForSplat(l),u=t[c]||1;return a.w>=u},i,r).then(()=>{const l=performance.now()-o;if(this.logLevel>=jc.Info&&console.log("SplatTree build: "+l+" ms"),this.disposed)s();else{this.splatTree=this.baseSplatTree,this.baseSplatTree=null;let c=0,u=0,d=0;this.splatTree.visitLeaves(h=>{const f=h.data.indexes.length;f>0&&(u+=f,d++,c++)}),this.logLevel>=jc.Info&&(console.log("SplatTree leaves: ".concat(this.splatTree.countLeaves())),console.log("SplatTree leaves with splats:".concat(c)),u=u/d,console.log("Avg splat count per node: ".concat(u)),console.log("Total splat count: ".concat(this.getSplatCount()))),s()}})}));xe(this,"updateUniforms",function(){const t=new qe;return function(i,r,s,o,a,l){if(this.getSplatCount()>0){if(t.set(i.x*this.devicePixelRatio,i.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(t),this.material.uniforms.basisViewport.value.set(1/t.x,1/t.y),this.material.uniforms.focal.value.set(r,s),this.material.uniforms.orthographicMode.value=o?1:0,this.material.uniforms.orthoZoom.value=a,this.material.uniforms.inverseFocalAdjustment.value=l,this.dynamicMode)for(let u=0;u<this.scenes.length;u++)this.material.uniforms.transforms.value[u].copy(this.getScene(u).transform);if(this.enableOptionalEffects)for(let u=0;u<this.scenes.length;u++)this.material.uniforms.sceneOpacity.value[u]=gi(this.getScene(u).opacity,0,1),this.material.uniforms.sceneVisibility.value[u]=this.getScene(u).visible?1:0,this.material.uniformsNeedUpdate=!0;this.material.uniformsNeedUpdate=!0}}}());xe(this,"setupDistancesComputationTransformFeedback",function(){let t;return()=>{const i=this.getMaxSplatCount();if(!this.renderer)return;const r=this.lastRenderer!==this.renderer,s=t!==i;if(!r&&!s)return;r?this.disposeDistancesComputationGPUResources():s&&this.disposeDistancesComputationGPUBufferResources();const o=this.renderer.getContext(),a=(f,p,g)=>{const y=f.createShader(p);if(!y)return console.error("Fatal error: gl could not create a shader object."),null;if(f.shaderSource(y,g),f.compileShader(y),!f.getShaderParameter(y,f.COMPILE_STATUS)){let v="unknown";p===f.VERTEX_SHADER?v="vertex shader":p===f.FRAGMENT_SHADER&&(v="fragement shader");const x=f.getShaderInfoLog(y);return console.error("Failed to compile "+v+" with these errors:"+x),f.deleteShader(y),null}return y};let l;this.integerBasedDistancesComputation?(l="#version 300 es\n in ivec4 center;\n flat out int distance;",this.dynamicMode?l+="\n in uint sceneIndex;\n uniform ivec4 transforms[".concat(Ft.MaxScenes,"];\n void main(void) {\n ivec4 transform = transforms[sceneIndex];\n distance = center.x * transform.x + center.y * transform.y + center.z * transform.z + transform.w * center.w;\n }\n "):l+="\n uniform ivec3 modelViewProj;\n void main(void) {\n distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\n }\n "):(l="#version 300 es\n in vec4 center;\n flat out float distance;",this.dynamicMode?l+="\n in uint sceneIndex;\n uniform mat4 transforms[".concat(Ft.MaxScenes,"];\n void main(void) {\n vec4 transformedCenter = transforms[sceneIndex] * vec4(center.xyz, 1.0);\n distance = transformedCenter.z;\n }\n "):l+="\n uniform vec3 modelViewProj;\n void main(void) {\n distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\n }\n ");const c="#version 300 es\n precision lowp float;\n out vec4 fragColor;\n void main(){}\n ",u=o.getParameter(o.VERTEX_ARRAY_BINDING),d=o.getParameter(o.CURRENT_PROGRAM),h=d?o.getProgramParameter(d,o.DELETE_STATUS):!1;if(r&&(this.distancesTransformFeedback.vao=o.createVertexArray()),o.bindVertexArray(this.distancesTransformFeedback.vao),r){const f=o.createProgram(),p=a(o,o.VERTEX_SHADER,l),g=a(o,o.FRAGMENT_SHADER,c);if(!p||!g)throw new Error("Could not compile shaders for distances computation on GPU.");if(o.attachShader(f,p),o.attachShader(f,g),o.transformFeedbackVaryings(f,["distance"],o.SEPARATE_ATTRIBS),o.linkProgram(f),!o.getProgramParameter(f,o.LINK_STATUS)){const m=o.getProgramInfoLog(f);throw console.error("Fatal error: Failed to link program: "+m),o.deleteProgram(f),o.deleteShader(g),o.deleteShader(p),new Error("Could not link shaders for distances computation on GPU.")}this.distancesTransformFeedback.program=f,this.distancesTransformFeedback.vertexShader=p,this.distancesTransformFeedback.vertexShader=g}if(o.useProgram(this.distancesTransformFeedback.program),this.distancesTransformFeedback.centersLoc=o.getAttribLocation(this.distancesTransformFeedback.program,"center"),this.dynamicMode){this.distancesTransformFeedback.sceneIndexesLoc=o.getAttribLocation(this.distancesTransformFeedback.program,"sceneIndex");for(let f=0;f<this.scenes.length;f++)this.distancesTransformFeedback.transformsLocs[f]=o.getUniformLocation(this.distancesTransformFeedback.program,"transforms[".concat(f,"]"))}else this.distancesTransformFeedback.modelViewProjLoc=o.getUniformLocation(this.distancesTransformFeedback.program,"modelViewProj");(r||s)&&(this.distancesTransformFeedback.centersBuffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.distancesTransformFeedback.centersBuffer),o.enableVertexAttribArray(this.distancesTransformFeedback.centersLoc),this.integerBasedDistancesComputation?o.vertexAttribIPointer(this.distancesTransformFeedback.centersLoc,4,o.INT,0,0):o.vertexAttribPointer(this.distancesTransformFeedback.centersLoc,4,o.FLOAT,!1,0,0),this.dynamicMode&&(this.distancesTransformFeedback.sceneIndexesBuffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.distancesTransformFeedback.sceneIndexesBuffer),o.enableVertexAttribArray(this.distancesTransformFeedback.sceneIndexesLoc),o.vertexAttribIPointer(this.distancesTransformFeedback.sceneIndexesLoc,1,o.UNSIGNED_INT,0,0))),(r||s)&&(this.distancesTransformFeedback.outDistancesBuffer=o.createBuffer()),o.bindBuffer(o.ARRAY_BUFFER,this.distancesTransformFeedback.outDistancesBuffer),o.bufferData(o.ARRAY_BUFFER,i*4,o.STATIC_READ),r&&(this.distancesTransformFeedback.id=o.createTransformFeedback()),o.bindTransformFeedback(o.TRANSFORM_FEEDBACK,this.distancesTransformFeedback.id),o.bindBufferBase(o.TRANSFORM_FEEDBACK_BUFFER,0,this.distancesTransformFeedback.outDistancesBuffer),d&&h!==!0&&o.useProgram(d),u&&o.bindVertexArray(u),this.lastRenderer=this.renderer,t=i}}());xe(this,"fillTransformsArray",function(){const t=[];return function(i){t.length!==i.length&&(t.length=i.length);for(let r=0;r<this.scenes.length;r++){const o=this.getScene(r).transform.elements;for(let a=0;a<16;a++)t[r*16+a]=o[a]}i.set(t)}}());xe(this,"computeDistancesOnGPU",function(){const t=new Xe;return(i,r)=>{if(!this.renderer)return;const s=this.renderer.getContext(),o=s.getParameter(s.VERTEX_ARRAY_BINDING),a=s.getParameter(s.CURRENT_PROGRAM),l=a?s.getProgramParameter(a,s.DELETE_STATUS):!1;if(s.bindVertexArray(this.distancesTransformFeedback.vao),s.useProgram(this.distancesTransformFeedback.program),s.enable(s.RASTERIZER_DISCARD),this.dynamicMode)for(let d=0;d<this.scenes.length;d++)if(t.copy(this.getScene(d).transform),t.premultiply(i),this.integerBasedDistancesComputation){const h=oi.getIntegerMatrixArray(t),f=[h[2],h[6],h[10],h[14]];s.uniform4i(this.distancesTransformFeedback.transformsLocs[d],f[0],f[1],f[2],f[3])}else s.uniformMatrix4fv(this.distancesTransformFeedback.transformsLocs[d],!1,t.elements);else if(this.integerBasedDistancesComputation){const d=oi.getIntegerMatrixArray(i),h=[d[2],d[6],d[10]];s.uniform3i(this.distancesTransformFeedback.modelViewProjLoc,h[0],h[1],h[2])}else{const d=[i.elements[2],i.elements[6],i.elements[10]];s.uniform3f(this.distancesTransformFeedback.modelViewProjLoc,d[0],d[1],d[2])}s.bindBuffer(s.ARRAY_BUFFER,this.distancesTransformFeedback.centersBuffer),s.enableVertexAttribArray(this.distancesTransformFeedback.centersLoc),this.integerBasedDistancesComputation?s.vertexAttribIPointer(this.distancesTransformFeedback.centersLoc,4,s.INT,0,0):s.vertexAttribPointer(this.distancesTransformFeedback.centersLoc,4,s.FLOAT,!1,0,0),this.dynamicMode&&(s.bindBuffer(s.ARRAY_BUFFER,this.distancesTransformFeedback.sceneIndexesBuffer),s.enableVertexAttribArray(this.distancesTransformFeedback.sceneIndexesLoc),s.vertexAttribIPointer(this.distancesTransformFeedback.sceneIndexesLoc,1,s.UNSIGNED_INT,0,0)),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,this.distancesTransformFeedback.id),s.bindBufferBase(s.TRANSFORM_FEEDBACK_BUFFER,0,this.distancesTransformFeedback.outDistancesBuffer),s.beginTransformFeedback(s.POINTS),s.drawArrays(s.POINTS,0,this.getSplatCount()),s.endTransformFeedback(),s.bindBufferBase(s.TRANSFORM_FEEDBACK_BUFFER,0,null),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,null),s.disable(s.RASTERIZER_DISCARD);const c=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);s.flush();const u=new Promise(d=>{const h=()=>{if(this.disposed)d();else switch(s.clientWaitSync(c,0,0)){case s.TIMEOUT_EXPIRED:return this.computeDistancesOnGPUSyncTimeout=setTimeout(h),this.computeDistancesOnGPUSyncTimeout;case s.WAIT_FAILED:throw new Error("should never get here");default:this.computeDistancesOnGPUSyncTimeout=null,s.deleteSync(c);const y=s.getParameter(s.VERTEX_ARRAY_BINDING);s.bindVertexArray(this.distancesTransformFeedback.vao),s.bindBuffer(s.ARRAY_BUFFER,this.distancesTransformFeedback.outDistancesBuffer),s.getBufferSubData(s.ARRAY_BUFFER,0,r),s.bindBuffer(s.ARRAY_BUFFER,null),y&&s.bindVertexArray(y),d()}};this.computeDistancesOnGPUSyncTimeout=setTimeout(h)});return a&&l!==!0&&s.useProgram(a),o&&s.bindVertexArray(o),u}}());xe(this,"morphedMesh");xe(this,"getSplatCenter",function(){const t={};return function(i,r,s,o){this.getLocalSplatParameters(r,t,o),t.splatBuffer.getSplatCenter(i,t.localIndex,s,t.sceneTransform)}}());xe(this,"getSplatScaleAndRotation",function(){const t={},i=new Y;return function(r,s,o,a){this.getLocalSplatParameters(r,t,a),i.x=void 0,i.y=void 0,i.z=void 0,this.splatRenderMode===Eo.TwoD&&(i.z=0),t.splatBuffer.getSplatScaleAndRotation(t.localIndex,s,o,t.sceneTransform,i)}}());xe(this,"getSplatColor",function(){const t={};return function(i,r){this.getLocalSplatParameters(i,t),t.splatBuffer.getSplatColor(t.localIndex,r)}}());this.renderer=void 0,this.splatRenderMode=t,this.dynamicMode=i,this.enableOptionalEffects=r,this.halfPrecisionCovariancesOnGPU=s,this.devicePixelRatio=o,this.enableDistancesComputationOnGPU=a,this.integerBasedDistancesComputation=l,this.antialiased=c,this.kernel2DSize=p,this.maxScreenSpaceSplatSize=u,this.logLevel=d,this.sphericalHarmonicsDegree=h,this.minSphericalHarmonicsDegree=0,this.sceneFadeInRateMultiplier=f,this.scenes=[],this.splatTree=null,this.baseSplatTree=null,this.splatDataTextures={},this.flameModel=null,this.expressionBSNum=0,this.bsWeight=[],this.bonesMatrix=null,this.bonesNum=null,this.bonesWeight=null,this.gaussianSplatCount=null,this.useFlameModel=!0,this.morphTargetDictionary=null,this.distancesTransformFeedback={id:null,vertexShader:null,fragmentShader:null,program:null,centersBuffer:null,sceneIndexesBuffer:null,outDistancesBuffer:null,centersLoc:-1,modelViewProjLoc:-1,sceneIndexesLoc:-1,transformsLocs:[]},this.globalSplatIndexToLocalSplatIndexMap=[],this.globalSplatIndexToSceneIndexMap=[],this.lastBuildSplatCount=0,this.lastBuildScenes=[],this.lastBuildMaxSplatCount=0,this.lastBuildSceneCount=0,this.firstRenderTime=-1,this.finalBuild=!1,this.webGLUtils=null,this.boundingBox=new rr,this.calculatedSceneCenter=new Y,this.maxSplatDistanceFromSceneCenter=0,this.visibleRegionBufferRadius=0,this.visibleRegionRadius=0,this.visibleRegionFadeStartRadius=0,this.visibleRegionChanging=!1,this.splatScale=1,this.pointCloudModeEnabled=!1,this.disposed=!1,this.lastRenderer=null,this.visible=!1}static buildScenes(t,i,r){const s=[];s.length=i.length;for(let o=0;o<i.length;o++){const a=i[o],l=r[o]||{};let c=l.position||[0,0,0],u=l.rotation||[0,0,0,1],d=l.scale||[1,1,1];const h=new Y().fromArray(c),f=new Qt().fromArray(u),p=new Y().fromArray(d),g=oi.createScene(a,h,f,p,l.splatAlphaRemovalThreshold||1,l.opacity,l.visible);t.add(g),s[o]=g}return s}static createScene(t,i,r,s,o,a=1,l=!0){return new Ck(t,i,r,s,o,a,l)}static buildSplatIndexMaps(t){const i=[],r=[];let s=0;for(let o=0;o<t.length;o++){const l=t[o].getMaxSplatCount();for(let c=0;c<l;c++)i[s]=c,r[s]=o,s++}return{localSplatIndexMap:i,sceneIndexMap:r}}build(t,i,r=!0,s=!1,o,a,l=!0){this.sceneOptions=i,this.finalBuild=s;const c=oi.getTotalMaxSplatCountForSplatBuffers(t),u=oi.buildScenes(this,t,i);if(r)for(let y=0;y<this.scenes.length&&y<u.length;y++){const m=u[y],v=this.getScene(y);m.copyTransformData(v)}this.scenes=u;let d=3;for(let y of t){const m=y.getMinSphericalHarmonicsDegree();m<d&&(d=m)}this.minSphericalHarmonicsDegree=Math.min(d,this.sphericalHarmonicsDegree);let h=!1;if(t.length!==this.lastBuildScenes.length)h=!0;else for(let y=0;y<t.length;y++)if(t[y]!==this.lastBuildScenes[y].splatBuffer){h=!0;break}let f=!0;if((this.scenes.length!==1||this.lastBuildSceneCount!==this.scenes.length||this.lastBuildMaxSplatCount!==c||h)&&(f=!1),!f){this.boundingBox=new rr,l||(this.maxSplatDistanceFromSceneCenter=0,this.visibleRegionBufferRadius=0,this.visibleRegionRadius=0,this.visibleRegionFadeStartRadius=0,this.firstRenderTime=-1),this.lastBuildScenes=[],this.lastBuildSplatCount=0,this.lastBuildMaxSplatCount=0,this.disposeMeshData(),this.geometry=wk.build(c),this.splatRenderMode===Eo.ThreeD?this.material=mm.build(this.dynamicMode,this.enableOptionalEffects,this.antialiased,this.maxScreenSpaceSplatSize,this.splatScale,this.pointCloudModeEnabled,this.minSphericalHarmonicsDegree,this.kernel2DSize,this.useFlameModel):this.material=gm.build(this.dynamicMode,this.enableOptionalEffects,this.splatScale,this.pointCloudModeEnabled,this.minSphericalHarmonicsDegree);const y=oi.buildSplatIndexMaps(t);this.globalSplatIndexToLocalSplatIndexMap=y.localSplatIndexMap,this.globalSplatIndexToSceneIndexMap=y.sceneIndexMap}const p=this.getSplatCount(!0);this.enableDistancesComputationOnGPU&&this.setupDistancesComputationTransformFeedback();const g=this.refreshGPUDataFromSplatBuffers(f);for(let y=0;y<this.scenes.length;y++)this.lastBuildScenes[y]=this.scenes[y];return this.lastBuildSplatCount=p,this.lastBuildMaxSplatCount=this.getMaxSplatCount(),this.lastBuildSceneCount=this.scenes.length,this.visible=this.scenes.length>0,g}freeIntermediateSplatData(){const t=i=>{delete i.source.data,delete i.image,i.onUpdate=null};delete this.splatDataTextures.baseData.covariances,delete this.splatDataTextures.baseData.centers,delete this.splatDataTextures.baseData.colors,delete this.splatDataTextures.baseData.sphericalHarmonics,delete this.splatDataTextures.centerColors.data,delete this.splatDataTextures.covariances.data,this.splatDataTextures.sphericalHarmonics&&delete this.splatDataTextures.sphericalHarmonics.data,this.splatDataTextures.sceneIndexes&&delete this.splatDataTextures.sceneIndexes.data,this.splatDataTextures.centerColors.texture.needsUpdate=!0,this.splatDataTextures.centerColors.texture.onUpdate=()=>{t(this.splatDataTextures.centerColors.texture)},this.splatDataTextures.flameModelPosTexture.texture.needsUpdate=!0,this.splatDataTextures.flameModelPosTexture.texture.onUpdate=()=>{t(this.splatDataTextures.flameModelPosTexture.texture)},this.splatDataTextures.covariances.texture.needsUpdate=!0,this.splatDataTextures.covariances.texture.onUpdate=()=>{t(this.splatDataTextures.covariances.texture)},this.splatDataTextures.sphericalHarmonics&&(this.splatDataTextures.sphericalHarmonics.texture?(this.splatDataTextures.sphericalHarmonics.texture.needsUpdate=!0,this.splatDataTextures.sphericalHarmonics.texture.onUpdate=()=>{t(this.splatDataTextures.sphericalHarmonics.texture)}):this.splatDataTextures.sphericalHarmonics.textures.forEach(i=>{i.needsUpdate=!0,i.onUpdate=()=>{t(i)}})),this.splatDataTextures.sceneIndexes&&(this.splatDataTextures.sceneIndexes.texture.needsUpdate=!0,this.splatDataTextures.sceneIndexes.texture.onUpdate=()=>{t(this.splatDataTextures.sceneIndexes.texture)})}dispose(){this.disposeMeshData(),this.disposeTextures(),this.disposeSplatTree(),this.enableDistancesComputationOnGPU&&(this.computeDistancesOnGPUSyncTimeout&&(clearTimeout(this.computeDistancesOnGPUSyncTimeout),this.computeDistancesOnGPUSyncTimeout=null),this.disposeDistancesComputationGPUResources()),this.scenes=[],this.distancesTransformFeedback={id:null,vertexShader:null,fragmentShader:null,program:null,centersBuffer:null,sceneIndexesBuffer:null,outDistancesBuffer:null,centersLoc:-1,modelViewProjLoc:-1,sceneIndexesLoc:-1,transformsLocs:[]},this.renderer=null,this.globalSplatIndexToLocalSplatIndexMap=[],this.globalSplatIndexToSceneIndexMap=[],this.lastBuildSplatCount=0,this.lastBuildScenes=[],this.lastBuildMaxSplatCount=0,this.lastBuildSceneCount=0,this.firstRenderTime=-1,this.finalBuild=!1,this.webGLUtils=null,this.boundingBox=new rr,this.calculatedSceneCenter=new Y,this.maxSplatDistanceFromSceneCenter=0,this.visibleRegionBufferRadius=0,this.visibleRegionRadius=0,this.visibleRegionFadeStartRadius=0,this.visibleRegionChanging=!1,this.splatScale=1,this.pointCloudModeEnabled=!1,this.disposed=!0,this.lastRenderer=null,this.visible=!1}disposeMeshData(){this.geometry&&this.geometry!==XA&&(this.geometry.dispose(),this.geometry=null),this.material&&(this.material.dispose(),this.material=null)}disposeTextures(){for(let t in this.splatDataTextures)if(this.splatDataTextures.hasOwnProperty(t)){const i=this.splatDataTextures[t];i.texture&&(i.texture.dispose(),i.texture=null)}this.splatDataTextures=null}disposeSplatTree(){this.splatTree&&(this.splatTree.dispose(),this.splatTree=null),this.baseSplatTree&&(this.baseSplatTree.dispose(),this.baseSplatTree=null)}getSplatTree(){return this.splatTree}onSplatTreeReady(t){this.onSplatTreeReadyCallback=t}getDataForDistancesComputation(t,i){const r=this.integerBasedDistancesComputation?this.getIntegerCenters(t,i,!0):this.getFloatCenters(t,i,!0),s=this.getSceneIndexes(t,i);return{centers:r,sceneIndexes:s}}refreshGPUDataFromSplatBuffers(t){const i=this.getSplatCount(!0);this.refreshDataTexturesFromSplatBuffers(t);const r=t?this.lastBuildSplatCount:0,{centers:s,sceneIndexes:o}=this.getDataForDistancesComputation(r,i-1);return this.enableDistancesComputationOnGPU&&this.refreshGPUBuffersForDistancesComputation(s,o,t),{from:r,to:i-1,count:i-r,centers:s,sceneIndexes:o}}refreshGPUBuffersForDistancesComputation(t,i,r=!1){const s=r?this.lastBuildSplatCount:0;this.updateGPUCentersBufferForDistancesComputation(r,t,s),this.updateGPUTransformIndexesBufferForDistancesComputation(r,i,s)}refreshDataTexturesFromSplatBuffers(t){const i=this.getSplatCount(!0),r=this.lastBuildSplatCount,s=i-1;t?this.updateBaseDataFromSplatBuffers(r,s):(this.setupDataTextures(),this.updateBaseDataFromSplatBuffers()),this.updateDataTexturesFromBaseData(r,s),this.updateVisibleRegion(t)}setupDataTextures(){const t=this.getMaxSplatCount(),i=this.getSplatCount(!0);this.disposeTextures();const r=(R,w)=>{const M=new qe(4096,1024);for(;M.x*M.y*R<t*w;)M.y*=2;return M},s=R=>R>=1?Ok:Dk,o=R=>{const w=s(R),M=r(w,6);return{elementsPerTexelStored:w,texSize:M}};let a=this.getTargetCovarianceCompressionLevel();const l=0,c=this.getTargetSphericalHarmonicsCompressionLevel();let u,d,h;if(this.splatRenderMode===Eo.ThreeD){const R=o(a);R.texSize.x*R.texSize.y>ZA&&a===0&&(a=1),u=new Float32Array(t*Xf)}else d=new Float32Array(t*3),h=new Float32Array(t*4);const f=new Float32Array(t*3),p=new Uint8Array(t*4);let g=Float32Array;c===1?g=Uint16Array:c===2&&(g=Uint8Array);const y=Gc(this.minSphericalHarmonicsDegree),m=this.minSphericalHarmonicsDegree?new g(t*y):void 0,v=r(cd,4),x=new Uint32Array(v.x*v.y*cd);oi.updateCenterColorsPaddedData(0,i-1,f,p,x);const _=new vr(x,v.x,v.y,wo,Ni);if(_.internalFormat="RGBA32UI",_.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=_,this.material.uniforms.centersColorsTextureSize.value.copy(v),this.material.uniformsNeedUpdate=!0,this.splatDataTextures={baseData:{covariances:u,scales:d,rotations:h,centers:f,colors:p,sphericalHarmonics:m},centerColors:{data:x,texture:_,size:v}},this.splatRenderMode===Eo.ThreeD){const R=o(a),w=R.elementsPerTexelStored,M=R.texSize;let I=a>=1?Uint32Array:Float32Array;const L=a>=1?Bk:Fk,k=new I(M.x*M.y*L);a===0?k.set(u):oi.updatePaddedCompressedCovariancesTextureData(u,k,0,0,u.length);let T;if(a>=1)T=new vr(k,M.x,M.y,wo,Ni),T.internalFormat="RGBA32UI",this.material.uniforms.covariancesTextureHalfFloat.value=T;else{T=new vr(k,M.x,M.y,Di,ir),this.material.uniforms.covariancesTexture.value=T;const F=new vr(new Uint32Array(32),2,2,wo,Ni);F.internalFormat="RGBA32UI",this.material.uniforms.covariancesTextureHalfFloat.value=F,F.needsUpdate=!0}T.needsUpdate=!0,this.material.uniforms.covariancesAreHalfFloat.value=a>=1?1:0,this.material.uniforms.covariancesTextureSize.value.copy(M),this.splatDataTextures.covariances={data:k,texture:T,size:M,compressionLevel:a,elementsPerTexelStored:w,elementsPerTexelAllocated:L}}else{const w=r(Gg,6);let M=Float32Array,I=ir;const L=new M(w.x*w.y*Gg);oi.updateScaleRotationsPaddedData(0,i-1,d,h,L);const k=new vr(L,w.x,w.y,Di,I);k.needsUpdate=!0,this.material.uniforms.scaleRotationsTexture.value=k,this.material.uniforms.scaleRotationsTextureSize.value.copy(w),this.splatDataTextures.scaleRotations={data:L,texture:k,size:w,compressionLevel:l}}if(m){const R=c===2?Js:Ts;let w=y;w%2!==0&&w++;const M=this.minSphericalHarmonicsDegree===2?4:2,I=M===4?Di:oh;let L=r(M,w);if(L.x*L.y<=ZA){const k=L.x*L.y*M,T=new g(k);for(let V=0;V<i;V++){const Q=y*V,ee=w*V;for(let se=0;se<y;se++)T[ee+se]=m[Q+se]}const F=new vr(T,L.x,L.y,I,R);F.needsUpdate=!0,this.material.uniforms.sphericalHarmonicsTexture.value=F,this.splatDataTextures.sphericalHarmonics={componentCount:y,paddedComponentCount:w,data:T,textureCount:1,texture:F,size:L,compressionLevel:c,elementsPerTexel:M}}else{const k=y/3;w=k,w%2!==0&&w++,L=r(M,w);const T=L.x*L.y*M,F=[this.material.uniforms.sphericalHarmonicsTextureR,this.material.uniforms.sphericalHarmonicsTextureG,this.material.uniforms.sphericalHarmonicsTextureB],V=[],Q=[];for(let ee=0;ee<3;ee++){const se=new g(T);V.push(se);for(let ie=0;ie<i;ie++){const re=y*ie,be=w*ie;if(k>=3){for(let le=0;le<3;le++)se[be+le]=m[re+ee*3+le];if(k>=8)for(let le=0;le<5;le++)se[be+3+le]=m[re+9+ee*5+le]}}const he=new vr(se,L.x,L.y,I,R);Q.push(he),he.needsUpdate=!0,F[ee].value=he}this.material.uniforms.sphericalHarmonicsMultiTextureMode.value=1,this.splatDataTextures.sphericalHarmonics={componentCount:y,componentCountPerChannel:k,paddedComponentCount:w,data:V,textureCount:3,textures:Q,size:L,compressionLevel:c,elementsPerTexel:M}}this.material.uniforms.sphericalHarmonicsTextureSize.value.copy(L),this.material.uniforms.sphericalHarmonics8BitMode.value=c===2?1:0;for(let k=0;k<this.scenes.length;k++){const T=this.scenes[k].splatBuffer;this.material.uniforms.sphericalHarmonics8BitCompressionRangeMin.value[k]=T.minSphericalHarmonicsCoeff,this.material.uniforms.sphericalHarmonics8BitCompressionRangeMax.value[k]=T.maxSphericalHarmonicsCoeff}this.material.uniformsNeedUpdate=!0}const S=r(KA,4),E=new Uint32Array(S.x*S.y*KA);for(let R=0;R<i;R++)E[R]=this.globalSplatIndexToSceneIndexMap[R];const A=new vr(E,S.x,S.y,Jm,Ni);A.internalFormat="R32UI",A.needsUpdate=!0,this.material.uniforms.sceneIndexesTexture.value=A,this.material.uniforms.sceneIndexesTextureSize.value.copy(S),this.material.uniformsNeedUpdate=!0,this.splatDataTextures.sceneIndexes={data:E,texture:A,size:S},this.material.uniforms.sceneCount.value=this.scenes.length,this.expressionBSNum=this.flameModel.geometry.morphAttributes.position.length,this.material.uniforms.bsCount.value=this.expressionBSNum,this.flameModel.skeleton.bones.forEach((R,w)=>{R.name=="head"&&(this.material.uniforms.headBoneIndex.value=w)}),this.buildModelTexture(this.flameModel),this.buildBoneMatrixTexture(),this.useFlameModel&&this.buildBoneWeightTexture(this.flameModel)}buildBoneMatrixTexture(){if(!this.bsWeight)return;const t=new qe(4,32);let i=new Float32Array(this.bonesMatrix),r=new Uint32Array(t.x*t.y*4);if(this.morphTargetDictionary=this.flameModel.morphTargetDictionary,this.useFlameModel){for(let o=0;o<this.bonesNum*16;o++)r[o]=Vi(i[o]);this.flameModel&&this.flameModel.skeleton&&(this.material.uniforms.boneTexture0.value=this.flameModel.skeleton.boneTexture,this.material.uniforms.bindMatrix.value=this.flameModel.bindMatrix,this.material.uniforms.bindMatrixInverse.value=this.flameModel.bindMatrixInverse)}for(const o in this.bsWeight)if(this.bsWeight.hasOwnProperty(o)){const a=this.bsWeight[o],l=this.morphTargetDictionary[o];r[l+this.bonesNum*16]=Vi(a)}const s=new vr(r,t.x,t.y,wo,Ni);s.internalFormat="RGBA32UI",s.needsUpdate=!0,this.material.uniforms.boneTexture.value=s,this.material.uniforms.boneTextureSize.value.copy(t),this.material.uniformsNeedUpdate=!0,this.splatDataTextures.boneMatrix={data:r,texture:s,size:t},this.splatDataTextures.baseData.boneMatrix=r}updateBoneMatrixTexture(t=!1){if(!(!this.bsWeight||!this.morphTargetDictionary)){if(t==!0){let i=new Float32Array(this.bonesMatrix);for(let r=0;r<this.bonesNum*16;r++)this.splatDataTextures.baseData.boneMatrix[r]=Vi(i[r])}for(const i in this.bsWeight)if(this.bsWeight.hasOwnProperty(i)){const r=this.bsWeight[i],s=this.morphTargetDictionary[i];this.splatDataTextures.baseData.boneMatrix[s+this.bonesNum*16]=Vi(r)}this.splatDataTextures.boneMatrix.texture.data=this.splatDataTextures.baseData.boneMatrix,this.splatDataTextures.boneMatrix.texture.needsUpdate=!0,this.material.uniforms.boneTexture.value=this.splatDataTextures.boneMatrix.texture,this.flameModel.skeleton&&(this.material.uniforms.boneTexture0.value=this.flameModel.skeleton.boneTexture,this.material.uniforms.bindMatrix.value=this.flameModel.bindMatrix,this.material.uniforms.bindMatrixInverse.value=this.flameModel.bindMatrixInverse),this.material.uniformsNeedUpdate=!0}}buildBoneWeightTexture(t){let r=t.geometry.attributes.position.array.length/3;const s=new qe(512,512);let o=new Float32Array(s.x*s.y*4),a=new Uint32Array(s.x*s.y*4);for(let c=0;c<r;c++)o[c*8+0]=this.bonesWeight[c][0],o[c*8+1]=this.bonesWeight[c][1],o[c*8+2]=this.bonesWeight[c][2],o[c*8+3]=this.bonesWeight[c][3],o[c*8+4]=this.bonesWeight[c][4],a[c*8+0]=Vi(this.bonesWeight[c][0]),a[c*8+1]=Vi(this.bonesWeight[c][1]),a[c*8+2]=Vi(this.bonesWeight[c][2]),a[c*8+3]=Vi(this.bonesWeight[c][3]),a[c*8+4]=Vi(this.bonesWeight[c][4]);const l=new vr(a,s.x,s.y,wo,Ni);l.internalFormat="RGBA32UI",l.needsUpdate=!0,this.material.uniforms.boneWeightTexture.value=l,this.material.uniforms.boneWeightTextureSize.value.copy(s),this.material.uniformsNeedUpdate=!0,this.splatDataTextures.boneWeight={data:a,texture:l,size:s},this.splatDataTextures.baseData.boneWeight=a}buildModelTexture(t){const i=new qe(4096,2048);var r=t.geometry.attributes.position.array,s=[];let o=r.length/3,a=t.geometry.morphAttributes.position.length;Object.keys(t.morphTargetDictionary).forEach((h,f)=>{const p=t.morphTargetDictionary[h];var g=t.geometry.morphAttributes.position[p];s=s.concat(Array.from(g.array))}),s=s.concat(Array.from(r));let c=new Float32Array(i.x*i.y*4),u=new Uint32Array(i.x*i.y*4);for(let h=0;h<o*(a+1);h++)c[h*4+0]=s[h*3+0],c[h*4+1]=s[h*3+1],c[h*4+2]=s[h*3+2],u[h*4+0]=Vi(c[h*4+0]),u[h*4+1]=Vi(c[h*4+1]),u[h*4+2]=Vi(c[h*4+2]);const d=new vr(u,i.x,i.y,wo,Ni);d.internalFormat="RGBA32UI",d.needsUpdate=!0,this.material.uniforms.flameModelTexture.value=d,this.material.uniforms.flameModelTextureSize.value.copy(i),this.material.uniformsNeedUpdate=!0,this.material.uniforms.gaussianSplatCount.value=this.gaussianSplatCount,this.splatDataTextures.flameModel={data:u,texture:d,size:i},this.splatDataTextures.baseData.flameModelPos=c}updateTetureAfterBSAndSkeleton(t,i,r=!0){const s=new Xe;this.getSceneTransform(0,s),this.getScene(0).splatBuffer.fillSplatCenterArray(this.morphedMesh,this.splatDataTextures.baseData.centers,s,t,i,0);const o=this.splatDataTextures.centerColors,a=o.data,l=o.texture;oi.updateCenterColorsPaddedData(t,i,this.splatDataTextures.baseData.centers,this.splatDataTextures.baseData.colors,a);const c=this.renderer?this.renderer.properties.get(l):null;!c||!c.__webglTexture?l.needsUpdate=!0:this.updateDataTexture(a,o.texture,o.size,c,cd,$g,4,t,i),this.updateBoneMatrixTexture(r)}updateBaseDataFromSplatBuffers(t,i){const r=this.splatDataTextures.covariances,s=r?r.compressionLevel:void 0,o=this.splatDataTextures.scaleRotations,a=o?o.compressionLevel:void 0,l=this.splatDataTextures.sphericalHarmonics,c=l?l.compressionLevel:0;this.fillSplatDataArrays(this.splatDataTextures.baseData.covariances,this.splatDataTextures.baseData.scales,this.splatDataTextures.baseData.rotations,this.splatDataTextures.baseData.centers,this.splatDataTextures.baseData.colors,this.splatDataTextures.baseData.sphericalHarmonics,this.splatDataTextures.baseData.flameModelPos,void 0,s,a,c,t,i,t)}updateDataTexturesFromBaseData(t,i){const r=this.splatDataTextures.covariances,s=r?r.compressionLevel:void 0,o=this.splatDataTextures.scaleRotations,a=o?o.compressionLevel:void 0,l=this.splatDataTextures.sphericalHarmonics,c=l?l.compressionLevel:0,u=this.splatDataTextures.flameModel,d=u.data,h=u.texture,f=this.renderer?this.renderer.properties.get(h):null;!f||!f.__webglTexture?h.needsUpdate=!0:this.updateDataTexture(d,u.texture,u.size,f,cd,$g,3,t,i);const p=this.splatDataTextures.centerColors,g=p.data,y=p.texture;oi.updateCenterColorsPaddedData(t,i,this.splatDataTextures.baseData.centers,this.splatDataTextures.baseData.colors,g);const m=this.renderer?this.renderer.properties.get(y):null;if(!m||!m.__webglTexture?y.needsUpdate=!0:this.updateDataTexture(g,p.texture,p.size,m,cd,$g,4,t,i),r){const A=r.texture,R=t*Xf,w=i*Xf;if(s===0)for(let I=R;I<=w;I++){const L=this.splatDataTextures.baseData.covariances[I];r.data[I]=L}else oi.updatePaddedCompressedCovariancesTextureData(this.splatDataTextures.baseData.covariances,r.data,t*r.elementsPerTexelAllocated,R,w);const M=this.renderer?this.renderer.properties.get(A):null;!M||!M.__webglTexture?A.needsUpdate=!0:s===0?this.updateDataTexture(r.data,r.texture,r.size,M,r.elementsPerTexelStored,Xf,4,t,i):this.updateDataTexture(r.data,r.texture,r.size,M,r.elementsPerTexelAllocated,r.elementsPerTexelAllocated,2,t,i)}if(o){const A=o.data,R=o.texture,w=6,M=a===0?4:2;oi.updateScaleRotationsPaddedData(t,i,this.splatDataTextures.baseData.scales,this.splatDataTextures.baseData.rotations,A);const I=this.renderer?this.renderer.properties.get(R):null;!I||!I.__webglTexture?R.needsUpdate=!0:this.updateDataTexture(A,o.texture,o.size,I,Gg,w,M,t,i)}const v=this.splatDataTextures.baseData.sphericalHarmonics;if(v){let A=4;c===1?A=2:c===2&&(A=1);const R=(I,L,k,T,F)=>{const V=this.renderer?this.renderer.properties.get(I):null;!V||!V.__webglTexture?I.needsUpdate=!0:this.updateDataTexture(T,I,L,V,k,F,A,t,i)},w=l.componentCount,M=l.paddedComponentCount;if(l.textureCount===1){const I=l.data;for(let L=t;L<=i;L++){const k=w*L,T=M*L;for(let F=0;F<w;F++)I[T+F]=v[k+F]}R(l.texture,l.size,l.elementsPerTexel,I,M)}else{const I=l.componentCountPerChannel;for(let L=0;L<3;L++){const k=l.data[L];for(let T=t;T<=i;T++){const F=w*T,V=M*T;if(I>=3){for(let Q=0;Q<3;Q++)k[V+Q]=v[F+L*3+Q];if(I>=8)for(let Q=0;Q<5;Q++)k[V+3+Q]=v[F+9+L*5+Q]}}R(l.textures[L],l.size,l.elementsPerTexel,k,M)}}}const x=this.splatDataTextures.sceneIndexes,_=x.data;for(let A=this.lastBuildSplatCount;A<=i;A++)_[A]=this.globalSplatIndexToSceneIndexMap[A];const S=x.texture,E=this.renderer?this.renderer.properties.get(S):null;!E||!E.__webglTexture?S.needsUpdate=!0:this.updateDataTexture(_,x.texture,x.size,E,1,1,1,this.lastBuildSplatCount,i)}getTargetCovarianceCompressionLevel(){return this.halfPrecisionCovariancesOnGPU?1:0}getTargetSphericalHarmonicsCompressionLevel(){return Math.max(1,this.getMaximumSplatBufferCompressionLevel())}getMaximumSplatBufferCompressionLevel(){let t;for(let i=0;i<this.scenes.length;i++){const s=this.getScene(i).splatBuffer;(i===0||s.compressionLevel>t)&&(t=s.compressionLevel)}return t}getMinimumSplatBufferCompressionLevel(){let t;for(let i=0;i<this.scenes.length;i++){const s=this.getScene(i).splatBuffer;(i===0||s.compressionLevel<t)&&(t=s.compressionLevel)}return t}static computeTextureUpdateRegion(t,i,r,s,o){const a=o/s,l=t*a,c=Math.floor(l/r),u=c*r*s,d=i*a,h=Math.floor(d/r),f=h*r*s+r*s;return{dataStart:u,dataEnd:f,startRow:c,endRow:h}}updateDataTexture(t,i,r,s,o,a,l,c,u){const d=this.renderer.getContext(),h=oi.computeTextureUpdateRegion(c,u,r.x,o,a),f=h.dataEnd-h.dataStart,p=new t.constructor(t.buffer,h.dataStart*l,f),g=h.endRow-h.startRow+1,y=this.webGLUtils.convert(i.type),m=this.webGLUtils.convert(i.format,i.colorSpace),v=d.getParameter(d.TEXTURE_BINDING_2D);d.bindTexture(d.TEXTURE_2D,s.__webglTexture),d.texSubImage2D(d.TEXTURE_2D,0,0,h.startRow,r.x,g,m,y,p),d.bindTexture(d.TEXTURE_2D,v)}static updatePaddedCompressedCovariancesTextureData(t,i,r,s,o){let a=new DataView(i.buffer),l=r,c=0;for(let u=s;u<=o;u+=2)a.setUint16(l*2,t[u],!0),a.setUint16(l*2+2,t[u+1],!0),l+=2,c++,c>=3&&(l+=2,c=0)}static updateCenterColorsPaddedData(t,i,r,s,o){for(let a=t;a<=i;a++){const l=a*4,c=a*3,u=a*4;o[u]=SN(s,l),o[u+1]=Vi(r[c]),o[u+2]=Vi(r[c+1]),o[u+3]=Vi(r[c+2])}}static updateScaleRotationsPaddedData(t,i,r,s,o){for(let l=t;l<=i;l++){const c=l*3,u=l*4,d=l*6;o[d]=r[c],o[d+1]=r[c+1],o[d+2]=r[c+2],o[d+3]=s[u],o[d+4]=s[u+1],o[d+5]=s[u+2]}}updateVisibleRegion(t){const i=this.getSplatCount(!0),r=new Y;if(!t){const o=new Y;this.scenes.forEach(a=>{o.add(a.splatBuffer.sceneCenter)}),o.multiplyScalar(1/this.scenes.length),this.calculatedSceneCenter.copy(o),this.material.uniforms.sceneCenter.value.copy(this.calculatedSceneCenter),this.material.uniformsNeedUpdate=!0}const s=t?this.lastBuildSplatCount:0;for(let o=s;o<i;o++){this.getSplatCenter(this.morphedMesh,o,r,!0);const a=r.sub(this.calculatedSceneCenter).length();a>this.maxSplatDistanceFromSceneCenter&&(this.maxSplatDistanceFromSceneCenter=a)}this.maxSplatDistanceFromSceneCenter-this.visibleRegionBufferRadius>YA&&(this.visibleRegionBufferRadius=this.maxSplatDistanceFromSceneCenter,this.visibleRegionRadius=Math.max(this.visibleRegionBufferRadius-YA,0)),this.finalBuild&&(this.visibleRegionRadius=this.visibleRegionBufferRadius=this.maxSplatDistanceFromSceneCenter),this.updateVisibleRegionFadeDistance()}updateVisibleRegionFadeDistance(t=Hd.Default){const i=kk*this.sceneFadeInRateMultiplier,r=Uk*this.sceneFadeInRateMultiplier,s=this.finalBuild?i:r,o=t===Hd.Default?s:r;this.visibleRegionFadeStartRadius=(this.visibleRegionRadius-this.visibleRegionFadeStartRadius)*o+this.visibleRegionFadeStartRadius;const l=(this.visibleRegionBufferRadius>0?this.visibleRegionFadeStartRadius/this.visibleRegionBufferRadius:0)>.99,c=l||t===Hd.Instant?1:0;this.material.uniforms.visibleRegionFadeStartRadius.value=this.visibleRegionFadeStartRadius,this.material.uniforms.visibleRegionRadius.value=this.visibleRegionRadius,this.material.uniforms.firstRenderTime.value=this.firstRenderTime,this.material.uniforms.currentTime.value=performance.now(),this.material.uniforms.fadeInComplete.value=c,this.material.uniformsNeedUpdate=!0,this.visibleRegionChanging=!l}updateRenderIndexes(t,i){const r=this.geometry;r.attributes.splatIndex.set(t),r.attributes.splatIndex.needsUpdate=!0,i>0&&this.firstRenderTime===-1&&(this.firstRenderTime=performance.now()),r.instanceCount=i,r.setDrawRange(0,i)}updateTransforms(){for(let t=0;t<this.scenes.length;t++)this.getScene(t).updateTransform(this.dynamicMode)}setSplatScale(t=1){this.splatScale=t,this.material.uniforms.splatScale.value=t,this.material.uniformsNeedUpdate=!0}getSplatScale(){return this.splatScale}setPointCloudModeEnabled(t){this.pointCloudModeEnabled=t,this.material.uniforms.pointCloudModeEnabled.value=t?1:0,this.material.uniformsNeedUpdate=!0}getPointCloudModeEnabled(){return this.pointCloudModeEnabled}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(t=!1){return t?oi.getTotalSplatCountForScenes(this.scenes):this.lastBuildSplatCount}static getTotalSplatCountForScenes(t){let i=0;for(let r of t)r&&r.splatBuffer&&(i+=r.splatBuffer.getSplatCount());return i}static getTotalSplatCountForSplatBuffers(t){let i=0;for(let r of t)i+=r.getSplatCount();return i}getMaxSplatCount(){return oi.getTotalMaxSplatCountForScenes(this.scenes)}static getTotalMaxSplatCountForScenes(t){let i=0;for(let r of t)r&&r.splatBuffer&&(i+=r.splatBuffer.getMaxSplatCount());return i}static getTotalMaxSplatCountForSplatBuffers(t){let i=0;for(let r of t)i+=r.getMaxSplatCount();return i}disposeDistancesComputationGPUResources(){if(!this.renderer)return;const t=this.renderer.getContext();this.distancesTransformFeedback.vao&&(t.deleteVertexArray(this.distancesTransformFeedback.vao),this.distancesTransformFeedback.vao=null),this.distancesTransformFeedback.program&&(t.deleteProgram(this.distancesTransformFeedback.program),t.deleteShader(this.distancesTransformFeedback.vertexShader),t.deleteShader(this.distancesTransformFeedback.fragmentShader),this.distancesTransformFeedback.program=null,this.distancesTransformFeedback.vertexShader=null,this.distancesTransformFeedback.fragmentShader=null),this.disposeDistancesComputationGPUBufferResources(),this.distancesTransformFeedback.id&&(t.deleteTransformFeedback(this.distancesTransformFeedback.id),this.distancesTransformFeedback.id=null)}disposeDistancesComputationGPUBufferResources(){if(!this.renderer)return;const t=this.renderer.getContext();this.distancesTransformFeedback.centersBuffer&&(this.distancesTransformFeedback.centersBuffer=null,t.deleteBuffer(this.distancesTransformFeedback.centersBuffer)),this.distancesTransformFeedback.outDistancesBuffer&&(t.deleteBuffer(this.distancesTransformFeedback.outDistancesBuffer),this.distancesTransformFeedback.outDistancesBuffer=null)}setRenderer(t){if(t!==this.renderer){this.renderer=t;const i=this.renderer.getContext(),r=new Nk(i),s=new Pk(i,r,{});if(r.init(s),this.webGLUtils=new Q5(i,r),this.enableDistancesComputationOnGPU&&this.getSplatCount()>0){this.setupDistancesComputationTransformFeedback();const{centers:o,sceneIndexes:a}=this.getDataForDistancesComputation(0,this.getSplatCount()-1);this.refreshGPUBuffersForDistancesComputation(o,a)}}}updateGPUCentersBufferForDistancesComputation(t,i,r){if(!this.renderer)return;const s=this.renderer.getContext(),o=s.getParameter(s.VERTEX_ARRAY_BINDING);s.bindVertexArray(this.distancesTransformFeedback.vao);const a=this.integerBasedDistancesComputation?Uint32Array:Float32Array,l=16,c=r*l;if(s.bindBuffer(s.ARRAY_BUFFER,this.distancesTransformFeedback.centersBuffer),t)s.bufferSubData(s.ARRAY_BUFFER,c,i);else{const u=new a(this.getMaxSplatCount()*l);u.set(i),s.bufferData(s.ARRAY_BUFFER,u,s.STATIC_DRAW)}s.bindBuffer(s.ARRAY_BUFFER,null),o&&s.bindVertexArray(o)}updateGPUTransformIndexesBufferForDistancesComputation(t,i,r){if(!this.renderer||!this.dynamicMode)return;const s=this.renderer.getContext(),o=s.getParameter(s.VERTEX_ARRAY_BINDING);s.bindVertexArray(this.distancesTransformFeedback.vao);const a=r*4;if(s.bindBuffer(s.ARRAY_BUFFER,this.distancesTransformFeedback.sceneIndexesBuffer),t)s.bufferSubData(s.ARRAY_BUFFER,a,i);else{const l=new Uint32Array(this.getMaxSplatCount()*4);l.set(i),s.bufferData(s.ARRAY_BUFFER,l,s.STATIC_DRAW)}s.bindBuffer(s.ARRAY_BUFFER,null),o&&s.bindVertexArray(o)}getSceneIndexes(t,i){let r;const s=i-t+1;r=new Uint32Array(s);for(let o=t;o<=i;o++)r[o]=this.globalSplatIndexToSceneIndexMap[o];return r}getLocalSplatParameters(t,i,r){r==null&&(r=!this.dynamicMode),i.splatBuffer=this.getSplatBufferForSplat(t),i.localIndex=this.getSplatLocalIndex(t),i.sceneTransform=r?this.getSceneTransformForSplat(t):null}fillSplatDataArrays(t,i,r,s,o,a,l,c,u=0,d=0,h=1,f,p,g=0,y){const m=new Y;m.x=void 0,m.y=void 0,this.splatRenderMode===Eo.ThreeD?m.z=void 0:m.z=1;const v=new Xe;let x=0,_=this.scenes.length-1;y!=null&&y>=0&&y<=this.scenes.length&&(x=y,_=y);for(let S=x;S<=_;S++){c==null&&(c=!this.dynamicMode);const E=this.getScene(S),A=E.splatBuffer;let R;if(c&&(this.getSceneTransform(S,v),R=v),t&&A.fillSplatCovarianceArray(t,R,f,p,g,u),i||r){if(!i||!r)throw new Error('SplatMesh::fillSplatDataArrays() -> "scales" and "rotations" must both be valid.');A.fillSplatScaleRotationArray(i,r,R,f,p,g,d,m)}s&&A.fillSplatCenterArray(this.morphedMesh,s,R,f,p,g),o&&A.fillSplatColorArray(o,E.minimumAlpha,f,p,g),a&&A.fillSphericalHarmonicsArray(a,this.minSphericalHarmonicsDegree,R,f,p,g,h),g+=A.getSplatCount()}}getIntegerCenters(t,i,r=!1){const s=i-t+1,o=new Float32Array(s*3);this.fillSplatDataArrays(null,null,null,o,null,null,void 0,void 0,void 0,void 0,t);let a,l=r?4:3;a=new Int32Array(s*l);for(let c=0;c<s;c++){for(let u=0;u<3;u++)a[c*l+u]=Math.round(o[c*3+u]*1e3);r&&(a[c*l+3]=1e3)}return a}getFloatCenters(t,i,r=!1){const s=i-t+1,o=new Float32Array(s*3);if(this.fillSplatDataArrays(null,null,null,o,null,null,void 0,void 0,void 0,void 0,t),!r)return o;let a=new Float32Array(s*4);for(let l=0;l<s;l++){for(let c=0;c<3;c++)a[l*4+c]=o[l*3+c];a[l*4+3]=1}return a}getSceneTransform(t,i){const r=this.getScene(t);r.updateTransform(this.dynamicMode),i.copy(r.transform)}getScene(t){if(t<0||t>=this.scenes.length)throw new Error("SplatMesh::getScene() -> Invalid scene index.");return this.scenes[t]}getSceneCount(){return this.scenes.length}getSplatBufferForSplat(t){return this.getScene(this.globalSplatIndexToSceneIndexMap[t]).splatBuffer}getSceneIndexForSplat(t){return this.globalSplatIndexToSceneIndexMap[t]}getSceneTransformForSplat(t){return this.getScene(this.globalSplatIndexToSceneIndexMap[t]).transform}getSplatLocalIndex(t){return this.globalSplatIndexToLocalSplatIndexMap[t]}static getIntegerMatrixArray(t){const i=t.elements,r=[];for(let s=0;s<16;s++)r[s]=Math.round(i[s]*1e3);return r}computeBoundingBox(t=!1,i){let r=this.getSplatCount();if(i!=null){if(i<0||i>=this.scenes.length)throw new Error("SplatMesh::computeBoundingBox() -> Invalid scene index.");r=this.scenes[i].splatBuffer.getSplatCount()}const s=new Float32Array(r*3);this.fillSplatDataArrays(null,null,null,s,null,null,t,void 0,void 0,void 0,void 0,i);const o=new Y,a=new Y;for(let l=0;l<r;l++){const c=l*3,u=s[c],d=s[c+1],h=s[c+2];(l===0||u<o.x)&&(o.x=u),(l===0||d<o.y)&&(o.y=d),(l===0||h<o.z)&&(o.z=h),(l===0||u>a.x)&&(a.x=u),(l===0||d>a.y)&&(a.y=d),(l===0||h>a.z)&&(a.z=h)}return new rr(o,a)}}var zk="AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEbA2AAAGAQf39/f39/f39/f39/f39/fwBgAAF/AhIBA2VudgZtZW1vcnkCAwCAgAQDBAMAAQIHVAQRX193YXNtX2NhbGxfY3RvcnMAABhfX3dhc21fYXBwbHlfZGF0YV9yZWxvY3MAAAtzb3J0SW5kZXhlcwABE2Vtc2NyaXB0ZW5fdGxzX2luaXQAAgqWEAMDAAELihAEAXwDewN/A30gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEBA0AgAyABQQJ0IgVqIAIgACAFaigCAEECdGooAgAiBTYCACAFIAogBSAKSBshCiAFIA0gBSANShshDSABQQFqIgEgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiFWooAgAiFkECdGooAgAiFEcEQAJ/IAX9CQI4IAggFEEGdGoiDv0JAgwgDioCHP0gASAOKgIs/SACIA4qAjz9IAP95gEgBf0JAiggDv0JAgggDioCGP0gASAOKgIo/SACIA4qAjj9IAP95gEgBf0JAgggDv0JAgAgDioCEP0gASAOKgIg/SACIA4qAjD9IAP95gEgBf0JAhggDv0JAgQgDioCFP0gASAOKgIk/SACIA4qAjT9IAP95gH95AH95AH95AEiEf1f/QwAAAAAAECPQAAAAAAAQI9AIhL98gEiE/0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBP9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/REgDv0cAQJ/IBEgEf0NCAkKCwwNDg8AAAAAAAAAAP1fIBL98gEiEf0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9HAICfyAR/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAyESIBQhDwsgAyAVaiABIBZBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmogEf0bA2oiDjYCACAOIAogCiAOShshCiAOIA0gDSAOSBshDSACQQFqIgIgC0cNAAsMAwsCfyAFKgIIu/0UIAUqAhi7/SIB/QwAAAAAAECPQAAAAAAAQI9A/fIBIhH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIQ4CfyAR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyECAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQIgAv0RIA79HAEgBf0cAiESIAwhBQNAIAMgBUECdCICaiABIAAgAmooAgBBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmoiAjYCACACIAogAiAKSBshCiACIA0gAiANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEBA0AgAyABQQJ0IgVqAn8gAiAAIAVqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAFBAWoiASALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIRcgBSoCGCEYIAUqAgghGUH4////ByEKQYiAgIB4IQ0gDCEFA0ACfyAXIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCAZIAIqAgCUIBggAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIUaigCAEECdCIVaigCACIORwRAIAX9CQI4IAggDkEGdGoiD/0JAgwgDyoCHP0gASAPKgIs/SACIA8qAjz9IAP95gEgBf0JAiggD/0JAgggDyoCGP0gASAPKgIo/SACIA8qAjj9IAP95gEgBf0JAgggD/0JAgAgDyoCEP0gASAPKgIg/SACIA8qAjD9IAP95gEgBf0JAhggD/0JAgQgDyoCFP0gASAPKgIk/SACIA8qAjT9IAP95gH95AH95AH95AEhESAOIQ8LIAMgFGoCfyAR/R8DIAEgFUECdCIOQQxyaioCAJQgEf0fAiABIA5BCHJqKgIAlCAR/R8AIAEgDmoqAgCUIBH9HwEgASAOQQRyaioCAJSSkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSACQQFqIgIgC0cNAAsMAQtBiICAgHghDUH4////ByEKCyALIAxLBEAgCUEBa7MgDbIgCrKTlSEXIAwhDQNAAn8gFyADIA1BAnRqIgEoAgAgCmuylCIYi0MAAABPXQRAIBioDAELQYCAgIB4CyEOIAEgDjYCACAEIA5BAnRqIgEgASgCAEEBajYCACANQQFqIg0gC0cNAAsLIAlBAk8EQCAEKAIAIQ1BASEKA0AgBCAKQQJ0aiIBIAEoAgAgDWoiDTYCACAKQQFqIgogCUcNAAsLIAxBAEoEQCAMIQoDQCAGIApBAWsiAUECdCICaiAAIAJqKAIANgIAIApBAUshAiABIQogAg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCwsEAEEACw==",JA="AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACEgEDZW52Bm1lbW9yeQIDAICABAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=",Vk="AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQrrDwICAAvlDwQBfAN7B30DfyALIAprIQwCQAJAIA4EQCANBEBB+P///wchCkGIgICAeCENIAsgDE0NAyAMIQUDQCADIAVBAnQiAWogAiAAIAFqKAIAQQJ0aigCACIBNgIAIAEgCiABIApIGyEKIAEgDSABIA1KGyENIAVBAWoiBSALRw0ACwwDCyAPBEAgCyAMTQ0CQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIcaigCACIdQQJ0aigCACIbRwRAAn8gBf0JAjggCCAbQQZ0aiIO/QkCDCAOKgIc/SABIA4qAiz9IAIgDioCPP0gA/3mASAF/QkCKCAO/QkCCCAOKgIY/SABIA4qAij9IAIgDioCOP0gA/3mASAF/QkCCCAO/QkCACAOKgIQ/SABIA4qAiD9IAIgDioCMP0gA/3mASAF/QkCGCAO/QkCBCAOKgIU/SABIA4qAiT9IAIgDioCNP0gA/3mAf3kAf3kAf3kASIR/V/9DAAAAAAAQI9AAAAAAABAj0AiEv3yASIT/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOAn8gE/0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9ESAO/RwBAn8gESAR/Q0ICQoLDA0ODwABAgMAAQID/V8gEv3yASIR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAgJ/IBH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/RwDIRIgGyEPCyADIBxqIAEgHUEEdGr9AAAAIBL9tQEiEf0bACAR/RsBaiAR/RsCaiAR/RsDaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAgi7/RQgBSoCGLv9IgH9DAAAAAAAQI9AAAAAAABAj0D98gEiEf0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBH9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQL9ESAO/RwBIAX9HAIhEiAMIQUDQCADIAVBAnQiAmogASAAIAJqKAIAQQR0av0AAAAgEv21ASIR/RsAIBH9GwFqIBH9GwJqIgI2AgAgAiAKIAIgCkgbIQogAiANIAIgDUobIQ0gBUEBaiIFIAtHDQALDAILIA0EQEH4////ByEKQYiAgIB4IQ0gCyAMTQ0CIAwhBQNAIAMgBUECdCIBagJ/IAIgACABaigCAEECdGoqAgC7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgD0UEQCALIAxNDQEgBSoCKCEUIAUqAhghFSAFKgIIIRZB+P///wchCkGIgICAeCENIAwhBQNAAn8gFCABIAAgBUECdCIHaigCAEEEdGoiAioCCJQgFiACKgIAlCAVIAIqAgSUkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDiADIAdqIA42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gBUEBaiIFIAtHDQALDAILIAsgDE0NAEF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiG2ooAgBBAnQiHGooAgAiDkcEQCAFKgI4IhQgCCAOQQZ0aiIPKgI8lCAFKgIoIhUgDyoCOJQgBSoCCCIWIA8qAjCUIAUqAhgiFyAPKgI0lJKSkiEYIBQgDyoCLJQgFSAPKgIolCAWIA8qAiCUIBcgDyoCJJSSkpIhGSAUIA8qAhyUIBUgDyoCGJQgFiAPKgIQlCAXIA8qAhSUkpKSIRogFCAPKgIMlCAVIA8qAgiUIBYgDyoCAJQgFyAPKgIElJKSkiEUIA4hDwsgAyAbagJ/IBggASAcQQJ0aiIOKgIMlCAZIA4qAgiUIBQgDioCAJQgGiAOKgIElJKSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAJBAWoiAiALRw0ACwwBC0GIgICAeCENQfj///8HIQoLIAsgDEsEQCAJQQFrsyANsiAKspOVIRQgDCENA0ACfyAUIAMgDUECdGoiASgCACAKa7KUIhWLQwAAAE9dBEAgFagMAQtBgICAgHgLIQ4gASAONgIAIAQgDkECdGoiASABKAIAQQFqNgIAIA1BAWoiDSALRw0ACwsgCUECTwRAIAQoAgAhDUEBIQoDQCAEIApBAnRqIgEgASgCACANaiINNgIAIApBAWoiCiAJRw0ACwsgDEEASgRAIAwhCgNAIAYgCkEBayIBQQJ0IgJqIAAgAmooAgA2AgAgCkEBSyABIQoNAAsLIAsgDEoEQCALIQoDQCAGIAsgBCADIApBAWsiCkECdCIBaigCAEECdGoiAigCACIFa0ECdGogACABaigCADYCACACIAVBAWs2AgAgCiAMSg0ACwsL",Hk="AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=";function $k(n){let e,t,i,r,s,o,a,l,c,u,d,h,f,p,g,y,m,v,x,_;function S(E,A,R,w,M,I,L){const k=performance.now();if(!i&&(new Uint32Array(t,a,M.byteLength/_.BytesPerInt).set(M),new Float32Array(t,u,L.byteLength/_.BytesPerFloat).set(L),w)){let ee;r?ee=new Int32Array(t,d,I.byteLength/_.BytesPerInt):ee=new Float32Array(t,d,I.byteLength/_.BytesPerFloat),ee.set(I)}y||(y=new Uint32Array(v)),new Float32Array(t,g,16).set(R),new Uint32Array(t,f,v).set(y),e.exports.sortIndexes(a,p,d,h,f,g,l,c,u,v,E,A,o,w,r,s);const T={sortDone:!0,splatSortCount:E,splatRenderCount:A,sortTime:0};if(!i){const V=new Uint32Array(t,l,A);(!m||m.length<A)&&(m=new Uint32Array(A)),m.set(V),T.sortedIndexes=m}const F=performance.now();T.sortTime=F-k,n.postMessage(T)}n.onmessage=E=>{if(E.data.centers)centers=E.data.centers,sceneIndexes=E.data.sceneIndexes,r?new Int32Array(t,p+E.data.range.from*_.BytesPerInt*4,E.data.range.count*4).set(new Int32Array(centers)):new Float32Array(t,p+E.data.range.from*_.BytesPerFloat*4,E.data.range.count*4).set(new Float32Array(centers)),s&&new Uint32Array(t,c+E.data.range.from*4,E.data.range.count).set(new Uint32Array(sceneIndexes)),x=E.data.range.from+E.data.range.count;else if(E.data.sort){const A=Math.min(E.data.sort.splatRenderCount||0,x),R=Math.min(E.data.sort.splatSortCount||0,x),w=E.data.sort.usePrecomputedDistances;let M,I,L;i||(M=E.data.sort.indexesToSort,L=E.data.sort.transforms,w&&(I=E.data.sort.precomputedDistances)),S(R,A,E.data.sort.modelViewProj,w,M,I,L)}else if(E.data.init){_=E.data.init.Constants,o=E.data.init.splatCount,i=E.data.init.useSharedMemory,r=E.data.init.integerBasedSort,s=E.data.init.dynamicMode,v=E.data.init.distanceMapRange,x=0;const A=r?_.BytesPerInt*4:_.BytesPerFloat*4,R=new Uint8Array(E.data.init.sorterWasmBytes),w=16*_.BytesPerFloat,M=o*_.BytesPerInt,I=o*A,L=w,k=r?o*_.BytesPerInt:o*_.BytesPerFloat,T=o*_.BytesPerInt,F=o*_.BytesPerInt,V=r?v*_.BytesPerInt*2:v*_.BytesPerFloat*2,Q=s?o*_.BytesPerInt:0,ee=s?_.MaxScenes*w:0,se=_.MemoryPageSize*32,he=M+I+L+k+T+V+F+Q+ee+se,ie=Math.floor(he/_.MemoryPageSize)+1,re={module:{},env:{memory:new WebAssembly.Memory({initial:ie,maximum:ie,shared:!0})}};WebAssembly.compile(R).then(be=>WebAssembly.instantiate(be,re)).then(be=>{e=be,a=0,p=a+M,g=p+I,d=g+L,h=d+k,f=h+T,l=f+V,c=l+F,u=c+Q,t=re.env.memory.buffer,i?n.postMessage({sortSetupPhase1Complete:!0,indexesToSortBuffer:t,indexesToSortOffset:a,sortedIndexesBuffer:t,sortedIndexesOffset:l,precomputedDistancesBuffer:t,precomputedDistancesOffset:d,transformsBuffer:t,transformsOffset:u}):n.postMessage({sortSetupPhase1Complete:!0})})}}}function Gk(n,e,t,i,r,s=Ft.DefaultSplatSortDistanceMapPrecision){const o=new Worker(URL.createObjectURL(new Blob(["(",$k.toString(),")(self)"],{type:"application/javascript"})));let a=zk;const l=u_()?l5():null;!t&&!e?(a=JA,l&&l.major<=16&&l.minor<4&&(a=Hk)):t?e||l&&l.major<=16&&l.minor<4&&(a=Vk):a=JA;const c=atob(a),u=new Uint8Array(c.length);for(let d=0;d<c.length;d++)u[d]=c.charCodeAt(d);return o.postMessage({init:{sorterWasmBytes:u.buffer,splatCount:n,useSharedMemory:e,integerBasedSort:i,dynamicMode:r,distanceMapRange:1<<s,Constants:{BytesPerFloat:Ft.BytesPerFloat,BytesPerInt:Ft.BytesPerInt,MemoryPageSize:Ft.MemoryPageSize,MaxScenes:Ft.MaxScenes}}}),o}const xc={None:0,VR:1,AR:2};class vu{static createButton(e,t={}){const i=document.createElement("button");function r(){let c=null;async function u(f){f.addEventListener("end",d),await e.xr.setSession(f),i.textContent="EXIT VR",c=f}function d(){c.removeEventListener("end",d),i.textContent="ENTER VR",c=null}i.style.display="",i.style.cursor="pointer",i.style.left="calc(50% - 50px)",i.style.width="100px",i.textContent="ENTER VR";const h={...t,optionalFeatures:["local-floor","bounded-floor","layers",...t.optionalFeatures||[]]};i.onmouseenter=function(){i.style.opacity="1.0"},i.onmouseleave=function(){i.style.opacity="0.5"},i.onclick=function(){c===null?navigator.xr.requestSession("immersive-vr",h).then(u):(c.end(),navigator.xr.offerSession!==void 0&&navigator.xr.offerSession("immersive-vr",h).then(u).catch(f=>{console.warn(f)}))},navigator.xr.offerSession!==void 0&&navigator.xr.offerSession("immersive-vr",h).then(u).catch(f=>{console.warn(f)})}function s(){i.style.display="",i.style.cursor="auto",i.style.left="calc(50% - 75px)",i.style.width="150px",i.onmouseenter=null,i.onmouseleave=null,i.onclick=null}function o(){s(),i.textContent="VR NOT SUPPORTED"}function a(c){s(),console.warn("Exception when trying to call xr.isSessionSupported",c),i.textContent="VR NOT ALLOWED"}function l(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return i.id="VRButton",i.style.display="none",l(i),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():o(),c&&vu.xrSessionIsGranted&&i.click()}).catch(a),i;{const c=document.createElement("a");return window.isSecureContext===!1?(c.href=document.location.href.replace(/^http:/,"https:"),c.innerHTML="WEBXR NEEDS HTTPS"):(c.href="https://immersiveweb.dev/",c.innerHTML="WEBXR NOT AVAILABLE"),c.style.left="calc(50% - 90px)",c.style.width="180px",c.style.textDecoration="none",l(c),c}}static registerSessionGrantedListener(){if(typeof navigator<"u"&&"xr"in navigator){if(/WebXRViewer\//i.test(navigator.userAgent))return;navigator.xr.addEventListener("sessiongranted",()=>{vu.xrSessionIsGranted=!0})}}}vu.xrSessionIsGranted=!1;vu.registerSessionGrantedListener();class Wk{static createButton(e,t={}){const i=document.createElement("button");function r(){if(t.domOverlay===void 0){const h=document.createElement("div");h.style.display="none",document.body.appendChild(h);const f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("width",38),f.setAttribute("height",38),f.style.position="absolute",f.style.right="20px",f.style.top="20px",f.addEventListener("click",function(){c.end()}),h.appendChild(f);const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d","M 12,12 L 28,28 M 28,12 12,28"),p.setAttribute("stroke","#fff"),p.setAttribute("stroke-width",2),f.appendChild(p),t.optionalFeatures===void 0&&(t.optionalFeatures=[]),t.optionalFeatures.push("dom-overlay"),t.domOverlay={root:h}}let c=null;async function u(h){h.addEventListener("end",d),e.xr.setReferenceSpaceType("local"),await e.xr.setSession(h),i.textContent="STOP AR",t.domOverlay.root.style.display="",c=h}function d(){c.removeEventListener("end",d),i.textContent="START AR",t.domOverlay.root.style.display="none",c=null}i.style.display="",i.style.cursor="pointer",i.style.left="calc(50% - 50px)",i.style.width="100px",i.textContent="START AR",i.onmouseenter=function(){i.style.opacity="1.0"},i.onmouseleave=function(){i.style.opacity="0.5"},i.onclick=function(){c===null?navigator.xr.requestSession("immersive-ar",t).then(u):(c.end(),navigator.xr.offerSession!==void 0&&navigator.xr.offerSession("immersive-ar",t).then(u).catch(h=>{console.warn(h)}))},navigator.xr.offerSession!==void 0&&navigator.xr.offerSession("immersive-ar",t).then(u).catch(h=>{console.warn(h)})}function s(){i.style.display="",i.style.cursor="auto",i.style.left="calc(50% - 75px)",i.style.width="150px",i.onmouseenter=null,i.onmouseleave=null,i.onclick=null}function o(){s(),i.textContent="AR NOT SUPPORTED"}function a(c){s(),console.warn("Exception when trying to call xr.isSessionSupported",c),i.textContent="AR NOT ALLOWED"}function l(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return i.id="ARButton",i.style.display="none",l(i),navigator.xr.isSessionSupported("immersive-ar").then(function(c){c?r():o()}).catch(a),i;{const c=document.createElement("a");return window.isSecureContext===!1?(c.href=document.location.href.replace(/^http:/,"https:"),c.innerHTML="WEBXR NEEDS HTTPS"):(c.href="https://immersiveweb.dev/",c.innerHTML="WEBXR NOT AVAILABLE"),c.style.left="calc(50% - 90px)",c.style.width="180px",c.style.textDecoration="none",l(c),c}}}const Wg={Always:0,Never:2};/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/const Qk=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveMap","envMap","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class jk{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=e.object.isSkinnedMesh===!0,this.refreshUniforms=Qk,this.renderId=0}firstInitialization(e){return this.renderObjects.has(e)===!1?(this.getRenderObjectData(e),!0):!1}getRenderObjectData(e){let t=this.renderObjects.get(e);if(t===void 0){const{geometry:i,material:r,object:s}=e;if(t={material:this.getMaterialData(r),geometry:{id:i.id,attributes:this.getAttributesData(i.attributes),indexVersion:i.index?i.index.version:null,drawRange:{start:i.drawRange.start,count:i.drawRange.count}},worldMatrix:s.matrixWorld.clone()},s.center&&(t.center=s.center.clone()),s.morphTargetInfluences&&(t.morphTargetInfluences=s.morphTargetInfluences.slice()),e.bundle!==null&&(t.version=e.bundle.version),t.material.transmission>0){const{width:o,height:a}=e.context;t.bufferWidth=o,t.bufferHeight=a}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const i in e){const r=e[i];t[i]={version:r.version}}return t}containsNode(e){const t=e.material;for(const i in t)if(t[i]&&t[i].isNode)return!0;return e.renderer.nodes.modelViewMatrix!==null||e.renderer.nodes.modelNormalViewMatrix!==null}getMaterialData(e){const t={};for(const i of this.refreshUniforms){const r=e[i];r!=null&&(typeof r=="object"&&r.clone!==void 0?r.isTexture===!0?t[i]={id:r.id,version:r.version}:t[i]=r.clone():t[i]=r)}return t}equals(e){const{object:t,material:i,geometry:r}=e,s=this.getRenderObjectData(e);if(s.worldMatrix.equals(t.matrixWorld)!==!0)return s.worldMatrix.copy(t.matrixWorld),!1;const o=s.material;for(const g in o){const y=o[g],m=i[g];if(y.equals!==void 0){if(y.equals(m)===!1)return y.copy(m),!1}else if(m.isTexture===!0){if(y.id!==m.id||y.version!==m.version)return y.id=m.id,y.version=m.version,!1}else if(y!==m)return o[g]=m,!1}if(o.transmission>0){const{width:g,height:y}=e.context;if(s.bufferWidth!==g||s.bufferHeight!==y)return s.bufferWidth=g,s.bufferHeight=y,!1}const a=s.geometry,l=r.attributes,c=a.attributes,u=Object.keys(c),d=Object.keys(l);if(a.id!==r.id)return a.id=r.id,!1;if(u.length!==d.length)return s.geometry.attributes=this.getAttributesData(l),!1;for(const g of u){const y=c[g],m=l[g];if(m===void 0)return delete c[g],!1;if(y.version!==m.version)return y.version=m.version,!1}const h=r.index,f=a.indexVersion,p=h?h.version:null;if(f!==p)return a.indexVersion=p,!1;if(a.drawRange.start!==r.drawRange.start||a.drawRange.count!==r.drawRange.count)return a.drawRange.start=r.drawRange.start,a.drawRange.count=r.drawRange.count,!1;if(s.morphTargetInfluences){let g=!1;for(let y=0;y<s.morphTargetInfluences.length;y++)s.morphTargetInfluences[y]!==t.morphTargetInfluences[y]&&(g=!0);if(g)return!0}return s.center&&s.center.equals(t.center)===!1?(s.center.copy(t.center),!0):(e.bundle!==null&&(s.version=e.bundle.version),!0)}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e))return!0;const{renderId:i}=t;if(this.renderId!==i)return this.renderId=i,!0;const r=e.object.static===!0,s=e.bundle!==null&&e.bundle.static===!0&&this.getRenderObjectData(e).version===e.bundle.version;return r||s?!1:this.equals(e)!==!0}}function fh(n,e=0){let t=3735928559^e,i=1103547991^e;if(n instanceof Array)for(let r=0,s;r<n.length;r++)s=n[r],t=Math.imul(t^s,2654435761),i=Math.imul(i^s,1597334677);else for(let r=0,s;r<n.length;r++)s=n.charCodeAt(r),t=Math.imul(t^s,2654435761),i=Math.imul(i^s,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}const qk=n=>fh(n),eC=n=>fh(n),tC=(...n)=>fh(n);function nC(n,e=!1){const t=[];n.isNode===!0&&(t.push(n.id),n=n.getSelf());for(const{property:i,childNode:r}of ym(n))t.push(fh(i.slice(0,-4)),r.getCacheKey(e));return fh(t)}function*ym(n,e=!1){for(const t in n){if(t.startsWith("_")===!0)continue;const i=n[t];if(Array.isArray(i)===!0)for(let r=0;r<i.length;r++){const s=i[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}else if(i&&i.isNode===!0)yield{property:t,childNode:i};else if(typeof i=="object")for(const r in i){const s=i[r];s&&(s.isNode===!0||e&&typeof s.toJSON=="function")&&(yield{property:t,index:r,childNode:s})}}}const Xk=new Map([[1,"float"],[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),eb=new WeakMap;function Kk(n){return Xk.get(n)}function vm(n){if(/[iu]?vec\d/.test(n))return n.startsWith("ivec")?Int32Array:n.startsWith("uvec")?Uint32Array:Float32Array;if(/mat\d/.test(n)||/float/.test(n))return Float32Array;if(/uint/.test(n))return Uint32Array;if(/int/.test(n))return Int32Array;throw new Error("THREE.NodeUtils: Unsupported type: ".concat(n))}function G_(n){if(/float|int|uint/.test(n))return 1;if(/vec2/.test(n))return 2;if(/vec3/.test(n))return 3;if(/vec4/.test(n)||/mat2/.test(n))return 4;if(/mat3/.test(n))return 9;if(/mat4/.test(n))return 16;console.error("THREE.TSL: Unsupported type:",n)}function Ca(n){if(n==null)return null;const e=typeof n;return n.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":n.isVector2===!0?"vec2":n.isVector3===!0?"vec3":n.isVector4===!0?"vec4":n.isMatrix2===!0?"mat2":n.isMatrix3===!0?"mat3":n.isMatrix4===!0?"mat4":n.isColor===!0?"color":n instanceof ArrayBuffer?"ArrayBuffer":null}function iC(n,...e){const t=n?n.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),n==="color"?new gt(...e):t==="vec2"?new qe(...e):t==="vec3"?new Y(...e):t==="vec4"?new Mt(...e):t==="mat2"?new R_(...e):t==="mat3"?new mt(...e):t==="mat4"?new Xe(...e):n==="bool"?e[0]||!1:n==="float"||n==="int"||n==="uint"?e[0]||0:n==="string"?e[0]||"":n==="ArrayBuffer"?oC(e[0]):null}function rC(n){let e=eb.get(n);return e===void 0&&(e={},eb.set(n,e)),e}function sC(n){let e="";const t=new Uint8Array(n);for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}function oC(n){return Uint8Array.from(atob(n),e=>e.charCodeAt(0)).buffer}const Hy={VERTEX:"vertex",FRAGMENT:"fragment"},Wt={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Yk={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Gs={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},aC=["fragment","vertex"],Zk=["setup","analyze","generate"],Jk=[...aC,"compute"],ku=["x","y","z","w"];let eU=0;class ut extends ro{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Wt.NONE,this.updateBeforeType=Wt.NONE,this.updateAfterType=Wt.NONE,this.uuid=Ta.generateUUID(),this.version=0,this.global=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:eU++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,Wt.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Wt.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Wt.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of ym(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=tC(nC(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let i=0;for(const r of this.getChildren())t["node"+i++]=r;return t.outputNode||null}analyze(e){if(e.increaseUsage(this)===1){const i=e.getNodeProperties(this);for(const r of Object.values(i))r&&r.isNode===!0&&r.build(e)}}generate(e,t){const{outputNode:i}=e.getNodeProperties(this);if(i&&i.isNode===!0)return i.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const i=this.getShared(e);if(this!==i)return i.build(e,t);e.addNode(this),e.addChain(this);let r=null;const s=e.getBuildStage();if(s==="setup"){this.updateReference(e);const o=e.getNodeProperties(this);if(o.initialized!==!0){o.initialized=!0;const a=this.setup(e),l=a&&a.isNode===!0;for(const c of Object.values(o))c&&c.isNode===!0&&c.build(e);l&&a.build(e),o.outputNode=a}}else if(s==="analyze")this.analyze(e);else if(s==="generate")if(this.generate.length===1){const a=this.getNodeType(e),l=e.getDataFromNode(this);r=l.snippet,r===void 0?(r=this.generate(e)||"",l.snippet=r):l.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),r=e.format(r,a,t)}else r=this.generate(e,t)||"";return e.removeChain(this),e.addSequentialNode(this),r}getSerializeChildren(){return ym(this)}serialize(e){const t=this.getSerializeChildren(),i={};for(const{property:r,index:s,childNode:o}of t)s!==void 0?(i[r]===void 0&&(i[r]=Number.isInteger(s)?[]:{}),i[r][s]=o.toJSON(e.meta).uuid):i[r]=o.toJSON(e.meta).uuid;Object.keys(i).length>0&&(e.inputNodes=i)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const i in e.inputNodes)if(Array.isArray(e.inputNodes[i])){const r=[];for(const s of e.inputNodes[i])r.push(t[s]);this[i]=r}else if(typeof e.inputNodes[i]=="object"){const r={};for(const s in e.inputNodes[i]){const o=e.inputNodes[i][s];r[s]=t[o]}this[i]=r}else{const r=e.inputNodes[i];this[i]=t[r]}}}toJSON(e){const{uuid:t,type:i}=this,r=e===void 0||typeof e=="string";r&&(e={textures:{},images:{},nodes:{}});let s=e.nodes[t];s===void 0&&(s={uuid:t,type:i,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},r!==!0&&(e.nodes[s.uuid]=s),this.serialize(s),delete s.meta);function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}if(r){const a=o(e.textures),l=o(e.images),c=o(e.nodes);a.length>0&&(s.textures=a),l.length>0&&(s.images=l),c.length>0&&(s.nodes=c)}return s}}class Ql extends ut{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.node.build(e),i=this.indexNode.build(e,"uint");return"".concat(t,"[ ").concat(i," ]")}}class lC extends ut{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let i=null;for(const r of this.convertTo.split("|"))(i===null||e.getTypeLength(t)===e.getTypeLength(r))&&(i=r);return i}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const i=this.node,r=this.getNodeType(e),s=i.build(e,r);return e.format(s,r,t)}}class kn extends ut{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(s.propertyName!==void 0)return e.format(s.propertyName,r,t);if(r!=="void"&&t!=="void"&&this.hasDependencies(e)){const o=super.build(e,r),a=e.getVarFromNode(this,null,r),l=e.getPropertyName(a);return e.addLineFlowCode("".concat(l," = ").concat(o),this),s.snippet=o,s.propertyName=l,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class tU extends kn{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,i)=>t+e.getTypeLength(i.getNodeType(e)),0))}generate(e,t){const i=this.getNodeType(e),r=this.nodes,s=e.getComponentType(i),o=[];for(const l of r){let c=l.build(e);const u=e.getComponentType(l.getNodeType(e));u!==s&&(c=e.format(c,u,s)),o.push(c)}const a="".concat(e.getType(i),"( ").concat(o.join(", ")," )");return e.format(a,i,t)}}const nU=ku.join("");class $y extends ut{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(ku.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const i=this.node,r=e.getTypeLength(i.getNodeType(e));let s=null;if(r>1){let o=null;this.getVectorLength()>=r&&(o=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const l=i.build(e,o);this.components.length===r&&this.components===nU.slice(0,this.components.length)?s=e.format(l,o,t):s=e.format("".concat(l,".").concat(this.components),this.getNodeType(e),t)}else s=i.build(e,t);return s}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class iU extends kn{static get type(){return"SetNode"}constructor(e,t,i){super(),this.sourceNode=e,this.components=t,this.targetNode=i}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:i,targetNode:r}=this,s=this.getNodeType(e),o=e.getComponentType(r.getNodeType(e)),a=e.getTypeFromLength(i.length,o),l=r.build(e,a),c=t.build(e,s),u=e.getTypeLength(s),d=[];for(let h=0;h<u;h++){const f=ku[h];f===i[0]?(d.push(l),h+=i.length-1):d.push(c+"."+f)}return"".concat(e.getType(s),"( ").concat(d.join(", ")," )")}}class rU extends kn{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:i}=this,r=this.getNodeType(e),s=i.build(e),o=e.getVarFromNode(this),a=e.getPropertyName(o);e.addLineFlowCode(a+" = "+s,this);const l=e.getTypeLength(r),c=[];let u=0;for(let d=0;d<l;d++){const h=ku[d];h===t[u]?(c.push("1.0 - "+(a+"."+h)),u++):c.push(a+"."+h)}return"".concat(e.getType(r),"( ").concat(c.join(", ")," )")}}class W_ extends ut{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Ca(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Ca(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=sC(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?iC(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}const tb=/float|u?int/;class Cs extends W_{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const i=this.getNodeType(e);return tb.test(i)&&tb.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),i,t)}}class sU extends ut{static get type(){return"MemberNode"}constructor(e,t){super(),this.node=e,this.property=t,this.isMemberNode=!0}getNodeType(e){return this.node.getMemberType(e,this.property)}generate(e){return this.node.build(e)+"."+this.property}}let _u=null;const Oc=new Map;function Ne(n,e){if(Oc.has(n)){console.warn("Redefinition of method chaining ".concat(n));return}if(typeof e!="function")throw new Error("Node element ".concat(n," is not a function"));Oc.set(n,e)}const cC=n=>n.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),nb=n=>cC(n).split("").sort().join(""),uC={setup(n,e){const t=e.shift();return n(kh(t),...e)},get(n,e,t){if(typeof e=="string"&&n[e]===void 0){if(n.isStackNode!==!0&&e==="assign")return(...i)=>(_u.assign(t,...i),t);if(Oc.has(e)){const i=Oc.get(e);return n.isStackNode?(...r)=>t.add(i(...r)):(...r)=>i(t,...r)}else{if(e==="self")return n;if(e.endsWith("Assign")&&Oc.has(e.slice(0,e.length-6))){const i=Oc.get(e.slice(0,e.length-6));return n.isStackNode?(...r)=>t.assign(r[0],i(...r)):(...r)=>t.assign(i(t,...r))}else{if(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0)return e=cC(e),Fe(new $y(t,e));if(/^set[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=nb(e.slice(3).toLowerCase()),i=>Fe(new iU(n,e,i));if(/^flip[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=nb(e.slice(4).toLowerCase()),()=>Fe(new rU(Fe(n),e));if(e==="width"||e==="height"||e==="depth")return e==="width"?e="x":e==="height"?e="y":e==="depth"&&(e="z"),Fe(new $y(n,e));if(/^\d+$/.test(e)===!0)return Fe(new Ql(t,new Cs(Number(e),"uint")));if(/^get$/.test(e)===!0)return i=>Fe(new sU(t,i))}}}return Reflect.get(n,e,t)},set(n,e,t,i){return typeof e=="string"&&n[e]===void 0&&(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0||e==="width"||e==="height"||e==="depth"||/^\d+$/.test(e)===!0)?(i[e].assign(t),!0):Reflect.set(n,e,t,i)}},Qg=new WeakMap,ib=new WeakMap,oU=function(n,e=null){const t=Ca(n);if(t==="node"){let i=Qg.get(n);return i===void 0&&(i=new Proxy(n,uC),Qg.set(n,i),Qg.set(i,i)),i}else{if(e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string")return Fe(Gy(n,e));if(t==="shader")return _e(n)}return n},aU=function(n,e=null){for(const t in n)n[t]=Fe(n[t],e);return n},lU=function(n,e=null){const t=n.length;for(let i=0;i<t;i++)n[i]=Fe(n[i],e);return n},cU=function(n,e=null,t=null,i=null){const r=s=>Fe(i!==null?Object.assign(s,i):s);return e===null?(...s)=>r(new n(...Rl(s))):t!==null?(t=Fe(t),(...s)=>r(new n(e,...Rl(s),t))):(...s)=>r(new n(e,...Rl(s)))},uU=function(n,...e){return Fe(new n(...Rl(e)))};class dU extends ut{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:i}=this,r=e.getNodeProperties(t);if(r.onceOutput)return r.onceOutput;let s=null;if(t.layout){let o=ib.get(e.constructor);o===void 0&&(o=new WeakMap,ib.set(e.constructor,o));let a=o.get(t);a===void 0&&(a=Fe(e.buildFunctionNode(t)),o.set(t,a)),e.currentFunctionNode!==null&&e.currentFunctionNode.includes.push(a),s=Fe(a.call(i))}else{const o=t.jsFunc,a=i!==null||o.length>1?o(i||[],e):o(e);s=Fe(a)}return t.once&&(r.onceOutput=s),s}getOutputNode(e){const t=e.getNodeProperties(this);return t.outputNode===null&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class hU extends ut{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return kh(e),Fe(new dU(this,e))}setup(){return this.call()}}const fU=[!1,!0],pU=[0,1,2,3],mU=[-1,-2],dC=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],Q_=new Map;for(const n of fU)Q_.set(n,new Cs(n));const j_=new Map;for(const n of pU)j_.set(n,new Cs(n,"uint"));const q_=new Map([...j_].map(n=>new Cs(n.value,"int")));for(const n of mU)q_.set(n,new Cs(n,"int"));const r0=new Map([...q_].map(n=>new Cs(n.value)));for(const n of dC)r0.set(n,new Cs(n));for(const n of dC)r0.set(-n,new Cs(-n));const s0={bool:Q_,uint:j_,ints:q_,float:r0},rb=new Map([...Q_,...r0]),Gy=(n,e)=>rb.has(n)?rb.get(n):n.isNode===!0?n:new Cs(n,e),gU=n=>{try{return n.getNodeType()}catch(e){return}},Qn=function(n,e=null){return(...t)=>{if((t.length===0||!["bool","float","int","uint"].includes(n)&&t.every(r=>typeof r!="object"))&&(t=[iC(n,...t)]),t.length===1&&e!==null&&e.has(t[0]))return Fe(e.get(t[0]));if(t.length===1){const r=Gy(t[0],n);return gU(r)===n?Fe(r):Fe(new lC(r,n))}const i=t.map(r=>Gy(r));return Fe(new tU(i,n))}},ph=n=>typeof n=="object"&&n!==null?n.value:n,hC=n=>n!=null?n.nodeType||n.convertTo||(typeof n=="string"?n:null):null;function $d(n,e){return new Proxy(new hU(n,e),uC)}const Fe=(n,e=null)=>oU(n,e),kh=(n,e=null)=>new aU(n,e),Rl=(n,e=null)=>new lU(n,e),Pe=(...n)=>new cU(...n),Qe=(...n)=>new uU(...n),_e=(n,e)=>{const t=new $d(n,e),i=(...r)=>{let s;return kh(r),r[0]&&r[0].isNode?s=[...r]:s=r[0],t.call(s)};return i.shaderNode=t,i.setLayout=r=>(t.setLayout(r),i),i.once=()=>(t.once=!0,i),i},yU=(...n)=>(console.warn("TSL.ShaderNode: tslFn() has been renamed to Fn()."),_e(...n));Ne("toGlobal",n=>(n.global=!0,n));const Wy=n=>{_u=n},fC=()=>_u,Dt=(...n)=>_u.If(...n);function pC(n){return _u&&_u.add(n),n}Ne("append",pC);const mC=new Qn("color"),ce=new Qn("float",s0.float),de=new Qn("int",s0.ints),Ye=new Qn("uint",s0.uint),qo=new Qn("bool",s0.bool),He=new Qn("vec2"),Xn=new Qn("ivec2"),gC=new Qn("uvec2"),yC=new Qn("bvec2"),ve=new Qn("vec3"),vC=new Qn("ivec3"),Uu=new Qn("uvec3"),X_=new Qn("bvec3"),vt=new Qn("vec4"),_C=new Qn("ivec4"),xC=new Qn("uvec4"),SC=new Qn("bvec4"),o0=new Qn("mat2"),is=new Qn("mat3"),Il=new Qn("mat4"),vU=(n="")=>Fe(new Cs(n,"string")),_U=n=>Fe(new Cs(n,"ArrayBuffer"));Ne("toColor",mC);Ne("toFloat",ce);Ne("toInt",de);Ne("toUint",Ye);Ne("toBool",qo);Ne("toVec2",He);Ne("toIVec2",Xn);Ne("toUVec2",gC);Ne("toBVec2",yC);Ne("toVec3",ve);Ne("toIVec3",vC);Ne("toUVec3",Uu);Ne("toBVec3",X_);Ne("toVec4",vt);Ne("toIVec4",_C);Ne("toUVec4",xC);Ne("toBVec4",SC);Ne("toMat2",o0);Ne("toMat3",is);Ne("toMat4",Il);const AC=Pe(Ql),bC=(n,e)=>Fe(new lC(Fe(n),e)),xU=(n,e)=>Fe(new $y(Fe(n),e));Ne("element",AC);Ne("convert",bC);class sb extends kn{static get type(){return"ArrayNode"}constructor(e,t,i=null){super(e),this.count=t,this.values=i,this.isArrayNode=!0}getNodeType(e){return this.nodeType===null&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const TC=(...n)=>{let e;if(n.length===1){const t=n[0];e=new sb(null,t.length,t)}else{const t=n[0],i=n[1];e=new sb(t,i)}return Fe(e)};Ne("toArray",(n,e)=>TC(Array(e).fill(n)));class wC extends ut{static get type(){return"UniformGroupNode"}constructor(e,t=!1,i=1){super("string"),this.name=e,this.shared=t,this.order=i,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const CC=n=>new wC(n),a0=(n,e=0)=>new wC(n,!0,e),SU=a0("frame"),kt=a0("render"),EC=CC("object");class Uh extends W_{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=EC}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const i=this.getSelf();return e=e.bind(i),super.onUpdate(r=>{const s=e(r,i);s!==void 0&&(this.value=s)},t)}generate(e,t){const i=this.getNodeType(e),r=this.getUniformHash(e);let s=e.getNodeFromHash(r);s===void 0&&(e.setHashNode(this,r),s=this);const o=s.getInputType(e),a=e.getUniformFromNode(s,o,e.shaderStage,this.name||e.context.label),l=e.getPropertyName(a);return e.context.label!==void 0&&delete e.context.label,e.format(l,i,t)}}const Rt=(n,e)=>{const t=hC(e||n),i=n&&n.isNode===!0?n.node&&n.node.value||n.value:n;return Fe(new Uh(i,t))};class qt extends ut{static get type(){return"PropertyNode"}constructor(e,t=null,i=!1){super(e),this.name=t,this.varying=i,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const MC=(n,e)=>Fe(new qt(n,e)),mh=(n,e)=>Fe(new qt(n,e,!0)),hs=Qe(qt,"vec4","DiffuseColor"),Qy=Qe(qt,"vec3","EmissiveColor"),RC=Qe(qt,"float","Roughness"),AU=Qe(qt,"float","Metalness"),bU=Qe(qt,"float","Clearcoat"),TU=Qe(qt,"float","ClearcoatRoughness"),wU=Qe(qt,"vec3","Sheen"),CU=Qe(qt,"float","SheenRoughness"),IC=Qe(qt,"float","Iridescence"),EU=Qe(qt,"float","IridescenceIOR"),MU=Qe(qt,"float","IridescenceThickness"),jy=Qe(qt,"float","AlphaT"),NC=Qe(qt,"float","Anisotropy"),Ip=Qe(qt,"vec3","AnisotropyT"),qc=Qe(qt,"vec3","AnisotropyB"),RU=Qe(qt,"color","SpecularColor"),IU=Qe(qt,"float","SpecularF90"),NU=Qe(qt,"float","Shininess"),gh=Qe(qt,"vec4","Output"),PU=Qe(qt,"float","dashSize"),LU=Qe(qt,"float","gapSize"),DU=Qe(qt,"float","pointWidth"),FU=Qe(qt,"float","IOR"),OU=Qe(qt,"float","Transmission"),BU=Qe(qt,"float","Thickness"),kU=Qe(qt,"float","AttenuationDistance"),UU=Qe(qt,"color","AttenuationColor"),zU=Qe(qt,"float","Dispersion");class VU extends kn{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const i=e.getTypeLength(t.node.getNodeType(e));return ku.join("").slice(0,i)!==t.components}return!1}generate(e,t){const{targetNode:i,sourceNode:r}=this,s=this.needsSplitAssign(e),o=i.getNodeType(e),a=i.context({assign:!0}).build(e),l=r.build(e,o),c=r.getNodeType(e),u=e.getDataFromNode(this);let d;if(u.initialized===!0)t!=="void"&&(d=a);else if(s){const h=e.getVarFromNode(this,null,o),f=e.getPropertyName(h);e.addLineFlowCode("".concat(f," = ").concat(l),this);const p=i.node.context({assign:!0}).build(e);for(let g=0;g<i.components.length;g++){const y=i.components[g];e.addLineFlowCode("".concat(p,".").concat(y," = ").concat(f,"[ ").concat(g," ]"),this)}t!=="void"&&(d=a)}else d="".concat(a," = ").concat(l),(t==="void"||c==="void")&&(e.addLineFlowCode(d,this),t!=="void"&&(d=a));return u.initialized=!0,e.format(d,o,t)}}const PC=Pe(VU);Ne("assign",PC);class HU extends kn{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],i=this.functionNode,r=i.getInputs(e),s=this.parameters,o=(l,c)=>{const u=c.type,d=u==="pointer";let h;return d?h="&"+l.build(e):h=l.build(e,u),h};if(Array.isArray(s))for(let l=0;l<s.length;l++)t.push(o(s[l],r[l]));else for(const l of r){const c=s[l.name];if(c!==void 0)t.push(o(c,l));else throw new Error("FunctionCallNode: Input '".concat(l.name,"' not found in FunctionNode."))}const a=i.build(e,"property");return"".concat(a,"( ").concat(t.join(", ")," )")}}const LC=(n,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?Rl(e):kh(e[0]),Fe(new HU(Fe(n),e)));Ne("call",LC);class Tn extends kn{static get type(){return"OperatorNode"}constructor(e,t,i,...r){if(super(),r.length>0){let s=new Tn(e,t,i);for(let o=0;o<r.length-1;o++)s=new Tn(e,s,r[o]);t=s,i=r[r.length-1]}this.op=e,this.aNode=t,this.bNode=i,this.isOperatorNode=!0}getNodeType(e,t){const i=this.op,r=this.aNode,s=this.bNode,o=r.getNodeType(e),a=typeof s<"u"?s.getNodeType(e):null;if(o==="void"||a==="void")return"void";if(i==="%")return o;if(i==="~"||i==="&"||i==="|"||i==="^"||i===">>"||i==="<<")return e.getIntegerType(o);if(i==="!"||i==="=="||i==="&&"||i==="||"||i==="^^")return"bool";if(i==="<"||i===">"||i==="<="||i===">="){const l=t?e.getTypeLength(t):Math.max(e.getTypeLength(o),e.getTypeLength(a));return l>1?"bvec".concat(l):"bool"}else{if(e.isMatrix(o)){if(a==="float")return o;if(e.isVector(a))return e.getVectorFromMatrix(o);if(e.isMatrix(a))return o}else if(e.isMatrix(a)){if(o==="float")return a;if(e.isVector(o))return e.getVectorFromMatrix(a)}return e.getTypeLength(a)>e.getTypeLength(o)?a:o}}generate(e,t){const i=this.op,r=this.aNode,s=this.bNode,o=this.getNodeType(e,t);let a=null,l=null;o!=="void"?(a=r.getNodeType(e),l=typeof s<"u"?s.getNodeType(e):null,i==="<"||i===">"||i==="<="||i===">="||i==="=="?e.isVector(a)?l=a:a!==l&&(a=l="float"):i===">>"||i==="<<"?(a=o,l=e.changeComponentType(l,"uint")):e.isMatrix(a)?l==="float"?l="float":e.isVector(l)?l=e.getVectorFromMatrix(a):e.isMatrix(l)||(a=l=o):e.isMatrix(l)?a==="float"?a="float":e.isVector(a)?a=e.getVectorFromMatrix(l):a=l=o:a=l=o):a=l=o;const c=r.build(e,a),u=typeof s<"u"?s.build(e,l):null,d=e.getTypeLength(t),h=e.getFunctionOperator(i);if(t!=="void")return i==="<"&&d>1?e.useComparisonMethod?e.format("".concat(e.getMethod("lessThan",t),"( ").concat(c,", ").concat(u," )"),o,t):e.format("( ".concat(c," < ").concat(u," )"),o,t):i==="<="&&d>1?e.useComparisonMethod?e.format("".concat(e.getMethod("lessThanEqual",t),"( ").concat(c,", ").concat(u," )"),o,t):e.format("( ".concat(c," <= ").concat(u," )"),o,t):i===">"&&d>1?e.useComparisonMethod?e.format("".concat(e.getMethod("greaterThan",t),"( ").concat(c,", ").concat(u," )"),o,t):e.format("( ".concat(c," > ").concat(u," )"),o,t):i===">="&&d>1?e.useComparisonMethod?e.format("".concat(e.getMethod("greaterThanEqual",t),"( ").concat(c,", ").concat(u," )"),o,t):e.format("( ".concat(c," >= ").concat(u," )"),o,t):i==="!"||i==="~"?e.format("(".concat(i).concat(c,")"),a,t):h?e.format("".concat(h,"( ").concat(c,", ").concat(u," )"),o,t):e.isMatrix(a)&&l==="float"?e.format("( ".concat(u," ").concat(i," ").concat(c," )"),o,t):a==="float"&&e.isMatrix(l)?e.format("".concat(c," ").concat(i," ").concat(u),o,t):e.format("( ".concat(c," ").concat(i," ").concat(u," )"),o,t);if(a!=="void")return h?e.format("".concat(h,"( ").concat(c,", ").concat(u," )"),o,t):e.isMatrix(a)&&l==="float"?e.format("".concat(u," ").concat(i," ").concat(c),o,t):e.format("".concat(c," ").concat(i," ").concat(u),o,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const On=Pe(Tn,"+"),Bt=Pe(Tn,"-"),St=Pe(Tn,"*"),Xo=Pe(Tn,"/"),K_=Pe(Tn,"%"),DC=Pe(Tn,"=="),FC=Pe(Tn,"!="),OC=Pe(Tn,"<"),Y_=Pe(Tn,">"),BC=Pe(Tn,"<="),kC=Pe(Tn,">="),UC=Pe(Tn,"&&"),zC=Pe(Tn,"||"),VC=Pe(Tn,"!"),HC=Pe(Tn,"^^"),$C=Pe(Tn,"&"),GC=Pe(Tn,"~"),WC=Pe(Tn,"|"),QC=Pe(Tn,"^"),jC=Pe(Tn,"<<"),qC=Pe(Tn,">>");Ne("add",On);Ne("sub",Bt);Ne("mul",St);Ne("div",Xo);Ne("modInt",K_);Ne("equal",DC);Ne("notEqual",FC);Ne("lessThan",OC);Ne("greaterThan",Y_);Ne("lessThanEqual",BC);Ne("greaterThanEqual",kC);Ne("and",UC);Ne("or",zC);Ne("not",VC);Ne("xor",HC);Ne("bitAnd",$C);Ne("bitNot",GC);Ne("bitOr",WC);Ne("bitXor",QC);Ne("shiftLeft",jC);Ne("shiftRight",qC);const XC=(...n)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),K_(...n));Ne("remainder",XC);class me extends kn{static get type(){return"MathNode"}constructor(e,t,i=null,r=null){super(),this.method=e,this.aNode=t,this.bNode=i,this.cNode=r,this.isMathNode=!0}getInputType(e){const t=this.aNode.getNodeType(e),i=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,s=e.isMatrix(t)?0:e.getTypeLength(t),o=e.isMatrix(i)?0:e.getTypeLength(i),a=e.isMatrix(r)?0:e.getTypeLength(r);return s>o&&s>a?t:o>a?i:a>s?r:t}getNodeType(e){const t=this.method;return t===me.LENGTH||t===me.DISTANCE||t===me.DOT?"float":t===me.CROSS?"vec3":t===me.ALL?"bool":t===me.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):t===me.MOD?this.aNode.getNodeType(e):this.getInputType(e)}generate(e,t){let i=this.method;const r=this.getNodeType(e),s=this.getInputType(e),o=this.aNode,a=this.bNode,l=this.cNode,c=e.renderer.coordinateSystem;if(i===me.TRANSFORM_DIRECTION){let u=o,d=a;e.isMatrix(u.getNodeType(e))?d=vt(ve(d),0):u=vt(ve(u),0);const h=St(u,d).xyz;return jl(h).build(e,t)}else{if(i===me.NEGATE)return e.format("( - "+o.build(e,s)+" )",r,t);if(i===me.ONE_MINUS)return Bt(1,o).build(e,t);if(i===me.RECIPROCAL)return Xo(1,o).build(e,t);if(i===me.DIFFERENCE)return mn(Bt(o,a)).build(e,t);{const u=[];return i===me.CROSS||i===me.MOD?u.push(o.build(e,r),a.build(e,r)):c===Ir&&i===me.STEP?u.push(o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":s),a.build(e,s)):c===Ir&&(i===me.MIN||i===me.MAX)||i===me.MOD?u.push(o.build(e,s),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":s)):i===me.REFRACT?u.push(o.build(e,s),a.build(e,s),l.build(e,"float")):i===me.MIX?u.push(o.build(e,s),a.build(e,s),l.build(e,e.getTypeLength(l.getNodeType(e))===1?"float":s)):(c===Qo&&i===me.ATAN&&a!==null&&(i="atan2"),u.push(o.build(e,s)),a!==null&&u.push(a.build(e,s)),l!==null&&u.push(l.build(e,s))),e.format("".concat(e.getMethod(i,r),"( ").concat(u.join(", ")," )"),r,t)}}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}me.ALL="all";me.ANY="any";me.RADIANS="radians";me.DEGREES="degrees";me.EXP="exp";me.EXP2="exp2";me.LOG="log";me.LOG2="log2";me.SQRT="sqrt";me.INVERSE_SQRT="inversesqrt";me.FLOOR="floor";me.CEIL="ceil";me.NORMALIZE="normalize";me.FRACT="fract";me.SIN="sin";me.COS="cos";me.TAN="tan";me.ASIN="asin";me.ACOS="acos";me.ATAN="atan";me.ABS="abs";me.SIGN="sign";me.LENGTH="length";me.NEGATE="negate";me.ONE_MINUS="oneMinus";me.DFDX="dFdx";me.DFDY="dFdy";me.ROUND="round";me.RECIPROCAL="reciprocal";me.TRUNC="trunc";me.FWIDTH="fwidth";me.TRANSPOSE="transpose";me.BITCAST="bitcast";me.EQUALS="equals";me.MIN="min";me.MAX="max";me.MOD="mod";me.STEP="step";me.REFLECT="reflect";me.DISTANCE="distance";me.DIFFERENCE="difference";me.DOT="dot";me.CROSS="cross";me.POW="pow";me.TRANSFORM_DIRECTION="transformDirection";me.MIX="mix";me.CLAMP="clamp";me.REFRACT="refract";me.SMOOTHSTEP="smoothstep";me.FACEFORWARD="faceforward";const KC=ce(1e-6),$U=ce(1e6),_m=ce(Math.PI),GU=ce(Math.PI*2),Z_=Pe(me,me.ALL),YC=Pe(me,me.ANY),ZC=Pe(me,me.RADIANS),JC=Pe(me,me.DEGREES),eE=Pe(me,me.EXP),xu=Pe(me,me.EXP2),J_=Pe(me,me.LOG),Ho=Pe(me,me.LOG2),lo=Pe(me,me.SQRT),ex=Pe(me,me.INVERSE_SQRT),js=Pe(me,me.FLOOR),l0=Pe(me,me.CEIL),jl=Pe(me,me.NORMALIZE),na=Pe(me,me.FRACT),wr=Pe(me,me.SIN),Mo=Pe(me,me.COS),tE=Pe(me,me.TAN),nE=Pe(me,me.ASIN),iE=Pe(me,me.ACOS),tx=Pe(me,me.ATAN),mn=Pe(me,me.ABS),nx=Pe(me,me.SIGN),xm=Pe(me,me.LENGTH),rE=Pe(me,me.NEGATE),sE=Pe(me,me.ONE_MINUS),ix=Pe(me,me.DFDX),rx=Pe(me,me.DFDY),oE=Pe(me,me.ROUND),aE=Pe(me,me.RECIPROCAL),sx=Pe(me,me.TRUNC),lE=Pe(me,me.FWIDTH),cE=Pe(me,me.TRANSPOSE),WU=Pe(me,me.BITCAST),uE=Pe(me,me.EQUALS),Fr=Pe(me,me.MIN),ui=Pe(me,me.MAX),ox=Pe(me,me.MOD),c0=Pe(me,me.STEP),dE=Pe(me,me.REFLECT),hE=Pe(me,me.DISTANCE),fE=Pe(me,me.DIFFERENCE),za=Pe(me,me.DOT),u0=Pe(me,me.CROSS),gs=Pe(me,me.POW),pE=Pe(me,me.POW,2),mE=Pe(me,me.POW,3),gE=Pe(me,me.POW,4),yE=Pe(me,me.TRANSFORM_DIRECTION),vE=n=>St(nx(n),gs(mn(n),1/3)),ax=n=>za(n,n),Ln=Pe(me,me.MIX),Ko=(n,e=0,t=1)=>Fe(new me(me.CLAMP,Fe(n),Fe(e),Fe(t))),_E=n=>Ko(n),xE=Pe(me,me.REFRACT),Vl=Pe(me,me.SMOOTHSTEP),lx=Pe(me,me.FACEFORWARD),SE=_e(([n])=>{const i=43758.5453,r=za(n.xy,He(12.9898,78.233)),s=ox(r,_m);return na(wr(s).mul(i))}),AE=(n,e,t)=>Ln(e,t,n),bE=(n,e,t)=>Vl(e,t,n),TE=(n,e)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),tx(n,e)),QU=lx,jU=ex;Ne("all",Z_);Ne("any",YC);Ne("equals",uE);Ne("radians",ZC);Ne("degrees",JC);Ne("exp",eE);Ne("exp2",xu);Ne("log",J_);Ne("log2",Ho);Ne("sqrt",lo);Ne("inverseSqrt",ex);Ne("floor",js);Ne("ceil",l0);Ne("normalize",jl);Ne("fract",na);Ne("sin",wr);Ne("cos",Mo);Ne("tan",tE);Ne("asin",nE);Ne("acos",iE);Ne("atan",tx);Ne("abs",mn);Ne("sign",nx);Ne("length",xm);Ne("lengthSq",ax);Ne("negate",rE);Ne("oneMinus",sE);Ne("dFdx",ix);Ne("dFdy",rx);Ne("round",oE);Ne("reciprocal",aE);Ne("trunc",sx);Ne("fwidth",lE);Ne("atan2",TE);Ne("min",Fr);Ne("max",ui);Ne("mod",ox);Ne("step",c0);Ne("reflect",dE);Ne("distance",hE);Ne("dot",za);Ne("cross",u0);Ne("pow",gs);Ne("pow2",pE);Ne("pow3",mE);Ne("pow4",gE);Ne("transformDirection",yE);Ne("mix",AE);Ne("clamp",Ko);Ne("refract",xE);Ne("smoothstep",bE);Ne("faceForward",lx);Ne("difference",fE);Ne("saturate",_E);Ne("cbrt",vE);Ne("transpose",cE);Ne("rand",SE);class qU extends ut{static get type(){return"ConditionalNode"}constructor(e,t,i=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=i}getNodeType(e){const{ifNode:t,elseNode:i}=e.getNodeProperties(this);if(t===void 0)return this.setup(e),this.getNodeType(e);const r=t.getNodeType(e);if(i!==null){const s=i.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(r))return s}return r}setup(e){const t=this.condNode.cache(),i=this.ifNode.cache(),r=this.elseNode?this.elseNode.cache():null,s=e.context.nodeBlock;e.getDataFromNode(i).parentNodeBlock=s,r!==null&&(e.getDataFromNode(r).parentNodeBlock=s);const o=e.getNodeProperties(this);o.condNode=t,o.ifNode=i.context({nodeBlock:i}),o.elseNode=r?r.context({nodeBlock:r}):null}generate(e,t){const i=this.getNodeType(e),r=e.getDataFromNode(this);if(r.nodeProperty!==void 0)return r.nodeProperty;const{condNode:s,ifNode:o,elseNode:a}=e.getNodeProperties(this),l=t!=="void",c=l?MC(i).build(e):"";r.nodeProperty=c;const u=s.build(e,"bool");e.addFlowCode("\n".concat(e.tab,"if ( ").concat(u," ) {\n\n")).addFlowTab();let d=o.build(e,i);if(d&&(l?d=c+" = "+d+";":d="return "+d+";"),e.removeFlowTab().addFlowCode(e.tab+" "+d+"\n\n"+e.tab+"}"),a!==null){e.addFlowCode(" else {\n\n").addFlowTab();let h=a.build(e,i);h&&(l?h=c+" = "+h+";":h="return "+h+";"),e.removeFlowTab().addFlowCode(e.tab+" "+h+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(c,i,t)}}const sr=Pe(qU);Ne("select",sr);const wE=(...n)=>(console.warn("TSL.ConditionalNode: cond() has been renamed to select()."),sr(...n));Ne("cond",wE);class CE extends ut{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){this.node.build(e)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value});const i=this.node.build(e);return e.setContext(t),i}generate(e,t){const i=e.getContext();e.setContext({...e.context,...this.value});const r=this.node.build(e,t);return e.setContext(i),r}}const cx=Pe(CE),EE=(n,e)=>cx(n,{label:e});Ne("context",cx);Ne("label",EE);class XU extends ut{static get type(){return"VarNode"}constructor(e,t=null,i=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=i}getHash(e){return this.name||super.getHash(e)}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:i,readOnly:r}=this,{renderer:s}=e,o=s.backend.isWebGPUBackend===!0;let a=!1,l=!1;r&&(a=e.isDeterministic(t),l=o?r:a);const c=e.getVectorType(this.getNodeType(e)),u=t.build(e,c),d=e.getVarFromNode(this,i,c,void 0,l),h=e.getPropertyName(d);let f=h;if(l)if(o)f=a?"const ".concat(h):"let ".concat(h);else{const p=e.getArrayCount(t);f="const ".concat(e.getVar(d.type,h,p))}return e.addLineFlowCode("".concat(f," = ").concat(u),this),h}}const ux=Pe(XU),ME=(n,e=null)=>ux(n,e).append(),RE=(n,e=null)=>ux(n,e,!0).append();Ne("toVar",ME);Ne("toConst",RE);const IE=n=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),ux(n));Ne("temp",IE);class KU extends ut{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0}isGlobal(){return!0}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let i=t.varying;if(i===void 0){const r=this.name,s=this.getNodeType(e);t.varying=i=e.getVaryingFromNode(this,r,s),t.node=this.node}return i.needsInterpolation||(i.needsInterpolation=e.shaderStage==="fragment"),i}setup(e){this.setupVarying(e)}analyze(e){return this.setupVarying(e),this.node.analyze(e)}generate(e){const t=e.getNodeProperties(this),i=this.setupVarying(e),r=e.shaderStage==="fragment"&&t.reassignPosition===!0&&e.context.needsPositionReassign;if(t.propertyName===void 0||r){const s=this.getNodeType(e),o=e.getPropertyName(i,Hy.VERTEX);e.flowNodeFromShaderStage(Hy.VERTEX,this.node,s,o),t.propertyName=o,r?t.reassignPosition=!1:t.reassignPosition===void 0&&e.context.isPositionNodeInput&&(t.reassignPosition=!0)}return e.getPropertyName(i)}}const tr=Pe(KU),NE=n=>tr(n);Ne("toVarying",tr);Ne("toVertexStage",NE);Ne("varying",(...n)=>(console.warn("TSL.VaryingNode: .varying() has been renamed to .toVarying()."),tr(...n)));Ne("vertexStage",(...n)=>(console.warn("TSL.VaryingNode: .vertexStage() has been renamed to .toVertexStage()."),tr(...n)));const PE=_e(([n])=>{const e=n.mul(.9478672986).add(.0521327014).pow(2.4),t=n.mul(.0773993808),i=n.lessThanEqual(.04045);return Ln(e,t,i)}).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),LE=_e(([n])=>{const e=n.pow(.41666).mul(1.055).sub(.055),t=n.mul(12.92),i=n.lessThanEqual(.0031308);return Ln(e,t,i)}).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),zh="WorkingColorSpace",dx="OutputColorSpace";class Vh extends kn{static get type(){return"ColorSpaceNode"}constructor(e,t,i){super("vec4"),this.colorNode=e,this.source=t,this.target=i}resolveColorSpace(e,t){return t===zh?wt.workingColorSpace:t===dx?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,i=this.resolveColorSpace(e,this.source),r=this.resolveColorSpace(e,this.target);let s=t;return wt.enabled===!1||i===r||!i||!r||(wt.getTransfer(i)===Zt&&(s=vt(PE(s.rgb),s.a)),wt.getPrimaries(i)!==wt.getPrimaries(r)&&(s=vt(is(wt._getMatrix(new mt,i,r)).mul(s.rgb),s.a)),wt.getTransfer(r)===Zt&&(s=vt(LE(s.rgb),s.a))),s}}const DE=n=>Fe(new Vh(Fe(n),zh,dx)),FE=n=>Fe(new Vh(Fe(n),dx,zh)),OE=(n,e)=>Fe(new Vh(Fe(n),zh,e)),hx=(n,e)=>Fe(new Vh(Fe(n),e,zh)),YU=(n,e,t)=>Fe(new Vh(Fe(n),e,t));Ne("toOutputColorSpace",DE);Ne("toWorkingColorSpace",FE);Ne("workingToColorSpace",OE);Ne("colorSpaceToWorking",hx);let ZU=class extends Ql{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),i=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,i,r)}};class JU extends ut{static get type(){return"ReferenceBaseNode"}constructor(e,t,i=null,r=null){super(),this.property=e,this.uniformType=t,this.object=i,this.count=r,this.properties=e.split("."),this.reference=i,this.node=null,this.group=null,this.updateType=Wt.OBJECT}setGroup(e){return this.group=e,this}element(e){return Fe(new ZU(this,Fe(e)))}setNodeType(e){const t=Rt(null,e).getSelf();this.group!==null&&t.setGroup(this.group),this.node=t}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let i=e[t[0]];for(let r=1;r<t.length;r++)i=i[t[r]];return i}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}class ez extends JU{static get type(){return"RendererReferenceNode"}constructor(e,t,i=null){super(e,t,i),this.renderer=i,this.setGroup(kt)}updateReference(e){return this.reference=this.renderer!==null?this.renderer:e.renderer,this.reference}}const BE=(n,e,t=null)=>Fe(new ez(n,e,t));class tz extends kn{static get type(){return"ToneMappingNode"}constructor(e,t=UE,i=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=i}customCacheKey(){return tC(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,i=this.toneMapping;if(i===_s)return t;let r=null;const s=e.renderer.library.getToneMappingFunction(i);return s!==null?r=vt(s(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",i),r=t),r}}const kE=(n,e,t)=>Fe(new tz(n,Fe(e),Fe(t))),UE=BE("toneMappingExposure","float");Ne("toneMapping",(n,e,t)=>kE(e,t,n));class nz extends W_{static get type(){return"BufferAttributeNode"}constructor(e,t=null,i=0,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=i,this.bufferOffset=r,this.usage=um,this.instanced=!1,this.attribute=null,this.global=!0,e&&e.isBufferAttribute===!0&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(this.bufferStride===0&&this.bufferOffset===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return this.bufferType===null&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(this.attribute!==null)return;const t=this.getNodeType(e),i=this.value,r=e.getTypeLength(t),s=this.bufferStride||r,o=this.bufferOffset,a=i.isInterleavedBuffer===!0?i:new x_(i,s),l=new e0(a,r,o);a.setUsage(this.usage),this.attribute=l,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),i=e.getBufferAttributeFromNode(this,t),r=e.getPropertyName(i);let s=null;return e.shaderStage==="vertex"||e.shaderStage==="compute"?(this.name=r,s=r):s=tr(this).build(e,t),s}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&this.attribute.isBufferAttribute===!0&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const Hh=(n,e=null,t=0,i=0)=>Fe(new nz(n,e,t,i)),zE=(n,e=null,t=0,i=0)=>Hh(n,e,t,i).setUsage(ba),Sm=(n,e=null,t=0,i=0)=>Hh(n,e,t,i).setInstanced(!0),qy=(n,e=null,t=0,i=0)=>zE(n,e,t,i).setInstanced(!0);Ne("toAttribute",n=>Hh(n.value));class iz extends ut{static get type(){return"ComputeNode"}constructor(e,t,i=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=i,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=Wt.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let i=t[0];for(let r=1;r<t.length;r++)i*=t[r];this.dispatchCount=Math.ceil(e/i)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}generate(e){const{shaderStage:t}=e;if(t==="compute"){const i=this.computeNode.build(e,"void");i!==""&&e.addLineFlowCode(i,this)}}}const VE=(n,e,t)=>Fe(new iz(Fe(n),e,t));Ne("compute",VE);class rz extends ut{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){const t=e.getCache(),i=e.getCacheFromNode(this,this.parent);e.setCache(i);const r=this.node.getNodeType(e);return e.setCache(t),r}build(e,...t){const i=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.build(e,...t);return e.setCache(i),s}}const HE=(n,e)=>Fe(new rz(Fe(n),e));Ne("cache",HE);class sz extends ut{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return t!==""&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const $E=Pe(sz);Ne("bypass",$E);class GE extends ut{static get type(){return"RemapNode"}constructor(e,t,i,r=ce(0),s=ce(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=i,this.outLowNode=r,this.outHighNode=s,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:i,outLowNode:r,outHighNode:s,doClamp:o}=this;let a=e.sub(t).div(i.sub(t));return o===!0&&(a=a.clamp()),a.mul(s.sub(r)).add(r)}}const WE=Pe(GE,null,null,{doClamp:!1}),QE=Pe(GE);Ne("remap",WE);Ne("remapClamp",QE);class oz extends ut{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const i=this.getNodeType(e),r=this.snippet;if(i==="void")e.addLineFlowCode(r,this);else return e.format("( ".concat(r," )"),i,t)}}const Oa=Pe(oz),jE=n=>(n?sr(n,Oa("discard")):Oa("discard")).append(),az=()=>Oa("return").append();Ne("discard",jE);class lz extends kn{static get type(){return"RenderOutputNode"}constructor(e,t,i){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=i,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const i=(this.toneMapping!==null?this.toneMapping:e.toneMapping)||_s,r=(this.outputColorSpace!==null?this.outputColorSpace:e.outputColorSpace)||Vs;return i!==_s&&(t=t.toneMapping(i)),r!==Vs&&r!==wt.workingColorSpace&&(t=t.workingToColorSpace(r)),t}}const qE=(n,e=null,t=null)=>Fe(new lz(Fe(n),e,t));Ne("renderOutput",qE);function cz(n){console.warn("THREE.TSLBase: AddNodeElement has been removed in favor of tree-shaking. Trying add",n)}class XE extends ut{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(t===null){const i=this.getAttributeName(e);if(e.hasGeometryAttribute(i)){const r=e.geometry.getAttribute(i);t=e.getTypeFromAttribute(r)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),i=this.getNodeType(e);if(e.hasGeometryAttribute(t)===!0){const s=e.geometry.getAttribute(t),o=e.getTypeFromAttribute(s),a=e.getAttribute(t,o);return e.shaderStage==="vertex"?e.format(a.name,o,i):tr(this).build(e,i)}else return console.warn('AttributeNode: Vertex attribute "'.concat(t,'" not found on geometry.')),e.generateConst(i)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Yo=(n,e)=>Fe(new XE(n,e)),xn=(n=0)=>Yo("uv"+(n>0?n:""),"vec2");class uz extends ut{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const i=this.textureNode.build(e,"property"),r=this.levelNode===null?"0":this.levelNode.build(e,"int");return e.format("".concat(e.getMethod("textureDimensions"),"( ").concat(i,", ").concat(r," )"),this.getNodeType(e),t)}}const Pa=Pe(uz);class dz extends Uh{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Wt.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,i=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(i&&i.width!==void 0){const{width:r,height:s}=i;this.value=Math.log2(Math.max(r,s))}}}const KE=Pe(dz);class Zo extends Uh{static get type(){return"TextureNode"}constructor(e,t=null,i=null,r=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=i,this.biasNode=r,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Wt.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(t===null)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return this.value.isDepthTexture===!0?"float":this.value.type===Ni?"uvec4":this.value.type===Zm?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return xn(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return this._matrixUniform===null&&(this._matrixUniform=Rt(this.value.matrix)),this._matrixUniform.mul(ve(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Wt.RENDER:Wt.NONE,this}setupUV(e,t){const i=this.value;return e.isFlipY()&&(i.image instanceof ImageBitmap&&i.flipY===!0||i.isRenderTargetTexture===!0||i.isFramebufferTexture===!0||i.isDepthTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(de(Pa(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const i=this.value;if(!i||i.isTexture!==!0)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let r=this.uvNode;(r===null||e.context.forceUVContext===!0)&&e.context.getUV&&(r=e.context.getUV(this)),r||(r=this.getDefaultUV()),this.updateMatrix===!0&&(r=this.getTransformedUV(r)),r=this.setupUV(e,r);let s=this.levelNode;s===null&&e.context.getTextureLevel&&(s=e.context.getTextureLevel(this)),t.uvNode=r,t.levelNode=s,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,this.sampler===!0?"vec2":"ivec2")}generateSnippet(e,t,i,r,s,o,a,l){const c=this.value;let u;return r?u=e.generateTextureLevel(c,t,i,r,o):s?u=e.generateTextureBias(c,t,i,s,o):l?u=e.generateTextureGrad(c,t,i,l,o):a?u=e.generateTextureCompare(c,t,i,a,o):this.sampler===!1?u=e.generateTextureLoad(c,t,i,o):u=e.generateTexture(c,t,i,o),u}generate(e,t){const i=this.value,r=e.getNodeProperties(this),s=super.generate(e,"property");if(t==="sampler")return s+"_sampler";if(e.isReference(t))return s;{const o=e.getDataFromNode(this);let a=o.propertyName;if(a===void 0){const{uvNode:u,levelNode:d,biasNode:h,compareNode:f,depthNode:p,gradNode:g}=r,y=this.generateUV(e,u),m=d?d.build(e,"float"):null,v=h?h.build(e,"float"):null,x=p?p.build(e,"int"):null,_=f?f.build(e,"float"):null,S=g?[g[0].build(e,"vec2"),g[1].build(e,"vec2")]:null,E=e.getVarFromNode(this);a=e.getPropertyName(E);const A=this.generateSnippet(e,s,y,m,v,x,_,S);e.addLineFlowCode("".concat(a," = ").concat(A),this),o.snippet=A,o.propertyName=a}let l=a;const c=this.getNodeType(e);return e.needsToWorkingColorSpace(i)&&(l=hx(Oa(l,c),i.colorSpace).setup(e).build(e,c)),e.format(l,c,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Fe(e),t.referenceNode=this.getSelf(),Fe(t)}blur(e){const t=this.clone();return t.biasNode=Fe(e).mul(KE(t)),t.referenceNode=this.getSelf(),Fe(t)}level(e){const t=this.clone();return t.levelNode=Fe(e),t.referenceNode=this.getSelf(),Fe(t)}size(e){return Pa(this,e)}bias(e){const t=this.clone();return t.biasNode=Fe(e),t.referenceNode=this.getSelf(),Fe(t)}compare(e){const t=this.clone();return t.compareNode=Fe(e),t.referenceNode=this.getSelf(),Fe(t)}grad(e,t){const i=this.clone();return i.gradNode=[Fe(e),Fe(t)],i.referenceNode=this.getSelf(),Fe(i)}depth(e){const t=this.clone();return t.depthNode=Fe(e),t.referenceNode=this.getSelf(),Fe(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;t!==null&&(t.value=e.matrix),e.matrixAutoUpdate===!0&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e}}const er=Pe(Zo),Rn=(...n)=>er(...n).setSampler(!1),hz=n=>(n.isNode===!0?n:er(n)).convert("sampler");class fx extends Uh{static get type(){return"BufferNode"}constructor(e,t,i=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=i}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const $h=(n,e,t)=>Fe(new fx(n,e,t));class fz extends Ql{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),i=this.getNodeType(),r=this.node.getPaddedType();return e.format(t,r,i)}}class YE extends fx{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=t===null?Ca(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Wt.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return e==="mat2"?t="mat2":/mat/.test(e)===!0?t="mat4":e.charAt(0)==="i"?t="ivec4":e.charAt(0)==="u"&&(t="uvec4"),t}update(){const{array:e,value:t}=this,i=this.elementType;if(i==="float"||i==="int"||i==="uint")for(let r=0;r<e.length;r++){const s=r*4;t[s]=e[r]}else if(i==="color")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.r,t[s+1]=o.g,t[s+2]=o.b||0}else if(i==="mat2")for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+3]=o.elements[3]}else if(i==="mat3")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];t[s]=o.elements[0],t[s+1]=o.elements[1],t[s+2]=o.elements[2],t[s+4]=o.elements[3],t[s+5]=o.elements[4],t[s+6]=o.elements[5],t[s+8]=o.elements[6],t[s+9]=o.elements[7],t[s+10]=o.elements[8],t[s+15]=1}else if(i==="mat4")for(let r=0;r<e.length;r++){const s=r*16,o=e[r];for(let a=0;a<o.elements.length;a++)t[s+a]=o.elements[a]}else for(let r=0;r<e.length;r++){const s=r*4,o=e[r];t[s]=o.x,t[s+1]=o.y,t[s+2]=o.z||0,t[s+3]=o.w||0}}setup(e){const t=this.array.length,i=this.elementType;let r=Float32Array;const s=this.paddedType,o=e.getTypeLength(s);return i.charAt(0)==="i"&&(r=Int32Array),i.charAt(0)==="u"&&(r=Uint32Array),this.value=new r(t*o),this.bufferCount=t,this.bufferType=s,super.setup(e)}element(e){return Fe(new fz(this,Fe(e)))}}const Do=(n,e)=>Fe(new YE(n,e)),pz=(n,e)=>(console.warn("TSL.UniformArrayNode: uniforms() has been renamed to uniformArray()."),Fe(new YE(n,e))),px=Rt(0,"uint").setGroup(a0("cameraIndex")).toVarying("v_cameraIndex"),_a=Rt("float").label("cameraNear").setGroup(kt).onRenderUpdate(({camera:n})=>n.near),xa=Rt("float").label("cameraFar").setGroup(kt).onRenderUpdate(({camera:n})=>n.far),Gh=_e(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.projectionMatrix);e=Do(t).setGroup(kt).label("cameraProjectionMatrices").element(px).toVar("cameraProjectionMatrix")}else e=Rt("mat4").label("cameraProjectionMatrix").setGroup(kt).onRenderUpdate(({camera:t})=>t.projectionMatrix);return e}).once()(),mz=Rt("mat4").label("cameraProjectionMatrixInverse").setGroup(kt).onRenderUpdate(({camera:n})=>n.projectionMatrixInverse),ss=_e(({camera:n})=>{let e;if(n.isArrayCamera&&n.cameras.length>0){const t=[];for(const r of n.cameras)t.push(r.matrixWorldInverse);e=Do(t).setGroup(kt).label("cameraViewMatrices").element(px).toVar("cameraViewMatrix")}else e=Rt("mat4").label("cameraViewMatrix").setGroup(kt).onRenderUpdate(({camera:t})=>t.matrixWorldInverse);return e}).once()(),gz=Rt("mat4").label("cameraWorldMatrix").setGroup(kt).onRenderUpdate(({camera:n})=>n.matrixWorld),yz=Rt("mat3").label("cameraNormalMatrix").setGroup(kt).onRenderUpdate(({camera:n})=>n.normalMatrix),vz=Rt(new Y).label("cameraPosition").setGroup(kt).onRenderUpdate(({camera:n},e)=>e.value.setFromMatrixPosition(n.matrixWorld));class Ht extends ut{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Wt.OBJECT,this._uniformNode=new Uh(null)}getNodeType(){const e=this.scope;if(e===Ht.WORLD_MATRIX)return"mat4";if(e===Ht.POSITION||e===Ht.VIEW_POSITION||e===Ht.DIRECTION||e===Ht.SCALE)return"vec3"}update(e){const t=this.object3d,i=this._uniformNode,r=this.scope;if(r===Ht.WORLD_MATRIX)i.value=t.matrixWorld;else if(r===Ht.POSITION)i.value=i.value||new Y,i.value.setFromMatrixPosition(t.matrixWorld);else if(r===Ht.SCALE)i.value=i.value||new Y,i.value.setFromMatrixScale(t.matrixWorld);else if(r===Ht.DIRECTION)i.value=i.value||new Y,t.getWorldDirection(i.value);else if(r===Ht.VIEW_POSITION){const s=e.camera;i.value=i.value||new Y,i.value.setFromMatrixPosition(t.matrixWorld),i.value.applyMatrix4(s.matrixWorldInverse)}}generate(e){const t=this.scope;return t===Ht.WORLD_MATRIX?this._uniformNode.nodeType="mat4":(t===Ht.POSITION||t===Ht.VIEW_POSITION||t===Ht.DIRECTION||t===Ht.SCALE)&&(this._uniformNode.nodeType="vec3"),this._uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}Ht.WORLD_MATRIX="worldMatrix";Ht.POSITION="position";Ht.SCALE="scale";Ht.VIEW_POSITION="viewPosition";Ht.DIRECTION="direction";const _z=Pe(Ht,Ht.DIRECTION),xz=Pe(Ht,Ht.WORLD_MATRIX),ZE=Pe(Ht,Ht.POSITION),Sz=Pe(Ht,Ht.SCALE),Az=Pe(Ht,Ht.VIEW_POSITION);class eo extends Ht{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const bz=Qe(eo,eo.DIRECTION),Fo=Qe(eo,eo.WORLD_MATRIX),Tz=Qe(eo,eo.POSITION),wz=Qe(eo,eo.SCALE),Cz=Qe(eo,eo.VIEW_POSITION),JE=Rt(new mt).onObjectUpdate(({object:n},e)=>e.value.getNormalMatrix(n.matrixWorld)),Ez=Rt(new Xe).onObjectUpdate(({object:n},e)=>e.value.copy(n.matrixWorld).invert()),Wh=_e(n=>n.renderer.nodes.modelViewMatrix||eM).once()().toVar("modelViewMatrix"),eM=ss.mul(Fo),Mz=_e(n=>(n.context.isHighPrecisionModelViewMatrix=!0,Rt("mat4").onObjectUpdate(({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))).once()().toVar("highpModelViewMatrix"),Rz=_e(n=>{const e=n.context.isHighPrecisionModelViewMatrix;return Rt("mat3").onObjectUpdate(({object:t,camera:i})=>(e!==!0&&t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix)))}).once()().toVar("highpModelNormalViewMatrix"),mx=Yo("position","vec3"),Nn=mx.toVarying("positionLocal"),Am=mx.toVarying("positionPrevious"),Nl=Fo.mul(Nn).xyz.toVarying("v_positionWorld").context({needsPositionReassign:!0}),tM=Nn.transformDirection(Fo).toVarying("v_positionWorldDirection").normalize().toVar("positionWorldDirection").context({needsPositionReassign:!0}),Yn=_e(n=>n.context.setupPositionView(),"vec3").once()().toVarying("v_positionView").context({needsPositionReassign:!0}),Er=Yn.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class Iz extends ut{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:i}=e;return t.coordinateSystem===Ir&&i.side===Fi?"false":e.getFrontFacing()}}const nM=Qe(Iz),Qh=ce(nM).mul(2).sub(1),gx=Yo("normal","vec3"),cr=_e(n=>n.geometry.hasAttribute("normal")===!1?(console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'),ve(0,1,0)):gx,"vec3").once()().toVar("normalLocal"),iM=Yn.dFdx().cross(Yn.dFdy()).normalize().toVar("normalFlat"),to=_e(n=>{let e;return n.material.flatShading===!0?e=iM:e=tr(yx(cr),"v_normalView").normalize(),e},"vec3").once()().toVar("normalView"),rM=tr(to.transformDirection(ss),"v_normalWorld").normalize().toVar("normalWorld"),Jo=_e(n=>n.context.setupNormal().context({getUV:null}),"vec3").once()().mul(Qh).toVar("transformedNormalView"),sM=Jo.transformDirection(ss).toVar("transformedNormalWorld"),Nz=_e(n=>n.context.setupClearcoatNormal().context({getUV:null}),"vec3").once()().mul(Qh).toVar("transformedClearcoatNormalView"),oM=_e(([n,e=Fo])=>{const t=is(e),i=n.div(ve(t[0].dot(t[0]),t[1].dot(t[1]),t[2].dot(t[2])));return t.mul(i).xyz}),yx=_e(([n],e)=>{const t=e.renderer.nodes.modelNormalViewMatrix;if(t!==null)return t.transformDirection(n);const i=JE.mul(n);return ss.transformDirection(i)}),aM=Rt(0).onReference(({material:n})=>n).onRenderUpdate(({material:n})=>n.refractionRatio),lM=Er.negate().reflect(Jo),cM=Er.negate().refract(Jo,aM),uM=lM.transformDirection(ss).toVar("reflectVector"),dM=cM.transformDirection(ss).toVar("reflectVector");class Pz extends Zo{static get type(){return"CubeTextureNode"}constructor(e,t=null,i=null,r=null){super(e,t,i,r),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===kl?uM:e.mapping===Ul?dM:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),ve(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const i=this.value;return e.renderer.coordinateSystem===Qo||!i.isRenderTargetTexture?ve(t.x.negate(),t.yz):t}generateUV(e,t){return t.build(e,"vec3")}}const hM=Pe(Pz);class Lz extends Ql{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),i=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,i,r)}}class d0 extends ut{static get type(){return"ReferenceNode"}constructor(e,t,i=null,r=null){super(),this.property=e,this.uniformType=t,this.object=i,this.count=r,this.properties=e.split("."),this.reference=i,this.node=null,this.group=null,this.name=null,this.updateType=Wt.OBJECT}element(e){return Fe(new Lz(this,Fe(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;this.count!==null?t=$h(null,e,this.count):Array.isArray(this.getValueFromReference())?t=Do(null,e):e==="texture"?t=er(null):e==="cubeTexture"?t=hM(null):t=Rt(null,e),this.group!==null&&t.setGroup(this.group),this.name!==null&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let i=e[t[0]];for(let r=1;r<t.length;r++)i=i[t[r]];return i}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const Pn=(n,e,t)=>Fe(new d0(n,e,t)),Xy=(n,e,t,i)=>Fe(new d0(n,e,i,t));class Dz extends d0{static get type(){return"MaterialReferenceNode"}constructor(e,t,i=null){super(e,t,i),this.material=i,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=this.material!==null?this.material:e.material,this.reference}}const ml=(n,e,t=null)=>Fe(new Dz(n,e,t)),h0=_e(n=>(n.geometry.hasAttribute("tangent")===!1&&n.geometry.computeTangents(),Yo("tangent","vec4")))(),jh=h0.xyz.toVar("tangentLocal"),qh=Wh.mul(vt(jh,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),fM=qh.transformDirection(ss).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),vx=qh.toVar("transformedTangentView"),Fz=vx.transformDirection(ss).normalize().toVar("transformedTangentWorld"),Xh=n=>n.mul(h0.w).xyz,Oz=tr(Xh(gx.cross(h0)),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Bz=tr(Xh(cr.cross(jh)),"v_bitangentLocal").normalize().toVar("bitangentLocal"),pM=tr(Xh(to.cross(qh)),"v_bitangentView").normalize().toVar("bitangentView"),kz=tr(Xh(rM.cross(fM)),"v_bitangentWorld").normalize().toVar("bitangentWorld"),mM=Xh(Jo.cross(vx)).normalize().toVar("transformedBitangentView"),Uz=mM.transformDirection(ss).normalize().toVar("transformedBitangentWorld"),_x=is(qh,pM,to),gM=Er.mul(_x),zz=(n,e)=>n.sub(gM.mul(e)),Vz=(()=>{let n=qc.cross(Er);return n=n.cross(qc).normalize(),n=Ln(n,Jo,NC.mul(RC.oneMinus()).oneMinus().pow2().pow2()).normalize(),n})(),Hz=_e(n=>{const{eye_pos:e,surf_norm:t,mapN:i,uv:r}=n,s=e.dFdx(),o=e.dFdy(),a=r.dFdx(),l=r.dFdy(),c=t,u=o.cross(c),d=c.cross(s),h=u.mul(a.x).add(d.mul(l.x)),f=u.mul(a.y).add(d.mul(l.y)),p=h.dot(h).max(f.dot(f)),g=Qh.mul(p.inverseSqrt());return On(h.mul(i.x,g),f.mul(i.y,g),c.mul(i.z)).normalize()});class $z extends kn{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=lm}setup(e){const{normalMapType:t,scaleNode:i}=this;let r=this.node.mul(2).sub(1);i!==null&&(r=ve(r.xy.mul(i),r.z));let s=null;return t===A5?s=yx(r):t===lm&&(e.hasGeometryAttribute("tangent")===!0?s=_x.mul(r).normalize():s=Hz({eye_pos:Yn,surf_norm:to,mapN:r,uv:xn()})),s}}const Ky=Pe($z),Gz=_e(({textureNode:n,bumpScale:e})=>{const t=r=>n.cache().context({getUV:s=>r(s.uvNode||xn()),forceUVContext:!0}),i=ce(t(r=>r));return He(ce(t(r=>r.add(r.dFdx()))).sub(i),ce(t(r=>r.add(r.dFdy()))).sub(i)).mul(e)}),Wz=_e(n=>{const{surf_pos:e,surf_norm:t,dHdxy:i}=n,r=e.dFdx().normalize(),s=e.dFdy().normalize(),o=t,a=s.cross(o),l=o.cross(r),c=r.dot(a).mul(Qh),u=c.sign().mul(i.x.mul(a).add(i.y.mul(l)));return c.abs().mul(t).sub(u).normalize()});class Qz extends kn{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=this.scaleNode!==null?this.scaleNode:1,t=Gz({textureNode:this.textureNode,bumpScale:e});return Wz({surf_pos:Yn,surf_norm:to,dHdxy:t})}}const yM=Pe(Qz),ob=new Map;class Ee extends ut{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let i=ob.get(e);return i===void 0&&(i=ml(e,t),ob.set(e,i)),i}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache(e==="map"?"map":e+"Map","texture")}setup(e){const t=e.context.material,i=this.scope;let r=null;if(i===Ee.COLOR){const s=t.color!==void 0?this.getColor(i):ve();t.map&&t.map.isTexture===!0?r=s.mul(this.getTexture("map")):r=s}else if(i===Ee.OPACITY){const s=this.getFloat(i);t.alphaMap&&t.alphaMap.isTexture===!0?r=s.mul(this.getTexture("alpha")):r=s}else if(i===Ee.SPECULAR_STRENGTH)t.specularMap&&t.specularMap.isTexture===!0?r=this.getTexture("specular").r:r=ce(1);else if(i===Ee.SPECULAR_INTENSITY){const s=this.getFloat(i);t.specularIntensityMap&&t.specularIntensityMap.isTexture===!0?r=s.mul(this.getTexture(i).a):r=s}else if(i===Ee.SPECULAR_COLOR){const s=this.getColor(i);t.specularColorMap&&t.specularColorMap.isTexture===!0?r=s.mul(this.getTexture(i).rgb):r=s}else if(i===Ee.ROUGHNESS){const s=this.getFloat(i);t.roughnessMap&&t.roughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).g):r=s}else if(i===Ee.METALNESS){const s=this.getFloat(i);t.metalnessMap&&t.metalnessMap.isTexture===!0?r=s.mul(this.getTexture(i).b):r=s}else if(i===Ee.EMISSIVE){const s=this.getFloat("emissiveIntensity"),o=this.getColor(i).mul(s);t.emissiveMap&&t.emissiveMap.isTexture===!0?r=o.mul(this.getTexture(i)):r=o}else if(i===Ee.NORMAL)t.normalMap?(r=Ky(this.getTexture("normal"),this.getCache("normalScale","vec2")),r.normalMapType=t.normalMapType):t.bumpMap?r=yM(this.getTexture("bump").r,this.getFloat("bumpScale")):r=to;else if(i===Ee.CLEARCOAT){const s=this.getFloat(i);t.clearcoatMap&&t.clearcoatMap.isTexture===!0?r=s.mul(this.getTexture(i).r):r=s}else if(i===Ee.CLEARCOAT_ROUGHNESS){const s=this.getFloat(i);t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).r):r=s}else if(i===Ee.CLEARCOAT_NORMAL)t.clearcoatNormalMap?r=Ky(this.getTexture(i),this.getCache(i+"Scale","vec2")):r=to;else if(i===Ee.SHEEN){const s=this.getColor("sheenColor").mul(this.getFloat("sheen"));t.sheenColorMap&&t.sheenColorMap.isTexture===!0?r=s.mul(this.getTexture("sheenColor").rgb):r=s}else if(i===Ee.SHEEN_ROUGHNESS){const s=this.getFloat(i);t.sheenRoughnessMap&&t.sheenRoughnessMap.isTexture===!0?r=s.mul(this.getTexture(i).a):r=s,r=r.clamp(.07,1)}else if(i===Ee.ANISOTROPY)if(t.anisotropyMap&&t.anisotropyMap.isTexture===!0){const s=this.getTexture(i);r=o0(Mc.x,Mc.y,Mc.y.negate(),Mc.x).mul(s.rg.mul(2).sub(He(1)).normalize().mul(s.b))}else r=Mc;else if(i===Ee.IRIDESCENCE_THICKNESS){const s=Pn("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const o=Pn("0","float",t.iridescenceThicknessRange);r=s.sub(o).mul(this.getTexture(i).g).add(o)}else r=s}else if(i===Ee.TRANSMISSION){const s=this.getFloat(i);t.transmissionMap?r=s.mul(this.getTexture(i).r):r=s}else if(i===Ee.THICKNESS){const s=this.getFloat(i);t.thicknessMap?r=s.mul(this.getTexture(i).g):r=s}else if(i===Ee.IOR)r=this.getFloat(i);else if(i===Ee.LIGHT_MAP)r=this.getTexture(i).rgb.mul(this.getFloat("lightMapIntensity"));else if(i===Ee.AO)r=this.getTexture(i).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const s=this.getNodeType(e);r=this.getCache(i,s)}return r}}Ee.ALPHA_TEST="alphaTest";Ee.COLOR="color";Ee.OPACITY="opacity";Ee.SHININESS="shininess";Ee.SPECULAR="specular";Ee.SPECULAR_STRENGTH="specularStrength";Ee.SPECULAR_INTENSITY="specularIntensity";Ee.SPECULAR_COLOR="specularColor";Ee.REFLECTIVITY="reflectivity";Ee.ROUGHNESS="roughness";Ee.METALNESS="metalness";Ee.NORMAL="normal";Ee.CLEARCOAT="clearcoat";Ee.CLEARCOAT_ROUGHNESS="clearcoatRoughness";Ee.CLEARCOAT_NORMAL="clearcoatNormal";Ee.EMISSIVE="emissive";Ee.ROTATION="rotation";Ee.SHEEN="sheen";Ee.SHEEN_ROUGHNESS="sheenRoughness";Ee.ANISOTROPY="anisotropy";Ee.IRIDESCENCE="iridescence";Ee.IRIDESCENCE_IOR="iridescenceIOR";Ee.IRIDESCENCE_THICKNESS="iridescenceThickness";Ee.IOR="ior";Ee.TRANSMISSION="transmission";Ee.THICKNESS="thickness";Ee.ATTENUATION_DISTANCE="attenuationDistance";Ee.ATTENUATION_COLOR="attenuationColor";Ee.LINE_SCALE="scale";Ee.LINE_DASH_SIZE="dashSize";Ee.LINE_GAP_SIZE="gapSize";Ee.LINE_WIDTH="linewidth";Ee.LINE_DASH_OFFSET="dashOffset";Ee.POINT_SIZE="size";Ee.DISPERSION="dispersion";Ee.LIGHT_MAP="light";Ee.AO="ao";const vM=Qe(Ee,Ee.ALPHA_TEST),_M=Qe(Ee,Ee.COLOR),jz=Qe(Ee,Ee.SHININESS),xM=Qe(Ee,Ee.EMISSIVE),SM=Qe(Ee,Ee.OPACITY),qz=Qe(Ee,Ee.SPECULAR),Xz=Qe(Ee,Ee.SPECULAR_INTENSITY),Kz=Qe(Ee,Ee.SPECULAR_COLOR),Yz=Qe(Ee,Ee.SPECULAR_STRENGTH),Zz=Qe(Ee,Ee.REFLECTIVITY),Jz=Qe(Ee,Ee.ROUGHNESS),eV=Qe(Ee,Ee.METALNESS),AM=Qe(Ee,Ee.NORMAL),tV=Qe(Ee,Ee.CLEARCOAT),nV=Qe(Ee,Ee.CLEARCOAT_ROUGHNESS),iV=Qe(Ee,Ee.CLEARCOAT_NORMAL),rV=Qe(Ee,Ee.ROTATION),sV=Qe(Ee,Ee.SHEEN),oV=Qe(Ee,Ee.SHEEN_ROUGHNESS),aV=Qe(Ee,Ee.ANISOTROPY),lV=Qe(Ee,Ee.IRIDESCENCE),cV=Qe(Ee,Ee.IRIDESCENCE_IOR),uV=Qe(Ee,Ee.IRIDESCENCE_THICKNESS),dV=Qe(Ee,Ee.TRANSMISSION),hV=Qe(Ee,Ee.THICKNESS),fV=Qe(Ee,Ee.IOR),pV=Qe(Ee,Ee.ATTENUATION_DISTANCE),mV=Qe(Ee,Ee.ATTENUATION_COLOR),gV=Qe(Ee,Ee.LINE_SCALE),yV=Qe(Ee,Ee.LINE_DASH_SIZE),vV=Qe(Ee,Ee.LINE_GAP_SIZE),_V=Qe(Ee,Ee.LINE_WIDTH),xV=Qe(Ee,Ee.LINE_DASH_OFFSET),SV=Qe(Ee,Ee.POINT_SIZE),AV=Qe(Ee,Ee.DISPERSION),bM=Qe(Ee,Ee.LIGHT_MAP),TM=Qe(Ee,Ee.AO),Mc=Rt(new qe).onReference(function(n){return n.material}).onRenderUpdate(function({material:n}){this.value.set(n.anisotropy*Math.cos(n.anisotropyRotation),n.anisotropy*Math.sin(n.anisotropyRotation))}),wM=_e(n=>n.context.setupModelViewProjection(),"vec4").once()().toVarying("v_modelViewProjection");class vn extends ut{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),i=this.scope;let r;if(i===vn.VERTEX)r=e.getVertexIndex();else if(i===vn.INSTANCE)r=e.getInstanceIndex();else if(i===vn.DRAW)r=e.getDrawIndex();else if(i===vn.INVOCATION_LOCAL)r=e.getInvocationLocalIndex();else if(i===vn.INVOCATION_SUBGROUP)r=e.getInvocationSubgroupIndex();else if(i===vn.SUBGROUP)r=e.getSubgroupIndex();else throw new Error("THREE.IndexNode: Unknown scope: "+i);let s;return e.shaderStage==="vertex"||e.shaderStage==="compute"?s=r:s=tr(this).build(e,t),s}}vn.VERTEX="vertex";vn.INSTANCE="instance";vn.SUBGROUP="subgroup";vn.INVOCATION_LOCAL="invocationLocal";vn.INVOCATION_SUBGROUP="invocationSubgroup";vn.DRAW="draw";const CM=Qe(vn,vn.VERTEX),Kh=Qe(vn,vn.INSTANCE),bV=Qe(vn,vn.SUBGROUP),TV=Qe(vn,vn.INVOCATION_SUBGROUP),wV=Qe(vn,vn.INVOCATION_LOCAL),EM=Qe(vn,vn.DRAW);class MM extends ut{static get type(){return"InstanceNode"}constructor(e,t,i){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=i,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=Wt.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:i,instanceColor:r}=this;let{instanceMatrixNode:s,instanceColorNode:o}=this;if(s===null){if(t<=1e3)s=$h(i.array,"mat4",Math.max(t,1)).element(Kh);else{const l=new ZL(i.array,16,1);this.buffer=l;const c=i.usage===ba?qy:Sm,u=[c(l,"vec4",16,0),c(l,"vec4",16,4),c(l,"vec4",16,8),c(l,"vec4",16,12)];s=Il(...u)}this.instanceMatrixNode=s}if(r&&o===null){const l=new jo(r.array,3),c=r.usage===ba?qy:Sm;this.bufferColor=l,o=ve(c(l,"vec3",3,0)),this.instanceColorNode=o}const a=s.mul(Nn).xyz;if(Nn.assign(a),e.hasGeometryAttribute("normal")){const l=oM(cr,s);cr.assign(l)}this.instanceColorNode!==null&&mh("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==ba&&this.buffer!==null&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==ba&&this.bufferColor!==null&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const CV=Pe(MM);class EV extends MM{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:i,instanceColor:r}=e;super(t,i,r),this.instancedMesh=e}}const RM=Pe(EV);class MV extends ut{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){this.batchingIdNode===null&&(e.getDrawIndex()===null?this.batchingIdNode=Kh:this.batchingIdNode=EM);const i=_e(([p])=>{const g=de(Pa(Rn(this.batchMesh._indirectTexture),0)),y=de(p).modInt(g),m=de(p).div(g);return Rn(this.batchMesh._indirectTexture,Xn(y,m)).x}).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]})(de(this.batchingIdNode)),r=this.batchMesh._matricesTexture,s=Pa(Rn(r),0),o=ce(i).mul(4).toInt().toVar(),a=o.modInt(s),l=o.div(de(s)),c=Il(Rn(r,Xn(a,l)),Rn(r,Xn(a.add(1),l)),Rn(r,Xn(a.add(2),l)),Rn(r,Xn(a.add(3),l))),u=this.batchMesh._colorsTexture;if(u!==null){const g=_e(([y])=>{const m=Pa(Rn(u),0).x,v=y,x=v.modInt(m),_=v.div(m);return Rn(u,Xn(x,_)).rgb}).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]})(i);mh("vec3","vBatchColor").assign(g)}const d=is(c);Nn.assign(c.mul(Nn));const h=cr.div(ve(d[0].dot(d[0]),d[1].dot(d[1]),d[2].dot(d[2]))),f=d.mul(h).xyz;cr.assign(f),e.hasGeometryAttribute("tangent")&&jh.mulAssign(d)}}const IM=Pe(MV),ab=new WeakMap;class NM extends ut{static get type(){return"SkinningNode"}constructor(e,t=!1){super("void"),this.skinnedMesh=e,this.useReference=t,this.updateType=Wt.OBJECT,this.skinIndexNode=Yo("skinIndex","uvec4"),this.skinWeightNode=Yo("skinWeight","vec4");let i,r,s;t?(i=Pn("bindMatrix","mat4"),r=Pn("bindMatrixInverse","mat4"),s=Xy("skeleton.boneMatrices","mat4",e.skeleton.bones.length)):(i=Rt(e.bindMatrix,"mat4"),r=Rt(e.bindMatrixInverse,"mat4"),s=$h(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length)),this.bindMatrixNode=i,this.bindMatrixInverseNode=r,this.boneMatricesNode=s,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=Nn){const{skinIndexNode:i,skinWeightNode:r,bindMatrixNode:s,bindMatrixInverseNode:o}=this,a=e.element(i.x),l=e.element(i.y),c=e.element(i.z),u=e.element(i.w),d=s.mul(t),h=On(a.mul(r.x).mul(d),l.mul(r.y).mul(d),c.mul(r.z).mul(d),u.mul(r.w).mul(d));return o.mul(h).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=cr){const{skinIndexNode:i,skinWeightNode:r,bindMatrixNode:s,bindMatrixInverseNode:o}=this,a=e.element(i.x),l=e.element(i.y),c=e.element(i.z),u=e.element(i.w);let d=On(r.x.mul(a),r.y.mul(l),r.z.mul(c),r.w.mul(u));return d=o.mul(d).mul(s),d.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return this.previousBoneMatricesNode===null&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=Xy("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,Am)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||rC(e.object).useVelocity===!0}setup(e){this.needsPreviousBoneMatrices(e)&&Am.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(Nn.assign(t),e.hasGeometryAttribute("normal")){const i=this.getSkinnedNormal();cr.assign(i),e.hasGeometryAttribute("tangent")&&jh.assign(i)}}generate(e,t){if(t!=="void")return Nn.build(e,t)}update(e){const i=(this.useReference?e.object:this.skinnedMesh).skeleton;ab.get(i)!==e.frameId&&(ab.set(i,e.frameId),this.previousBoneMatricesNode!==null&&i.previousBoneMatrices.set(i.boneMatrices),i.update())}}const RV=n=>Fe(new NM(n)),PM=n=>Fe(new NM(n,!0));class IV extends ut{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode(105+e)}getProperties(e){const t=e.getNodeProperties(this);if(t.stackNode!==void 0)return t;const i={};for(let s=0,o=this.params.length-1;s<o;s++){const a=this.params[s],l=a.isNode!==!0&&a.name||this.getVarName(s),c=a.isNode!==!0&&a.type||"int";i[l]=Oa(l,c)}const r=e.addStack();return t.returnsNode=this.params[this.params.length-1](i,r,e),t.stackNode=r,e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),i=this.params,r=t.stackNode;for(let a=0,l=i.length-1;a<l;a++){const c=i[a];let u=null,d=null,h=null,f=null,p=null,g=null;c.isNode?(f="int",h=this.getVarName(a),u="0",d=c.build(e,f),p="<"):(f=c.type||"int",h=c.name||this.getVarName(a),u=c.start,d=c.end,p=c.condition,g=c.update,typeof u=="number"?u=e.generateConst(f,u):u&&u.isNode&&(u=u.build(e,f)),typeof d=="number"?d=e.generateConst(f,d):d&&d.isNode&&(d=d.build(e,f)),u!==void 0&&d===void 0?(u=u+" - 1",d="0",p=">="):d!==void 0&&u===void 0&&(u="0",p="<"),p===void 0&&(Number(u)>Number(d)?p=">=":p="<"));const y={start:u,end:d},m=y.start,v=y.end;let x="",_="",S="";g||(f==="int"||f==="uint"?p.includes("<")?g="++":g="--":p.includes("<")?g="+= 1.":g="-= 1."),x+=e.getVar(f,h)+" = "+m,_+=h+" "+p+" "+v,S+=h+" "+g;const E="for ( ".concat(x,"; ").concat(_,"; ").concat(S," )");e.addFlowCode((a===0?"\n":"")+e.tab+E+" {\n\n").addFlowTab()}const s=r.build(e,"void"),o=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+s);for(let a=0,l=this.params.length-1;a<l;a++)e.addFlowCode((a===0?"":e.tab)+"}\n\n").removeFlowTab();return e.addFlowTab(),o}}const cn=(...n)=>Fe(new IV(Rl(n,"int"))).append(),NV=()=>Oa("continue").append(),LM=()=>Oa("break").append(),PV=(...n)=>(console.warn("TSL.LoopNode: loop() has been renamed to Loop()."),cn(...n)),jg=new WeakMap,pr=new Mt,lb=_e(({bufferMap:n,influence:e,stride:t,width:i,depth:r,offset:s})=>{const o=de(CM).mul(t).add(s),a=o.div(i),l=o.sub(a.mul(i));return Rn(n,Xn(l,a)).depth(r).mul(e)});function LV(n){const e=n.morphAttributes.position!==void 0,t=n.morphAttributes.normal!==void 0,i=n.morphAttributes.color!==void 0,r=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,s=r!==void 0?r.length:0;let o=jg.get(n);if(o===void 0||o.count!==s){let m=function(){g.dispose(),jg.delete(n),n.removeEventListener("dispose",m)};o!==void 0&&o.texture.dispose();const a=n.morphAttributes.position||[],l=n.morphAttributes.normal||[],c=n.morphAttributes.color||[];let u=0;e===!0&&(u=1),t===!0&&(u=2),i===!0&&(u=3);let d=n.attributes.position.count*u,h=1;const f=4096;d>f&&(h=Math.ceil(d/f),d=f);const p=new Float32Array(d*h*4*s),g=new __(p,d,h,s);g.type=ir,g.needsUpdate=!0;const y=u*4;for(let v=0;v<s;v++){const x=a[v],_=l[v],S=c[v],E=d*h*4*v;for(let A=0;A<x.count;A++){const R=A*y;e===!0&&(pr.fromBufferAttribute(x,A),p[E+R+0]=pr.x,p[E+R+1]=pr.y,p[E+R+2]=pr.z,p[E+R+3]=0),t===!0&&(pr.fromBufferAttribute(_,A),p[E+R+4]=pr.x,p[E+R+5]=pr.y,p[E+R+6]=pr.z,p[E+R+7]=0),i===!0&&(pr.fromBufferAttribute(S,A),p[E+R+8]=pr.x,p[E+R+9]=pr.y,p[E+R+10]=pr.z,p[E+R+11]=S.itemSize===4?pr.w:1)}}o={count:s,texture:g,stride:u,size:new qe(d,h)},jg.set(n,o),n.addEventListener("dispose",m)}return o}class DV extends ut{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Rt(1),this.updateType=Wt.OBJECT}setup(e){const{geometry:t}=e,i=t.morphAttributes.position!==void 0,r=t.hasAttribute("normal")&&t.morphAttributes.normal!==void 0,s=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,o=s!==void 0?s.length:0,{texture:a,stride:l,size:c}=LV(t);i===!0&&Nn.mulAssign(this.morphBaseInfluence),r===!0&&cr.mulAssign(this.morphBaseInfluence);const u=de(c.width);cn(o,({i:d})=>{const h=ce(0).toVar();this.mesh.count>1&&this.mesh.morphTexture!==null&&this.mesh.morphTexture!==void 0?h.assign(Rn(this.mesh.morphTexture,Xn(de(d).add(1),de(Kh))).r):h.assign(Pn("morphTargetInfluences","float").element(d).toVar()),i===!0&&Nn.addAssign(lb({bufferMap:a,influence:h,stride:l,width:u,depth:d,offset:de(0)})),r===!0&&cr.addAssign(lb({bufferMap:a,influence:h,stride:l,width:u,depth:d,offset:de(1)}))})}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce((t,i)=>t+i,0)}}const DM=Pe(DV);class FM extends ut{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class FV extends FM{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class OV extends CE{static get type(){return"LightingContextNode"}constructor(e,t=null,i=null,r=null){super(e),this.lightingModel=t,this.backdropNode=i,this.backdropAlphaNode=r,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,i=ve().toVar("directDiffuse"),r=ve().toVar("directSpecular"),s=ve().toVar("indirectDiffuse"),o=ve().toVar("indirectSpecular"),a={directDiffuse:i,directSpecular:r,indirectDiffuse:s,indirectSpecular:o};return{radiance:ve().toVar("radiance"),irradiance:ve().toVar("irradiance"),iblIrradiance:ve().toVar("iblIrradiance"),ambientOcclusion:ce(1).toVar("ambientOcclusion"),reflectedLight:a,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const OM=Pe(OV);class BV extends FM{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let ud,dd;class Vn extends ut{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===Vn.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Wt.NONE;return(this.scope===Vn.SIZE||this.scope===Vn.VIEWPORT)&&(e=Wt.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===Vn.VIEWPORT?t!==null?dd.copy(t.viewport):(e.getViewport(dd),dd.multiplyScalar(e.getPixelRatio())):t!==null?(ud.width=t.width,ud.height=t.height):e.getDrawingBufferSize(ud)}setup(){const e=this.scope;let t=null;return e===Vn.SIZE?t=Rt(ud||(ud=new qe)):e===Vn.VIEWPORT?t=Rt(dd||(dd=new Mt)):t=He(Yh.div(bm)),t}generate(e){if(this.scope===Vn.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const i=e.getNodeProperties(bm).outputNode.build(e);t="".concat(e.getType("vec2"),"( ").concat(t,".x, ").concat(i,".y - ").concat(t,".y )")}return t}return super.generate(e)}}Vn.COORDINATE="coordinate";Vn.VIEWPORT="viewport";Vn.SIZE="size";Vn.UV="uv";const Va=Qe(Vn,Vn.UV),bm=Qe(Vn,Vn.SIZE),Yh=Qe(Vn,Vn.COORDINATE),xx=Qe(Vn,Vn.VIEWPORT),BM=xx.zw,kM=Yh.sub(xx.xy),kV=kM.div(BM),UV=_e(()=>(console.warn('TSL.ViewportNode: "viewportResolution" is deprecated. Use "screenSize" instead.'),bm),"vec2").once()(),zV=_e(()=>(console.warn('TSL.ViewportNode: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),Va),"vec2").once()(),VV=_e(()=>(console.warn('TSL.ViewportNode: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),Va.flipY()),"vec2").once()(),hd=new qe;class f0 extends Zo{static get type(){return"ViewportTextureNode"}constructor(e=Va,t=null,i=null){i===null&&(i=new O5,i.minFilter=Hs),super(i,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=Wt.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(hd);const i=this.value;(i.image.width!==hd.width||i.image.height!==hd.height)&&(i.image.width=hd.width,i.image.height=hd.height,i.needsUpdate=!0);const r=i.generateMipmaps;i.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(i),i.generateMipmaps=r}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const HV=Pe(f0),$V=Pe(f0,null,null,{generateMipmaps:!0});let qg=null;class GV extends f0{static get type(){return"ViewportDepthTextureNode"}constructor(e=Va,t=null){qg===null&&(qg=new Ua),super(e,t,qg)}}const Sx=Pe(GV);class or extends ut{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===or.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,i=this.valueNode;let r=null;if(t===or.DEPTH_BASE)i!==null&&(r=zM().assign(i));else if(t===or.DEPTH)e.isPerspectiveCamera?r=UM(Yn.z,_a,xa):r=Xc(Yn.z,_a,xa);else if(t===or.LINEAR_DEPTH)if(i!==null)if(e.isPerspectiveCamera){const s=Ax(i,_a,xa);r=Xc(s,_a,xa)}else r=i;else r=Xc(Yn.z,_a,xa);return r}}or.DEPTH_BASE="depthBase";or.DEPTH="depth";or.LINEAR_DEPTH="linearDepth";const Xc=(n,e,t)=>n.add(e).div(e.sub(t)),WV=(n,e,t)=>e.sub(t).mul(n).sub(e),UM=(n,e,t)=>e.add(n).mul(t).div(t.sub(e).mul(n)),Ax=(n,e,t)=>e.mul(t).div(t.sub(e).mul(n).sub(t)),bx=(n,e,t)=>{e=e.max(1e-6).toVar();const i=Ho(n.negate().div(e)),r=Ho(t.div(e));return i.div(r)},QV=(n,e,t)=>{const i=n.mul(J_(t.div(e)));return ce(Math.E).pow(i).mul(e).negate()},zM=Pe(or,or.DEPTH_BASE),Tx=Qe(or,or.DEPTH),Tm=Pe(or,or.LINEAR_DEPTH),jV=Tm(Sx());Tx.assign=n=>zM(n);class qV extends ut{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}const XV=Pe(qV);class ts extends ut{static get type(){return"ClippingNode"}constructor(e=ts.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:i,unionPlanes:r}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===ts.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(i,r):this.scope===ts.HARDWARE?this.setupHardwareClipping(r,e):this.setupDefault(i,r)}setupAlphaToCoverage(e,t){return _e(()=>{const i=ce().toVar("distanceToPlane"),r=ce().toVar("distanceToGradient"),s=ce(1).toVar("clipOpacity"),o=t.length;if(this.hardwareClipping===!1&&o>0){const l=Do(t);cn(o,({i:c})=>{const u=l.element(c);i.assign(Yn.dot(u.xyz).negate().add(u.w)),r.assign(i.fwidth().div(2)),s.mulAssign(Vl(r.negate(),r,i))})}const a=e.length;if(a>0){const l=Do(e),c=ce(1).toVar("intersectionClipOpacity");cn(a,({i:u})=>{const d=l.element(u);i.assign(Yn.dot(d.xyz).negate().add(d.w)),r.assign(i.fwidth().div(2)),c.mulAssign(Vl(r.negate(),r,i).oneMinus())}),s.mulAssign(c.oneMinus())}hs.a.mulAssign(s),hs.a.equal(0).discard()})()}setupDefault(e,t){return _e(()=>{const i=t.length;if(this.hardwareClipping===!1&&i>0){const s=Do(t);cn(i,({i:o})=>{const a=s.element(o);Yn.dot(a.xyz).greaterThan(a.w).discard()})}const r=e.length;if(r>0){const s=Do(e),o=qo(!0).toVar("clipped");cn(r,({i:a})=>{const l=s.element(a);o.assign(Yn.dot(l.xyz).greaterThan(l.w).and(o))}),o.discard()}})()}setupHardwareClipping(e,t){const i=e.length;return t.enableHardwareClipping(i),_e(()=>{const r=Do(e),s=XV(t.getClipDistance());cn(i,({i:o})=>{const a=r.element(o),l=Yn.dot(a.xyz).sub(a.w).negate();s.element(o).assign(l)})})()}}ts.ALPHA_TO_COVERAGE="alphaToCoverage";ts.DEFAULT="default";ts.HARDWARE="hardware";const KV=()=>Fe(new ts),YV=()=>Fe(new ts(ts.ALPHA_TO_COVERAGE)),ZV=()=>Fe(new ts(ts.HARDWARE)),JV=.05,cb=_e(([n])=>na(St(1e4,wr(St(17,n.x).add(St(.1,n.y)))).mul(On(.1,mn(wr(St(13,n.y).add(n.x))))))),ub=_e(([n])=>cb(He(cb(n.xy),n.z))),eH=_e(([n])=>{const e=ui(xm(ix(n.xyz)),xm(rx(n.xyz))),t=ce(1).div(ce(JV).mul(e)).toVar("pixScale"),i=He(xu(js(Ho(t))),xu(l0(Ho(t)))),r=He(ub(js(i.x.mul(n.xyz))),ub(js(i.y.mul(n.xyz)))),s=na(Ho(t)),o=On(St(s.oneMinus(),r.x),St(s,r.y)),a=Fr(s,s.oneMinus()),l=ve(o.mul(o).div(St(2,a).mul(Bt(1,a))),o.sub(St(.5,a)).div(Bt(1,a)),Bt(1,Bt(1,o).mul(Bt(1,o)).div(St(2,a).mul(Bt(1,a))))),c=o.lessThan(a.oneMinus()).select(o.lessThan(a).select(l.x,l.y),l.z);return Ko(c,1e-6,1)}).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class yh extends es{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.shadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null}customProgramCacheKey(){return this.type+nC(this)}build(e){this.setup(e)}setupObserver(e){return new jk(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,i=t.getRenderTarget();e.addStack();const r=this.vertexNode||this.setupVertex(e);e.stack.outputNode=r,this.setupHardwareClipping(e),this.geometryNode!==null&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();let s;const o=this.setupClipping(e);if((this.depthWrite===!0||this.depthTest===!0)&&(i!==null?i.depthBuffer===!0&&this.setupDepth(e):t.depth===!0&&this.setupDepth(e)),this.fragmentNode===null){this.setupDiffuseColor(e),this.setupVariants(e);const a=this.setupLighting(e);o!==null&&e.stack.add(o);const l=vt(a,hs.a).max(0);if(s=this.setupOutput(e,l),gh.assign(s),this.outputNode!==null&&(s=this.outputNode),i!==null){const c=t.getMRT(),u=this.mrtNode;c!==null?(s=c,u!==null&&(s=c.merge(u))):u!==null&&(s=u)}}else{let a=this.fragmentNode;a.isOutputStructNode!==!0&&(a=vt(a)),s=this.setupOutput(e,a)}e.stack.outputNode=s,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(e.clippingContext===null)return null;const{unionPlanes:t,intersectionPlanes:i}=e.clippingContext;let r=null;if(t.length>0||i.length>0){const s=e.renderer.samples;this.alphaToCoverage&&s>1?r=YV():e.stack.add(KV())}return r}setupHardwareClipping(e){if(this.hardwareClipping=!1,e.clippingContext===null)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(ZV()),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:i}=e;let r=this.depthNode;if(r===null){const s=t.getMRT();s&&s.has("depth")?r=s.get("depth"):t.logarithmicDepthBuffer===!0&&(i.isPerspectiveCamera?r=bx(Yn.z,_a,xa):r=Xc(Yn.z,_a,xa))}r!==null&&Tx.assign(r).append()}setupPositionView(){return Wh.mul(Nn).xyz}setupModelViewProjection(){return Gh.mul(Yn)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),wM}setupPosition(e){const{object:t,geometry:i}=e;if((i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color)&&DM(t).append(),t.isSkinnedMesh===!0&&PM(t).append(),this.displacementMap){const r=ml("displacementMap","texture"),s=ml("displacementScale","float"),o=ml("displacementBias","float");Nn.addAssign(cr.normalize().mul(r.x.mul(s).add(o)))}return t.isBatchedMesh&&IM(t).append(),t.isInstancedMesh&&t.instanceMatrix&&t.instanceMatrix.isInstancedBufferAttribute===!0&&RM(t).append(),this.positionNode!==null&&Nn.assign(this.positionNode.context({isPositionNodeInput:!0})),Nn}setupDiffuseColor({object:e,geometry:t}){let i=this.colorNode?vt(this.colorNode):_M;this.vertexColors===!0&&t.hasAttribute("color")&&(i=vt(i.xyz.mul(Yo("color","vec3")),i.a)),e.instanceColor&&(i=mh("vec3","vInstanceColor").mul(i)),e.isBatchedMesh&&e._colorsTexture&&(i=mh("vec3","vBatchColor").mul(i)),hs.assign(i);const r=this.opacityNode?ce(this.opacityNode):SM;if(hs.a.assign(hs.a.mul(r)),this.alphaTestNode!==null||this.alphaTest>0){const s=this.alphaTestNode!==null?ce(this.alphaTestNode):vM;hs.a.lessThanEqual(s).discard()}this.alphaHash===!0&&hs.a.lessThan(eH(Nn)).discard(),this.transparent===!1&&this.blending===zo&&this.alphaToCoverage===!1&&hs.a.assign(1)}setupVariants(){}setupOutgoingLight(){return this.lights===!0?ve(0):hs.rgb}setupNormal(){return this.normalNode?ve(this.normalNode):AM}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?ml("envMap","cubeTexture"):ml("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new BV(bM)),t}setupLights(e){const t=[],i=this.setupEnvironment(e);i&&i.isLightingNode&&t.push(i);const r=this.setupLightMap(e);if(r&&r.isLightingNode&&t.push(r),this.aoNode!==null||e.material.aoMap){const o=this.aoNode!==null?this.aoNode:TM;t.push(new FV(o))}let s=this.lightsNode||e.lightsNode;return t.length>0&&(s=e.renderer.lighting.createNode([...s.getLights(),...t])),s}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:i,backdropAlphaNode:r,emissiveNode:s}=this,a=this.lights===!0||this.lightsNode!==null?this.setupLights(e):null;let l=this.setupOutgoingLight(e);if(a&&a.getScope().hasLights){const c=this.setupLightingModel(e);l=OM(a,c,i,r)}else i!==null&&(l=ve(r!==null?Ln(l,i,r):i));return(s&&s.isNode===!0||t.emissive&&t.emissive.isColor===!0)&&(Qy.assign(ve(s||xM)),l=l.add(Qy)),l}setupOutput(e,t){if(this.fog===!0){const i=e.fogNode;i&&(gh.assign(t),t=vt(i))}return t}setDefaultValues(e){for(const i in e){const r=e[i];this[i]===void 0&&(this[i]=r,r&&r.clone&&(this[i]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const i in t)Object.getOwnPropertyDescriptor(this.constructor.prototype,i)===void 0&&t[i].get!==void 0&&Object.defineProperty(this.constructor.prototype,i,t[i])}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{},nodes:{}});const i=es.prototype.toJSON.call(this,e),r=ym(this);i.inputNodes={};for(const{property:o,childNode:a}of r)i.inputNodes[o]=a.toJSON(e).uuid;function s(o){const a=[];for(const l in o){const c=o[l];delete c.metadata,a.push(c)}return a}if(t){const o=s(e.textures),a=s(e.images),l=s(e.nodes);o.length>0&&(i.textures=o),a.length>0&&(i.images=a),l.length>0&&(i.nodes=l)}return i}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.shadowPositionNode=e.shadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}let Xg=null;class tH extends f0{static get type(){return"ViewportSharedTextureNode"}constructor(e=Va,t=null){Xg===null&&(Xg=new O5),super(e,t,Xg)}updateReference(){return this}}const nH=Pe(tH),iH=n=>Fe(n).mul(.5).add(.5),rH=n=>Fe(n).mul(2).sub(1);class sH extends kn{static get type(){return"EquirectUVNode"}constructor(e=tM){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(Math.PI*2)).add(.5),i=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return He(t,i)}}const oH=Pe(sH),VM=_e(({f0:n,f90:e,dotVH:t})=>{const i=t.mul(-5.55473).sub(6.98316).mul(t).exp2();return n.mul(i.oneMinus()).add(e.mul(i))}),aH=_e(n=>n.diffuseColor.mul(1/Math.PI)),HM=_e(n=>{if(n.geometry.hasAttribute("normal")===!1)return ce(0);const e=to.dFdx().abs().max(to.dFdy().abs());return e.x.max(e.y).max(e.z)}),lH=_e(n=>{const{roughness:e}=n,t=HM();let i=e.max(.0525);return i=i.add(t),i=i.min(1),i}),$M=_e(({alpha:n,dotNL:e,dotNV:t})=>{const i=n.pow2(),r=e.mul(i.add(i.oneMinus().mul(t.pow2())).sqrt()),s=t.mul(i.add(i.oneMinus().mul(e.pow2())).sqrt());return Xo(.5,r.add(s).max(KC))}).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),cH=_e(({alphaT:n,alphaB:e,dotTV:t,dotBV:i,dotTL:r,dotBL:s,dotNV:o,dotNL:a})=>{const l=a.mul(ve(n.mul(t),e.mul(i),o).length()),c=o.mul(ve(n.mul(r),e.mul(s),a).length());return Xo(.5,l.add(c)).saturate()}).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),GM=_e(({alpha:n,dotNH:e})=>{const t=n.pow2(),i=e.pow2().mul(t.oneMinus()).oneMinus();return t.div(i.pow2()).mul(1/Math.PI)}).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),uH=ce(1/Math.PI),dH=_e(({alphaT:n,alphaB:e,dotNH:t,dotTH:i,dotBH:r})=>{const s=n.mul(e),o=ve(e.mul(i),n.mul(r),s.mul(t)),a=o.dot(o),l=s.div(a);return uH.mul(s.mul(l.pow2()))}).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),hH=_e(n=>{const{lightDirection:e,f0:t,f90:i,roughness:r,f:s,USE_IRIDESCENCE:o,USE_ANISOTROPY:a}=n,l=n.normalView||Jo,c=r.pow2(),u=e.add(Er).normalize(),d=l.dot(e).clamp(),h=l.dot(Er).clamp(),f=l.dot(u).clamp(),p=Er.dot(u).clamp();let g=VM({f0:t,f90:i,dotVH:p}),y,m;if(ph(o)&&(g=IC.mix(g,s)),ph(a)){const v=Ip.dot(e),x=Ip.dot(Er),_=Ip.dot(u),S=qc.dot(e),E=qc.dot(Er),A=qc.dot(u);y=cH({alphaT:jy,alphaB:c,dotTV:x,dotBV:E,dotTL:v,dotBL:S,dotNV:h,dotNL:d}),m=dH({alphaT:jy,alphaB:c,dotNH:f,dotTH:_,dotBH:A})}else y=$M({alpha:c,dotNL:d,dotNV:h}),m=GM({alpha:c,dotNH:f});return g.mul(y).mul(m)}),fH=_e(({roughness:n,dotNV:e})=>{const t=vt(-1,-.0275,-.572,.022),i=vt(1,.0425,1.04,-.04),r=n.mul(t).add(i),s=r.x.mul(r.x).min(e.mul(-9.28).exp2()).mul(r.x).add(r.y);return He(-1.04,1.04).mul(s).add(r.zw)}).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),pH=_e(({f:n,f90:e,dotVH:t})=>{const i=t.oneMinus().saturate(),r=i.mul(i),s=i.mul(r,r).clamp(0,.9999);return n.sub(ve(e).mul(s)).div(s.oneMinus())}).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),p0=1/6,WM=n=>St(p0,St(n,St(n,n.negate().add(3)).sub(3)).add(1)),Yy=n=>St(p0,St(n,St(n,St(3,n).sub(6))).add(4)),QM=n=>St(p0,St(n,St(n,St(-3,n).add(3)).add(3)).add(1)),Zy=n=>St(p0,gs(n,3)),db=n=>WM(n).add(Yy(n)),hb=n=>QM(n).add(Zy(n)),fb=n=>On(-1,Yy(n).div(WM(n).add(Yy(n)))),pb=n=>On(1,Zy(n).div(QM(n).add(Zy(n)))),mb=(n,e,t)=>{const i=n.uvNode,r=St(i,e.zw).add(.5),s=js(r),o=na(r),a=db(o.x),l=hb(o.x),c=fb(o.x),u=pb(o.x),d=fb(o.y),h=pb(o.y),f=He(s.x.add(c),s.y.add(d)).sub(.5).mul(e.xy),p=He(s.x.add(u),s.y.add(d)).sub(.5).mul(e.xy),g=He(s.x.add(c),s.y.add(h)).sub(.5).mul(e.xy),y=He(s.x.add(u),s.y.add(h)).sub(.5).mul(e.xy),m=db(o.y).mul(On(a.mul(n.sample(f).level(t)),l.mul(n.sample(p).level(t)))),v=hb(o.y).mul(On(a.mul(n.sample(g).level(t)),l.mul(n.sample(y).level(t))));return m.add(v)},mH=_e(([n,e=ce(3)])=>{const t=He(n.size(de(e))),i=He(n.size(de(e.add(1)))),r=Xo(1,t),s=Xo(1,i),o=mb(n,vt(r,t),js(e)),a=mb(n,vt(s,i),l0(e));return na(e).mix(o,a)});ve(.04);ce(1);const gb=ce(1),Jy=ce(-2),Kf=ce(.8),Kg=ce(-1),Yf=ce(.4),Yg=ce(2),Zf=ce(.305),Zg=ce(3),yb=ce(.21),gH=ce(4),vb=ce(4),yH=ce(16),vH=_e(([n])=>{const e=ve(mn(n)).toVar(),t=ce(-1).toVar();return Dt(e.x.greaterThan(e.z),()=>{Dt(e.x.greaterThan(e.y),()=>{t.assign(sr(n.x.greaterThan(0),0,3))}).Else(()=>{t.assign(sr(n.y.greaterThan(0),1,4))})}).Else(()=>{Dt(e.z.greaterThan(e.y),()=>{t.assign(sr(n.z.greaterThan(0),2,5))}).Else(()=>{t.assign(sr(n.y.greaterThan(0),1,4))})}),t}).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),_H=_e(([n,e])=>{const t=He().toVar();return Dt(e.equal(0),()=>{t.assign(He(n.z,n.y).div(mn(n.x)))}).ElseIf(e.equal(1),()=>{t.assign(He(n.x.negate(),n.z.negate()).div(mn(n.y)))}).ElseIf(e.equal(2),()=>{t.assign(He(n.x.negate(),n.y).div(mn(n.z)))}).ElseIf(e.equal(3),()=>{t.assign(He(n.z.negate(),n.y).div(mn(n.x)))}).ElseIf(e.equal(4),()=>{t.assign(He(n.x.negate(),n.z).div(mn(n.y)))}).Else(()=>{t.assign(He(n.x,n.y).div(mn(n.z)))}),St(.5,t.add(1))}).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),xH=_e(([n])=>{const e=ce(0).toVar();return Dt(n.greaterThanEqual(Kf),()=>{e.assign(gb.sub(n).mul(Kg.sub(Jy)).div(gb.sub(Kf)).add(Jy))}).ElseIf(n.greaterThanEqual(Yf),()=>{e.assign(Kf.sub(n).mul(Yg.sub(Kg)).div(Kf.sub(Yf)).add(Kg))}).ElseIf(n.greaterThanEqual(Zf),()=>{e.assign(Yf.sub(n).mul(Zg.sub(Yg)).div(Yf.sub(Zf)).add(Yg))}).ElseIf(n.greaterThanEqual(yb),()=>{e.assign(Zf.sub(n).mul(gH.sub(Zg)).div(Zf.sub(yb)).add(Zg))}).Else(()=>{e.assign(ce(-2).mul(Ho(St(1.16,n))))}),e}).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),jM=_e(([n,e])=>{const t=n.toVar();t.assign(St(2,t).sub(1));const i=ve(t,1).toVar();return Dt(e.equal(0),()=>{i.assign(i.zyx)}).ElseIf(e.equal(1),()=>{i.assign(i.xzy),i.xz.mulAssign(-1)}).ElseIf(e.equal(2),()=>{i.x.mulAssign(-1)}).ElseIf(e.equal(3),()=>{i.assign(i.zyx),i.xz.mulAssign(-1)}).ElseIf(e.equal(4),()=>{i.assign(i.xzy),i.xy.mulAssign(-1)}).ElseIf(e.equal(5),()=>{i.z.mulAssign(-1)}),i}).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),qM=_e(([n,e,t,i,r,s])=>{const o=ce(t),a=ve(e),l=Ko(xH(o),Jy,s),c=na(l),u=js(l),d=ve(ev(n,a,u,i,r,s)).toVar();return Dt(c.notEqual(0),()=>{const h=ve(ev(n,a,u.add(1),i,r,s)).toVar();d.assign(Ln(d,h,c))}),d}),ev=_e(([n,e,t,i,r,s])=>{const o=ce(t).toVar(),a=ve(e),l=ce(vH(a)).toVar(),c=ce(ui(vb.sub(o),0)).toVar();o.assign(ui(o,vb));const u=ce(xu(o)).toVar(),d=He(_H(a,l).mul(u.sub(2)).add(1)).toVar();return Dt(l.greaterThan(2),()=>{d.y.addAssign(u),l.subAssign(3)}),d.x.addAssign(l.mul(u)),d.x.addAssign(c.mul(St(3,yH))),d.y.addAssign(St(4,xu(s).sub(u))),d.x.mulAssign(i),d.y.mulAssign(r),n.sample(d).grad(He(),He())}),Jg=_e(({envMap:n,mipInt:e,outputDirection:t,theta:i,axis:r,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:o,CUBEUV_MAX_MIP:a})=>{const l=Mo(i),c=t.mul(l).add(r.cross(t).mul(wr(i))).add(r.mul(r.dot(t).mul(l.oneMinus())));return ev(n,c,e,s,o,a)}),SH=_e(({n,latitudinal:e,poleAxis:t,outputDirection:i,weights:r,samples:s,dTheta:o,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:d})=>{const h=ve(sr(e,t,u0(t,i))).toVar();Dt(Z_(h.equals(ve(0))),()=>{h.assign(ve(i.z,0,i.x.negate()))}),h.assign(jl(h));const f=ve().toVar();return f.addAssign(r.element(0).mul(Jg({theta:0,axis:h,outputDirection:i,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:d}))),cn({start:de(1),end:n},({i:p})=>{Dt(p.greaterThanEqual(s),()=>{LM()});const g=ce(o.mul(ce(p))).toVar();f.addAssign(r.element(p).mul(Jg({theta:g.mul(-1),axis:h,outputDirection:i,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:d}))),f.addAssign(r.element(p).mul(Jg({theta:g,axis:h,outputDirection:i,mipInt:a,envMap:l,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:u,CUBEUV_MAX_MIP:d})))}),vt(f,1)});let wm=null;const _b=new WeakMap;function AH(n){const e=Math.log2(n)-2,t=1/n;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:t,maxMip:e}}function bH(n){let e=_b.get(n);if((e!==void 0?e.pmremVersion:-1)!==n.pmremVersion){const i=n.image;if(n.isCubeTexture)if(wH(i))e=wm.fromCubemap(n,e);else return null;else if(CH(i))e=wm.fromEquirectangular(n,e);else return null;e.pmremVersion=n.pmremVersion,_b.set(n,e)}return e.texture}class TH extends kn{static get type(){return"PMREMNode"}constructor(e,t=null,i=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=i,this._generator=null;const r=new Wn;r.isRenderTargetTexture=!0,this._texture=er(r),this._width=Rt(0),this._height=Rt(0),this._maxMip=Rt(0),this.updateBeforeType=Wt.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=AH(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(){let e=this._pmrem;const t=e?e.pmremVersion:-1,i=this._value;t!==i.pmremVersion&&(i.isPMREMTexture===!0?e=i:e=bH(i),e!==null&&(this._pmrem=e,this.updateFromTexture(e)))}setup(e){wm===null&&(wm=e.createPMREMGenerator()),this.updateBefore(e);let t=this.uvNode;t===null&&e.context.getUV&&(t=e.context.getUV(this));const i=this.value;e.renderer.coordinateSystem===Ir&&i.isPMREMTexture!==!0&&i.isRenderTargetTexture===!0&&(t=ve(t.x.negate(),t.yz)),t=ve(t.x,t.y.negate(),t.z);let r=this.levelNode;return r===null&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),qM(this._texture,t,r,this._width,this._height,this._maxMip)}}function wH(n){if(n==null)return!1;let e=0;const t=6;for(let i=0;i<t;i++)n[i]!==void 0&&e++;return e===t}function CH(n){return n==null?!1:n.height>0}const EH=Pe(TH);class MH extends kn{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=ve(Er.z,0,Er.x.negate()).normalize(),t=Er.cross(e);return He(e.dot(Jo),t.dot(Jo)).mul(.495).add(.5)}}const RH=Qe(MH);class IH extends kn{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:i}=this;if(this.getNodeType(e)==="vec2"){const s=t.cos(),o=t.sin();return o0(s,o,o.negate(),s).mul(i)}else{const s=t,o=Il(vt(1,0,0,0),vt(0,Mo(s.x),wr(s.x).negate(),0),vt(0,wr(s.x),Mo(s.x),0),vt(0,0,0,1)),a=Il(vt(Mo(s.y),0,wr(s.y),0),vt(0,1,0,0),vt(wr(s.y).negate(),0,Mo(s.y),0),vt(0,0,0,1)),l=Il(vt(Mo(s.z),wr(s.z).negate(),0,0),vt(wr(s.z),Mo(s.z),0,0),vt(0,0,1,0),vt(0,0,0,1));return o.mul(a).mul(l).mul(vt(i,1)).xyz}}}const XM=Pe(IH),NH=_e(({texture:n,uv:e})=>{const i=ve().toVar();return Dt(e.x.lessThan(1e-4),()=>{i.assign(ve(1,0,0))}).ElseIf(e.y.lessThan(1e-4),()=>{i.assign(ve(0,1,0))}).ElseIf(e.z.lessThan(1e-4),()=>{i.assign(ve(0,0,1))}).ElseIf(e.x.greaterThan(1-1e-4),()=>{i.assign(ve(-1,0,0))}).ElseIf(e.y.greaterThan(1-1e-4),()=>{i.assign(ve(0,-1,0))}).ElseIf(e.z.greaterThan(1-1e-4),()=>{i.assign(ve(0,0,-1))}).Else(()=>{const s=n.sample(e.add(ve(-.01,0,0))).r.sub(n.sample(e.add(ve(.01,0,0))).r),o=n.sample(e.add(ve(0,-.01,0))).r.sub(n.sample(e.add(ve(0,.01,0))).r),a=n.sample(e.add(ve(0,0,-.01))).r.sub(n.sample(e.add(ve(0,0,.01))).r);i.assign(ve(s,o,a))}),i.normalize()});class PH extends Zo{static get type(){return"Texture3DNode"}constructor(e,t=null,i=null){super(e,t,i),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return ve(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const i=this.value;return e.isFlipY()&&(i.isRenderTargetTexture===!0||i.isFramebufferTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(de(Pa(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return NH({texture:this,uv:e})}}const LH=Pe(PH);class DH extends qt{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}const FH=(n,e)=>Fe(new DH(n,e));class OH extends ut{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const i=new $d(t);return this._currentCond=sr(e,i),this.add(this._currentCond)}ElseIf(e,t){const i=new $d(t),r=sr(e,i);return this._currentCond.elseNode=r,this._currentCond=r,this}Else(e){return this._currentCond.elseNode=new $d(e),this}build(e,...t){const i=fC();Wy(this);for(const r of this.nodes)r.build(e,"void");return Wy(i),this.outputNode?this.outputNode.build(e,...t):super.build(e,...t)}else(...e){return console.warn("TSL.StackNode: .else() has been renamed to .Else()."),this.Else(...e)}elseif(...e){return console.warn("TSL.StackNode: .elseif() has been renamed to .ElseIf()."),this.ElseIf(...e)}}const BH=Pe(OH);function kH(n){return Object.entries(n).map(([e,t])=>typeof t=="string"?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1})}class UH extends ut{static get type(){return"StructTypeNode"}constructor(e,t=null){super("struct"),this.membersLayout=kH(e),this.name=t,this.isStructLayoutNode=!0}getLength(){let e=0;for(const t of this.membersLayout)e+=G_(t.type);return e}getMemberType(e,t){const i=this.membersLayout.find(r=>r.name===t);return i?i.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}generate(e){return this.getNodeType(e)}}class zH extends ut{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),i=t.type,r=e.getPropertyName(t);return e.addLineFlowCode("".concat(r," = ").concat(e.generateStruct(i,this.structLayoutNode.membersLayout,this.values)),this),t.name}}const VH=(n,e=null)=>{const t=new UH(n,e),i=(...r)=>{let s=null;if(r.length>0)if(r[0].isNode){s={};const o=Object.keys(n);for(let a=0;a<r.length;a++)s[o[a]]=r[a]}else s=r[0];return Fe(new zH(t,s))};return i.layout=t,i.isStruct=!0,i};class KM extends ut{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(t.membersLayout===void 0){const i=this.members,r=[];for(let s=0;s<i.length;s++){const o="m"+s,a=i[s].getNodeType(e);r.push({name:o,type:a,index:s})}t.membersLayout=r,t.structType=e.getOutputStructTypeFromNode(this,t.membersLayout)}return t.structType.name}generate(e){const t=e.getOutputStructName(),i=this.members,r=t!==""?t+".":"";for(let s=0;s<i.length;s++){const o=i[s].build(e);e.addLineFlowCode("".concat(r,"m").concat(s," = ").concat(o),this)}return t}}const HH=Pe(KM);function YM(n,e){for(let t=0;t<n.length;t++)if(n[t].name===e)return t;return-1}class $H extends KM{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return ZM(t)}setup(e){const t=this.outputNodes,i=e.renderer.getRenderTarget(),r=[],s=i.textures;for(const o in t){const a=YM(s,o);r[a]=vt(t[o])}return this.members=r,super.setup(e)}}const ZM=Pe($H),GH=_e(([n])=>{const e=n.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),tv=(n,e)=>gs(St(4,n.mul(Bt(1,n))),e),WH=(n,e)=>n.lessThan(.5)?tv(n.mul(2),e).div(2):Bt(1,tv(St(Bt(1,n),2),e).div(2)),QH=(n,e,t)=>gs(Xo(gs(n,e),On(gs(n,e),gs(Bt(1,n),t))),1/e),jH=(n,e)=>wr(_m.mul(e.mul(n).sub(1))).div(_m.mul(e.mul(n).sub(1))),Ro=_e(([n])=>n.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),qH=_e(([n])=>ve(Ro(n.z.add(Ro(n.y.mul(1)))),Ro(n.z.add(Ro(n.x.mul(1)))),Ro(n.y.add(Ro(n.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),XH=_e(([n,e,t])=>{const i=ve(n).toVar(),r=ce(1.4).toVar(),s=ce(0).toVar(),o=ve(i).toVar();return cn({start:ce(0),end:ce(3),type:"float",condition:"<="},()=>{const a=ve(qH(o.mul(2))).toVar();i.addAssign(a.add(t.mul(ce(.1).mul(e)))),o.mulAssign(1.8),r.mulAssign(1.5),i.mulAssign(1.2);const l=ce(Ro(i.z.add(Ro(i.x.add(Ro(i.y)))))).toVar();s.addAssign(l.div(r)),o.addAssign(.14)}),s}).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class KH extends ut{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let i=this._candidateFnCall;if(i===null){let r=null,s=-1;for(const o of this.functionNodes){const l=o.shaderNode.layout;if(l===null)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const c=l.inputs;if(t.length===c.length){let u=0;for(let d=0;d<t.length;d++){const h=t[d],f=c[d];h.getNodeType(e)===f.type?u++:u=0}u>s&&(r=o,s=u)}}this._candidateFnCall=i=r(...t)}return i}}const YH=Pe(KH),bi=n=>(...e)=>YH(n,...e),ql=Rt(0).setGroup(kt).onRenderUpdate(n=>n.time),JM=Rt(0).setGroup(kt).onRenderUpdate(n=>n.deltaTime),ZH=Rt(0,"uint").setGroup(kt).onRenderUpdate(n=>n.frameId),JH=(n=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),ql.mul(n)),e$=(n=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),ql.mul(n)),t$=(n=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),JM.mul(n)),n$=(n=ql)=>n.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5),i$=(n=ql)=>n.fract().round(),r$=(n=ql)=>n.add(.5).fract().mul(2).sub(1).abs(),s$=(n=ql)=>n.fract(),o$=_e(([n,e,t=He(.5)])=>XM(n.sub(t),e).add(t)),a$=_e(([n,e,t=He(.5)])=>{const i=n.sub(t),r=i.dot(i),o=r.mul(r).mul(e);return n.add(i.mul(o))}),l$=_e(({position:n=null,horizontal:e=!0,vertical:t=!1})=>{let i;n!==null?(i=Fo.toVar(),i[3][0]=n.x,i[3][1]=n.y,i[3][2]=n.z):i=Fo;const r=ss.mul(i);return ph(e)&&(r[0][0]=Fo[0].length(),r[0][1]=0,r[0][2]=0),ph(t)&&(r[1][0]=0,r[1][1]=Fo[1].length(),r[1][2]=0),r[2][0]=0,r[2][1]=0,r[2][2]=1,Gh.mul(r).mul(Nn)}),c$=_e(([n=null])=>{const e=Tm();return Tm(Sx(n)).sub(e).lessThan(0).select(Va,n)});class u$ extends ut{static get type(){return"SpriteSheetUVNode"}constructor(e,t=xn(),i=ce(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=i}setup(){const{frameNode:e,uvNode:t,countNode:i}=this,{width:r,height:s}=i,o=e.mod(r.mul(s)).floor(),a=o.mod(r),l=s.sub(o.add(1).div(r).ceil()),c=i.reciprocal(),u=He(a,l);return t.add(u).mul(c)}}const d$=Pe(u$);class h$ extends ut{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,i=null,r=ce(1),s=Nn,o=cr){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=i,this.scaleNode=r,this.positionNode=s,this.normalNode=o}setup(){const{textureXNode:e,textureYNode:t,textureZNode:i,scaleNode:r,positionNode:s,normalNode:o}=this;let a=o.abs().normalize();a=a.div(a.dot(ve(1)));const l=s.yz.mul(r),c=s.zx.mul(r),u=s.xy.mul(r),d=e.value,h=t!==null?t.value:d,f=i!==null?i.value:d,p=er(d,l).mul(a.x),g=er(h,c).mul(a.y),y=er(f,u).mul(a.z);return On(p,g,y)}}const e4=Pe(h$),f$=(...n)=>e4(...n),Sc=new Co,il=new Y,Ac=new Y,e1=new Y,fd=new Xe,Jf=new Y(0,0,-1),Rs=new Mt,pd=new Y,ep=new Y,md=new Mt,tp=new qe,Cm=new Fh,p$=Va.flipX();Cm.depthTexture=new Ua(1,1);let t1=!1;class wx extends Zo{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||Cm.texture,p$),this._reflectorBaseNode=e.reflector||new m$(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(this._depthNode===null){if(this._reflectorBaseNode.depth!==!0)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=Fe(new wx({defaultTexture:Cm.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}}class m$ extends ut{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:i=new nn,resolution:r=1,generateMipmaps:s=!1,bounces:o=!0,depth:a=!1}=t;this.textureNode=e,this.target=i,this.resolution=r,this.generateMipmaps=s,this.bounces=o,this.depth=a,this.updateBeforeType=o?Wt.RENDER:Wt.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new WeakMap}_updateResolution(e,t){const i=this.resolution;t.getDrawingBufferSize(tp),e.setSize(Math.round(tp.width*i),Math.round(tp.height*i))}setup(e){return this._updateResolution(Cm,e.renderer),super.setup(e)}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new Fh(0,0,{type:Ts}),this.generateMipmaps===!0&&(t.texture.minFilter=eP,t.texture.generateMipmaps=!0),this.depth===!0&&(t.depthTexture=new Ua),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&t1)return!1;t1=!0;const{scene:t,camera:i,renderer:r,material:s}=e,{target:o}=this,a=this.getVirtualCamera(i),l=this.getRenderTarget(a);if(r.getDrawingBufferSize(tp),this._updateResolution(l,r),Ac.setFromMatrixPosition(o.matrixWorld),e1.setFromMatrixPosition(i.matrixWorld),fd.extractRotation(o.matrixWorld),il.set(0,0,1),il.applyMatrix4(fd),pd.subVectors(Ac,e1),pd.dot(il)>0)return;pd.reflect(il).negate(),pd.add(Ac),fd.extractRotation(i.matrixWorld),Jf.set(0,0,-1),Jf.applyMatrix4(fd),Jf.add(e1),ep.subVectors(Ac,Jf),ep.reflect(il).negate(),ep.add(Ac),a.coordinateSystem=i.coordinateSystem,a.position.copy(pd),a.up.set(0,1,0),a.up.applyMatrix4(fd),a.up.reflect(il),a.lookAt(ep),a.near=i.near,a.far=i.far,a.updateMatrixWorld(),a.projectionMatrix.copy(i.projectionMatrix),Sc.setFromNormalAndCoplanarPoint(il,Ac),Sc.applyMatrix4(a.matrixWorldInverse),Rs.set(Sc.normal.x,Sc.normal.y,Sc.normal.z,Sc.constant);const c=a.projectionMatrix;md.x=(Math.sign(Rs.x)+c.elements[8])/c.elements[0],md.y=(Math.sign(Rs.y)+c.elements[9])/c.elements[5],md.z=-1,md.w=(1+c.elements[10])/c.elements[14],Rs.multiplyScalar(1/Rs.dot(md));const u=0;c.elements[2]=Rs.x,c.elements[6]=Rs.y,c.elements[10]=r.coordinateSystem===Qo?Rs.z-u:Rs.z+1-u,c.elements[14]=Rs.w,this.textureNode.value=l.texture,this.depth===!0&&(this.textureNode.getDepthNode().value=l.depthTexture),s.visible=!1;const d=r.getRenderTarget(),h=r.getMRT(),f=r.autoClear;r.setMRT(null),r.setRenderTarget(l),r.autoClear=!0,r.render(t,a),r.setMRT(h),r.setRenderTarget(d),r.autoClear=f,s.visible=!0,t1=!1}}const g$=n=>Fe(new wx(n)),n1=new Ou(-1,1,1,-1,0,1);class y$ extends ki{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Si([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Si(t,2))}}const v$=new y$;class t4 extends pn{constructor(e=null){super(v$,e),this.camera=n1,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,n1)}render(e){e.render(this,n1)}}const _$=new qe;class x$ extends Zo{static get type(){return"RTTNode"}constructor(e,t=null,i=null,r={type:Ts}){const s=new Fh(t,i,r);super(s.texture,xn()),this.node=e,this.width=t,this.height=i,this.pixelRatio=1,this.renderTarget=s,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new t4(new yh),this.updateBeforeType=Wt.RENDER}get autoSize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const i=e*this.pixelRatio,r=t*this.pixelRatio;this.renderTarget.setSize(i,r),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;if(this.textureNeedsUpdate=!1,this.autoSize===!0){this.pixelRatio=e.getPixelRatio();const i=e.getSize(_$);this.setSize(i.width,i.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Zo(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const n4=(n,...e)=>Fe(new x$(Fe(n),...e)),S$=(n,...e)=>n.isTextureNode?n:n.isPassNode?n.getTextureNode():n4(n,...e),Rc=_e(([n,e,t],i)=>{let r;i.renderer.coordinateSystem===Qo?(n=He(n.x,n.y.oneMinus()).mul(2).sub(1),r=vt(ve(n,e),1)):r=vt(ve(n.x,n.y.oneMinus(),e).mul(2).sub(1),1);const s=vt(t.mul(r));return s.xyz.div(s.w)}),A$=_e(([n,e])=>{const t=e.mul(vt(n,1)),i=t.xy.div(t.w).mul(.5).add(.5).toVar();return He(i.x,i.y.oneMinus())}),b$=_e(([n,e,t])=>{const i=Pa(Rn(e)),r=Xn(n.mul(i)).toVar(),s=Rn(e,r).toVar(),o=Rn(e,r.sub(Xn(2,0))).toVar(),a=Rn(e,r.sub(Xn(1,0))).toVar(),l=Rn(e,r.add(Xn(1,0))).toVar(),c=Rn(e,r.add(Xn(2,0))).toVar(),u=Rn(e,r.add(Xn(0,2))).toVar(),d=Rn(e,r.add(Xn(0,1))).toVar(),h=Rn(e,r.sub(Xn(0,1))).toVar(),f=Rn(e,r.sub(Xn(0,2))).toVar(),p=mn(Bt(ce(2).mul(a).sub(o),s)).toVar(),g=mn(Bt(ce(2).mul(l).sub(c),s)).toVar(),y=mn(Bt(ce(2).mul(d).sub(u),s)).toVar(),m=mn(Bt(ce(2).mul(h).sub(f),s)).toVar(),v=Rc(n,s,t).toVar(),x=p.lessThan(g).select(v.sub(Rc(n.sub(He(ce(1).div(i.x),0)),a,t)),v.negate().add(Rc(n.add(He(ce(1).div(i.x),0)),l,t))),_=y.lessThan(m).select(v.sub(Rc(n.add(He(0,ce(1).div(i.y))),d,t)),v.negate().add(Rc(n.sub(He(0,ce(1).div(i.y))),h,t)));return jl(u0(x,_))});class T$ extends jo{constructor(e,t,i=Float32Array){const r=ArrayBuffer.isView(e)?e:new i(e*t);super(r,t),this.isStorageInstancedBufferAttribute=!0}}class w$ extends xi{constructor(e,t,i=Float32Array){const r=ArrayBuffer.isView(e)?e:new i(e*t);super(r,t),this.isStorageBufferAttribute=!0}}class C$ extends Ql{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const i=this.storageBufferNode.structTypeNode;return i?i.getMemberType(e,t):"void"}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.isPBO===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let i;const r=e.context.assign;if(e.isAvailable("storageBuffer")===!1?this.node.isPBO===!0&&r!==!0&&(this.node.value.isInstancedBufferAttribute||e.shaderStage!=="compute")?i=e.generatePBO(this):i=this.node.build(e):i=super.generate(e),r!==!0){const s=this.getNodeType(e);i=e.format(i,s,t)}return i}}const E$=Pe(C$);class M$ extends fx{static get type(){return"StorageBufferNode"}constructor(e,t=null,i=0){let r,s=null;t&&t.isStruct?(r="struct",s=t.layout):t===null&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(r=Kk(e.itemSize),i=e.count):r=t,super(e,r,i),this.isStorageBufferNode=!0,this.structTypeNode=s,this.access=Gs.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(this.bufferCount===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return E$(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Gs.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return this._attribute===null&&(this._attribute=Hh(this.value),this._varying=tr(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(this.structTypeNode!==null)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}generate(e){if(this.structTypeNode!==null&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:i}=this.getAttributeData(),r=i.build(e);return e.registerTransform(r,t),r}}const m0=(n,e=null,t=0)=>Fe(new M$(n,e,t)),R$=(n,e,t)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),m0(n,e,t).setPBO(!0)),I$=(n,e="float")=>{let t,i;e.isStruct===!0?(t=e.layout.getLength(),i=vm("float")):(t=G_(e),i=vm(e));const r=new w$(n,t,i);return m0(r,e,n)},N$=(n,e="float")=>{let t,i;e.isStruct===!0?(t=e.layout.getLength(),i=vm("float")):(t=G_(e),i=vm(e));const r=new T$(n,t,i);return m0(r,e,n)};class P$ extends XE{static get type(){return"VertexColorNode"}constructor(e=0){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),i=e.hasGeometryAttribute(t);let r;return i===!0?r=super.generate(e):r=e.generateConst(this.nodeType,new Mt(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const L$=n=>Fe(new P$(n));class D$ extends ut{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const F$=Qe(D$),gd=new ws,i1=new Xe;class ar extends ut{static get type(){return"SceneNode"}constructor(e=ar.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,i=this.scene!==null?this.scene:e.scene;let r;return t===ar.BACKGROUND_BLURRINESS?r=Pn("backgroundBlurriness","float",i):t===ar.BACKGROUND_INTENSITY?r=Pn("backgroundIntensity","float",i):t===ar.BACKGROUND_ROTATION?r=Rt("mat4").label("backgroundRotation").setGroup(kt).onRenderUpdate(()=>{const s=i.background;return s!==null&&s.isTexture&&s.mapping!==h_?(gd.copy(i.backgroundRotation),gd.x*=-1,gd.y*=-1,gd.z*=-1,i1.makeRotationFromEuler(gd)):i1.identity(),i1}):console.error("THREE.SceneNode: Unknown scope:",t),r}}ar.BACKGROUND_BLURRINESS="backgroundBlurriness";ar.BACKGROUND_INTENSITY="backgroundIntensity";ar.BACKGROUND_ROTATION="backgroundRotation";const O$=Qe(ar,ar.BACKGROUND_BLURRINESS),B$=Qe(ar,ar.BACKGROUND_INTENSITY),k$=Qe(ar,ar.BACKGROUND_ROTATION);class U$ extends Zo{static get type(){return"StorageTextureNode"}constructor(e,t,i=null){super(e,t),this.storeNode=i,this.isStorageTextureNode=!0,this.access=Gs.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);t.storeNode=this.storeNode}setAccess(e){return this.access=e,this}generate(e,t){let i;return this.storeNode!==null?i=this.generateStore(e):i=super.generate(e,t),i}toReadWrite(){return this.setAccess(Gs.READ_WRITE)}toReadOnly(){return this.setAccess(Gs.READ_ONLY)}toWriteOnly(){return this.setAccess(Gs.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:i,storeNode:r}=t,s=super.generate(e,"property"),o=i.build(e,"uvec2"),a=r.build(e,"vec4"),l=e.generateTextureStore(e,s,o,a);e.addLineFlowCode(l,this)}}const i4=Pe(U$),z$=(n,e,t)=>{const i=i4(n,e,t);return t!==null&&i.append(),i};class V$ extends d0{static get type(){return"UserDataNode"}constructor(e,t,i=null){super(e,t,i),this.userData=i}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const H$=(n,e,t)=>Fe(new V$(n,e,t)),xb=new WeakMap;class $$ extends kn{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Wt.OBJECT,this.updateAfterType=Wt.OBJECT,this.previousModelWorldMatrix=Rt(new Xe),this.previousProjectionMatrix=Rt(new Xe).setGroup(kt),this.previousCameraViewMatrix=Rt(new Xe)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:i}){const r=Sb(i);this.previousModelWorldMatrix.value.copy(r);const s=r4(t);s.frameId!==e&&(s.frameId=e,s.previousProjectionMatrix===void 0?(s.previousProjectionMatrix=new Xe,s.previousCameraViewMatrix=new Xe,s.currentProjectionMatrix=new Xe,s.currentCameraViewMatrix=new Xe,s.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(s.previousProjectionMatrix.copy(s.currentProjectionMatrix),s.previousCameraViewMatrix.copy(s.currentCameraViewMatrix)),s.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),s.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(s.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(s.previousCameraViewMatrix))}updateAfter({object:e}){Sb(e).copy(e.matrixWorld)}setup(){const e=this.projectionMatrix===null?Gh:Rt(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),i=e.mul(Wh).mul(Nn),r=this.previousProjectionMatrix.mul(t).mul(Am),s=i.xy.div(i.w),o=r.xy.div(r.w);return Bt(s,o)}}function r4(n){let e=xb.get(n);return e===void 0&&(e={},xb.set(n,e)),e}function Sb(n,e=0){const t=r4(n);let i=t[e];return i===void 0&&(t[e]=i=new Xe),i}const G$=Qe($$),s4=_e(([n,e])=>Fr(1,n.oneMinus().div(e)).oneMinus()).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),o4=_e(([n,e])=>Fr(n.div(e.oneMinus()),1)).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),a4=_e(([n,e])=>n.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),l4=_e(([n,e])=>Ln(n.mul(2).mul(e),n.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),c0(.5,n))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),W$=_e(([n,e])=>{const t=e.a.add(n.a.mul(e.a.oneMinus()));return vt(e.rgb.mul(e.a).add(n.rgb.mul(n.a).mul(e.a.oneMinus())).div(t),t)}).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),Q$=(...n)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),s4(n)),j$=(...n)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),o4(n)),q$=(...n)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),a4(n)),X$=(...n)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),l4(n)),K$=_e(([n])=>Cx(n.rgb)),Y$=_e(([n,e=ce(1)])=>e.mix(Cx(n.rgb),n.rgb)),Z$=_e(([n,e=ce(1)])=>{const t=On(n.r,n.g,n.b).div(3),i=n.r.max(n.g.max(n.b)),r=i.sub(t).mul(e).mul(-3);return Ln(n.rgb,i,r)}),J$=_e(([n,e=ce(1)])=>{const t=ve(.57735,.57735,.57735),i=e.cos();return ve(n.rgb.mul(i).add(t.cross(n.rgb).mul(e.sin()).add(t.mul(za(t,n.rgb).mul(i.oneMinus())))))}),Cx=(n,e=ve(wt.getLuminanceCoefficients(new Y)))=>za(n,e),eG=_e(([n,e=ve(1),t=ve(0),i=ve(1),r=ce(1),s=ve(wt.getLuminanceCoefficients(new Y,Bi))])=>{const o=n.rgb.dot(ve(s)),a=ui(n.rgb.mul(e).add(t),0).toVar(),l=a.pow(i).toVar();return Dt(a.r.greaterThan(0),()=>{a.r.assign(l.r)}),Dt(a.g.greaterThan(0),()=>{a.g.assign(l.g)}),Dt(a.b.greaterThan(0),()=>{a.b.assign(l.b)}),a.assign(o.add(a.sub(o).mul(r))),vt(a.rgb,n.a)});class tG extends kn{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const nG=Pe(tG),iG=new qe;class c4 extends Zo{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class Ab extends c4{static get type(){return"PassMultipleTextureNode"}constructor(e,t,i=!1){super(e,null),this.textureName=t,this.previousTexture=i}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class no extends kn{static get type(){return"PassNode"}constructor(e,t,i,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=i,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const s=new Ua;s.isRenderTargetTexture=!0,s.name="depth";const o=new Fh(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Ts,...r});o.texture.name="output",o.depthTexture=s,this.renderTarget=o,this._textures={output:o.texture,depth:s},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Rt(0),this._cameraFar=Rt(0),this._mrt=null,this.isPassNode=!0,this.updateBeforeType=Wt.FRAME}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const i=this._textures[e],r=this.renderTarget.textures.indexOf(i);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=i,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(t=Fe(new Ab(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),t=Fe(new Ab(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=Ax(this.getTextureNode(e),i,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const i=this._cameraNear,r=this._cameraFar,s=this.getViewZNode(e);this._linearDepthNodes[e]=t=Xc(s,i,r)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.texture.type=e.getColorBufferType(),this.scope===no.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:i,camera:r}=this;this._pixelRatio=t.getPixelRatio();const s=t.getSize(iG);this.setSize(s.width,s.height);const o=t.getRenderTarget(),a=t.getMRT();this._cameraNear.value=r.near,this._cameraFar.value=r.far;for(const l in this._previousTextures)this.toggleTexture(l);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(i,r),t.setRenderTarget(o),t.setMRT(a)}setSize(e,t){this._width=e,this._height=t;const i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget.setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}no.COLOR="color";no.DEPTH="depth";const rG=(n,e,t)=>Fe(new no(no.COLOR,n,e,t)),sG=(n,e)=>Fe(new c4(n,e)),oG=(n,e,t)=>Fe(new no(no.DEPTH,n,e,t));class aG extends no{static get type(){return"ToonOutlinePassNode"}constructor(e,t,i,r,s){super(no.COLOR,e,t),this.colorNode=i,this.thicknessNode=r,this.alphaNode=s,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,i=t.getRenderObjectFunction();t.setRenderObjectFunction((r,s,o,a,l,c,u,d)=>{if((l.isMeshToonMaterial||l.isMeshToonNodeMaterial)&&l.wireframe===!1){const h=this._getOutlineMaterial(l);t.renderObject(r,s,o,a,h,c,u,d)}t.renderObject(r,s,o,a,l,c,u,d)}),super.updateBefore(e),t.setRenderObjectFunction(i)}_createMaterial(){const e=new yh;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=Fi;const t=cr.negate(),i=Gh.mul(Wh),r=ce(1),s=i.mul(vt(Nn,1)),o=i.mul(vt(Nn.add(t),1)),a=jl(s.sub(o));return e.vertexNode=s.add(a.mul(this.thicknessNode).mul(s.w).mul(r)),e.colorNode=vt(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const lG=(n,e,t=new gt(0,0,0),i=.003,r=1)=>Fe(new aG(n,e,Fe(t),Fe(i),Fe(r))),cG=_e(([n,e])=>n.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),uG=_e(([n,e])=>(n=n.mul(e),n.div(n.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),dG=_e(([n,e])=>{n=n.mul(e),n=n.sub(.004).max(0);const t=n.mul(n.mul(6.2).add(.5)),i=n.mul(n.mul(6.2).add(1.7)).add(.06);return t.div(i).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),hG=_e(([n])=>{const e=n.mul(n.add(.0245786)).sub(90537e-9),t=n.mul(n.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),fG=_e(([n,e])=>{const t=is(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),i=is(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return n=n.mul(e).div(.6),n=t.mul(n),n=hG(n),n=i.mul(n),n.clamp()}).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),pG=is(ve(1.6605,-.1246,-.0182),ve(-.5876,1.1329,-.1006),ve(-.0728,-.0083,1.1187)),mG=is(ve(.6274,.0691,.0164),ve(.3293,.9195,.088),ve(.0433,.0113,.8956)),gG=_e(([n])=>{const e=ve(n).toVar(),t=ve(e.mul(e)).toVar(),i=ve(t.mul(t)).toVar();return ce(15.5).mul(i.mul(t)).sub(St(40.14,i.mul(e))).add(St(31.96,i).sub(St(6.868,t.mul(e))).add(St(.4298,t).add(St(.1191,e).sub(.00232))))}),yG=_e(([n,e])=>{const t=ve(n).toVar(),i=is(ve(.856627153315983,.137318972929847,.11189821299995),ve(.0951212405381588,.761241990602591,.0767994186031903),ve(.0482516061458583,.101439036467562,.811302368396859)),r=is(ve(1.1271005818144368,-.1413297634984383,-.14132976349843826),ve(-.11060664309660323,1.157823702216272,-.11060664309660294),ve(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=ce(-12.47393),o=ce(4.026069);return t.mulAssign(e),t.assign(mG.mul(t)),t.assign(i.mul(t)),t.assign(ui(t,1e-10)),t.assign(Ho(t)),t.assign(t.sub(s).div(o.sub(s))),t.assign(Ko(t,0,1)),t.assign(gG(t)),t.assign(r.mul(t)),t.assign(gs(ui(ve(0),t),ve(2.2))),t.assign(pG.mul(t)),t.assign(Ko(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),vG=_e(([n,e])=>{const t=ce(.76),i=ce(.15);n=n.mul(e);const r=Fr(n.r,Fr(n.g,n.b)),s=sr(r.lessThan(.08),r.sub(St(6.25,r.mul(r))),.04);n.subAssign(s);const o=ui(n.r,ui(n.g,n.b));Dt(o.lessThan(t),()=>n);const a=Bt(1,t),l=Bt(1,a.mul(a).div(o.add(a.sub(t))));n.mulAssign(l.div(o));const c=Bt(1,Xo(1,i.mul(o.sub(l)).add(1)));return Ln(n,ve(l),c)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class qn extends ut{static get type(){return"CodeNode"}constructor(e="",t=[],i=""){super("code"),this.isCodeNode=!0,this.code=e,this.includes=t,this.language=i}isGlobal(){return!0}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const i=e.getCodeFromNode(this,this.getNodeType(e));return i.code=this.code,i.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const g0=Pe(qn),_G=(n,e)=>g0(n,e,"js"),xG=(n,e)=>g0(n,e,"wgsl"),SG=(n,e)=>g0(n,e,"glsl");class AG extends qn{static get type(){return"FunctionNode"}constructor(e="",t=[],i=""){super(e,t,i)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let i=t.nodeFunction;return i===void 0&&(i=e.parser.parseFunction(this.code),t.nodeFunction=i),i}generate(e,t){super.generate(e);const i=this.getNodeFunction(e),r=i.name,s=i.type,o=e.getCodeFromNode(this,s);r!==""&&(o.name=r);const a=e.getPropertyName(o),l=this.getNodeFunction(e).getCode(a);return o.code=l+"\n",t==="property"?a:e.format("".concat(a,"()"),s,t)}}const u4=(n,e=[],t="")=>{for(let s=0;s<e.length;s++){const o=e[s];typeof o=="function"&&(e[s]=o.functionNode)}const i=Fe(new AG(n,e,t)),r=(...s)=>i.call(...s);return r.functionNode=i,r},bG=(n,e)=>u4(n,e,"glsl"),TG=(n,e)=>u4(n,e,"wgsl");class wG extends ut{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new ro,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return this.outputType!==null}set value(e){this._value!==e&&(this._cache&&this.inputType==="URL"&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&this._cache===null&&this.inputType==="URL"&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&e.value!==null&&e.value!==void 0&&((this.inputType==="URL"||this.inputType==="String")&&typeof e.value=="string"||this.inputType==="Number"&&typeof e.value=="number"||this.inputType==="Vector2"&&e.value.isVector2||this.inputType==="Vector3"&&e.value.isVector3||this.inputType==="Vector4"&&e.value.isVector4||this.inputType==="Color"&&e.value.isColor||this.inputType==="Matrix3"&&e.value.isMatrix3||this.inputType==="Matrix4"&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:ce()}serialize(e){super.serialize(e),this.value!==null?this.inputType==="ArrayBuffer"?e.value=sC(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;e.value!==null&&(e.inputType==="ArrayBuffer"?t=oC(e.value):e.inputType==="Texture"?t=e.meta.textures[e.value]:t=e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Np=Pe(wG);class d4 extends Map{get(e,t=null,...i){if(this.has(e))return super.get(e);if(t!==null){const r=t(...i);return this.set(e,r),r}}}class CG{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Pp=new d4;class EG extends ut{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new d4,this._output=Np(),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const i=this._outputs;return i[e]===void 0?i[e]=Np(t):i[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const i=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),i[e]=t,i[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),i[e]=t,i[e].events.addEventListener("refresh",this.onRefresh)):i[e]===void 0?(i[e]=Np(t),i[e].events.addEventListener("refresh",this.onRefresh)):i[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if(typeof r=="function")return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if(typeof r=="function")return r.constructor.name==="AsyncFunction"?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){e!==null?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),this._object!==null)return this._object;const e=()=>this.refresh(),t=(c,u)=>this.setOutput(c,u),i=new CG(this),r=Pp.get("THREE"),s=Pp.get("TSL"),o=this.getMethod(),a=[i,this._local,Pp,e,t,r,s];this._object=o(...a);const l=this._object.layout;if(l&&(l.cache===!1&&this._local.clear(),this._output.outputType=l.outputType||null,Array.isArray(l.elements)))for(const c of l.elements){const u=c.id||c.name;c.inputType&&(this.getParameter(u)===void 0&&this.setParameter(u,null),this.getParameter(u).inputType=c.inputType),c.outputType&&(this.getOutput(u)===void 0&&this.setOutput(u,null),this.getOutput(u).outputType=c.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const t in this.parameters){let i=this.parameters[t];i.isScriptableNode&&(i=i.getDefaultOutput()),i.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:ce()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),this._method!==null)return this._method;const e=["parameters","local","global","refresh","setOutput","THREE","TSL"],i=["layout","init","main","dispose"].join(", "),r="var "+i+"; var output = {};\n",s="\nreturn { ...output, "+i+" };",o=r+this.codeNode.code+s;return this._method=new Function(...e,o),this._method}dispose(){this._method!==null&&(this._object&&typeof this._object.dispose=="function"&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[qk(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const i in this.parameters)t.push(this.parameters[i].getCacheKey(e));return eC(t)}set needsUpdate(e){e===!0&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return this.codeNode===null?this:(this._needsOutputUpdate===!0&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value,this)}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const MG=Pe(EG);function h4(n){let e;const t=n.context.getViewZ;return t!==void 0&&(e=t(this)),(e||Yn.z).negate()}const f4=_e(([n,e],t)=>{const i=h4(t);return Vl(n,e,i)}),p4=_e(([n],e)=>{const t=h4(e);return n.mul(n,t,t).negate().exp().oneMinus()}),Ex=_e(([n,e])=>vt(e.toFloat().mix(gh.rgb,n.toVec3()),gh.a));function RG(n,e,t){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),Ex(n,f4(e,t))}function IG(n,e){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),Ex(n,p4(e))}let rl=null,sl=null;class NG extends ut{static get type(){return"RangeNode"}constructor(e=ce(),t=ce()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ca(this.minNode.value)),i=e.getTypeLength(Ca(this.maxNode.value));return t>i?t:i}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let i=null;if(t.count>1){const r=this.minNode.value,s=this.maxNode.value,o=e.getTypeLength(Ca(r)),a=e.getTypeLength(Ca(s));rl=rl||new Mt,sl=sl||new Mt,rl.setScalar(0),sl.setScalar(0),o===1?rl.setScalar(r):r.isColor?rl.set(r.r,r.g,r.b,1):rl.set(r.x,r.y,r.z||0,r.w||0),a===1?sl.setScalar(s):s.isColor?sl.set(s.r,s.g,s.b,1):sl.set(s.x,s.y,s.z||0,s.w||0);const l=4,c=l*t.count,u=new Float32Array(c);for(let h=0;h<c;h++){const f=h%l,p=rl.getComponent(f),g=sl.getComponent(f);u[h]=Ta.lerp(p,g,Math.random())}const d=this.getNodeType(e);if(t.count<=4096)i=$h(u,"vec4",t.count).element(Kh).convert(d);else{const h=new jo(u,4);e.geometry.setAttribute("__range"+this.id,h),i=Sm(h).convert(d)}}else i=ce(0);return i}}const PG=Pe(NG);class LG extends ut{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){e.hasBuiltin(this._builtinName)}generate(e,t){const i=this.getBuiltinName(e),r=this.getNodeType(e);return e.shaderStage==="compute"?e.format(i,r,t):(console.warn("ComputeBuiltinNode: Compute built-in value ".concat(i," can not be accessed in the ").concat(e.shaderStage," stage")),e.generateConst(r))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const Zh=(n,e)=>Fe(new LG(n,e)),DG=Zh("numWorkgroups","uvec3"),FG=Zh("workgroupId","uvec3"),OG=Zh("globalId","uvec3"),BG=Zh("localId","uvec3"),kG=Zh("subgroupSize","uint");class UG extends ut{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:i}=e;i.backend.isWebGLBackend===!0?e.addFlowCode(" // ".concat(t,"Barrier \n")):e.addLineFlowCode("".concat(t,"Barrier()"),this)}}const Mx=Pe(UG),zG=()=>Mx("workgroup").append(),VG=()=>Mx("storage").append(),HG=()=>Mx("texture").append();class $G extends Ql{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let i;const r=e.context.assign;if(i=super.generate(e),r!==!0){const s=this.getNodeType(e);i=e.format(i,s,t)}return i}}class GG extends ut{constructor(e,t,i=0){super(t),this.bufferType=t,this.bufferCount=i,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return"".concat(this.scope,"Array")}element(e){return Fe(new $G(this,e))}generate(e){return e.getScopedArray(this.name||"".concat(this.scope,"Array_").concat(this.id),this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const WG=(n,e)=>Fe(new GG("Workgroup",n,e));class ni extends kn{static get type(){return"AtomicFunctionNode"}constructor(e,t,i,r=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=i,this.storeNode=r}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,i=this.getNodeType(e),r=this.getInputType(e),s=this.pointerNode,o=this.valueNode,a=[];a.push("&".concat(s.build(e,r))),o!==null&&a.push(o.build(e,r));const l="".concat(e.getMethod(t,i),"( ").concat(a.join(", ")," )");if(this.storeNode!==null){const c=this.storeNode.build(e,r);e.addLineFlowCode("".concat(c," = ").concat(l),this)}else e.addLineFlowCode(l,this)}}ni.ATOMIC_LOAD="atomicLoad";ni.ATOMIC_STORE="atomicStore";ni.ATOMIC_ADD="atomicAdd";ni.ATOMIC_SUB="atomicSub";ni.ATOMIC_MAX="atomicMax";ni.ATOMIC_MIN="atomicMin";ni.ATOMIC_AND="atomicAnd";ni.ATOMIC_OR="atomicOr";ni.ATOMIC_XOR="atomicXor";const QG=Pe(ni),co=(n,e,t,i=null)=>{const r=QG(n,e,t,i);return r.append(),r},jG=(n,e=null)=>co(ni.ATOMIC_LOAD,n,null,e),qG=(n,e,t=null)=>co(ni.ATOMIC_STORE,n,e,t),XG=(n,e,t=null)=>co(ni.ATOMIC_ADD,n,e,t),KG=(n,e,t=null)=>co(ni.ATOMIC_SUB,n,e,t),YG=(n,e,t=null)=>co(ni.ATOMIC_MAX,n,e,t),ZG=(n,e,t=null)=>co(ni.ATOMIC_MIN,n,e,t),JG=(n,e,t=null)=>co(ni.ATOMIC_AND,n,e,t),eW=(n,e,t=null)=>co(ni.ATOMIC_OR,n,e,t),tW=(n,e,t=null)=>co(ni.ATOMIC_XOR,n,e,t);let np;function Jh(n){np=np||new WeakMap;let e=np.get(n);return e===void 0&&np.set(n,e={}),e}function Rx(n){const e=Jh(n);return e.shadowMatrix||(e.shadowMatrix=Rt("mat4").setGroup(kt).onRenderUpdate(()=>(n.castShadow!==!0&&n.shadow.updateMatrices(n),n.shadow.matrix)))}function nW(n){const e=Jh(n);if(e.projectionUV===void 0){const t=Rx(n).mul(Nl);e.projectionUV=t.xyz.div(t.w)}return e.projectionUV}function m4(n){const e=Jh(n);return e.position||(e.position=Rt(new Y).setGroup(kt).onRenderUpdate((t,i)=>i.value.setFromMatrixPosition(n.matrixWorld)))}function g4(n){const e=Jh(n);return e.targetPosition||(e.targetPosition=Rt(new Y).setGroup(kt).onRenderUpdate((t,i)=>i.value.setFromMatrixPosition(n.target.matrixWorld)))}function iW(n){const e=Jh(n);return e.viewPosition||(e.viewPosition=Rt(new Y).setGroup(kt).onRenderUpdate(({camera:t},i)=>{i.value=i.value||new Y,i.value.setFromMatrixPosition(n.matrixWorld),i.value.applyMatrix4(t.matrixWorldInverse)}))}const rW=n=>ss.transformDirection(m4(n).sub(g4(n))),sW=n=>n.sort((e,t)=>e.id-t.id),oW=(n,e)=>{for(const t of e)if(t.isAnalyticLightNode&&t.light.id===n)return t;return null},r1=new WeakMap;class aW extends ut{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=ve().toVar("totalDiffuse"),this.totalSpecularNode=ve().toVar("totalSpecular"),this.outgoingLightNode=ve().toVar("outgoingLight"),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=[],t=this._lights;for(let i=0;i<t.length;i++)e.push(t[i].id);return eC(e)}getHash(e){if(this._lightNodesHash===null){this._lightNodes===null&&this.setupLightsNode(e);const t=[];for(const i of this._lightNodes)t.push(i.getSelf().getHash());this._lightNodesHash="lights-"+t.join(",")}return this._lightNodesHash}analyze(e){const t=e.getDataFromNode(this);for(const i of t.nodes)i.build(e)}setupLightsNode(e){const t=[],i=this._lightNodes,r=sW(this._lights),s=e.renderer.library;for(const o of r)if(o.isNode)t.push(Fe(o));else{let a=null;if(i!==null&&(a=oW(o.id,i)),a===null){const l=s.getLightNodeClass(o.constructor);if(l===null){console.warn("LightsNode.setupNodeLights: Light node not found for ".concat(o.constructor.name));continue}let c=null;r1.has(o)?c=r1.get(o):(c=Fe(new l(o)),r1.set(o,c)),t.push(c)}}this._lightNodes=t}setupLights(e,t){for(const i of t)i.build(e)}setup(e){this._lightNodes===null&&this.setupLightsNode(e);const t=e.context,i=t.lightingModel;let r=this.outgoingLightNode;if(i){const{_lightNodes:s,totalDiffuseNode:o,totalSpecularNode:a}=this;t.outgoingLight=r;const l=e.addStack(),c=e.getDataFromNode(this);c.nodes=l.nodes,i.start(t,l,e),this.setupLights(e,s),i.indirect(t,l,e);const{backdrop:u,backdropAlpha:d}=t,{directDiffuse:h,directSpecular:f,indirectDiffuse:p,indirectSpecular:g}=t.reflectedLight;let y=h.add(p);u!==null&&(d!==null?y=ve(d.mix(y,u)):y=ve(u),t.material.transparent=!0),o.assign(y),a.assign(f.add(g)),r.assign(o.add(a)),i.finish(t,l,e),r=r.bypass(e.removeStack())}return r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}const lW=(n=[])=>Fe(new aW).setLights(n);class cW extends ut{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Wt.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({material:e}){Ix.assign(e.shadowPositionNode||Nl)}dispose(){this.updateBeforeType=Wt.NONE}}const Ix=ve().toVar("shadowPositionWorld");function uW(n,e={}){return e.toneMapping=n.toneMapping,e.toneMappingExposure=n.toneMappingExposure,e.outputColorSpace=n.outputColorSpace,e.renderTarget=n.getRenderTarget(),e.activeCubeFace=n.getActiveCubeFace(),e.activeMipmapLevel=n.getActiveMipmapLevel(),e.renderObjectFunction=n.getRenderObjectFunction(),e.pixelRatio=n.getPixelRatio(),e.mrt=n.getMRT(),e.clearColor=n.getClearColor(e.clearColor||new gt),e.clearAlpha=n.getClearAlpha(),e.autoClear=n.autoClear,e.scissorTest=n.getScissorTest(),e}function dW(n,e){return e=uW(n,e),n.setMRT(null),n.setRenderObjectFunction(null),n.setClearColor(0,1),n.autoClear=!0,e}function hW(n,e){n.toneMapping=e.toneMapping,n.toneMappingExposure=e.toneMappingExposure,n.outputColorSpace=e.outputColorSpace,n.setRenderTarget(e.renderTarget,e.activeCubeFace,e.activeMipmapLevel),n.setRenderObjectFunction(e.renderObjectFunction),n.setPixelRatio(e.pixelRatio),n.setMRT(e.mrt),n.setClearColor(e.clearColor,e.clearAlpha),n.autoClear=e.autoClear,n.setScissorTest(e.scissorTest)}function fW(n,e={}){return e.background=n.background,e.backgroundNode=n.backgroundNode,e.overrideMaterial=n.overrideMaterial,e}function pW(n,e){return e=fW(n,e),n.background=null,n.backgroundNode=null,n.overrideMaterial=null,e}function mW(n,e){n.background=e.background,n.backgroundNode=e.backgroundNode,n.overrideMaterial=e.overrideMaterial}function gW(n,e,t){return t=dW(n,t),t=pW(e,t),t}function yW(n,e,t){hW(n,t),mW(e,t)}const bb=new WeakMap,vW=_e(([n,e,t])=>{let i=Nl.sub(n).length();return i=i.sub(e).div(t.sub(e)),i=i.saturate(),i}),_W=n=>{const e=n.shadow.camera,t=Pn("near","float",e).setGroup(kt),i=Pn("far","float",e).setGroup(kt),r=ZE(n);return vW(r,t,i)},xW=n=>{let e=bb.get(n);if(e===void 0){const t=n.isPointLight?_W(n):null;e=new yh,e.colorNode=vt(0,0,0,1),e.depthNode=t,e.isShadowPassMaterial=!0,e.name="ShadowMaterial",e.fog=!1,bb.set(n,e)}return e},y4=_e(({depthTexture:n,shadowCoord:e})=>er(n,e.xy).compare(e.z)),v4=_e(({depthTexture:n,shadowCoord:e,shadow:t})=>{const i=(g,y)=>er(n,g).compare(y),r=Pn("mapSize","vec2",t).setGroup(kt),s=Pn("radius","float",t).setGroup(kt),o=He(1).div(r),a=o.x.negate().mul(s),l=o.y.negate().mul(s),c=o.x.mul(s),u=o.y.mul(s),d=a.div(2),h=l.div(2),f=c.div(2),p=u.div(2);return On(i(e.xy.add(He(a,l)),e.z),i(e.xy.add(He(0,l)),e.z),i(e.xy.add(He(c,l)),e.z),i(e.xy.add(He(d,h)),e.z),i(e.xy.add(He(0,h)),e.z),i(e.xy.add(He(f,h)),e.z),i(e.xy.add(He(a,0)),e.z),i(e.xy.add(He(d,0)),e.z),i(e.xy,e.z),i(e.xy.add(He(f,0)),e.z),i(e.xy.add(He(c,0)),e.z),i(e.xy.add(He(d,p)),e.z),i(e.xy.add(He(0,p)),e.z),i(e.xy.add(He(f,p)),e.z),i(e.xy.add(He(a,u)),e.z),i(e.xy.add(He(0,u)),e.z),i(e.xy.add(He(c,u)),e.z)).mul(1/17)}),_4=_e(({depthTexture:n,shadowCoord:e,shadow:t})=>{const i=(u,d)=>er(n,u).compare(d),r=Pn("mapSize","vec2",t).setGroup(kt),s=He(1).div(r),o=s.x,a=s.y,l=e.xy,c=na(l.mul(r).add(.5));return l.subAssign(c.mul(s)),On(i(l,e.z),i(l.add(He(o,0)),e.z),i(l.add(He(0,a)),e.z),i(l.add(s),e.z),Ln(i(l.add(He(o.negate(),0)),e.z),i(l.add(He(o.mul(2),0)),e.z),c.x),Ln(i(l.add(He(o.negate(),a)),e.z),i(l.add(He(o.mul(2),a)),e.z),c.x),Ln(i(l.add(He(0,a.negate())),e.z),i(l.add(He(0,a.mul(2))),e.z),c.y),Ln(i(l.add(He(o,a.negate())),e.z),i(l.add(He(o,a.mul(2))),e.z),c.y),Ln(Ln(i(l.add(He(o.negate(),a.negate())),e.z),i(l.add(He(o.mul(2),a.negate())),e.z),c.x),Ln(i(l.add(He(o.negate(),a.mul(2))),e.z),i(l.add(He(o.mul(2),a.mul(2))),e.z),c.x),c.y)).mul(1/9)}),x4=_e(({depthTexture:n,shadowCoord:e})=>{const t=ce(1).toVar(),i=er(n).sample(e.xy).rg,r=c0(e.z,i.x);return Dt(r.notEqual(ce(1)),()=>{const s=e.z.sub(i.x),o=ui(0,i.y.mul(i.y));let a=o.div(o.add(s.mul(s)));a=Ko(Bt(a,.3).div(.95-.3)),t.assign(Ko(ui(r,a)))}),t}),SW=_e(({samples:n,radius:e,size:t,shadowPass:i})=>{const r=ce(0).toVar(),s=ce(0).toVar(),o=n.lessThanEqual(ce(1)).select(ce(0),ce(2).div(n.sub(1))),a=n.lessThanEqual(ce(1)).select(ce(0),ce(-1));cn({start:de(0),end:de(n),type:"int",condition:"<"},({i:c})=>{const u=a.add(ce(c).mul(o)),d=i.sample(On(Yh.xy,He(0,u).mul(e)).div(t)).x;r.addAssign(d),s.addAssign(d.mul(d))}),r.divAssign(n),s.divAssign(n);const l=lo(s.sub(r.mul(r)));return He(r,l)}),AW=_e(({samples:n,radius:e,size:t,shadowPass:i})=>{const r=ce(0).toVar(),s=ce(0).toVar(),o=n.lessThanEqual(ce(1)).select(ce(0),ce(2).div(n.sub(1))),a=n.lessThanEqual(ce(1)).select(ce(0),ce(-1));cn({start:de(0),end:de(n),type:"int",condition:"<"},({i:c})=>{const u=a.add(ce(c).mul(o)),d=i.sample(On(Yh.xy,He(u,0).mul(e)).div(t));r.addAssign(d.x),s.addAssign(On(d.y.mul(d.y),d.x.mul(d.x)))}),r.divAssign(n),s.divAssign(n);const l=lo(s.sub(r.mul(r)));return He(r,l)}),bW=[y4,v4,_4,x4];let s1;const ip=new t4;class TW extends cW{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this.isShadowNode=!0}setupShadowFilter(e,{filterFn:t,depthTexture:i,shadowCoord:r,shadow:s}){const o=r.x.greaterThanEqual(0).and(r.x.lessThanEqual(1)).and(r.y.greaterThanEqual(0)).and(r.y.lessThanEqual(1)).and(r.z.lessThanEqual(1)),a=t({depthTexture:i,shadowCoord:r,shadow:s});return o.select(a,ce(1))}setupShadowCoord(e,t){const{shadow:i}=this,{renderer:r}=e,s=Pn("bias","float",i).setGroup(kt);let o=t,a;if(i.camera.isOrthographicCamera||r.logarithmicDepthBuffer!==!0)o=o.xyz.div(o.w),a=o.z,r.coordinateSystem===Qo&&(a=a.mul(2).sub(1));else{const l=o.w;o=o.xy.div(l);const c=Pn("near","float",i.camera).setGroup(kt),u=Pn("far","float",i.camera).setGroup(kt);a=bx(l.negate(),c,u)}return o=ve(o.x,o.y.oneMinus(),a.add(s)),o}getShadowFilterFn(e){return bW[e]}setupShadow(e){const{renderer:t}=e,{light:i,shadow:r}=this,s=t.shadowMap.type,o=new Ua(r.mapSize.width,r.mapSize.height);o.compareFunction=b5;const a=e.createRenderTarget(r.mapSize.width,r.mapSize.height);if(a.depthTexture=o,r.camera.updateProjectionMatrix(),s===Ar){o.compareFunction=null,this.vsmShadowMapVertical=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:oh,type:Ts}),this.vsmShadowMapHorizontal=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:oh,type:Ts});const m=er(o),v=er(this.vsmShadowMapVertical.texture),x=Pn("blurSamples","float",r).setGroup(kt),_=Pn("radius","float",r).setGroup(kt),S=Pn("mapSize","vec2",r).setGroup(kt);let E=this.vsmMaterialVertical||(this.vsmMaterialVertical=new yh);E.fragmentNode=SW({samples:x,radius:_,size:S,shadowPass:m}).context(e.getSharedContext()),E.name="VSMVertical",E=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new yh),E.fragmentNode=AW({samples:x,radius:_,size:S,shadowPass:v}).context(e.getSharedContext()),E.name="VSMHorizontal"}const l=Pn("intensity","float",r).setGroup(kt),c=Pn("normalBias","float",r).setGroup(kt),u=Rx(i).mul(Ix.add(sM.mul(c))),d=this.setupShadowCoord(e,u),h=r.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(h===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const f=s===Ar?this.vsmShadowMapHorizontal.texture:o,p=this.setupShadowFilter(e,{filterFn:h,shadowTexture:a.texture,depthTexture:f,shadowCoord:d,shadow:r}),g=er(a.texture,d),y=Ln(1,p.rgb.mix(g,1),l.mul(g.a)).toVar();return this.shadowMap=a,this.shadow.map=a,y}setup(e){if(e.renderer.shadowMap.enabled!==!1)return _e(()=>{let t=this._node;return this.setupShadowPosition(e),t===null&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t})()}renderShadow(e){const{shadow:t,shadowMap:i,light:r}=this,{renderer:s,scene:o}=e;t.updateMatrices(r),i.setSize(t.mapSize.width,t.mapSize.height),s.render(o,t.camera)}updateShadow(e){const{shadowMap:t,light:i,shadow:r}=this,{renderer:s,scene:o,camera:a}=e,l=s.shadowMap.type,c=t.depthTexture.version;this._depthVersionCached=c,r.camera.layers.mask=a.layers.mask;const u=s.getRenderObjectFunction(),d=s.getMRT(),h=d?d.has("velocity"):!1;s1=gW(s,o,s1),o.overrideMaterial=xW(i),s.setRenderObjectFunction((f,p,g,y,m,v,...x)=>{(f.castShadow===!0||f.receiveShadow&&l===Ar)&&(h&&(rC(f).useVelocity=!0),f.onBeforeShadow(s,f,a,r.camera,y,p.overrideMaterial,v),s.renderObject(f,p,g,y,m,v,...x),f.onAfterShadow(s,f,a,r.camera,y,p.overrideMaterial,v))}),s.setRenderTarget(t),this.renderShadow(e),s.setRenderObjectFunction(u),i.isPointLight!==!0&&l===Ar&&this.vsmPass(s),yW(s,o,s1)}vsmPass(e){const{shadow:t}=this;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height),e.setRenderTarget(this.vsmShadowMapVertical),ip.material=this.vsmMaterialVertical,ip.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),ip.material=this.vsmMaterialHorizontal,ip.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;(t.needsUpdate||t.autoUpdate)&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const wW=(n,e)=>Fe(new TW(n,e)),S4=_e(n=>{const{lightDistance:e,cutoffDistance:t,decayExponent:i}=n,r=e.pow(i).max(.01).reciprocal();return t.greaterThan(0).select(r.mul(e.div(t).pow4().oneMinus().clamp().pow2()),r)}),CW=_e(({color:n,lightViewPosition:e,cutoffDistance:t,decayExponent:i},r)=>{const s=r.context.lightingModel,o=e.sub(Yn),a=o.normalize(),l=o.length(),c=S4({lightDistance:l,cutoffDistance:t,decayExponent:i}),u=n.mul(c),d=r.context.reflectedLight;s.direct({lightDirection:a,lightColor:u,reflectedLight:d},r.stack,r)}),EW=_e(([n=xn()])=>{const e=n.mul(2),t=e.x.floor(),i=e.y.floor();return t.add(i).mod(2).sign()}),MW=_e(([n=xn()],{renderer:e,material:t})=>{const i=ce(1).toVar(),r=ax(n.mul(2).sub(1));if(t.alphaToCoverage&&e.samples>1){const s=ce(r.fwidth()).toVar();i.assign(Vl(s.oneMinus(),s.add(1),r).oneMinus())}else r.greaterThan(1).discard();return i}),Gd=_e(([n,e,t])=>{const i=ce(t).toVar(),r=ce(e).toVar(),s=qo(n).toVar();return sr(s,r,i)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),Em=_e(([n,e])=>{const t=qo(e).toVar(),i=ce(n).toVar();return sr(t,i.negate(),i)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),Fn=_e(([n])=>{const e=ce(n).toVar();return de(js(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),_n=_e(([n,e])=>{const t=ce(n).toVar();return e.assign(Fn(t)),t.sub(ce(e))}),RW=_e(([n,e,t,i,r,s])=>{const o=ce(s).toVar(),a=ce(r).toVar(),l=ce(i).toVar(),c=ce(t).toVar(),u=ce(e).toVar(),d=ce(n).toVar(),h=ce(Bt(1,a)).toVar();return Bt(1,o).mul(d.mul(h).add(u.mul(a))).add(o.mul(c.mul(h).add(l.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),IW=_e(([n,e,t,i,r,s])=>{const o=ce(s).toVar(),a=ce(r).toVar(),l=ve(i).toVar(),c=ve(t).toVar(),u=ve(e).toVar(),d=ve(n).toVar(),h=ce(Bt(1,a)).toVar();return Bt(1,o).mul(d.mul(h).add(u.mul(a))).add(o.mul(c.mul(h).add(l.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),A4=bi([RW,IW]),NW=_e(([n,e,t,i,r,s,o,a,l,c,u])=>{const d=ce(u).toVar(),h=ce(c).toVar(),f=ce(l).toVar(),p=ce(a).toVar(),g=ce(o).toVar(),y=ce(s).toVar(),m=ce(r).toVar(),v=ce(i).toVar(),x=ce(t).toVar(),_=ce(e).toVar(),S=ce(n).toVar(),E=ce(Bt(1,f)).toVar(),A=ce(Bt(1,h)).toVar();return ce(Bt(1,d)).toVar().mul(A.mul(S.mul(E).add(_.mul(f))).add(h.mul(x.mul(E).add(v.mul(f))))).add(d.mul(A.mul(m.mul(E).add(y.mul(f))).add(h.mul(g.mul(E).add(p.mul(f))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),PW=_e(([n,e,t,i,r,s,o,a,l,c,u])=>{const d=ce(u).toVar(),h=ce(c).toVar(),f=ce(l).toVar(),p=ve(a).toVar(),g=ve(o).toVar(),y=ve(s).toVar(),m=ve(r).toVar(),v=ve(i).toVar(),x=ve(t).toVar(),_=ve(e).toVar(),S=ve(n).toVar(),E=ce(Bt(1,f)).toVar(),A=ce(Bt(1,h)).toVar();return ce(Bt(1,d)).toVar().mul(A.mul(S.mul(E).add(_.mul(f))).add(h.mul(x.mul(E).add(v.mul(f))))).add(d.mul(A.mul(m.mul(E).add(y.mul(f))).add(h.mul(g.mul(E).add(p.mul(f))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),b4=bi([NW,PW]),LW=_e(([n,e,t])=>{const i=ce(t).toVar(),r=ce(e).toVar(),s=Ye(n).toVar(),o=Ye(s.bitAnd(Ye(7))).toVar(),a=ce(Gd(o.lessThan(Ye(4)),r,i)).toVar(),l=ce(St(2,Gd(o.lessThan(Ye(4)),i,r))).toVar();return Em(a,qo(o.bitAnd(Ye(1)))).add(Em(l,qo(o.bitAnd(Ye(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),DW=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=ce(e).toVar(),a=Ye(n).toVar(),l=Ye(a.bitAnd(Ye(15))).toVar(),c=ce(Gd(l.lessThan(Ye(8)),o,s)).toVar(),u=ce(Gd(l.lessThan(Ye(4)),s,Gd(l.equal(Ye(12)).or(l.equal(Ye(14))),o,r))).toVar();return Em(c,qo(l.bitAnd(Ye(1)))).add(Em(u,qo(l.bitAnd(Ye(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),ai=bi([LW,DW]),FW=_e(([n,e,t])=>{const i=ce(t).toVar(),r=ce(e).toVar(),s=Uu(n).toVar();return ve(ai(s.x,r,i),ai(s.y,r,i),ai(s.z,r,i))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),OW=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=ce(e).toVar(),a=Uu(n).toVar();return ve(ai(a.x,o,s,r),ai(a.y,o,s,r),ai(a.z,o,s,r))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),jr=bi([FW,OW]),BW=_e(([n])=>{const e=ce(n).toVar();return St(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),kW=_e(([n])=>{const e=ce(n).toVar();return St(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),UW=_e(([n])=>{const e=ve(n).toVar();return St(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),T4=bi([BW,UW]),zW=_e(([n])=>{const e=ve(n).toVar();return St(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),w4=bi([kW,zW]),Tr=_e(([n,e])=>{const t=de(e).toVar(),i=Ye(n).toVar();return i.shiftLeft(t).bitOr(i.shiftRight(de(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),C4=_e(([n,e,t])=>{n.subAssign(t),n.bitXorAssign(Tr(t,de(4))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Tr(n,de(6))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Tr(e,de(8))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(Tr(t,de(16))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(Tr(n,de(19))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(Tr(e,de(4))),e.addAssign(n)}),ef=_e(([n,e,t])=>{const i=Ye(t).toVar(),r=Ye(e).toVar(),s=Ye(n).toVar();return i.bitXorAssign(r),i.subAssign(Tr(r,de(14))),s.bitXorAssign(i),s.subAssign(Tr(i,de(11))),r.bitXorAssign(s),r.subAssign(Tr(s,de(25))),i.bitXorAssign(r),i.subAssign(Tr(r,de(16))),s.bitXorAssign(i),s.subAssign(Tr(i,de(4))),r.bitXorAssign(s),r.subAssign(Tr(s,de(14))),i.bitXorAssign(r),i.subAssign(Tr(r,de(24))),i}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Oi=_e(([n])=>{const e=Ye(n).toVar();return ce(e).div(ce(Ye(de(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),qs=_e(([n])=>{const e=ce(n).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),VW=_e(([n])=>{const e=de(n).toVar(),t=Ye(Ye(1)).toVar(),i=Ye(Ye(de(3735928559)).add(t.shiftLeft(Ye(2))).add(Ye(13))).toVar();return ef(i.add(Ye(e)),i,i)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),HW=_e(([n,e])=>{const t=de(e).toVar(),i=de(n).toVar(),r=Ye(Ye(2)).toVar(),s=Ye().toVar(),o=Ye().toVar(),a=Ye().toVar();return s.assign(o.assign(a.assign(Ye(de(3735928559)).add(r.shiftLeft(Ye(2))).add(Ye(13))))),s.addAssign(Ye(i)),o.addAssign(Ye(t)),ef(s,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),$W=_e(([n,e,t])=>{const i=de(t).toVar(),r=de(e).toVar(),s=de(n).toVar(),o=Ye(Ye(3)).toVar(),a=Ye().toVar(),l=Ye().toVar(),c=Ye().toVar();return a.assign(l.assign(c.assign(Ye(de(3735928559)).add(o.shiftLeft(Ye(2))).add(Ye(13))))),a.addAssign(Ye(s)),l.addAssign(Ye(r)),c.addAssign(Ye(i)),ef(a,l,c)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),GW=_e(([n,e,t,i])=>{const r=de(i).toVar(),s=de(t).toVar(),o=de(e).toVar(),a=de(n).toVar(),l=Ye(Ye(4)).toVar(),c=Ye().toVar(),u=Ye().toVar(),d=Ye().toVar();return c.assign(u.assign(d.assign(Ye(de(3735928559)).add(l.shiftLeft(Ye(2))).add(Ye(13))))),c.addAssign(Ye(a)),u.addAssign(Ye(o)),d.addAssign(Ye(s)),C4(c,u,d),c.addAssign(Ye(r)),ef(c,u,d)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),WW=_e(([n,e,t,i,r])=>{const s=de(r).toVar(),o=de(i).toVar(),a=de(t).toVar(),l=de(e).toVar(),c=de(n).toVar(),u=Ye(Ye(5)).toVar(),d=Ye().toVar(),h=Ye().toVar(),f=Ye().toVar();return d.assign(h.assign(f.assign(Ye(de(3735928559)).add(u.shiftLeft(Ye(2))).add(Ye(13))))),d.addAssign(Ye(c)),h.addAssign(Ye(l)),f.addAssign(Ye(a)),C4(d,h,f),d.addAssign(Ye(o)),h.addAssign(Ye(s)),ef(d,h,f)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),tn=bi([VW,HW,$W,GW,WW]),QW=_e(([n,e])=>{const t=de(e).toVar(),i=de(n).toVar(),r=Ye(tn(i,t)).toVar(),s=Uu().toVar();return s.x.assign(r.bitAnd(de(255))),s.y.assign(r.shiftRight(de(8)).bitAnd(de(255))),s.z.assign(r.shiftRight(de(16)).bitAnd(de(255))),s}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),jW=_e(([n,e,t])=>{const i=de(t).toVar(),r=de(e).toVar(),s=de(n).toVar(),o=Ye(tn(s,r,i)).toVar(),a=Uu().toVar();return a.x.assign(o.bitAnd(de(255))),a.y.assign(o.shiftRight(de(8)).bitAnd(de(255))),a.z.assign(o.shiftRight(de(16)).bitAnd(de(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),qr=bi([QW,jW]),qW=_e(([n])=>{const e=He(n).toVar(),t=de().toVar(),i=de().toVar(),r=ce(_n(e.x,t)).toVar(),s=ce(_n(e.y,i)).toVar(),o=ce(qs(r)).toVar(),a=ce(qs(s)).toVar(),l=ce(A4(ai(tn(t,i),r,s),ai(tn(t.add(de(1)),i),r.sub(1),s),ai(tn(t,i.add(de(1))),r,s.sub(1)),ai(tn(t.add(de(1)),i.add(de(1))),r.sub(1),s.sub(1)),o,a)).toVar();return T4(l)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),XW=_e(([n])=>{const e=ve(n).toVar(),t=de().toVar(),i=de().toVar(),r=de().toVar(),s=ce(_n(e.x,t)).toVar(),o=ce(_n(e.y,i)).toVar(),a=ce(_n(e.z,r)).toVar(),l=ce(qs(s)).toVar(),c=ce(qs(o)).toVar(),u=ce(qs(a)).toVar(),d=ce(b4(ai(tn(t,i,r),s,o,a),ai(tn(t.add(de(1)),i,r),s.sub(1),o,a),ai(tn(t,i.add(de(1)),r),s,o.sub(1),a),ai(tn(t.add(de(1)),i.add(de(1)),r),s.sub(1),o.sub(1),a),ai(tn(t,i,r.add(de(1))),s,o,a.sub(1)),ai(tn(t.add(de(1)),i,r.add(de(1))),s.sub(1),o,a.sub(1)),ai(tn(t,i.add(de(1)),r.add(de(1))),s,o.sub(1),a.sub(1)),ai(tn(t.add(de(1)),i.add(de(1)),r.add(de(1))),s.sub(1),o.sub(1),a.sub(1)),l,c,u)).toVar();return w4(d)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),Nx=bi([qW,XW]),KW=_e(([n])=>{const e=He(n).toVar(),t=de().toVar(),i=de().toVar(),r=ce(_n(e.x,t)).toVar(),s=ce(_n(e.y,i)).toVar(),o=ce(qs(r)).toVar(),a=ce(qs(s)).toVar(),l=ve(A4(jr(qr(t,i),r,s),jr(qr(t.add(de(1)),i),r.sub(1),s),jr(qr(t,i.add(de(1))),r,s.sub(1)),jr(qr(t.add(de(1)),i.add(de(1))),r.sub(1),s.sub(1)),o,a)).toVar();return T4(l)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),YW=_e(([n])=>{const e=ve(n).toVar(),t=de().toVar(),i=de().toVar(),r=de().toVar(),s=ce(_n(e.x,t)).toVar(),o=ce(_n(e.y,i)).toVar(),a=ce(_n(e.z,r)).toVar(),l=ce(qs(s)).toVar(),c=ce(qs(o)).toVar(),u=ce(qs(a)).toVar(),d=ve(b4(jr(qr(t,i,r),s,o,a),jr(qr(t.add(de(1)),i,r),s.sub(1),o,a),jr(qr(t,i.add(de(1)),r),s,o.sub(1),a),jr(qr(t.add(de(1)),i.add(de(1)),r),s.sub(1),o.sub(1),a),jr(qr(t,i,r.add(de(1))),s,o,a.sub(1)),jr(qr(t.add(de(1)),i,r.add(de(1))),s.sub(1),o,a.sub(1)),jr(qr(t,i.add(de(1)),r.add(de(1))),s,o.sub(1),a.sub(1)),jr(qr(t.add(de(1)),i.add(de(1)),r.add(de(1))),s.sub(1),o.sub(1),a.sub(1)),l,c,u)).toVar();return w4(d)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),Px=bi([KW,YW]),ZW=_e(([n])=>{const e=ce(n).toVar(),t=de(Fn(e)).toVar();return Oi(tn(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),JW=_e(([n])=>{const e=He(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar();return Oi(tn(t,i))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),eQ=_e(([n])=>{const e=ve(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar(),r=de(Fn(e.z)).toVar();return Oi(tn(t,i,r))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),tQ=_e(([n])=>{const e=vt(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar(),r=de(Fn(e.z)).toVar(),s=de(Fn(e.w)).toVar();return Oi(tn(t,i,r,s))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),nQ=bi([ZW,JW,eQ,tQ]),iQ=_e(([n])=>{const e=ce(n).toVar(),t=de(Fn(e)).toVar();return ve(Oi(tn(t,de(0))),Oi(tn(t,de(1))),Oi(tn(t,de(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),rQ=_e(([n])=>{const e=He(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar();return ve(Oi(tn(t,i,de(0))),Oi(tn(t,i,de(1))),Oi(tn(t,i,de(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),sQ=_e(([n])=>{const e=ve(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar(),r=de(Fn(e.z)).toVar();return ve(Oi(tn(t,i,r,de(0))),Oi(tn(t,i,r,de(1))),Oi(tn(t,i,r,de(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),oQ=_e(([n])=>{const e=vt(n).toVar(),t=de(Fn(e.x)).toVar(),i=de(Fn(e.y)).toVar(),r=de(Fn(e.z)).toVar(),s=de(Fn(e.w)).toVar();return ve(Oi(tn(t,i,r,s,de(0))),Oi(tn(t,i,r,s,de(1))),Oi(tn(t,i,r,s,de(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),E4=bi([iQ,rQ,sQ,oQ]),Mm=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=de(e).toVar(),a=ve(n).toVar(),l=ce(0).toVar(),c=ce(1).toVar();return cn(o,()=>{l.addAssign(c.mul(Nx(a))),c.mulAssign(r),a.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),M4=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=de(e).toVar(),a=ve(n).toVar(),l=ve(0).toVar(),c=ce(1).toVar();return cn(o,()=>{l.addAssign(c.mul(Px(a))),c.mulAssign(r),a.mulAssign(s)}),l}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),aQ=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=de(e).toVar(),a=ve(n).toVar();return He(Mm(a,o,s,r),Mm(a.add(ve(de(19),de(193),de(17))),o,s,r))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),lQ=_e(([n,e,t,i])=>{const r=ce(i).toVar(),s=ce(t).toVar(),o=de(e).toVar(),a=ve(n).toVar(),l=ve(M4(a,o,s,r)).toVar(),c=ce(Mm(a.add(ve(de(19),de(193),de(17))),o,s,r)).toVar();return vt(l,c)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),cQ=_e(([n,e,t,i,r,s,o])=>{const a=de(o).toVar(),l=ce(s).toVar(),c=de(r).toVar(),u=de(i).toVar(),d=de(t).toVar(),h=de(e).toVar(),f=He(n).toVar(),p=ve(E4(He(h.add(u),d.add(c)))).toVar(),g=He(p.x,p.y).toVar();g.subAssign(.5),g.mulAssign(l),g.addAssign(.5);const y=He(He(ce(h),ce(d)).add(g)).toVar(),m=He(y.sub(f)).toVar();return Dt(a.equal(de(2)),()=>mn(m.x).add(mn(m.y))),Dt(a.equal(de(3)),()=>ui(mn(m.x),mn(m.y))),za(m,m)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),uQ=_e(([n,e,t,i,r,s,o,a,l])=>{const c=de(l).toVar(),u=ce(a).toVar(),d=de(o).toVar(),h=de(s).toVar(),f=de(r).toVar(),p=de(i).toVar(),g=de(t).toVar(),y=de(e).toVar(),m=ve(n).toVar(),v=ve(E4(ve(y.add(f),g.add(h),p.add(d)))).toVar();v.subAssign(.5),v.mulAssign(u),v.addAssign(.5);const x=ve(ve(ce(y),ce(g),ce(p)).add(v)).toVar(),_=ve(x.sub(m)).toVar();return Dt(c.equal(de(2)),()=>mn(_.x).add(mn(_.y)).add(mn(_.z))),Dt(c.equal(de(3)),()=>ui(ui(mn(_.x),mn(_.y)),mn(_.z))),za(_,_)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),zu=bi([cQ,uQ]),dQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=He(n).toVar(),o=de().toVar(),a=de().toVar(),l=He(_n(s.x,o),_n(s.y,a)).toVar(),c=ce(1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:u})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:d})=>{const h=ce(zu(l,u,d,o,a,r,i)).toVar();c.assign(Fr(c,h))})}),Dt(i.equal(de(0)),()=>{c.assign(lo(c))}),c}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),hQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=He(n).toVar(),o=de().toVar(),a=de().toVar(),l=He(_n(s.x,o),_n(s.y,a)).toVar(),c=He(1e6,1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:u})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:d})=>{const h=ce(zu(l,u,d,o,a,r,i)).toVar();Dt(h.lessThan(c.x),()=>{c.y.assign(c.x),c.x.assign(h)}).ElseIf(h.lessThan(c.y),()=>{c.y.assign(h)})})}),Dt(i.equal(de(0)),()=>{c.assign(lo(c))}),c}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),fQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=He(n).toVar(),o=de().toVar(),a=de().toVar(),l=He(_n(s.x,o),_n(s.y,a)).toVar(),c=ve(1e6,1e6,1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:u})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:d})=>{const h=ce(zu(l,u,d,o,a,r,i)).toVar();Dt(h.lessThan(c.x),()=>{c.z.assign(c.y),c.y.assign(c.x),c.x.assign(h)}).ElseIf(h.lessThan(c.y),()=>{c.z.assign(c.y),c.y.assign(h)}).ElseIf(h.lessThan(c.z),()=>{c.z.assign(h)})})}),Dt(i.equal(de(0)),()=>{c.assign(lo(c))}),c}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),pQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=ve(n).toVar(),o=de().toVar(),a=de().toVar(),l=de().toVar(),c=ve(_n(s.x,o),_n(s.y,a),_n(s.z,l)).toVar(),u=ce(1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:d})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:h})=>{cn({start:-1,end:de(1),name:"z",condition:"<="},({z:f})=>{const p=ce(zu(c,d,h,f,o,a,l,r,i)).toVar();u.assign(Fr(u,p))})})}),Dt(i.equal(de(0)),()=>{u.assign(lo(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),mQ=bi([dQ,pQ]),gQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=ve(n).toVar(),o=de().toVar(),a=de().toVar(),l=de().toVar(),c=ve(_n(s.x,o),_n(s.y,a),_n(s.z,l)).toVar(),u=He(1e6,1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:d})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:h})=>{cn({start:-1,end:de(1),name:"z",condition:"<="},({z:f})=>{const p=ce(zu(c,d,h,f,o,a,l,r,i)).toVar();Dt(p.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(p)}).ElseIf(p.lessThan(u.y),()=>{u.y.assign(p)})})})}),Dt(i.equal(de(0)),()=>{u.assign(lo(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),yQ=bi([hQ,gQ]),vQ=_e(([n,e,t])=>{const i=de(t).toVar(),r=ce(e).toVar(),s=ve(n).toVar(),o=de().toVar(),a=de().toVar(),l=de().toVar(),c=ve(_n(s.x,o),_n(s.y,a),_n(s.z,l)).toVar(),u=ve(1e6,1e6,1e6).toVar();return cn({start:-1,end:de(1),name:"x",condition:"<="},({x:d})=>{cn({start:-1,end:de(1),name:"y",condition:"<="},({y:h})=>{cn({start:-1,end:de(1),name:"z",condition:"<="},({z:f})=>{const p=ce(zu(c,d,h,f,o,a,l,r,i)).toVar();Dt(p.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(p)}).ElseIf(p.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(p)}).ElseIf(p.lessThan(u.z),()=>{u.z.assign(p)})})})}),Dt(i.equal(de(0)),()=>{u.assign(lo(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),_Q=bi([fQ,vQ]),xQ=_e(([n])=>{const e=n.y,t=n.z,i=ve().toVar();return Dt(e.lessThan(1e-4),()=>{i.assign(ve(t,t,t))}).Else(()=>{let r=n.x;r=r.sub(js(r)).mul(6).toVar();const s=de(sx(r)),o=r.sub(ce(s)),a=t.mul(e.oneMinus()),l=t.mul(e.mul(o).oneMinus()),c=t.mul(e.mul(o.oneMinus()).oneMinus());Dt(s.equal(de(0)),()=>{i.assign(ve(t,c,a))}).ElseIf(s.equal(de(1)),()=>{i.assign(ve(l,t,a))}).ElseIf(s.equal(de(2)),()=>{i.assign(ve(a,t,c))}).ElseIf(s.equal(de(3)),()=>{i.assign(ve(a,l,t))}).ElseIf(s.equal(de(4)),()=>{i.assign(ve(c,a,t))}).Else(()=>{i.assign(ve(t,a,l))})}),i}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),SQ=_e(([n])=>{const e=ve(n).toVar(),t=ce(e.x).toVar(),i=ce(e.y).toVar(),r=ce(e.z).toVar(),s=ce(Fr(t,Fr(i,r))).toVar(),o=ce(ui(t,ui(i,r))).toVar(),a=ce(o.sub(s)).toVar(),l=ce().toVar(),c=ce().toVar(),u=ce().toVar();return u.assign(o),Dt(o.greaterThan(0),()=>{c.assign(a.div(o))}).Else(()=>{c.assign(0)}),Dt(c.lessThanEqual(0),()=>{l.assign(0)}).Else(()=>{Dt(t.greaterThanEqual(o),()=>{l.assign(i.sub(r).div(a))}).ElseIf(i.greaterThanEqual(o),()=>{l.assign(On(2,r.sub(t).div(a)))}).Else(()=>{l.assign(On(4,t.sub(i).div(a)))}),l.mulAssign(1/6),Dt(l.lessThan(0),()=>{l.addAssign(1)})}),ve(l,c,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),AQ=_e(([n])=>{const e=ve(n).toVar(),t=X_(Y_(e,ve(.04045))).toVar(),i=ve(e.div(12.92)).toVar(),r=ve(gs(ui(e.add(ve(.055)),ve(0)).div(1.055),ve(2.4))).toVar();return Ln(i,r,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),R4=(n,e)=>{n=ce(n),e=ce(e);const t=He(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return Vl(n.sub(t),n.add(t),e)},I4=(n,e,t,i)=>Ln(n,e,t[i].clamp()),bQ=(n,e,t=xn())=>I4(n,e,t,"x"),TQ=(n,e,t=xn())=>I4(n,e,t,"y"),N4=(n,e,t,i,r)=>Ln(n,e,R4(t,i[r])),wQ=(n,e,t,i=xn())=>N4(n,e,t,i,"x"),CQ=(n,e,t,i=xn())=>N4(n,e,t,i,"y"),EQ=(n=1,e=0,t=xn())=>t.mul(n).add(e),MQ=(n,e=1)=>(n=ce(n),n.abs().pow(e).mul(n.sign())),RQ=(n,e=1,t=.5)=>ce(n).sub(t).mul(e).add(t),IQ=(n=xn(),e=1,t=0)=>Nx(n.convert("vec2|vec3")).mul(e).add(t),NQ=(n=xn(),e=1,t=0)=>Px(n.convert("vec2|vec3")).mul(e).add(t),PQ=(n=xn(),e=1,t=0)=>(n=n.convert("vec2|vec3"),vt(Px(n),Nx(n.add(He(19,73)))).mul(e).add(t)),LQ=(n=xn(),e=1)=>mQ(n.convert("vec2|vec3"),e,de(1)),DQ=(n=xn(),e=1)=>yQ(n.convert("vec2|vec3"),e,de(1)),FQ=(n=xn(),e=1)=>_Q(n.convert("vec2|vec3"),e,de(1)),OQ=(n=xn())=>nQ(n.convert("vec2|vec3")),BQ=(n=xn(),e=3,t=2,i=.5,r=1)=>Mm(n,de(e),t,i).mul(r),kQ=(n=xn(),e=3,t=2,i=.5,r=1)=>aQ(n,de(e),t,i).mul(r),UQ=(n=xn(),e=3,t=2,i=.5,r=1)=>M4(n,de(e),t,i).mul(r),zQ=(n=xn(),e=3,t=2,i=.5,r=1)=>lQ(n,de(e),t,i).mul(r),VQ=_e(([n,e,t])=>{const i=jl(n).toVar("nDir"),r=Bt(ce(.5).mul(e.sub(t)),Nl).div(i).toVar("rbmax"),s=Bt(ce(-.5).mul(e.sub(t)),Nl).div(i).toVar("rbmin"),o=ve().toVar("rbminmax");o.x=i.x.greaterThan(ce(0)).select(r.x,s.x),o.y=i.y.greaterThan(ce(0)).select(r.y,s.y),o.z=i.z.greaterThan(ce(0)).select(r.z,s.z);const a=Fr(Fr(o.x,o.y),o.z).toVar("correction");return Nl.add(i.mul(a)).toVar("boxIntersection").sub(t)}),HQ=_e(([n,e])=>{const t=n.x,i=n.y,r=n.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(2*.511664).mul(i)),s=s.add(e.element(2).mul(2*.511664).mul(r)),s=s.add(e.element(3).mul(2*.511664).mul(t)),s=s.add(e.element(4).mul(2*.429043).mul(t).mul(i)),s=s.add(e.element(5).mul(2*.429043).mul(i).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(2*.429043).mul(t).mul(r)),s=s.add(e.element(8).mul(.429043).mul(St(t,t).sub(St(i,i)))),s});var O=Object.freeze({__proto__:null,BRDF_GGX:hH,BRDF_Lambert:aH,BasicShadowFilter:y4,Break:LM,Const:RE,Continue:NV,DFGApprox:fH,D_GGX:GM,Discard:jE,EPSILON:KC,F_Schlick:VM,Fn:_e,INFINITY:$U,If:Dt,Loop:cn,NodeAccess:Gs,NodeShaderStage:Hy,NodeType:Yk,NodeUpdateType:Wt,PCFShadowFilter:v4,PCFSoftShadowFilter:_4,PI:_m,PI2:GU,Return:az,Schlick_to_F0:pH,ScriptableNodeResources:Pp,ShaderNode:$d,TBNViewMatrix:_x,VSMShadowFilter:x4,V_GGX_SmithCorrelated:$M,Var:ME,abs:mn,acesFilmicToneMapping:fG,acos:iE,add:On,addMethodChaining:Ne,addNodeElement:cz,agxToneMapping:yG,all:Z_,alphaT:jy,and:UC,anisotropy:NC,anisotropyB:qc,anisotropyT:Ip,any:YC,append:pC,array:TC,arrayBuffer:_U,asin:nE,assign:PC,atan:tx,atan2:TE,atomicAdd:XG,atomicAnd:JG,atomicFunc:co,atomicLoad:jG,atomicMax:YG,atomicMin:ZG,atomicOr:eW,atomicStore:qG,atomicSub:KG,atomicXor:tW,attenuationColor:UU,attenuationDistance:kU,attribute:Yo,attributeArray:I$,backgroundBlurriness:O$,backgroundIntensity:B$,backgroundRotation:k$,batch:IM,billboarding:l$,bitAnd:$C,bitNot:GC,bitOr:WC,bitXor:QC,bitangentGeometry:Oz,bitangentLocal:Bz,bitangentView:pM,bitangentWorld:kz,bitcast:WU,blendBurn:s4,blendColor:W$,blendDodge:o4,blendOverlay:l4,blendScreen:a4,blur:SH,bool:qo,buffer:$h,bufferAttribute:Hh,bumpMap:yM,burn:Q$,bvec2:yC,bvec3:X_,bvec4:SC,bypass:$E,cache:HE,call:LC,cameraFar:xa,cameraIndex:px,cameraNear:_a,cameraNormalMatrix:yz,cameraPosition:vz,cameraProjectionMatrix:Gh,cameraProjectionMatrixInverse:mz,cameraViewMatrix:ss,cameraWorldMatrix:gz,cbrt:vE,cdl:eG,ceil:l0,checker:EW,cineonToneMapping:dG,clamp:Ko,clearcoat:bU,clearcoatRoughness:TU,code:g0,color:mC,colorSpaceToWorking:hx,colorToDirection:rH,compute:VE,cond:wE,context:cx,convert:bC,convertColorSpace:YU,convertToTexture:S$,cos:Mo,cross:u0,cubeTexture:hM,dFdx:ix,dFdy:rx,dashSize:PU,defaultBuildStages:Zk,defaultShaderStages:aC,defined:ph,degrees:JC,deltaTime:JM,densityFog:IG,densityFogFactor:p4,depth:Tx,depthPass:oG,difference:fE,diffuseColor:hs,directPointLight:CW,directionToColor:iH,dispersion:zU,distance:hE,div:Xo,dodge:j$,dot:za,drawIndex:EM,dynamicBufferAttribute:zE,element:AC,emissive:Qy,equal:DC,equals:uE,equirectUV:oH,exp:eE,exp2:xu,expression:Oa,faceDirection:Qh,faceForward:lx,faceforward:QU,float:ce,floor:js,fog:Ex,fract:na,frameGroup:SU,frameId:ZH,frontFacing:nM,fwidth:lE,gain:WH,gapSize:LU,getConstNodeType:hC,getCurrentStack:fC,getDirection:jM,getDistanceAttenuation:S4,getGeometryRoughness:HM,getNormalFromDepth:b$,getParallaxCorrectNormal:VQ,getRoughness:lH,getScreenPosition:A$,getShIrradianceAt:HQ,getTextureIndex:YM,getViewPosition:Rc,globalId:OG,glsl:SG,glslFn:bG,grayscale:K$,greaterThan:Y_,greaterThanEqual:kC,hash:GH,highpModelNormalViewMatrix:Rz,highpModelViewMatrix:Mz,hue:J$,instance:CV,instanceIndex:Kh,instancedArray:N$,instancedBufferAttribute:Sm,instancedDynamicBufferAttribute:qy,instancedMesh:RM,int:de,inverseSqrt:ex,inversesqrt:jU,invocationLocalIndex:wV,invocationSubgroupIndex:TV,ior:FU,iridescence:IC,iridescenceIOR:EU,iridescenceThickness:MU,ivec2:Xn,ivec3:vC,ivec4:_C,js:_G,label:EE,length:xm,lengthSq:ax,lessThan:OC,lessThanEqual:BC,lightPosition:m4,lightProjectionUV:nW,lightShadowMatrix:Rx,lightTargetDirection:rW,lightTargetPosition:g4,lightViewPosition:iW,lightingContext:OM,lights:lW,linearDepth:Tm,linearToneMapping:cG,localId:BG,log:J_,log2:Ho,logarithmicDepthToViewZ:QV,loop:PV,luminance:Cx,mat2:o0,mat3:is,mat4:Il,matcapUV:RH,materialAO:TM,materialAlphaTest:vM,materialAnisotropy:aV,materialAnisotropyVector:Mc,materialAttenuationColor:mV,materialAttenuationDistance:pV,materialClearcoat:tV,materialClearcoatNormal:iV,materialClearcoatRoughness:nV,materialColor:_M,materialDispersion:AV,materialEmissive:xM,materialIOR:fV,materialIridescence:lV,materialIridescenceIOR:cV,materialIridescenceThickness:uV,materialLightMap:bM,materialLineDashOffset:xV,materialLineDashSize:yV,materialLineGapSize:vV,materialLineScale:gV,materialLineWidth:_V,materialMetalness:eV,materialNormal:AM,materialOpacity:SM,materialPointSize:SV,materialReference:ml,materialReflectivity:Zz,materialRefractionRatio:aM,materialRotation:rV,materialRoughness:Jz,materialSheen:sV,materialSheenRoughness:oV,materialShininess:jz,materialSpecular:qz,materialSpecularColor:Kz,materialSpecularIntensity:Xz,materialSpecularStrength:Yz,materialThickness:hV,materialTransmission:dV,max:ui,maxMipLevel:KE,mediumpModelViewMatrix:eM,metalness:AU,min:Fr,mix:Ln,mixElement:AE,mod:ox,modInt:K_,modelDirection:bz,modelNormalMatrix:JE,modelPosition:Tz,modelScale:wz,modelViewMatrix:Wh,modelViewPosition:Cz,modelViewProjection:wM,modelWorldMatrix:Fo,modelWorldMatrixInverse:Ez,morphReference:DM,mrt:ZM,mul:St,mx_aastep:R4,mx_cell_noise_float:OQ,mx_contrast:RQ,mx_fractal_noise_float:BQ,mx_fractal_noise_vec2:kQ,mx_fractal_noise_vec3:UQ,mx_fractal_noise_vec4:zQ,mx_hsvtorgb:xQ,mx_noise_float:IQ,mx_noise_vec3:NQ,mx_noise_vec4:PQ,mx_ramplr:bQ,mx_ramptb:TQ,mx_rgbtohsv:SQ,mx_safepower:MQ,mx_splitlr:wQ,mx_splittb:CQ,mx_srgb_texture_to_lin_rec709:AQ,mx_transform_uv:EQ,mx_worley_noise_float:LQ,mx_worley_noise_vec2:DQ,mx_worley_noise_vec3:FQ,negate:rE,neutralToneMapping:vG,nodeArray:Rl,nodeImmutable:Qe,nodeObject:Fe,nodeObjects:kh,nodeProxy:Pe,normalFlat:iM,normalGeometry:gx,normalLocal:cr,normalMap:Ky,normalView:to,normalWorld:rM,normalize:jl,not:VC,notEqual:FC,numWorkgroups:DG,objectDirection:_z,objectGroup:EC,objectPosition:ZE,objectScale:Sz,objectViewPosition:Az,objectWorldMatrix:xz,oneMinus:sE,or:zC,orthographicDepthToViewZ:WV,oscSawtooth:s$,oscSine:n$,oscSquare:i$,oscTriangle:r$,output:gh,outputStruct:HH,overlay:X$,overloadingFn:bi,parabola:tv,parallaxDirection:gM,parallaxUV:zz,parameter:FH,pass:rG,passTexture:sG,pcurve:QH,perspectiveDepthToViewZ:Ax,pmremTexture:EH,pointUV:F$,pointWidth:DU,positionGeometry:mx,positionLocal:Nn,positionPrevious:Am,positionView:Yn,positionViewDirection:Er,positionWorld:Nl,positionWorldDirection:tM,posterize:nG,pow:gs,pow2:pE,pow3:mE,pow4:gE,property:MC,radians:ZC,rand:SE,range:PG,rangeFog:RG,rangeFogFactor:f4,reciprocal:aE,reference:Pn,referenceBuffer:Xy,reflect:dE,reflectVector:uM,reflectView:lM,reflector:g$,refract:xE,refractVector:dM,refractView:cM,reinhardToneMapping:uG,remainder:XC,remap:WE,remapClamp:QE,renderGroup:kt,renderOutput:qE,rendererReference:BE,rotate:XM,rotateUV:o$,roughness:RC,round:oE,rtt:n4,sRGBTransferEOTF:PE,sRGBTransferOETF:LE,sampler:hz,saturate:_E,saturation:Y$,screen:q$,screenCoordinate:Yh,screenSize:bm,screenUV:Va,scriptable:MG,scriptableValue:Np,select:sr,setCurrentStack:Wy,shaderStages:Jk,shadow:wW,shadowPositionWorld:Ix,shapeCircle:MW,sharedUniformGroup:a0,sheen:wU,sheenRoughness:CU,shiftLeft:jC,shiftRight:qC,shininess:NU,sign:nx,sin:wr,sinc:jH,skinning:RV,skinningReference:PM,smoothstep:Vl,smoothstepElement:bE,specularColor:RU,specularF90:IU,spherizeUV:a$,split:xU,spritesheetUV:d$,sqrt:lo,stack:BH,step:c0,storage:m0,storageBarrier:VG,storageObject:R$,storageTexture:i4,string:vU,struct:VH,sub:Bt,subgroupIndex:bV,subgroupSize:kG,tan:tE,tangentGeometry:h0,tangentLocal:jh,tangentView:qh,tangentWorld:fM,temp:IE,texture:er,texture3D:LH,textureBarrier:HG,textureBicubic:mH,textureCubeUV:qM,textureLoad:Rn,textureSize:Pa,textureStore:z$,thickness:BU,time:ql,timerDelta:t$,timerGlobal:e$,timerLocal:JH,toOutputColorSpace:DE,toWorkingColorSpace:FE,toneMapping:kE,toneMappingExposure:UE,toonOutlinePass:lG,transformDirection:yE,transformNormal:oM,transformNormalToView:yx,transformedBentNormalView:Vz,transformedBitangentView:mM,transformedBitangentWorld:Uz,transformedClearcoatNormalView:Nz,transformedNormalView:Jo,transformedNormalWorld:sM,transformedTangentView:vx,transformedTangentWorld:Fz,transmission:OU,transpose:cE,triNoise3D:XH,triplanarTexture:f$,triplanarTextures:e4,trunc:sx,tslFn:yU,uint:Ye,uniform:Rt,uniformArray:Do,uniformGroup:CC,uniforms:pz,userData:H$,uv:xn,uvec2:gC,uvec3:Uu,uvec4:xC,varying:tr,varyingProperty:mh,vec2:He,vec3:ve,vec4:vt,vectorComponents:ku,velocity:G$,vertexColor:L$,vertexIndex:CM,vertexStage:NE,vibrance:Z$,viewZToLogarithmicDepth:bx,viewZToOrthographicDepth:Xc,viewZToPerspectiveDepth:UM,viewport:xx,viewportBottomLeft:VV,viewportCoordinate:kM,viewportDepthTexture:Sx,viewportLinearDepth:jV,viewportMipTexture:$V,viewportResolution:UV,viewportSafeUV:c$,viewportSharedTexture:nH,viewportSize:BM,viewportTexture:HV,viewportTopLeft:zV,viewportUV:kV,wgsl:xG,wgslFn:TG,workgroupArray:WG,workgroupBarrier:zG,workgroupId:FG,workingToColorSpace:OE,xor:HC});const o1=jM(xn(),Yo("faceIndex")).normalize();o1.x,o1.y,o1.z;const bc=typeof self<"u"?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4};Gs.READ_ONLY+"",Gs.WRITE_ONLY+"",Gs.READ_WRITE+"";bc&&bc.VERTEX,bc&&bc.FRAGMENT,bc&&bc.COMPUTE;const ol={tsl_xor:new qn("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new qn("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new qn("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new qn("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new qn("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new qn("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new qn("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new qn("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new qn("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new qn("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new qn("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new qn("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new qn("\nfn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n let res = vec2f( iRes );\n\n let uvScaled = coord * res;\n let uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n // https://www.shadertoy.com/view/WtyXRy\n\n let uv = uvWrapping - 0.5;\n let iuv = floor( uv );\n let f = fract( uv );\n\n let rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n let rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n let rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n let rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n return mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")};typeof navigator<"u"&&/Windows/g.test(navigator.userAgent)&&(ol.pow_float=new qn("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),ol.pow_vec2=new qn("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[ol.pow_float]),ol.pow_vec3=new qn("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[ol.pow_float]),ol.pow_vec4=new qn("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[ol.pow_float]));/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/O.BRDF_GGX;O.BRDF_Lambert;O.BasicShadowFilter;O.Break;O.Continue;O.DFGApprox;O.D_GGX;O.Discard;O.EPSILON;O.F_Schlick;O.Fn;O.INFINITY;O.If;O.Loop;O.NodeShaderStage;O.NodeType;O.NodeUpdateType;O.NodeAccess;O.PCFShadowFilter;O.PCFSoftShadowFilter;O.PI;O.PI2;O.Return;O.Schlick_to_F0;O.ScriptableNodeResources;O.ShaderNode;O.TBNViewMatrix;O.VSMShadowFilter;O.V_GGX_SmithCorrelated;O.abs;O.acesFilmicToneMapping;O.acos;O.add;O.addNodeElement;O.agxToneMapping;O.all;O.alphaT;O.and;O.anisotropy;O.anisotropyB;O.anisotropyT;O.any;O.append;O.array;O.arrayBuffer;O.asin;O.assign;O.atan;O.atan2;O.atomicAdd;O.atomicAnd;O.atomicFunc;O.atomicMax;O.atomicMin;O.atomicOr;O.atomicStore;O.atomicSub;O.atomicXor;O.atomicLoad;O.attenuationColor;O.attenuationDistance;O.attribute;O.attributeArray;O.backgroundBlurriness;O.backgroundIntensity;O.backgroundRotation;O.batch;O.billboarding;O.bitAnd;O.bitNot;O.bitOr;O.bitXor;O.bitangentGeometry;O.bitangentLocal;O.bitangentView;O.bitangentWorld;O.bitcast;O.blendBurn;O.blendColor;O.blendDodge;O.blendOverlay;O.blendScreen;O.blur;O.bool;O.buffer;O.bufferAttribute;O.bumpMap;O.burn;O.bvec2;O.bvec3;O.bvec4;O.bypass;O.cache;O.call;O.cameraFar;O.cameraIndex;O.cameraNear;O.cameraNormalMatrix;O.cameraPosition;O.cameraProjectionMatrix;O.cameraProjectionMatrixInverse;O.cameraViewMatrix;O.cameraWorldMatrix;O.cbrt;O.cdl;O.ceil;O.checker;O.cineonToneMapping;O.clamp;O.clearcoat;O.clearcoatRoughness;O.code;O.color;O.colorSpaceToWorking;O.colorToDirection;O.compute;O.cond;O.Const;O.context;O.convert;O.convertColorSpace;O.convertToTexture;O.cos;O.cross;O.cubeTexture;O.dFdx;O.dFdy;O.dashSize;O.defaultBuildStages;O.defaultShaderStages;O.defined;O.degrees;O.deltaTime;O.densityFog;O.densityFogFactor;O.depth;O.depthPass;O.difference;O.diffuseColor;O.directPointLight;O.directionToColor;O.dispersion;O.distance;O.div;O.dodge;O.dot;O.drawIndex;O.dynamicBufferAttribute;O.element;O.emissive;O.equal;O.equals;O.equirectUV;O.exp;O.exp2;O.expression;O.faceDirection;O.faceForward;O.faceforward;O.float;O.floor;O.fog;O.fract;O.frameGroup;O.frameId;O.frontFacing;O.fwidth;O.gain;O.gapSize;O.getConstNodeType;O.getCurrentStack;O.getDirection;O.getDistanceAttenuation;O.getGeometryRoughness;O.getNormalFromDepth;O.getParallaxCorrectNormal;O.getRoughness;O.getScreenPosition;O.getShIrradianceAt;O.getTextureIndex;O.getViewPosition;O.glsl;O.glslFn;O.grayscale;O.greaterThan;O.greaterThanEqual;O.hash;O.highpModelNormalViewMatrix;O.highpModelViewMatrix;O.hue;O.instance;O.instanceIndex;O.instancedArray;O.instancedBufferAttribute;O.instancedDynamicBufferAttribute;O.instancedMesh;O.int;O.inverseSqrt;O.inversesqrt;O.invocationLocalIndex;O.invocationSubgroupIndex;O.ior;O.iridescence;O.iridescenceIOR;O.iridescenceThickness;O.ivec2;O.ivec3;O.ivec4;O.js;O.label;O.length;O.lengthSq;O.lessThan;O.lessThanEqual;O.lightPosition;O.lightTargetDirection;O.lightTargetPosition;O.lightViewPosition;O.lightingContext;O.lights;O.linearDepth;O.linearToneMapping;O.localId;O.globalId;O.log;O.log2;O.logarithmicDepthToViewZ;O.loop;O.luminance;O.mediumpModelViewMatrix;O.mat2;O.mat3;O.mat4;O.matcapUV;O.materialAO;O.materialAlphaTest;O.materialAnisotropy;O.materialAnisotropyVector;O.materialAttenuationColor;O.materialAttenuationDistance;O.materialClearcoat;O.materialClearcoatNormal;O.materialClearcoatRoughness;O.materialColor;O.materialDispersion;O.materialEmissive;O.materialIOR;O.materialIridescence;O.materialIridescenceIOR;O.materialIridescenceThickness;O.materialLightMap;O.materialLineDashOffset;O.materialLineDashSize;O.materialLineGapSize;O.materialLineScale;O.materialLineWidth;O.materialMetalness;O.materialNormal;O.materialOpacity;O.materialPointSize;O.materialReference;O.materialReflectivity;O.materialRefractionRatio;O.materialRotation;O.materialRoughness;O.materialSheen;O.materialSheenRoughness;O.materialShininess;O.materialSpecular;O.materialSpecularColor;O.materialSpecularIntensity;O.materialSpecularStrength;O.materialThickness;O.materialTransmission;O.max;O.maxMipLevel;O.metalness;O.min;O.mix;O.mixElement;O.mod;O.modInt;O.modelDirection;O.modelNormalMatrix;O.modelPosition;O.modelScale;O.modelViewMatrix;O.modelViewPosition;O.modelViewProjection;O.modelWorldMatrix;O.modelWorldMatrixInverse;O.morphReference;O.mrt;O.mul;O.mx_aastep;O.mx_cell_noise_float;O.mx_contrast;O.mx_fractal_noise_float;O.mx_fractal_noise_vec2;O.mx_fractal_noise_vec3;O.mx_fractal_noise_vec4;O.mx_hsvtorgb;O.mx_noise_float;O.mx_noise_vec3;O.mx_noise_vec4;O.mx_ramplr;O.mx_ramptb;O.mx_rgbtohsv;O.mx_safepower;O.mx_splitlr;O.mx_splittb;O.mx_srgb_texture_to_lin_rec709;O.mx_transform_uv;O.mx_worley_noise_float;O.mx_worley_noise_vec2;O.mx_worley_noise_vec3;O.negate;O.neutralToneMapping;O.nodeArray;O.nodeImmutable;O.nodeObject;O.nodeObjects;O.nodeProxy;O.normalFlat;O.normalGeometry;O.normalLocal;O.normalMap;O.normalView;O.normalWorld;O.normalize;O.not;O.notEqual;O.numWorkgroups;O.objectDirection;O.objectGroup;O.objectPosition;O.objectScale;O.objectViewPosition;O.objectWorldMatrix;O.oneMinus;O.or;O.orthographicDepthToViewZ;O.oscSawtooth;O.oscSine;O.oscSquare;O.oscTriangle;O.output;O.outputStruct;O.overlay;O.overloadingFn;O.parabola;O.parallaxDirection;O.parallaxUV;O.parameter;O.pass;O.passTexture;O.pcurve;O.perspectiveDepthToViewZ;O.pmremTexture;O.pointUV;O.pointWidth;O.positionGeometry;O.positionLocal;O.positionPrevious;O.positionView;O.positionViewDirection;O.positionWorld;O.positionWorldDirection;O.posterize;O.pow;O.pow2;O.pow3;O.pow4;O.property;O.radians;O.rand;O.range;O.rangeFog;O.rangeFogFactor;O.reciprocal;O.reference;O.referenceBuffer;O.reflect;O.reflectVector;O.reflectView;O.reflector;O.refract;O.refractVector;O.refractView;O.reinhardToneMapping;O.remainder;O.remap;O.remapClamp;O.renderGroup;O.renderOutput;O.rendererReference;O.rotate;O.rotateUV;O.roughness;O.round;O.rtt;O.sRGBTransferEOTF;O.sRGBTransferOETF;O.sampler;O.saturate;O.saturation;O.screen;O.screenCoordinate;O.screenSize;O.screenUV;O.scriptable;O.scriptableValue;O.select;O.setCurrentStack;O.shaderStages;O.shadow;O.shadowPositionWorld;O.sharedUniformGroup;O.shapeCircle;O.sheen;O.sheenRoughness;O.shiftLeft;O.shiftRight;O.shininess;O.sign;O.sin;O.sinc;O.skinning;O.skinningReference;O.smoothstep;O.smoothstepElement;O.specularColor;O.specularF90;O.spherizeUV;O.split;O.spritesheetUV;O.sqrt;O.stack;O.step;O.storage;O.storageBarrier;O.storageObject;O.storageTexture;O.string;O.struct;O.sub;O.subgroupIndex;O.subgroupSize;O.tan;O.tangentGeometry;O.tangentLocal;O.tangentView;O.tangentWorld;O.temp;O.texture;O.texture3D;O.textureBarrier;O.textureBicubic;O.textureCubeUV;O.textureLoad;O.textureSize;O.textureStore;O.thickness;O.threshold;O.time;O.timerDelta;O.timerGlobal;O.timerLocal;O.toOutputColorSpace;O.toWorkingColorSpace;O.toneMapping;O.toneMappingExposure;O.toonOutlinePass;O.transformDirection;O.transformNormal;O.transformNormalToView;O.transformedBentNormalView;O.transformedBitangentView;O.transformedBitangentWorld;O.transformedClearcoatNormalView;O.transformedNormalView;O.transformedNormalWorld;O.transformedTangentView;O.transformedTangentWorld;O.transmission;O.transpose;O.tri;O.tri3;O.triNoise3D;O.triplanarTexture;O.triplanarTextures;O.trunc;O.tslFn;O.uint;O.uniform;O.uniformArray;O.uniformGroup;O.uniforms;O.userData;O.uv;O.uvec2;O.uvec3;O.uvec4;O.Var;O.varying;O.varyingProperty;O.vec2;O.vec3;O.vec4;O.vectorComponents;O.velocity;O.vertexColor;O.vertexIndex;O.vibrance;O.viewZToLogarithmicDepth;O.viewZToOrthographicDepth;O.viewZToPerspectiveDepth;O.viewport;O.viewportBottomLeft;O.viewportCoordinate;O.viewportDepthTexture;O.viewportLinearDepth;O.viewportMipTexture;O.viewportResolution;O.viewportSafeUV;O.viewportSharedTexture;O.viewportSize;O.viewportTexture;O.viewportTopLeft;O.viewportUV;O.wgsl;O.wgslFn;O.workgroupArray;O.workgroupBarrier;O.workgroupId;O.workingToColorSpace;O.xor;const $Q=50,GQ=.75,WQ=15e5,QQ=10,jQ=2.5,qQ=60,va=class va{constructor(e={}){xe(this,"tempForward",new Y);xe(this,"tempMatrixLeft",new Xe);xe(this,"tempMatrixRight",new Xe);xe(this,"onKeyDown",e=>{switch(this.tempForward.set(0,0,-1),this.tempForward.transformDirection(this.camera.matrixWorld),this.tempMatrixLeft.makeRotationAxis(this.tempForward,Math.PI/128),this.tempMatrixRight.makeRotationAxis(this.tempForward,-Math.PI/128),e.code){case"KeyG":this.focalAdjustment+=.02,this.forceRenderNextFrame();break;case"KeyF":this.focalAdjustment-=.02,this.forceRenderNextFrame();break;case"ArrowLeft":this.camera.up.transformDirection(this.tempMatrixLeft);break;case"ArrowRight":this.camera.up.transformDirection(this.tempMatrixRight);break;case"KeyC":this.showMeshCursor=!this.showMeshCursor;break;case"KeyU":this.showControlPlane=!this.showControlPlane;break;case"KeyI":this.showInfo=!this.showInfo,this.showInfo;break;case"KeyO":this.usingExternalCamera||this.setOrthographicMode(!this.camera.isOrthographicCamera);break;case"KeyP":this.usingExternalCamera||this.splatMesh.setPointCloudModeEnabled(!this.splatMesh.getPointCloudModeEnabled());break;case"Equal":this.usingExternalCamera||this.splatMesh.setSplatScale(this.splatMesh.getSplatScale()+.05);break;case"Minus":this.usingExternalCamera||this.splatMesh.setSplatScale(Math.max(this.splatMesh.getSplatScale()-.05,0));break}});xe(this,"onMouseUp",function(){const e=new qe;return function(t){e.copy(this.mousePosition).sub(this.mouseDownPosition),ec()-this.mouseDownTime<.5&&e.length()<2&&this.onMouseClick(t)}}());xe(this,"checkPointRenderDimensions",new qe);xe(this,"checkPointToNewFocalPoint",new Y);xe(this,"checkPointOutHits",[]);xe(this,"checkForFocalPointChange",()=>{if(!this.transitioningCameraTarget&&(this.getRenderDimensions(this.checkPointRenderDimensions),this.checkPointOutHits.length=0,this.raycaster.setFromCameraAndScreenPosition(this.camera,this.mousePosition,this.checkPointRenderDimensions),this.raycaster.intersectSplatMesh(this.splatMesh,this.checkPointOutHits),this.checkPointOutHits.length>0)){const t=this.checkPointOutHits[0].origin;this.checkPointToNewFocalPoint.copy(t).sub(this.camera.position),this.checkPointToNewFocalPoint.length()>GQ&&(this.previousCameraTarget.copy(this.controls.target),this.nextCameraTarget.copy(t),this.transitioningCameraTarget=!0,this.transitioningCameraTargetStartTime=ec())}});xe(this,"updateSplatMesh",function(){const e=new qe;return function(){if(!this.splatMesh)return;if(this.splatMesh.getSplatCount()>0){this.splatMesh.updateVisibleRegionFadeDistance(this.sceneRevealMode),this.splatMesh.updateTransforms(),this.getRenderDimensions(e);const i=this.camera.projectionMatrix.elements[0]*.5*this.devicePixelRatio*e.x,r=this.camera.projectionMatrix.elements[5]*.5*this.devicePixelRatio*e.y,s=this.camera.isOrthographicCamera?1/this.devicePixelRatio:1,o=this.focalAdjustment*s,a=1/o;this.adjustForWebXRStereo(e),this.splatMesh.updateUniforms(e,i*o,r*o,this.camera.isOrthographicCamera,this.camera.zoom||1,a)}}}());xe(this,"addSplatBuffers",(e,t=[],i=!0,r=!0,s=!0,o=!1,a=!1,l=!0)=>{if(this.isDisposingOrDisposed())return Promise.resolve();let c=null;const u=()=>{c!==null&&(this.loadingSpinner.removeTask(c),c=null)};return this.splatRenderReady=!1,new Promise(d=>{r&&(c=this.loadingSpinner.addTask("Processing splats...")),ms(()=>{if(this.isDisposingOrDisposed())d();else{const h=this.addSplatBuffersToMesh(e,t,i,s,o,l),f=this.splatMesh.getMaxSplatCount();this.sortWorker&&this.sortWorker.maxSplatCount!==f&&this.disposeSortWorker(),this.gpuAcceleratedSort||this.preSortMessages.push({centers:h.centers.buffer,sceneIndexes:h.sceneIndexes.buffer,range:{from:h.from,to:h.to,count:h.count}}),(!this.sortWorker&&f>0?this.setupSortWorker(this.splatMesh):Promise.resolve()).then(()=>{this.isDisposingOrDisposed()||this.runSplatSort(!0,!0).then(g=>{!this.sortWorker||!g?(this.splatRenderReady=!0,u(),d()):(a?this.splatRenderReady=!0:this.runAfterNextSort.push(()=>{this.splatRenderReady=!0}),this.runAfterNextSort.push(()=>{u(),d()}))})})}},!0)})});xe(this,"addSplatBuffersToMesh",function(){let e;return function(t,i,r=!0,s=!1,o=!1,a=!0){if(this.isDisposingOrDisposed())return;let l=[],c=[];o||(l=this.splatMesh.scenes.map(f=>f.splatBuffer)||[],c=this.splatMesh.sceneOptions?this.splatMesh.sceneOptions.map(f=>f):[]),l.push(...t),c.push(...i),this.renderer&&this.splatMesh.setRenderer(this.renderer);const u=f=>{if(this.isDisposingOrDisposed())return;const p=this.splatMesh.getSplatCount();s&&p>=WQ&&!f&&!e&&(this.loadingSpinner.setMinimized(!0,!0),e=this.loadingSpinner.addTask("Optimizing data structures..."))},d=f=>{this.isDisposingOrDisposed()||f&&e&&(this.loadingSpinner.removeTask(e),e=null)},h=this.splatMesh.build(l,c,!0,r,u,d,a);return r&&this.freeIntermediateSplatData&&this.splatMesh.freeIntermediateSplatData(),h}}());xe(this,"vsyncNum",4);xe(this,"shouldRender",function(){let e=0;const t=new Y,i=new Qt,r=1e-4;return function(){if(!this.initialized||!this.splatRenderReady||this.isDisposingOrDisposed())return!1;let s=!1,o=!1;if(this.camera){const a=this.camera.position,l=this.camera.quaternion;o=Math.abs(a.x-t.x)>r||Math.abs(a.y-t.y)>r||Math.abs(a.z-t.z)>r||Math.abs(l.x-i.x)>r||Math.abs(l.y-i.y)>r||Math.abs(l.z-i.z)>r||Math.abs(l.w-i.w)>r}return s=this.renderMode!==Wg.Never&&(e===0||this.splatMesh.visibleRegionChanging||o||this.renderMode===Wg.Always||this.dynamicMode===!0||this.renderNextFrame),this.camera&&(t.copy(this.camera.position),i.copy(this.camera.quaternion)),e++,s}}());xe(this,"render",function(){return function(){if(!this.initialized||!this.splatRenderReady||this.isDisposingOrDisposed())return;const e=i=>{for(let r of i.children)if(r.visible)return!0;return!1},t=this.renderer.autoClear;e(this.threeScene)&&(this.renderer.render(this.threeScene,this.camera),this.renderer.autoClear=!1),this.renderer.render(this.splatMesh,this.camera),this.renderer.autoClear=!1,this.sceneHelper.getFocusMarkerOpacity()>0&&this.renderer.render(this.sceneHelper.focusMarker,this.camera),this.showControlPlane&&this.renderer.render(this.sceneHelper.controlPlane,this.camera),this.renderer.autoClear=t}}());xe(this,"sortedIndexes");xe(this,"lastCalcTime",ec());xe(this,"fpsFrameCount",0);xe(this,"updateFPS",()=>{if(this.consecutiveRenderFrames>qQ){const e=ec();e-this.lastCalcTime>=1?(this.currentFPS=this.fpsFrameCount,this.fpsFrameCount=0,this.lastCalcTime=e):this.fpsFrameCount++}else this.currentFPS=null});xe(this,"updateForRendererSizeChanges",function(){const e=new qe,t=new qe;let i;return function(){this.usingExternalCamera||(this.renderer.getSize(t),(i===void 0||i!==this.camera.isOrthographicCamera||t.x!==e.x||t.y!==e.y)&&(this.camera.isOrthographicCamera?(this.camera.left=-t.x/2,this.camera.right=t.x/2,this.camera.top=t.y/2,this.camera.bottom=-t.y/2):this.camera.aspect=t.x/t.y,this.camera.updateProjectionMatrix(),e.copy(t),i=this.camera.isOrthographicCamera))}}());xe(this,"timingSensitiveUpdates",function(){let e;return function(){const t=ec();e||(e=t);const i=t-e;this.updateCameraTransition(t),this.updateFocusMarker(i),e=t}}());xe(this,"tempCameraTarget",new Y);xe(this,"toPreviousTarget",new Y);xe(this,"toNextTarget",new Y);xe(this,"updateCameraTransition",e=>{if(this.transitioningCameraTarget){this.toPreviousTarget.copy(this.previousCameraTarget).sub(this.camera.position).normalize(),this.toNextTarget.copy(this.nextCameraTarget).sub(this.camera.position).normalize();const t=Math.acos(this.toPreviousTarget.dot(this.toNextTarget)),r=(t/(Math.PI/3)*.65+.3)/t*(e-this.transitioningCameraTargetStartTime);this.tempCameraTarget.copy(this.previousCameraTarget).lerp(this.nextCameraTarget,r),this.camera.lookAt(this.tempCameraTarget),this.controls.target.copy(this.tempCameraTarget),r>=1&&(this.transitioningCameraTarget=!1)}});xe(this,"updateFocusMarker",function(){const e=new qe;let t=!1;return function(i){if(this.getRenderDimensions(e),this.transitioningCameraTarget){this.sceneHelper.setFocusMarkerVisibility(!0);const r=Math.max(this.sceneHelper.getFocusMarkerOpacity(),0);let s=Math.min(r+QQ*i,1);this.sceneHelper.setFocusMarkerOpacity(s),this.sceneHelper.updateFocusMarker(this.nextCameraTarget,this.camera,e),t=!0,this.forceRenderNextFrame()}else{let r;if(t?r=1:r=Math.min(this.sceneHelper.getFocusMarkerOpacity(),1),r>0){this.sceneHelper.updateFocusMarker(this.nextCameraTarget,this.camera,e);let s=Math.max(r-jQ*i,0);this.sceneHelper.setFocusMarkerOpacity(s),s===0&&this.sceneHelper.setFocusMarkerVisibility(!1)}r>0&&this.forceRenderNextFrame(),t=!1}}}());xe(this,"updateMeshCursor",function(){const e=[],t=new qe;return function(){this.showMeshCursor?(this.forceRenderNextFrame(),this.getRenderDimensions(t),e.length=0,this.raycaster.setFromCameraAndScreenPosition(this.camera,this.mousePosition,t),this.raycaster.intersectSplatMesh(this.splatMesh,e),e.length>0?(this.sceneHelper.setMeshCursorVisibility(!0),this.sceneHelper.positionAndOrientMeshCursor(e[0].origin,this.camera)):this.sceneHelper.setMeshCursorVisibility(!1)):(this.sceneHelper.getMeschCursorVisibility()&&this.forceRenderNextFrame(),this.sceneHelper.setMeshCursorVisibility(!1))}}());xe(this,"updateInfoPanel",function(){const e=new qe;return function(){if(!this.showInfo)return;const t=this.splatMesh.getSplatCount();this.getRenderDimensions(e),this.controls&&this.controls.target,this.showMeshCursor&&this.sceneHelper.meshCursor.position,t>0&&this.splatRenderCount/t*100}}());xe(this,"mvpMatrix",new Xe);xe(this,"cameraPositionArray",[]);xe(this,"lastSortViewDir",new Y(0,0,-1));xe(this,"sortViewDir",new Y(0,0,-1));xe(this,"lastSortViewPos",new Y);xe(this,"sortViewOffset",new Y);xe(this,"queuedSorts",[]);xe(this,"partialSorts",[{angleThreshold:.55,sortFractions:[.125,.33333,.75]},{angleThreshold:.65,sortFractions:[.33333,.66667]},{angleThreshold:.8,sortFractions:[.5]}]);xe(this,"runSplatSort",(e=!1,t=!1)=>{if(!this.initialized)return Promise.resolve(!1);if(this.sortRunning)return Promise.resolve(!0);if(this.splatMesh.getSplatCount()<=0)return this.splatRenderCount=0,Promise.resolve(!1);let i=0,r=0,s=!1,o=!1;if(this.sortViewDir.set(0,0,-1).applyQuaternion(this.camera.quaternion),i=this.sortViewDir.dot(this.lastSortViewDir),r=this.sortViewOffset.copy(this.camera.position).sub(this.lastSortViewPos).length(),!e&&!this.splatMesh.dynamicMode&&this.queuedSorts.length===0&&(i<=.99&&(s=!0),r>=1&&(o=!0),!s&&!o))return Promise.resolve(!1);this.sortRunning=!0;let{splatRenderCount:a,shouldSortAll:l}=this.gatherSceneNodesForSort();l=l||t,this.splatRenderCount=a,this.mvpMatrix.copy(this.camera.matrixWorld).invert();const c=this.perspectiveCamera||this.camera;this.mvpMatrix.premultiply(c.projectionMatrix),this.splatMesh.dynamicMode||this.mvpMatrix.multiply(this.splatMesh.matrixWorld);let u=Promise.resolve(!0);return this.gpuAcceleratedSort&&(this.queuedSorts.length<=1||this.queuedSorts.length%2===0)&&(u=this.splatMesh.computeDistancesOnGPU(this.mvpMatrix,this.sortWorkerPrecomputedDistances)),u.then(()=>{if(this.queuedSorts.length===0)if(this.splatMesh.dynamicMode||l)this.queuedSorts.push(this.splatRenderCount);else{for(let f of partialSorts)if(i<f.angleThreshold){for(let p of f.sortFractions)this.queuedSorts.push(Math.floor(this.splatRenderCount*p));break}this.queuedSorts.push(this.splatRenderCount)}let d=Math.min(this.queuedSorts.shift(),this.splatRenderCount);this.splatSortCount=d,this.cameraPositionArray[0]=this.camera.position.x,this.cameraPositionArray[1]=this.camera.position.y,this.cameraPositionArray[2]=this.camera.position.z;const h={modelViewProj:this.mvpMatrix.elements,cameraPosition:this.cameraPositionArray,splatRenderCount:this.splatRenderCount,splatSortCount:d,usePrecomputedDistances:this.gpuAcceleratedSort};return this.splatMesh.dynamicMode&&this.splatMesh.fillTransformsArray(this.sortWorkerTransforms),this.sharedMemoryForWorkers||(h.indexesToSort=this.sortWorkerIndexesToSort,h.transforms=this.sortWorkerTransforms,this.gpuAcceleratedSort&&(h.precomputedDistances=this.sortWorkerPrecomputedDistances)),this.sortPromise=new Promise(f=>{this.sortPromiseResolver=f}),this.preSortMessages.length>0&&(this.preSortMessages.forEach(f=>{this.sortWorker.postMessage(f)}),this.preSortMessages=[]),this.sortWorker.postMessage({sort:h}),this.queuedSorts.length===0&&(this.lastSortViewPos.copy(this.camera.position),this.lastSortViewDir.copy(this.sortViewDir)),!0}),u});xe(this,"gatherSceneNodesForSort",function(){const e=[];let t=null;const i=new Y,r=new Y,s=new Y,o=new Xe,a=new Xe,l=new Xe,c=new Y,u=new Y(0,0,-1),d=new Y,h=f=>d.copy(f.max).sub(f.min).length();return function(f=!1){this.getRenderDimensions(c);const p=c.y/2/Math.tan(this.camera.fov/2*Ta.DEG2RAD),g=Math.atan(c.x/2/p),y=Math.atan(c.y/2/p),m=Math.cos(g),v=Math.cos(y),x=this.splatMesh.getSplatTree();if(x){a.copy(this.camera.matrixWorld).invert(),this.splatMesh.dynamicMode||a.multiply(this.splatMesh.matrixWorld);let _=0,S=0;for(let A=0;A<x.subTrees.length;A++){const R=x.subTrees[A];o.copy(a),this.splatMesh.dynamicMode&&(this.splatMesh.getSceneTransform(A,l),o.multiply(l));const w=R.nodesWithIndexes.length;for(let M=0;M<w;M++){const I=R.nodesWithIndexes[M];if(!I.data||!I.data.indexes||I.data.indexes.length===0)continue;s.copy(I.center).applyMatrix4(o);const L=s.length();s.normalize(),i.copy(s).setX(0).normalize(),r.copy(s).setY(0).normalize();const k=u.dot(r),T=u.dot(i),F=h(I),V=T<v-.6,Q=k<m-.6;!f&&(Q||V)&&L>F||(S+=I.data.indexes.length,e[_]=I,I.data.distanceToNode=L,_++)}}e.length=_,e.sort((A,R)=>A.data.distanceToNode<R.data.distanceToNode?-1:1);let E=S*Ft.BytesPerInt;for(let A=0;A<_;A++){const R=e[A],w=R.data.indexes.length,M=w*Ft.BytesPerInt;new Uint32Array(this.sortWorkerIndexesToSort.buffer,E-M,w).set(R.data.indexes),E-=M}return{splatRenderCount:S,shouldSortAll:!1}}else{const _=this.splatMesh.getSplatCount();if(!t||t.length!==_){t=new Uint32Array(_);for(let S=0;S<_;S++)t[S]=S}return this.sortWorkerIndexesToSort.set(t),{splatRenderCount:_,shouldSortAll:!0}}}}());if(e.cameraUp||(e.cameraUp=[0,1,0]),this.cameraUp=new Y().fromArray(e.cameraUp),e.initialCameraPosition||(e.initialCameraPosition=[0,10,15]),this.initialCameraPosition=new Y().fromArray(e.initialCameraPosition),e.initialCameraRotation||(e.initialCameraRotation=[0,0,0]),this.initialCameraRotation=new Y().fromArray(e.initialCameraRotation),this.backgroundColor=e.backgroundColor,e.initialCameraLookAt||(e.initialCameraLookAt=[0,0,0]),this.initialCameraLookAt=new Y().fromArray(e.initialCameraLookAt),this.dropInMode=e.dropInMode||!1,(e.selfDrivenMode===void 0||e.selfDrivenMode===null)&&(e.selfDrivenMode=!0),this.selfDrivenMode=e.selfDrivenMode&&!this.dropInMode,this.selfDrivenUpdateFunc=this.selfDrivenUpdate.bind(this),e.useBuiltInControls===void 0&&(e.useBuiltInControls=!0),this.useBuiltInControls=e.useBuiltInControls,this.rootElement=e.rootElement,this.canvas=e.threejsCanvas,this.ignoreDevicePixelRatio=e.ignoreDevicePixelRatio||!1,this.devicePixelRatio=this.ignoreDevicePixelRatio?1:window.devicePixelRatio||1,this.halfPrecisionCovariancesOnGPU=e.halfPrecisionCovariancesOnGPU||!1,this.threeScene=e.threeScene,this.renderer=e.renderer,this.camera=e.camera,this.gpuAcceleratedSort=e.gpuAcceleratedSort||!1,(e.integerBasedSort===void 0||e.integerBasedSort===null)&&(e.integerBasedSort=!0),this.integerBasedSort=e.integerBasedSort,(e.sharedMemoryForWorkers===void 0||e.sharedMemoryForWorkers===null)&&(e.sharedMemoryForWorkers=!0),this.sharedMemoryForWorkers=!1,this.dynamicScene=!!e.dynamicScene,this.antialiased=e.antialiased||!1,this.kernel2DSize=e.kernel2DSize===void 0?.3:e.kernel2DSize,this.webXRMode=e.webXRMode||xc.None,this.webXRMode!==xc.None&&(this.gpuAcceleratedSort=!1),this.webXRActive=!1,this.webXRSessionInit=e.webXRSessionInit||{},this.renderMode=e.renderMode||Wg.Always,this.sceneRevealMode=e.sceneRevealMode||Hd.Default,this.focalAdjustment=e.focalAdjustment||1,this.maxScreenSpaceSplatSize=e.maxScreenSpaceSplatSize||1024,this.logLevel=e.logLevel||jc.None,this.sphericalHarmonicsDegree=e.sphericalHarmonicsDegree||0,this.enableOptionalEffects=e.enableOptionalEffects||!1,(e.enableSIMDInSort===void 0||e.enableSIMDInSort===null)&&(e.enableSIMDInSort=!0),this.enableSIMDInSort=e.enableSIMDInSort,(e.inMemoryCompressionLevel===void 0||e.inMemoryCompressionLevel===null)&&(e.inMemoryCompressionLevel=0),this.inMemoryCompressionLevel=e.inMemoryCompressionLevel,(e.optimizeSplatData===void 0||e.optimizeSplatData===null)&&(e.optimizeSplatData=!0),this.optimizeSplatData=e.optimizeSplatData,(e.freeIntermediateSplatData===void 0||e.freeIntermediateSplatData===null)&&(e.freeIntermediateSplatData=!1),this.freeIntermediateSplatData=e.freeIntermediateSplatData,u_()){const i=l5();i.major<17&&(this.enableSIMDInSort=!1),i.major<16&&(this.sharedMemoryForWorkers=!1)}(e.splatRenderMode===void 0||e.splatRenderMode===null)&&(e.splatRenderMode=Eo.ThreeD),this.splatRenderMode=e.splatRenderMode,this.sceneFadeInRateMultiplier=e.sceneFadeInRateMultiplier||1,this.splatSortDistanceMapPrecision=e.splatSortDistanceMapPrecision||Ft.DefaultSplatSortDistanceMapPrecision;const t=this.integerBasedSort?20:24;this.splatSortDistanceMapPrecision=gi(this.splatSortDistanceMapPrecision,10,t),this.onSplatMeshChangedCallback=null,this.createSplatMesh(),this.controls=null,this.perspectiveControls=null,this.orthographicControls=null,this.orthographicCamera=null,this.perspectiveCamera=null,this.showMeshCursor=!1,this.showControlPlane=!1,this.showInfo=!1,this.sceneHelper=null,this.sortWorker=null,this.sortRunning=!1,this.splatRenderCount=0,this.splatSortCount=0,this.lastSplatSortCount=0,this.sortWorkerIndexesToSort=null,this.sortWorkerSortedIndexes=null,this.sortWorkerPrecomputedDistances=null,this.sortWorkerTransforms=null,this.preSortMessages=[],this.runAfterNextSort=[],this.selfDrivenModeRunning=!1,this.splatRenderReady=!1,this.raycaster=new Tk,this.infoPanel=null,this.startInOrthographicMode=!1,this.currentFPS=0,this.lastSortTime=0,this.consecutiveRenderFrames=0,this.previousCameraTarget=new Y,this.nextCameraTarget=new Y,this.mousePosition=new qe,this.mouseDownPosition=new qe,this.mouseDownTime=null,this.resizeObserver=null,this.mouseMoveListener=null,this.mouseDownListener=null,this.mouseUpListener=null,this.keyDownListener=null,this.sortPromise=null,this.sortPromiseResolver=null,this.splatSceneDownloadPromises={},this.splatSceneDownloadAndBuildPromise=null,this.splatSceneRemovalPromise=null,this.loadingSpinner=new zy(null,this.rootElement||document.body),this.loadingSpinner.hide(),this.loadingProgressBar=new _k(this.rootElement||document.body),this.loadingProgressBar.hide(),this.usingExternalCamera=!!(this.dropInMode||this.camera),this.usingExternalRenderer=!!(this.dropInMode||this.renderer),this.initialized=!1,this.disposing=!1,this.disposed=!1,this.disposePromise=null,this.lastTime=0,this.gaussianSplatCount=0,this.totalFrames=0,this.flame_params=null,this.bone_tree=null,this.lbs_weight_80k=null,this.frame=0,this.useFlame=!0,this.bones=null,this.skeleton=null,this.avatarMesh=null,this.skinModel=null,this.boneRoot=null,this.baseMesh=null,this.setSkinAttibutes=!1,this.dropInMode||this.init()}createSplatMesh(){this.splatMesh=new oi(this.splatRenderMode,this.dynamicScene,this.enableOptionalEffects,this.halfPrecisionCovariancesOnGPU,this.devicePixelRatio,this.gpuAcceleratedSort,this.integerBasedSort,this.antialiased,this.maxScreenSpaceSplatSize,this.logLevel,this.sphericalHarmonicsDegree,this.sceneFadeInRateMultiplier,this.kernel2DSize),this.splatMesh.frustumCulled=!1,this.onSplatMeshChangedCallback&&this.onSplatMeshChangedCallback()}init(){this.initialized||(this.rootElement||(this.usingExternalRenderer?this.rootElement=this.renderer.domElement||document.body:(this.rootElement=document.createElement("div"),this.rootElement.style.width="100%",this.rootElement.style.height="100%",this.rootElement.style.position="absolute",document.body.appendChild(this.rootElement))),this.setupCamera(),this.setupRenderer(),this.setupWebXR(this.webXRSessionInit),this.setupEventHandlers(),this.threeScene=this.threeScene||new rL,this.sceneHelper=new zd(this.threeScene),this.sceneHelper.setupMeshCursor(),this.sceneHelper.setupFocusMarker(),this.sceneHelper.setupControlPlane(),this.loadingProgressBar.setContainer(this.rootElement),this.loadingSpinner.setContainer(this.rootElement),this.initialized=!0)}setupCamera(){if(!this.usingExternalCamera){const e=new qe;this.getRenderDimensions(e),this.perspectiveCamera=new Ki($Q,e.x/e.y,.1,1e3),this.orthographicCamera=new Ou(e.x/-2,e.x/2,e.y/2,e.y/-2,.1,1e3),this.camera=this.startInOrthographicMode?this.orthographicCamera:this.perspectiveCamera,this.camera.position.copy(this.initialCameraPosition),this.camera.rotateX(Ta.degToRad(this.initialCameraRotation.x)),this.camera.rotateY(Ta.degToRad(this.initialCameraRotation.y)),this.camera.rotateZ(Ta.degToRad(this.initialCameraRotation.z))}}setupRenderer(){if(!this.usingExternalRenderer){const e=new qe;this.getRenderDimensions(e),this.renderer=new LB({antialias:!1,precision:"highp",canvas:this.canvas}),this.renderer.setPixelRatio(this.devicePixelRatio),this.renderer.autoClear=!0,this.renderer.setClearColor(this.backgroundColor,1),this.renderer.setSize(e.x,e.y),this.resizeObserver=new ResizeObserver(()=>{this.getRenderDimensions(e),this.renderer.setSize(e.x,e.y),this.forceRenderNextFrame()}),this.resizeObserver.observe(this.rootElement),this.rootElement.appendChild(this.renderer.domElement)}}setupWebXR(e){this.webXRMode&&(this.webXRMode===xc.VR?this.rootElement.appendChild(vu.createButton(this.renderer,e)):this.webXRMode===xc.AR&&this.rootElement.appendChild(Wk.createButton(this.renderer,e)),this.renderer.xr.addEventListener("sessionstart",t=>{this.webXRActive=!0}),this.renderer.xr.addEventListener("sessionend",t=>{this.webXRActive=!1}),this.renderer.xr.enabled=!0,this.camera.position.copy(this.initialCameraPosition),this.camera.up.copy(this.cameraUp).normalize(),this.camera.lookAt(this.initialCameraLookAt))}setupControls(){if(this.useBuiltInControls&&this.webXRMode===xc.None){this.usingExternalCamera?this.camera.isOrthographicCamera?this.orthographicControls=new qf(this.camera,this.renderer.domElement):this.perspectiveControls=new qf(this.camera,this.renderer.domElement):(this.perspectiveControls=new qf(this.perspectiveCamera,this.renderer.domElement),this.orthographicControls=new qf(this.orthographicCamera,this.renderer.domElement));for(let e of[this.orthographicControls,this.perspectiveControls])e&&(e.listenToKeyEvents(window),e.rotateSpeed=.5,e.maxPolarAngle=Math.PI*.5,e.minPolarAngle=Math.PI*.5,e.enableDamping=!0,e.dampingFactor=.05,e.target.copy(this.initialCameraLookAt),e.update());this.controls=this.camera.isOrthographicCamera?this.orthographicControls:this.perspectiveControls,this.controls.update()}}setupEventHandlers(){this.useBuiltInControls&&this.webXRMode===xc.None&&(this.mouseMoveListener=this.onMouseMove.bind(this),this.renderer.domElement.addEventListener("pointermove",this.mouseMoveListener,!1),this.mouseDownListener=this.onMouseDown.bind(this),this.renderer.domElement.addEventListener("pointerdown",this.mouseDownListener,!1),this.mouseUpListener=this.onMouseUp.bind(this),this.renderer.domElement.addEventListener("pointerup",this.mouseUpListener,!1),this.keyDownListener=this.onKeyDown.bind(this))}removeEventHandlers(){this.useBuiltInControls&&(this.renderer.domElement.removeEventListener("pointermove",this.mouseMoveListener),this.mouseMoveListener=null,this.renderer.domElement.removeEventListener("pointerdown",this.mouseDownListener),this.mouseDownListener=null,this.renderer.domElement.removeEventListener("pointerup",this.mouseUpListener),this.mouseUpListener=null,window.removeEventListener("keydown",this.keyDownListener),this.keyDownListener=null)}setRenderMode(e){this.renderMode=e}setActiveSphericalHarmonicsDegrees(e){this.splatMesh.material.uniforms.sphericalHarmonicsDegree.value=e,this.splatMesh.material.uniformsNeedUpdate=!0}onSplatMeshChanged(e){this.onSplatMeshChangedCallback=e}onMouseMove(e){this.mousePosition.set(e.offsetX,e.offsetY)}onMouseDown(){this.mouseDownPosition.copy(this.mousePosition),this.mouseDownTime=ec()}onMouseClick(e){this.mousePosition.set(e.offsetX,e.offsetY),this.checkForFocalPointChange()}getRenderDimensions(e){this.rootElement?(e.x=this.rootElement.offsetWidth,e.y=this.rootElement.offsetHeight):this.renderer.getSize(e)}setOrthographicMode(e){if(e===this.camera.isOrthographicCamera)return;const t=this.camera,i=e?this.orthographicCamera:this.perspectiveCamera;if(i.position.copy(t.position),i.up.copy(t.up),i.rotation.copy(t.rotation),i.quaternion.copy(t.quaternion),i.matrix.copy(t.matrix),this.camera=i,this.controls){const r=a=>{a.saveState(),a.reset()},s=this.controls,o=e?this.orthographicControls:this.perspectiveControls;r(o),r(s),o.target.copy(s.target),e?va.setCameraZoomFromPosition(i,t,s):va.setCameraPositionFromZoom(i,t,o),this.controls=o,this.camera.lookAt(this.controls.target)}}adjustForWebXRStereo(e){if(this.camera&&this.webXRActive){const i=this.renderer.xr.getCamera().projectionMatrix.elements[0],r=this.camera.projectionMatrix.elements[0];e.x*=r/i}}isLoadingOrUnloading(){return Object.keys(this.splatSceneDownloadPromises).length>0||this.splatSceneDownloadAndBuildPromise!==null||this.splatSceneRemovalPromise!==null}isDisposingOrDisposed(){return this.disposing||this.disposed}addSplatSceneDownloadPromise(e){this.splatSceneDownloadPromises[e.id]=e}removeSplatSceneDownloadPromise(e){delete this.splatSceneDownloadPromises[e.id]}setSplatSceneDownloadAndBuildPromise(e){this.splatSceneDownloadAndBuildPromise=e}clearSplatSceneDownloadAndBuildPromise(){this.splatSceneDownloadAndBuildPromise=null}addSplatScene(e,t={}){if(this.isLoadingOrUnloading())throw new Error("Cannot add splat scene while another load or unload is already in progress.");if(this.isDisposingOrDisposed())throw new Error("Cannot add splat scene after dispose() is called.");t.progressiveLoad&&this.splatMesh.scenes&&this.splatMesh.scenes.length>0&&(console.log('addSplatScene(): "progressiveLoad" option ignore because there are multiple splat scenes'),t.progressiveLoad=!1);const i=t.format!==void 0&&t.format!==null?t.format:GA(e),r=va.isProgressivelyLoadable(i)&&t.progressiveLoad,s=t.showLoadingUI!==void 0&&t.showLoadingUI!==null?t.showLoadingUI:!0;let o=null;s&&(this.loadingSpinner.removeAllTasks(),o=this.loadingSpinner.addTask("Downloading..."));const a=()=>{this.loadingProgressBar.hide(),this.loadingSpinner.removeAllTasks()},l=(g,y,m)=>{if(s)if(m===Kn.Downloading)if(g==100)this.loadingSpinner.setMessageForTask(o,"Download complete!");else if(r)this.loadingSpinner.setMessageForTask(o,"Downloading splats...");else{const v=y?": ".concat(y):"...";this.loadingSpinner.setMessageForTask(o,"Downloading".concat(v))}else m===Kn.Processing&&(console.log("loaderStatus === LoaderStatus.Processing"),this.loadingSpinner.setMessageForTask(o,"Processing splats..."))};let c=!1,u=0;const d=(g,y)=>{s&&((g&&r||y&&!r)&&(this.loadingSpinner.removeTask(o),!y&&!c&&this.loadingProgressBar.show()),r&&(y?(c=!0,this.loadingProgressBar.hide()):this.loadingProgressBar.setProgress(u)))},h=(g,y,m)=>{u=g,l(g,y,m),t.onProgress&&t.onProgress(g,y,m)},f=(g,y,m)=>{!r&&t.onProgress&&t.onProgress(0,"0%",Kn.Processing);const v={rotation:t.rotation||t.orientation,position:t.position,scale:t.scale,splatAlphaRemovalThreshold:t.splatAlphaRemovalThreshold};return this.addSplatBuffers([g],[v],m,y&&s,s,r,r).then(()=>{!r&&t.onProgress&&t.onProgress(100,"100%",Kn.Processing),d(y,m)})};return(r?this.downloadAndBuildSingleSplatSceneProgressiveLoad.bind(this):this.downloadAndBuildSingleSplatSceneStandardLoad.bind(this))(e,i,t.splatAlphaRemovalThreshold,f.bind(this),h,a.bind(this),t.headers)}downloadAndBuildSingleSplatSceneStandardLoad(e,t,i,r,s,o,a){const l=this.downloadSplatSceneToSplatBuffer(e,i,s,!1,void 0,t,a),c=rg(l.abortHandler);return l.then(u=>(this.removeSplatSceneDownloadPromise(l),r(u,!0,!0).then(()=>{c.resolve(),this.clearSplatSceneDownloadAndBuildPromise()}))).catch(u=>{o&&o(),this.clearSplatSceneDownloadAndBuildPromise(),this.removeSplatSceneDownloadPromise(l);const d=u instanceof Ap?u:new Error("Viewer::addSplatScene -> Could not load file ".concat(e));c.reject(d)}),this.addSplatSceneDownloadPromise(l),this.setSplatSceneDownloadAndBuildPromise(c.promise),c.promise}downloadAndBuildSingleSplatSceneProgressiveLoad(e,t,i,r,s,o,a){let l=0,c=!1;const u=[],d=()=>{if(u.length>0&&!c&&!this.isDisposingOrDisposed()){c=!0;const y=u.shift();r(y.splatBuffer,y.firstBuild,y.finalBuild).then(()=>{c=!1,y.firstBuild?p.resolve():y.finalBuild&&(g.resolve(),this.clearSplatSceneDownloadAndBuildPromise()),u.length>0&&ms(()=>d())})}},h=(y,m)=>{this.isDisposingOrDisposed()||(m||u.length===0||y.getSplatCount()>u[0].splatBuffer.getSplatCount())&&(u.push({splatBuffer:y,firstBuild:l===0,finalBuild:m}),l++,d())},f=this.downloadSplatSceneToSplatBuffer(e,i,s,!0,h,t,a),p=rg(f.abortHandler),g=rg();return this.addSplatSceneDownloadPromise(f),this.setSplatSceneDownloadAndBuildPromise(g.promise),f.then(()=>{this.removeSplatSceneDownloadPromise(f)}).catch(y=>{this.clearSplatSceneDownloadAndBuildPromise(),this.removeSplatSceneDownloadPromise(f);const m=y instanceof Ap?y:new Error("Viewer::addSplatScene -> Could not load one or more scenes");p.reject(m),o&&o(m)}),p.promise}addSplatScenes(e,t=!0,i=void 0){if(this.isLoadingOrUnloading())throw new Error("Cannot add splat scene while another load or unload is already in progress.");if(this.isDisposingOrDisposed())throw new Error("Cannot add splat scene after dispose() is called.");const r=e.length,s=[];let o;t&&(this.loadingSpinner.removeAllTasks(),o=this.loadingSpinner.addTask("Downloading..."));const a=(d,h,f,p)=>{s[d]=h;let g=0;for(let y=0;y<r;y++)g+=s[y]||0;g=g/r,f="".concat(g.toFixed(2),"%"),t&&p===Kn.Downloading&&this.loadingSpinner.setMessageForTask(o,g==100?"Download complete!":"Downloading: ".concat(f)),i&&i(g,f,p)},l=[],c=[];for(let d=0;d<e.length;d++){const h=e[d],f=h.format!==void 0&&h.format!==null?h.format:GA(h.path),p=this.downloadSplatSceneToSplatBuffer(h.path,h.splatAlphaRemovalThreshold,a.bind(this,d),!1,void 0,f,h.headers);l.push(p),c.push(p.promise)}const u=new nh((d,h)=>{Promise.all(c).then(f=>{t&&this.loadingSpinner.removeTask(o),i&&i(0,"0%",Kn.Processing),this.addSplatBuffers(f,e,!0,t,t,!1,!1).then(()=>{i&&i(100,"100%",Kn.Processing),this.clearSplatSceneDownloadAndBuildPromise(),d()})}).catch(f=>{t&&this.loadingSpinner.removeTask(o),this.clearSplatSceneDownloadAndBuildPromise();const p=f instanceof Ap?f:new Error("Viewer::addSplatScenes -> Could not load one or more splat scenes.");h(p)}).finally(()=>{this.removeSplatSceneDownloadPromise(u)})},d=>{for(let h of l)h.abort(d)});return this.addSplatSceneDownloadPromise(u),this.setSplatSceneDownloadAndBuildPromise(u),u}downloadSplatSceneToSplatBuffer(e,t=1,i=void 0,r=!1,s=void 0,o,a){const l=r?!1:this.optimizeSplatData;try{if(o===zs.Splat)return H_.loadFromURL(e,i,r,s,t,this.inMemoryCompressionLevel,l,a);if(o===zs.KSplat)return Uy.loadFromURL(e,i,r,s,a);if(o===zs.Ply)return V_.loadFromURL(e,i,r,s,t,this.inMemoryCompressionLevel,l,this.sphericalHarmonicsDegree,a)}catch(c){throw c instanceof z_?new Error("File type or server does not support progressive loading."):c}throw new Error("Viewer::downloadSplatSceneToSplatBuffer -> File format not supported: ".concat(e))}static isProgressivelyLoadable(e){return e===zs.Splat||e===zs.KSplat||e===zs.Ply}async setupSortWorker(e){if(!this.isDisposingOrDisposed())return new Promise(async t=>{const i=this.integerBasedSort?Int32Array:Float32Array,r=e.getSplatCount(),s=e.getMaxSplatCount();this.sortWorker=await Gk(s,this.sharedMemoryForWorkers,this.enableSIMDInSort,this.integerBasedSort,this.splatMesh.dynamicMode,this.splatSortDistanceMapPrecision),this.sortWorker.onmessage=o=>{if(o.data.sortDone){if(this.sortRunning=!1,Array.from({length:this.gaussianSplatCount},(a,l)=>l),this.sharedMemoryForWorkers)this.splatMesh.updateRenderIndexes(this.sortWorkerSortedIndexes,o.data.splatRenderCount);else{const a=new Uint32Array(o.data.sortedIndexes.buffer,0,o.data.splatRenderCount);this.splatMesh.updateRenderIndexes(a,o.data.splatRenderCount)}this.lastSplatSortCount=this.splatSortCount,this.lastSortTime=o.data.sortTime,this.sortPromiseResolver(),this.sortPromiseResolver=null,this.forceRenderNextFrame(),this.runAfterNextSort.length>0&&(this.runAfterNextSort.forEach(a=>{a()}),this.runAfterNextSort.length=0)}else if(o.data.sortCanceled)this.sortRunning=!1;else if(o.data.sortSetupPhase1Complete){this.logLevel>=jc.Info&&console.log("Sorting web worker WASM setup complete."),this.sharedMemoryForWorkers?(this.sortWorkerSortedIndexes=new Uint32Array(o.data.sortedIndexesBuffer,o.data.sortedIndexesOffset,s),this.sortWorkerIndexesToSort=new Uint32Array(o.data.indexesToSortBuffer,o.data.indexesToSortOffset,s),this.sortWorkerPrecomputedDistances=new i(o.data.precomputedDistancesBuffer,o.data.precomputedDistancesOffset,s),this.sortWorkerTransforms=new Float32Array(o.data.transformsBuffer,o.data.transformsOffset,Ft.MaxScenes*16)):(this.sortWorkerIndexesToSort=new Uint32Array(s),this.sortWorkerPrecomputedDistances=new i(s),this.sortWorkerTransforms=new Float32Array(Ft.MaxScenes*16));for(let a=0;a<r;a++)this.sortWorkerIndexesToSort[a]=a;if(this.sortWorker.maxSplatCount=s,this.logLevel>=jc.Info){console.log("Sorting web worker ready.");const a=this.splatMesh.getSplatDataTextures(),l=a.covariances.size,c=a.centerColors.size;console.log("Covariances texture size: "+l.x+" x "+l.y),console.log("Centers/colors texture size: "+c.x+" x "+c.y)}t()}}})}disposeSortWorker(){this.sortWorker&&this.sortWorker.terminate(),this.sortWorker=null,this.sortPromise=null,this.sortPromiseResolver&&(this.sortPromiseResolver(),this.sortPromiseResolver=null),this.preSortMessages=[],this.sortRunning=!1}removeSplatScene(e,t=!0){return this.removeSplatScenes([e],t)}removeSplatScenes(e,t=!0){if(this.isLoadingOrUnloading())throw new Error("Cannot remove splat scene while another load or unload is already in progress.");if(this.isDisposingOrDisposed())throw new Error("Cannot remove splat scene after dispose() is called.");let i;return this.splatSceneRemovalPromise=new Promise((r,s)=>{let o;t&&(this.loadingSpinner.removeAllTasks(),this.loadingSpinner.show(),o=this.loadingSpinner.addTask("Removing splat scene..."));const a=()=>{t&&(this.loadingSpinner.hide(),this.loadingSpinner.removeTask(o))},l=u=>{a(),this.splatSceneRemovalPromise=null,u?s(u):r()},c=()=>this.isDisposingOrDisposed()?(l(),!0):!1;i=this.sortPromise||Promise.resolve(),i.then(()=>{if(c())return;const u=[],d=[],h=[];for(let f=0;f<this.splatMesh.scenes.length;f++){let p=!1;for(let g of e)if(g===f){p=!0;break}if(!p){const g=this.splatMesh.scenes[f];u.push(g.splatBuffer),d.push(this.splatMesh.sceneOptions[f]),h.push({position:g.position.clone(),quaternion:g.quaternion.clone(),scale:g.scale.clone()})}}this.disposeSortWorker(),this.splatMesh.dispose(),this.sceneRevealMode=Hd.Instant,this.createSplatMesh(),this.addSplatBuffers(u,d,!0,!1,!0).then(()=>{c()||(a(),this.splatMesh.scenes.forEach((f,p)=>{f.position.copy(h[p].position),f.quaternion.copy(h[p].quaternion),f.scale.copy(h[p].scale)}),this.splatMesh.updateTransforms(),this.splatRenderReady=!1,this.runSplatSort(!0).then(()=>{if(c()){this.splatRenderReady=!0;return}i=this.sortPromise||Promise.resolve(),i.then(()=>{this.splatRenderReady=!0,l()})}))}).catch(f=>{l(f)})})}),this.splatSceneRemovalPromise}start(){if(this.selfDrivenMode)this.webXRMode?this.renderer.setAnimationLoop(this.selfDrivenUpdateFunc):this.requestFrameId=requestAnimationFrame(this.selfDrivenUpdateFunc),this.selfDrivenModeRunning=!0;else throw new Error("Cannot start viewer unless it is in self driven mode.")}stop(){this.selfDrivenMode&&this.selfDrivenModeRunning&&(this.webXRMode?this.renderer.setAnimationLoop(null):cancelAnimationFrame(this.requestFrameId),this.selfDrivenModeRunning=!1)}async dispose(){if(this.isDisposingOrDisposed())return this.disposePromise;let e=[],t=[];for(let i in this.splatSceneDownloadPromises)if(this.splatSceneDownloadPromises.hasOwnProperty(i)){const r=this.splatSceneDownloadPromises[i];t.push(r),e.push(r.promise)}return this.sortPromise&&e.push(this.sortPromise),this.disposing=!0,this.disposePromise=Promise.all(e).finally(()=>{this.stop(),this.orthographicControls&&(this.orthographicControls.dispose(),this.orthographicControls=null),this.perspectiveControls&&(this.perspectiveControls.dispose(),this.perspectiveControls=null),this.controls=null,this.splatMesh&&(this.splatMesh.dispose(),this.splatMesh=null),this.sceneHelper&&(this.sceneHelper.dispose(),this.sceneHelper=null),this.resizeObserver&&(this.resizeObserver.unobserve(this.rootElement),this.resizeObserver=null),this.disposeSortWorker(),this.removeEventHandlers(),this.loadingSpinner.removeAllTasks(),this.loadingSpinner.setContainer(null),this.loadingProgressBar.hide(),this.loadingProgressBar.setContainer(null),this.camera=null,this.threeScene=null,this.splatRenderReady=!1,this.initialized=!1,this.renderer&&(this.usingExternalRenderer||(this.rootElement.removeChild(this.renderer.domElement),this.renderer.dispose()),this.renderer=null),this.usingExternalRenderer,this.sortWorkerSortedIndexes=null,this.sortWorkerIndexesToSort=null,this.sortWorkerPrecomputedDistances=null,this.sortWorkerTransforms=null,this.disposed=!0,this.disposing=!1,this.disposePromise=null}),t.forEach(i=>{i.abort("Scene disposed")}),this.disposePromise}selfDrivenUpdate(){this.selfDrivenMode&&!this.webXRMode&&(this.requestFrameId=requestAnimationFrame(this.selfDrivenUpdateFunc)),this.vsyncCount++,!(this.vsyncCount<this.vsyncNum)&&(this.vsyncCount=0,this.update(),this.shouldRender()?(this.render(),this.consecutiveRenderFrames++):this.consecutiveRenderFrames=0,this.renderNextFrame=!1)}forceRenderNextFrame(){this.renderNextFrame=!0}update(e,t){const i=document.getElementById("fps");i&&(i.textContent="FPS: ".concat(this.currentFPS)),this.frame>=this.totalFrames&&(this.frame=0),this.dropInMode&&this.updateForDropInMode(e,t),!(!this.initialized||!this.splatRenderReady||this.isDisposingOrDisposed())&&(this.controls&&(this.controls.update(),this.camera.isOrthographicCamera&&!this.usingExternalCamera&&va.setCameraPositionFromZoom(this.camera,this.camera,this.controls)),this.runMorphUpdate(),this.runSplatSort(!0,!0),this.updateForRendererSizeChanges(),this.updateSplatMesh(),this.updateMeshCursor(),this.updateFPS(),this.timingSensitiveUpdates(),this.updateControlPlane())}updateForDropInMode(e,t){this.renderer=e,this.splatMesh&&this.splatMesh.setRenderer(this.renderer),this.camera=t,this.controls&&(this.controls.object=t),this.init()}updateControlPlane(){this.showControlPlane?(this.sceneHelper.setControlPlaneVisibility(!0),this.sceneHelper.positionAndOrientControlPlane(this.controls.target,this.camera.up)):this.sceneHelper.setControlPlaneVisibility(!1)}getSplatMesh(){return this.splatMesh}getSplatScene(e){return this.splatMesh.getScene(e)}getSceneCount(){return this.splatMesh.getSceneCount()}isMobile(){return navigator.userAgent.includes("Mobi")}createBonesFromJson(e){const t=[];function i(r,s=null){const o=new dh;return o.name=r.name,s&&s.add(o),o.position.set(...r.position),t.push(o),r.children&&r.children.forEach(a=>i(a,o)),o}return e.forEach(r=>i(r)),t}updateMorphTarget(e){if(this.avatarMesh=e,this.splatMesh.flameModel=e,this.splatMesh.useFlameModel=this.useFlame,this.useFlame==!0){this.bones=this.createBonesFromJson(this.bone_tree.bones);const t=[new Y(this.bones[0].position.x,this.bones[0].position.y,this.bones[0].position.z),new Y(this.bones[1].position.x,this.bones[1].position.y,this.bones[1].position.z),new Y(this.bones[2].position.x,this.bones[2].position.y,this.bones[2].position.z),new Y(this.bones[3].position.x,this.bones[3].position.y,this.bones[3].position.z),new Y(this.bones[4].position.x,this.bones[4].position.y,this.bones[4].position.z)];this.bones[1].position.copy(new Y(t[1].x-t[0].x,t[1].y-t[0].y,t[1].z-t[0].z)),this.bones[2].position.copy(new Y(t[2].x-t[1].x,t[2].y-t[1].y,t[2].z-t[1].z)),this.bones[3].position.copy(new Y(t[3].x-t[1].x,t[3].y-t[1].y,t[3].z-t[1].z)),this.bones[4].position.copy(new Y(t[4].x-t[1].x,t[4].y-t[1].y,t[4].z-t[1].z)),this.bones[0].updateMatrixWorld(!0);const i=[this.bones[0].matrixWorld.clone().invert(),this.bones[1].matrixWorld.clone().invert(),this.bones[2].matrixWorld.clone().invert(),this.bones[3].matrixWorld.clone().invert(),this.bones[4].matrixWorld.clone().invert()];this.skeleton=new t0(this.bones,i)}this.runMorphUpdate(),this.splatMesh.gaussianSplatCount=this.gaussianSplatCount}updatedBoneMatrices(e){let t=[];for(let r=0;r<e;r++){let o=function(a,l){let c=a.elements;for(let u=0;u<c.length;u++)l.push(c[u])},s;s=this.skeleton.bones[r].matrixWorld.clone().multiply(this.skeleton.boneInverses[r].clone()),o(s,t)}return new Float32Array(t)}runMorphUpdate(){this.gaussianSplatCount=this.avatarMesh.geometry.attributes.position.count;var e=new Float32Array(this.avatarMesh.geometry.attributes.position.array);const t=5;if(this.splatMesh.bonesNum=t,this.useFlame==!1){if(this.skinModel.skeleton.update(),this.boneRoot.updateMatrixWorld(!0),this.splatMesh.geometry.getAttribute("splatIndex")&&this.setSkinAttibutes===!1){this.setSkinAttibutes=!0;const r=this.splatMesh.geometry,s=this.skinModel.geometry.attributes.skinIndex,o=this.skinModel.geometry.attributes.skinWeight,a=new jo(new s.array.constructor(s.array),4,s.normalized,1),l=new jo(new o.array.constructor(o.array),4,o.normalized,1);a.setUsage(ba),l.setUsage(ba),r.setAttribute("skinIndex",a),r.setAttribute("skinWeight",l)}}else this.updateFlameBones();this.splatMesh.morphedMesh=e;let i=this.splatMesh.morphedMesh.length/3;this.splatMesh.splatDataTextures.flameModel!=null&&this.splatMesh.updateTetureAfterBSAndSkeleton(0,i-1,this.useFlame)}updateFlameBones(){this.splatMesh.bsWeight=this.flame_params.expr[this.frame];function e(s,o,a=!1){let l;if(a==!0)l=new Qt(o[0],o[1],o[2],o[3]);else{const c=new Y(o[0],o[1],o[2]),u=c.length(),d=c.normalize();l=new Qt().setFromAxisAngle(d,u)}s.quaternion.copy(l),s.updateMatrixWorld(!0)}let t=this.flame_params.rotation[this.frame];e(this.skeleton.bones[0],t),t=this.flame_params.neck_pose[this.frame],e(this.skeleton.bones[1],t),t=this.flame_params.jaw_pose[this.frame],e(this.skeleton.bones[2],t),t=this.flame_params.eyes_pose[this.frame],e(this.skeleton.bones[3],t),e(this.skeleton.bones[4],[t[3],t[4],t[5]]),this.skeleton.update();const i=5,r=this.updatedBoneMatrices(i);this.splatMesh.bonesMatrix=r,this.splatMesh.bonesNum=i,this.splatMesh.bonesWeight=this.lbs_weight_80k}};xe(va,"setCameraPositionFromZoom",function(){const e=new Y;return function(t,i,r){const s=1/(i.zoom*.001);e.copy(r.target).sub(t.position).normalize().multiplyScalar(s).negate(),t.position.copy(r.target).add(e)}}()),xe(va,"setCameraZoomFromPosition",function(){const e=new Y;return function(t,i,r){const s=e.copy(r.target).sub(i.position).length();t.zoom=1/(s*.001)}}());let nv=va;function al(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(d){o(d)}}function l(u){try{c(i.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function P4(n,e){return function(){return n.apply(e,arguments)}}const{toString:XQ}=Object.prototype,{getPrototypeOf:Lx}=Object,y0=(n=>e=>{const t=XQ.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Es=n=>(n=n.toLowerCase(),e=>y0(e)===n),v0=n=>e=>typeof e===n,{isArray:Vu}=Array,vh=v0("undefined");function KQ(n){return n!==null&&!vh(n)&&n.constructor!==null&&!vh(n.constructor)&&Lr(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const L4=Es("ArrayBuffer");function YQ(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&L4(n.buffer),e}const ZQ=v0("string"),Lr=v0("function"),D4=v0("number"),_0=n=>n!==null&&typeof n=="object",JQ=n=>n===!0||n===!1,Lp=n=>{if(y0(n)!=="object")return!1;const e=Lx(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ej=Es("Date"),tj=Es("File"),nj=Es("Blob"),ij=Es("FileList"),rj=n=>_0(n)&&Lr(n.pipe),sj=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Lr(n.append)&&((e=y0(n))==="formdata"||e==="object"&&Lr(n.toString)&&n.toString()==="[object FormData]"))},oj=Es("URLSearchParams"),[aj,lj,cj,uj]=["ReadableStream","Request","Response","Headers"].map(Es),dj=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tf(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),Vu(n))for(i=0,r=n.length;i<r;i++)e.call(null,n[i],i,n);else{const s=t?Object.getOwnPropertyNames(n):Object.keys(n),o=s.length;let a;for(i=0;i<o;i++)a=s[i],e.call(null,n[a],a,n)}}function F4(n,e){e=e.toLowerCase();const t=Object.keys(n);let i=t.length,r;for(;i-- >0;)if(r=t[i],e===r.toLowerCase())return r;return null}const Al=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,O4=n=>!vh(n)&&n!==Al;function iv(){const{caseless:n}=O4(this)&&this||{},e={},t=(i,r)=>{const s=n&&F4(e,r)||r;Lp(e[s])&&Lp(i)?e[s]=iv(e[s],i):Lp(i)?e[s]=iv({},i):Vu(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&tf(arguments[i],t);return e}const hj=(n,e,t,{allOwnKeys:i}={})=>(tf(e,(r,s)=>{t&&Lr(r)?n[s]=P4(r,t):n[s]=r},{allOwnKeys:i}),n),fj=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),pj=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},mj=(n,e,t,i)=>{let r,s,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)o=r[s],(!i||i(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&Lx(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},gj=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},yj=n=>{if(!n)return null;if(Vu(n))return n;let e=n.length;if(!D4(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},vj=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Lx(Uint8Array)),_j=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},xj=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},Sj=Es("HTMLFormElement"),Aj=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),Tb=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),bj=Es("RegExp"),B4=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};tf(t,(r,s)=>{let o;(o=e(r,s,n))!==!1&&(i[s]=o||r)}),Object.defineProperties(n,i)},Tj=n=>{B4(n,(e,t)=>{if(Lr(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(Lr(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},wj=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return Vu(n)?i(n):i(String(n).split(e)),t},Cj=()=>{},Ej=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function Mj(n){return!!(n&&Lr(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Rj=n=>{const e=new Array(10),t=(i,r)=>{if(_0(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=Vu(i)?[]:{};return tf(i,(o,a)=>{const l=t(o,r+1);!vh(l)&&(s[a]=l)}),e[r]=void 0,s}}return i};return t(n,0)},Ij=Es("AsyncFunction"),Nj=n=>n&&(_0(n)||Lr(n))&&Lr(n.then)&&Lr(n.catch),k4=((n,e)=>n?setImmediate:e?((t,i)=>(Al.addEventListener("message",({source:r,data:s})=>{r===Al&&s===t&&i.length&&i.shift()()},!1),r=>{i.push(r),Al.postMessage(t,"*")}))("axios@".concat(Math.random()),[]):t=>setTimeout(t))(typeof setImmediate=="function",Lr(Al.postMessage)),Pj=typeof queueMicrotask<"u"?queueMicrotask.bind(Al):typeof process<"u"&&process.nextTick||k4;var Me={isArray:Vu,isArrayBuffer:L4,isBuffer:KQ,isFormData:sj,isArrayBufferView:YQ,isString:ZQ,isNumber:D4,isBoolean:JQ,isObject:_0,isPlainObject:Lp,isReadableStream:aj,isRequest:lj,isResponse:cj,isHeaders:uj,isUndefined:vh,isDate:ej,isFile:tj,isBlob:nj,isRegExp:bj,isFunction:Lr,isStream:rj,isURLSearchParams:oj,isTypedArray:vj,isFileList:ij,forEach:tf,merge:iv,extend:hj,trim:dj,stripBOM:fj,inherits:pj,toFlatObject:mj,kindOf:y0,kindOfTest:Es,endsWith:gj,toArray:yj,forEachEntry:_j,matchAll:xj,isHTMLForm:Sj,hasOwnProperty:Tb,hasOwnProp:Tb,reduceDescriptors:B4,freezeMethods:Tj,toObjectSet:wj,toCamelCase:Aj,noop:Cj,toFiniteNumber:Ej,findKey:F4,global:Al,isContextDefined:O4,isSpecCompliantForm:Mj,toJSONObject:Rj,isAsyncFn:Ij,isThenable:Nj,setImmediate:k4,asap:Pj};function Et(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}Me.inherits(Et,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Me.toJSONObject(this.config),code:this.code,status:this.status}}});const U4=Et.prototype,z4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{z4[n]={value:n}});Object.defineProperties(Et,z4);Object.defineProperty(U4,"isAxiosError",{value:!0});Et.from=(n,e,t,i,r,s)=>{const o=Object.create(U4);return Me.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Et.call(o,n.message,e,t,i,r),o.cause=n,o.name=n.name,s&&Object.assign(o,s),o};var Lj=null;function rv(n){return Me.isPlainObject(n)||Me.isArray(n)}function V4(n){return Me.endsWith(n,"[]")?n.slice(0,-2):n}function wb(n,e,t){return n?n.concat(e).map(function(r,s){return r=V4(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function Dj(n){return Me.isArray(n)&&!n.some(rv)}const Fj=Me.toFlatObject(Me,{},null,function(e){return/^is[A-Z]/.test(e)});function x0(n,e,t){if(!Me.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=Me.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!Me.isUndefined(y[g])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&Me.isSpecCompliantForm(e);if(!Me.isFunction(r))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Me.isDate(p))return p.toISOString();if(!l&&Me.isBlob(p))throw new Et("Blob is not supported. Use a Buffer instead.");return Me.isArrayBuffer(p)||Me.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,y){let m=p;if(p&&!y&&typeof p=="object"){if(Me.endsWith(g,"{}"))g=i?g:g.slice(0,-2),p=JSON.stringify(p);else if(Me.isArray(p)&&Dj(p)||(Me.isFileList(p)||Me.endsWith(g,"[]"))&&(m=Me.toArray(p)))return g=V4(g),m.forEach(function(x,_){!(Me.isUndefined(x)||x===null)&&e.append(o===!0?wb([g],_,s):o===null?g:g+"[]",c(x))}),!1}return rv(p)?!0:(e.append(wb(y,g,s),c(p)),!1)}const d=[],h=Object.assign(Fj,{defaultVisitor:u,convertValue:c,isVisitable:rv});function f(p,g){if(!Me.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Me.forEach(p,function(m,v){(!(Me.isUndefined(m)||m===null)&&r.call(e,m,Me.isString(v)?v.trim():v,g,h))===!0&&f(m,g?g.concat(v):[v])}),d.pop()}}if(!Me.isObject(n))throw new TypeError("data must be an object");return f(n),e}function Cb(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Dx(n,e){this._pairs=[],n&&x0(n,this,e)}const H4=Dx.prototype;H4.append=function(e,t){this._pairs.push([e,t])};H4.toString=function(e){const t=e?function(i){return e.call(this,i,Cb)}:Cb;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Oj(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $4(n,e,t){if(!e)return n;const i=t&&t.encode||Oj;Me.isFunction(t)&&(t={serialize:t});const r=t&&t.serialize;let s;if(r?s=r(e,t):s=Me.isURLSearchParams(e)?e.toString():new Dx(e,t).toString(i),s){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class Eb{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Me.forEach(this.handlers,function(i){i!==null&&e(i)})}}var G4={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bj=typeof URLSearchParams<"u"?URLSearchParams:Dx,kj=typeof FormData<"u"?FormData:null,Uj=typeof Blob<"u"?Blob:null,zj={isBrowser:!0,classes:{URLSearchParams:Bj,FormData:kj,Blob:Uj},protocols:["http","https","file","blob","url","data"]};const Fx=typeof window<"u"&&typeof document<"u",sv=typeof navigator=="object"&&navigator||void 0,Vj=Fx&&(!sv||["ReactNative","NativeScript","NS"].indexOf(sv.product)<0),Hj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$j=Fx&&window.location.href||"http://localhost";var Gj=Object.freeze({__proto__:null,hasBrowserEnv:Fx,hasStandardBrowserEnv:Vj,hasStandardBrowserWebWorkerEnv:Hj,navigator:sv,origin:$j}),Li={...Gj,...zj};function Wj(n,e){return x0(n,new Li.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return Li.isNode&&Me.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Qj(n){return Me.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function jj(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i<r;i++)s=t[i],e[s]=n[s];return e}function W4(n){function e(t,i,r,s){let o=t[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=t.length;return o=!o&&Me.isArray(r)?r.length:o,l?(Me.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!a):((!r[o]||!Me.isObject(r[o]))&&(r[o]=[]),e(t,i,r[o],s)&&Me.isArray(r[o])&&(r[o]=jj(r[o])),!a)}if(Me.isFormData(n)&&Me.isFunction(n.entries)){const t={};return Me.forEachEntry(n,(i,r)=>{e(Qj(i),r,t,0)}),t}return null}function qj(n,e,t){if(Me.isString(n))try{return(e||JSON.parse)(n),Me.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const nf={transitional:G4,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=Me.isObject(e);if(s&&Me.isHTMLForm(e)&&(e=new FormData(e)),Me.isFormData(e))return r?JSON.stringify(W4(e)):e;if(Me.isArrayBuffer(e)||Me.isBuffer(e)||Me.isStream(e)||Me.isFile(e)||Me.isBlob(e)||Me.isReadableStream(e))return e;if(Me.isArrayBufferView(e))return e.buffer;if(Me.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Wj(e,this.formSerializer).toString();if((a=Me.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return x0(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),qj(e)):e}],transformResponse:[function(e){const t=this.transitional||nf.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(Me.isResponse(e)||Me.isReadableStream(e))return e;if(e&&Me.isString(e)&&(i&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Et.from(a,Et.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Li.classes.FormData,Blob:Li.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Me.forEach(["delete","get","head","post","put","patch"],n=>{nf.headers[n]={}});const Xj=Me.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Kj=n=>{const e={};let t,i,r;return n&&n.split("\n").forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!t||e[t]&&Xj[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e};const Mb=Symbol("internals");function yd(n){return n&&String(n).trim().toLowerCase()}function Dp(n){return n===!1||n==null?n:Me.isArray(n)?n.map(Dp):String(n)}function Yj(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const Zj=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function a1(n,e,t,i,r){if(Me.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!Me.isString(e)){if(Me.isString(i))return e.indexOf(i)!==-1;if(Me.isRegExp(i))return i.test(e)}}function Jj(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function eq(n,e){const t=Me.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}let lr=class{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function s(a,l,c){const u=yd(l);if(!u)throw new Error("header name must be a non-empty string");const d=Me.findKey(r,u);(!d||r[d]===void 0||c===!0||c===void 0&&r[d]!==!1)&&(r[d||l]=Dp(a))}const o=(a,l)=>Me.forEach(a,(c,u)=>s(c,u,l));if(Me.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Me.isString(e)&&(e=e.trim())&&!Zj(e))o(Kj(e),t);else if(Me.isHeaders(e))for(const[a,l]of e.entries())s(l,a,i);else e!=null&&s(t,e,i);return this}get(e,t){if(e=yd(e),e){const i=Me.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return Yj(r);if(Me.isFunction(t))return t.call(this,r,i);if(Me.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=yd(e),e){const i=Me.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||a1(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function s(o){if(o=yd(o),o){const a=Me.findKey(i,o);a&&(!t||a1(i,i[a],a,t))&&(delete i[a],r=!0)}}return Me.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const s=t[i];(!e||a1(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,i={};return Me.forEach(this,(r,s)=>{const o=Me.findKey(i,s);if(o){t[o]=Dp(r),delete t[s];return}const a=e?Jj(s):String(s).trim();a!==s&&delete t[s],t[a]=Dp(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Me.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&Me.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Mb]=this[Mb]={accessors:{}}).accessors,r=this.prototype;function s(o){const a=yd(o);i[a]||(eq(r,o),i[a]=!0)}return Me.isArray(e)?e.forEach(s):s(e),this}};lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Me.reduceDescriptors(lr.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});Me.freezeMethods(lr);function l1(n,e){const t=this||nf,i=e||t,r=lr.from(i.headers);let s=i.data;return Me.forEach(n,function(a){s=a.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Q4(n){return!!(n&&n.__CANCEL__)}function Hu(n,e,t){Et.call(this,n==null?"canceled":n,Et.ERR_CANCELED,e,t),this.name="CanceledError"}Me.inherits(Hu,Et,{__CANCEL__:!0});function j4(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new Et("Request failed with status code "+t.status,[Et.ERR_BAD_REQUEST,Et.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function tq(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function nq(n,e){n=n||10;const t=new Array(n),i=new Array(n);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[s];o||(o=c),t[r]=l,i[r]=c;let d=s,h=0;for(;d!==r;)h+=t[d++],d=d%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),c-o<e)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function iq(n,e){let t=0,i=1e3/e,r,s;const o=(c,u=Date.now())=>{t=u,r=null,s&&(clearTimeout(s),s=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-t;d>=i?o(c,u):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-d)))},()=>r&&o(r)]}const Rm=(n,e,t=3)=>{let i=0;const r=nq(50,250);return iq(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-i,c=r(l),u=o<=a;i=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(d)},t)},Rb=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},Ib=n=>(...e)=>Me.asap(()=>n(...e));var rq=Li.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Li.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Li.origin),Li.navigator&&/(msie|trident)/i.test(Li.navigator.userAgent)):()=>!0,sq=Li.hasStandardBrowserEnv?{write(n,e,t,i,r,s){const o=[n+"="+encodeURIComponent(e)];Me.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),Me.isString(i)&&o.push("path="+i),Me.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function oq(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function aq(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function q4(n,e,t){let i=!oq(e);return n&&(i||t==!1)?aq(n,e):e}const Nb=n=>n instanceof lr?{...n}:n;function Hl(n,e){e=e||{};const t={};function i(c,u,d,h){return Me.isPlainObject(c)&&Me.isPlainObject(u)?Me.merge.call({caseless:h},c,u):Me.isPlainObject(u)?Me.merge({},u):Me.isArray(u)?u.slice():u}function r(c,u,d,h){if(Me.isUndefined(u)){if(!Me.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function s(c,u){if(!Me.isUndefined(u))return i(void 0,u)}function o(c,u){if(Me.isUndefined(u)){if(!Me.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(d in e)return i(c,u);if(d in n)return i(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>r(Nb(c),Nb(u),d,!0)};return Me.forEach(Object.keys(Object.assign({},n,e)),function(u){const d=l[u]||r,h=d(n[u],e[u],u);Me.isUndefined(h)&&d!==a||(t[u]=h)}),t}var X4=n=>{const e=Hl({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=lr.from(o),e.url=$4(q4(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(Me.isFormData(t)){if(Li.hasStandardBrowserEnv||Li.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Li.hasStandardBrowserEnv&&(i&&Me.isFunction(i)&&(i=i(e)),i||i!==!1&&rq(e.url))){const c=r&&s&&sq.read(s);c&&o.set(r,c)}return e};const lq=typeof XMLHttpRequest<"u";var cq=lq&&function(n){return new Promise(function(t,i){const r=X4(n);let s=r.data;const o=lr.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=r,u,d,h,f,p;function g(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function m(){if(!y)return;const x=lr.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};j4(function(A){t(A),g()},function(A){i(A),g()},S),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(m)},y.onabort=function(){y&&(i(new Et("Request aborted",Et.ECONNABORTED,n,y)),y=null)},y.onerror=function(){i(new Et("Network Error",Et.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let _=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||G4;r.timeoutErrorMessage&&(_=r.timeoutErrorMessage),i(new Et(_,S.clarifyTimeoutError?Et.ETIMEDOUT:Et.ECONNABORTED,n,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&Me.forEach(o.toJSON(),function(_,S){y.setRequestHeader(S,_)}),Me.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),c&&([h,p]=Rm(c,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,f]=Rm(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",f)),(r.cancelToken||r.signal)&&(u=x=>{y&&(i(!x||x.type?new Hu(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const v=tq(r.url);if(v&&Li.protocols.indexOf(v)===-1){i(new Et("Unsupported protocol "+v+":",Et.ERR_BAD_REQUEST,n));return}y.send(s||null)})};const uq=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,r;const s=function(c){if(!r){r=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof Et?u:new Hu(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,s(new Et("timeout ".concat(e," of ms exceeded"),Et.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),n=null)};n.forEach(c=>c.addEventListener("abort",s));const{signal:l}=i;return l.unsubscribe=()=>Me.asap(a),l}},dq=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let i=0,r;for(;i<t;)r=i+e,yield n.slice(i,r),i=r},hq=async function*(n,e){for await(const t of fq(n))yield*dq(t,e)},fq=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},Pb=(n,e,t,i)=>{const r=hq(n,e);let s=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){a(),l.close();return}let d=u.byteLength;if(t){let h=s+=d;t(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},S0=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",K4=S0&&typeof ReadableStream=="function",pq=S0&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Y4=(n,...e)=>{try{return!!n(...e)}catch(t){return!1}},mq=K4&&Y4(()=>{let n=!1;const e=new Request(Li.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Lb=64*1024,ov=K4&&Y4(()=>Me.isReadableStream(new Response("").body)),Im={stream:ov&&(n=>n.body)};S0&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Im[e]&&(Im[e]=Me.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new Et("Response type '".concat(e,"' is not supported"),Et.ERR_NOT_SUPPORT,i)})})})(new Response);const gq=async n=>{if(n==null)return 0;if(Me.isBlob(n))return n.size;if(Me.isSpecCompliantForm(n))return(await new Request(Li.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(Me.isArrayBufferView(n)||Me.isArrayBuffer(n))return n.byteLength;if(Me.isURLSearchParams(n)&&(n=n+""),Me.isString(n))return(await pq(n)).byteLength},yq=async(n,e)=>{const t=Me.toFiniteNumber(n.getContentLength());return t==null?gq(e):t};var vq=S0&&(async n=>{let{url:e,method:t,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:h}=X4(n);c=c?(c+"").toLowerCase():"text";let f=uq([r,s&&s.toAbortSignal()],o),p;const g=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let y;try{if(l&&mq&&t!=="get"&&t!=="head"&&(y=await yq(u,i))!==0){let S=new Request(e,{method:"POST",body:i,duplex:"half"}),E;if(Me.isFormData(i)&&(E=S.headers.get("content-type"))&&u.setContentType(E),S.body){const[A,R]=Rb(y,Rm(Ib(l)));i=Pb(S.body,Lb,A,R)}}Me.isString(d)||(d=d?"include":"omit");const m="credentials"in Request.prototype;p=new Request(e,{...h,signal:f,method:t.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:m?d:void 0});let v=await fetch(p);const x=ov&&(c==="stream"||c==="response");if(ov&&(a||x&&g)){const S={};["status","statusText","headers"].forEach(w=>{S[w]=v[w]});const E=Me.toFiniteNumber(v.headers.get("content-length")),[A,R]=a&&Rb(E,Rm(Ib(a),!0))||[];v=new Response(Pb(v.body,Lb,A,()=>{R&&R(),g&&g()}),S)}c=c||"text";let _=await Im[Me.findKey(Im,c)||"text"](v,n);return!x&&g&&g(),await new Promise((S,E)=>{j4(S,E,{data:_,headers:lr.from(v.headers),status:v.status,statusText:v.statusText,config:n,request:p})})}catch(m){throw g&&g(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new Et("Network Error",Et.ERR_NETWORK,n,p),{cause:m.cause||m}):Et.from(m,m&&m.code,n,p)}});const av={http:Lj,xhr:cq,fetch:vq};Me.forEach(av,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch(t){}Object.defineProperty(n,"adapterName",{value:e})}});const Db=n=>"- ".concat(n),_q=n=>Me.isFunction(n)||n===null||n===!1;var Z4={getAdapter:n=>{n=Me.isArray(n)?n:[n];const{length:e}=n;let t,i;const r={};for(let s=0;s<e;s++){t=n[s];let o;if(i=t,!_q(t)&&(i=av[(o=String(t)).toLowerCase()],i===void 0))throw new Et("Unknown adapter '".concat(o,"'"));if(i)break;r[o||"#"+s]=i}if(!i){const s=Object.entries(r).map(([a,l])=>"adapter ".concat(a," ")+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?"since :\n"+s.map(Db).join("\n"):" "+Db(s[0]):"as no adapter specified";throw new Et("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:av};function c1(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Hu(null,n)}function Fb(n){return c1(n),n.headers=lr.from(n.headers),n.data=l1.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Z4.getAdapter(n.adapter||nf.adapter)(n).then(function(i){return c1(n),i.data=l1.call(n,n.transformResponse,i),i.headers=lr.from(i.headers),i},function(i){return Q4(i)||(c1(n),i&&i.response&&(i.response.data=l1.call(n,n.transformResponse,i.response),i.response.headers=lr.from(i.response.headers))),Promise.reject(i)})}const J4="1.8.4",A0={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{A0[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const Ob={};A0.transitional=function(e,t,i){function r(s,o){return"[Axios v"+J4+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,a)=>{if(e===!1)throw new Et(r(o," has been removed"+(t?" in "+t:"")),Et.ERR_DEPRECATED);return t&&!Ob[o]&&(Ob[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};A0.spelling=function(e){return(t,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(e)),!0)};function xq(n,e,t){if(typeof n!="object")throw new Et("options must be an object",Et.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let r=i.length;for(;r-- >0;){const s=i[r],o=e[s];if(o){const a=n[s],l=a===void 0||o(a,s,n);if(l!==!0)throw new Et("option "+s+" must be "+l,Et.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Et("Unknown option "+s,Et.ERR_BAD_OPTION)}}var Fp={assertOptions:xq,validators:A0};const Is=Fp.validators;let Pl=class{constructor(e){this.defaults=e,this.interceptors={request:new Eb,response:new Eb}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+s):i.stack=s}catch(o){}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Hl(this.defaults,t);const{transitional:i,paramsSerializer:r,headers:s}=t;i!==void 0&&Fp.assertOptions(i,{silentJSONParsing:Is.transitional(Is.boolean),forcedJSONParsing:Is.transitional(Is.boolean),clarifyTimeoutError:Is.transitional(Is.boolean)},!1),r!=null&&(Me.isFunction(r)?t.paramsSerializer={serialize:r}:Fp.assertOptions(r,{encode:Is.function,serialize:Is.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Fp.assertOptions(t,{baseUrl:Is.spelling("baseURL"),withXsrfToken:Is.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&Me.merge(s.common,s[t.method]);s&&Me.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),t.headers=lr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Fb.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(t);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=t;for(d=0;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(y){g.call(this,y);break}}try{u=Fb.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Hl(this.defaults,e);const t=q4(e.baseURL,e.url,e.allowAbsoluteUrls);return $4(t,e.params,e.paramsSerializer)}};Me.forEach(["delete","get","head","options"],function(e){Pl.prototype[e]=function(t,i){return this.request(Hl(i||{},{method:e,url:t,data:(i||{}).data}))}});Me.forEach(["post","put","patch"],function(e){function t(i){return function(s,o,a){return this.request(Hl(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Pl.prototype[e]=t(),Pl.prototype[e+"Form"]=t(!0)});let Sq=class e6{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(a=>{i.subscribe(a),s=a}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,a){i.reason||(i.reason=new Hu(s,o,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new e6(function(r){e=r}),cancel:e}}};function Aq(n){return function(t){return n.apply(null,t)}}function bq(n){return Me.isObject(n)&&n.isAxiosError===!0}const lv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lv).forEach(([n,e])=>{lv[e]=n});function t6(n){const e=new Pl(n),t=P4(Pl.prototype.request,e);return Me.extend(t,Pl.prototype,e,{allOwnKeys:!0}),Me.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return t6(Hl(n,r))},t}const Bn=t6(nf);Bn.Axios=Pl;Bn.CanceledError=Hu;Bn.CancelToken=Sq;Bn.isCancel=Q4;Bn.VERSION=J4;Bn.toFormData=x0;Bn.AxiosError=Et;Bn.Cancel=Bn.CanceledError;Bn.all=function(e){return Promise.all(e)};Bn.spread=Aq;Bn.isAxiosError=bq;Bn.mergeConfig=Hl;Bn.AxiosHeaders=lr;Bn.formToJSON=n=>W4(Me.isHTMLForm(n)?new FormData(n):n);Bn.getAdapter=Z4.getAdapter;Bn.HttpStatusCode=lv;Bn.default=Bn;const{Axios:rre,AxiosError:sre,CanceledError:ore,isCancel:are,CancelToken:lre,VERSION:cre,all:ure,Cancel:dre,isAxiosError:hre,spread:fre,toFormData:pre,AxiosHeaders:mre,HttpStatusCode:gre,formToJSON:yre,getAdapter:vre,mergeConfig:_re}=Bn;var Bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function n6(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function rp(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var u1={exports:{}},Bb;function Tq(){return Bb||(Bb=1,function(n,e){(function(t){n.exports=t()})(function(){return function t(i,r,s){function o(c,u){if(!r[c]){if(!i[c]){var d=typeof rp=="function"&&rp;if(!u&&d)return d(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var f=r[c]={exports:{}};i[c][0].call(f.exports,function(p){var g=i[c][1][p];return o(g||p)},f,f.exports,t,i,r,s)}return r[c].exports}for(var a=typeof rp=="function"&&rp,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(t,i,r){var s=t("./utils"),o=t("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(l){for(var c,u,d,h,f,p,g,y=[],m=0,v=l.length,x=v,_=s.getTypeOf(l)!=="string";m<l.length;)x=v-m,d=_?(c=l[m++],u=m<v?l[m++]:0,m<v?l[m++]:0):(c=l.charCodeAt(m++),u=m<v?l.charCodeAt(m++):0,m<v?l.charCodeAt(m++):0),h=c>>2,f=(3&c)<<4|u>>4,p=1<x?(15&u)<<2|d>>6:64,g=2<x?63&d:64,y.push(a.charAt(h)+a.charAt(f)+a.charAt(p)+a.charAt(g));return y.join("")},r.decode=function(l){var c,u,d,h,f,p,g=0,y=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var v,x=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&x--,l.charAt(l.length-2)===a.charAt(64)&&x--,x%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=o.uint8array?new Uint8Array(0|x):new Array(0|x);g<l.length;)c=a.indexOf(l.charAt(g++))<<2|(h=a.indexOf(l.charAt(g++)))>>4,u=(15&h)<<4|(f=a.indexOf(l.charAt(g++)))>>2,d=(3&f)<<6|(p=a.indexOf(l.charAt(g++))),v[y++]=c,f!==64&&(v[y++]=u),p!==64&&(v[y++]=d);return v}},{"./support":30,"./utils":32}],2:[function(t,i,r){var s=t("./external"),o=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function c(u,d,h,f,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=h,this.compression=f,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,h){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(d.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},i.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,r){var s=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i,r){var s=t("./utils"),o=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();i.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(c,u,d,h){var f=o,p=h+d;c^=-1;for(var g=h;g<p;g++)c=c>>>8^f[255&(c^u[g])];return-1^c}(0|l,a,a.length,0):function(c,u,d,h){var f=o,p=h+d;c^=-1;for(var g=h;g<p;g++)c=c>>>8^f[255&(c^u.charCodeAt(g))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(t,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,i,r){var s=null;s=typeof Promise<"u"?Promise:t("lie"),i.exports={Promise:s}},{lie:37}],7:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),a=t("./utils"),l=t("./stream/GenericWorker"),c=s?"uint8array":"array";function u(d,h){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=h,this.meta={}}r.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(h){d.push({data:h,meta:d.meta})}},r.compressWorker=function(d){return new u("Deflate",d)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i,r){function s(f,p){var g,y="";for(g=0;g<p;g++)y+=String.fromCharCode(255&f),f>>>=8;return y}function o(f,p,g,y,m,v){var x,_,S=f.file,E=f.compression,A=v!==c.utf8encode,R=a.transformTo("string",v(S.name)),w=a.transformTo("string",c.utf8encode(S.name)),M=S.comment,I=a.transformTo("string",v(M)),L=a.transformTo("string",c.utf8encode(M)),k=w.length!==S.name.length,T=L.length!==M.length,F="",V="",Q="",ee=S.dir,se=S.date,he={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(he.crc32=f.crc32,he.compressedSize=f.compressedSize,he.uncompressedSize=f.uncompressedSize);var ie=0;p&&(ie|=8),A||!k&&!T||(ie|=2048);var re=0,be=0;ee&&(re|=16),m==="UNIX"?(be=798,re|=function(fe,Te){var Ce=fe;return fe||(Ce=Te?16893:33204),(65535&Ce)<<16}(S.unixPermissions,ee)):(be=20,re|=function(fe){return 63&(fe||0)}(S.dosPermissions)),x=se.getUTCHours(),x<<=6,x|=se.getUTCMinutes(),x<<=5,x|=se.getUTCSeconds()/2,_=se.getUTCFullYear()-1980,_<<=4,_|=se.getUTCMonth()+1,_<<=5,_|=se.getUTCDate(),k&&(V=s(1,1)+s(u(R),4)+w,F+="up"+s(V.length,2)+V),T&&(Q=s(1,1)+s(u(I),4)+L,F+="uc"+s(Q.length,2)+Q);var le="";return le+="\n\0",le+=s(ie,2),le+=E.magic,le+=s(x,2),le+=s(_,2),le+=s(he.crc32,4),le+=s(he.compressedSize,4),le+=s(he.uncompressedSize,4),le+=s(R.length,2),le+=s(F.length,2),{fileRecord:d.LOCAL_FILE_HEADER+le+R+F,dirRecord:d.CENTRAL_FILE_HEADER+s(be,2)+le+s(I.length,2)+"\0\0\0\0"+s(re,4)+s(y,4)+R+F+I}}var a=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),u=t("../crc32"),d=t("../signature");function h(f,p,g,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-y-1))/g:100}}))},h.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=o(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=o(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(y){return d.DATA_DESCRIPTOR+s(y.crc32,4)+s(y.compressedSize,4)+s(y.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var g=this.bytesWritten-f,y=function(m,v,x,_,S){var E=a.transformTo("string",S(_));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(m,2)+s(m,2)+s(v,4)+s(x,4)+s(E.length,2)+E}(this.dirRecords.length,g,f,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(f){this._sources.push(f);var p=this;return f.on("data",function(g){p.processChunk(g)}),f.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),f.on("error",function(g){p.error(g)}),this},h.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(f){var p=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var g=0;g<p.length;g++)try{p[g].error(f)}catch(y){}return!0},h.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,p=0;p<f.length;p++)f[p].lock()},i.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,r){var s=t("../compressions"),o=t("./ZipFileWorker");r.generateWorker=function(a,l,c){var u=new o(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{a.forEach(function(h,f){d++;var p=function(v,x){var _=v||x,S=s[_];if(!S)throw new Error(_+" is not a valid compression method !");return S}(f.options.compression,l.compression),g=f.options.compressionOptions||l.compressionOptions||{},y=f.dir,m=f.date;f._compressWorker(p,g).withStreamInfo("file",{name:h,dir:y,date:m,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(h){u.error(h)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i,r){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new s;for(var a in this)typeof this[a]!="function"&&(o[a]=this[a]);return o}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(o,a){return new s().loadAsync(o,a)},s.external=t("./external"),i.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i,r){var s=t("./utils"),o=t("./external"),a=t("./utf8"),l=t("./zipEntries"),c=t("./stream/Crc32Probe"),u=t("./nodejsUtils");function d(h){return new o.Promise(function(f,p){var g=h.decompressed.getContentWorker().pipe(new c);g.on("error",function(y){p(y)}).on("end",function(){g.streamInfo.crc32!==h.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}i.exports=function(h,f){var p=this;return f=s.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(h)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",h,!0,f.optimizedBinaryString,f.base64).then(function(g){var y=new l(f);return y.load(g),y}).then(function(g){var y=[o.Promise.resolve(g)],m=g.files;if(f.checkCRC32)for(var v=0;v<m.length;v++)y.push(d(m[v]));return o.Promise.all(y)}).then(function(g){for(var y=g.shift(),m=y.files,v=0;v<m.length;v++){var x=m[v],_=x.fileNameStr,S=s.resolve(x.fileNameStr);p.file(S,x.decompressed,{binary:!0,optimizedBinaryString:!0,date:x.date,dir:x.dir,comment:x.fileCommentStr.length?x.fileCommentStr:null,unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions,createFolders:f.createFolders}),x.dir||(p.file(S).unsafeOriginalName=_)}return y.zipComment.length&&(p.comment=y.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i,r){var s=t("../utils"),o=t("../stream/GenericWorker");function a(l,c){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}s.inherits(a,o),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i,r){var s=t("readable-stream").Readable;function o(a,l,c){s.call(this,l),this._helper=a;var u=this;a.on("data",function(d,h){u.push(d)||u._helper.pause(),c&&c(h)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}t("../utils").inherits(o,s),o.prototype._read=function(){this._helper.resume()},i.exports=o},{"../utils":32,"readable-stream":16}],14:[function(t,i,r){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,o);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,o)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var o=new Buffer(s);return o.fill(0),o},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,i,r){function s(S,E,A){var R,w=a.getTypeOf(E),M=a.extend(A||{},u);M.date=M.date||new Date,M.compression!==null&&(M.compression=M.compression.toUpperCase()),typeof M.unixPermissions=="string"&&(M.unixPermissions=parseInt(M.unixPermissions,8)),M.unixPermissions&&16384&M.unixPermissions&&(M.dir=!0),M.dosPermissions&&16&M.dosPermissions&&(M.dir=!0),M.dir&&(S=m(S)),M.createFolders&&(R=y(S))&&v.call(this,R,!0);var I=w==="string"&&M.binary===!1&&M.base64===!1;A&&A.binary!==void 0||(M.binary=!I),(E instanceof d&&E.uncompressedSize===0||M.dir||!E||E.length===0)&&(M.base64=!1,M.binary=!0,E="",M.compression="STORE",w="string");var L=null;L=E instanceof d||E instanceof l?E:p.isNode&&p.isStream(E)?new g(S,E):a.prepareContent(S,E,M.binary,M.optimizedBinaryString,M.base64);var k=new h(S,L,M);this.files[S]=k}var o=t("./utf8"),a=t("./utils"),l=t("./stream/GenericWorker"),c=t("./stream/StreamHelper"),u=t("./defaults"),d=t("./compressedObject"),h=t("./zipObject"),f=t("./generate"),p=t("./nodejsUtils"),g=t("./nodejs/NodejsStreamInputAdapter"),y=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var E=S.lastIndexOf("/");return 0<E?S.substring(0,E):""},m=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},v=function(S,E){return E=E!==void 0?E:u.createFolders,S=m(S),this.files[S]||s.call(this,S,null,{dir:!0,createFolders:E}),this.files[S]};function x(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var E,A,R;for(E in this.files)R=this.files[E],(A=E.slice(this.root.length,E.length))&&E.slice(0,this.root.length)===this.root&&S(A,R)},filter:function(S){var E=[];return this.forEach(function(A,R){S(A,R)&&E.push(R)}),E},file:function(S,E,A){if(arguments.length!==1)return S=this.root+S,s.call(this,S,E,A),this;if(x(S)){var R=S;return this.filter(function(M,I){return!I.dir&&R.test(M)})}var w=this.files[this.root+S];return w&&!w.dir?w:null},folder:function(S){if(!S)return this;if(x(S))return this.filter(function(w,M){return M.dir&&S.test(w)});var E=this.root+S,A=v.call(this,E),R=this.clone();return R.root=A.name,R},remove:function(S){S=this.root+S;var E=this.files[S];if(E||(S.slice(-1)!=="/"&&(S+="/"),E=this.files[S]),E&&!E.dir)delete this.files[S];else for(var A=this.filter(function(w,M){return M.name.slice(0,S.length)===S}),R=0;R<A.length;R++)delete this.files[A[R].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var E,A={};try{if((A=a.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var R=A.comment||this.comment||"";E=f.generateWorker(this,A,R)}catch(w){(E=new l("error")).error(w)}return new c(E,A.type||"string",A.mimeType)},generateAsync:function(S,E){return this.generateInternalStream(S).accumulate(E)},generateNodeStream:function(S,E){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(E)}};i.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i,r){i.exports=t("stream")},{stream:void 0}],17:[function(t,i,r){var s=t("./DataReader");function o(a){s.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}t("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data[this.zero+a]},o.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===l&&this.data[h+1]===c&&this.data[h+2]===u&&this.data[h+3]===d)return h-this.zero;return-1},o.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),h=this.readData(4);return l===h[0]&&c===h[1]&&u===h[2]&&d===h[3]},o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],18:[function(t,i,r){var s=t("../utils");function o(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(t,i,r){var s=t("./Uint8ArrayReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i,r){var s=t("./DataReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,i,r){var s=t("./ArrayReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,i,r){var s=t("../utils"),o=t("../support"),a=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");i.exports=function(d){var h=s.getTypeOf(d);return s.checkSupport(h),h!=="string"||o.uint8array?h==="nodebuffer"?new c(d):o.uint8array?new u(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,i,r){var s=t("./GenericWorker"),o=t("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,i,r){var s=t("./GenericWorker"),o=t("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i,r){var s=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}o.prototype.processChunk.call(this,l)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,i,r){var s=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=s.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(t,i,r){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,a)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var a=this;return o.on("data",function(l){a.processChunk(l)}),o.on("end",function(){a.end()}),o.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,a){return this.extraStreamInfo[o]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},i.exports=s},{}],29:[function(t,i,r){var s=t("../utils"),o=t("./ConvertWorker"),a=t("./GenericWorker"),l=t("../base64"),c=t("../support"),u=t("../external"),d=null;if(c.nodestream)try{d=t("../nodejs/NodejsStreamOutputAdapter")}catch(p){}function h(p,g){return new u.Promise(function(y,m){var v=[],x=p._internalType,_=p._outputType,S=p._mimeType;p.on("data",function(E,A){v.push(E),g&&g(A)}).on("error",function(E){v=[],m(E)}).on("end",function(){try{var E=function(A,R,w){switch(A){case"blob":return s.newBlob(s.transformTo("arraybuffer",R),w);case"base64":return l.encode(R);default:return s.transformTo(A,R)}}(_,function(A,R){var w,M=0,I=null,L=0;for(w=0;w<R.length;w++)L+=R[w].length;switch(A){case"string":return R.join("");case"array":return Array.prototype.concat.apply([],R);case"uint8array":for(I=new Uint8Array(L),w=0;w<R.length;w++)I.set(R[w],M),M+=R[w].length;return I;case"nodebuffer":return Buffer.concat(R);default:throw new Error("concat : unsupported type '"+A+"'")}}(x,v),S);y(E)}catch(A){m(A)}v=[]}).resume()})}function f(p,g,y){var m=g;switch(g){case"blob":case"arraybuffer":m="uint8array";break;case"base64":m="string"}try{this._internalType=m,this._outputType=g,this._mimeType=y,s.checkSupport(m),this._worker=p.pipe(new o(m)),p.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(p){return h(this,p)},on:function(p,g){var y=this;return p==="data"?this._worker.on(p,function(m){g.call(y,m.data,m.meta)}):this._worker.on(p,function(){s.delay(g,arguments,y)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},p)}},i.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var s=new ArrayBuffer(0);try{r.blob=new Blob([s],{type:"application/zip"}).size===0}catch(a){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),r.blob=o.getBlob("application/zip").size===0}catch(l){r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch(a){r.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,r){for(var s=t("./utils"),o=t("./support"),a=t("./nodejsUtils"),l=t("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}r.utf8encode=function(f){return o.nodebuffer?a.newBufferFrom(f,"utf-8"):function(p){var g,y,m,v,x,_=p.length,S=0;for(v=0;v<_;v++)(64512&(y=p.charCodeAt(v)))==55296&&v+1<_&&(64512&(m=p.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(m-56320),v++),S+=y<128?1:y<2048?2:y<65536?3:4;for(g=o.uint8array?new Uint8Array(S):new Array(S),v=x=0;x<S;v++)(64512&(y=p.charCodeAt(v)))==55296&&v+1<_&&(64512&(m=p.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(m-56320),v++),y<128?g[x++]=y:(y<2048?g[x++]=192|y>>>6:(y<65536?g[x++]=224|y>>>12:(g[x++]=240|y>>>18,g[x++]=128|y>>>12&63),g[x++]=128|y>>>6&63),g[x++]=128|63&y);return g}(f)},r.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(p){var g,y,m,v,x=p.length,_=new Array(2*x);for(g=y=0;g<x;)if((m=p[g++])<128)_[y++]=m;else if(4<(v=c[m]))_[y++]=65533,g+=v-1;else{for(m&=v===2?31:v===3?15:7;1<v&&g<x;)m=m<<6|63&p[g++],v--;1<v?_[y++]=65533:m<65536?_[y++]=m:(m-=65536,_[y++]=55296|m>>10&1023,_[y++]=56320|1023&m)}return _.length!==y&&(_.subarray?_=_.subarray(0,y):_.length=y),s.applyFromCharCode(_)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(d,l),d.prototype.processChunk=function(f){var p=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=function(v,x){var _;for((x=x||v.length)>v.length&&(x=v.length),_=x-1;0<=_&&(192&v[_])==128;)_--;return _<0||_===0?x:_+c[v[_]]>x?_:x}(p),m=p;y!==p.length&&(o.uint8array?(m=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(m=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:r.utf8decode(m),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=d,s.inherits(h,l),h.prototype.processChunk=function(f){this.push({data:r.utf8encode(f.data),meta:f.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,r){var s=t("./support"),o=t("./base64"),a=t("./nodejsUtils"),l=t("./external");function c(g){return g}function u(g,y){for(var m=0;m<g.length;++m)y[m]=255&g.charCodeAt(m);return y}t("setimmediate"),r.newBlob=function(g,y){r.checkSupport("blob");try{return new Blob([g],{type:y})}catch(v){try{var m=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return m.append(g),m.getBlob(y)}catch(x){throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(g,y,m){var v=[],x=0,_=g.length;if(_<=m)return String.fromCharCode.apply(null,g);for(;x<_;)y==="array"||y==="nodebuffer"?v.push(String.fromCharCode.apply(null,g.slice(x,Math.min(x+m,_)))):v.push(String.fromCharCode.apply(null,g.subarray(x,Math.min(x+m,_)))),x+=m;return v.join("")},stringifyByChar:function(g){for(var y="",m=0;m<g.length;m++)y+=String.fromCharCode(g[m]);return y},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch(g){return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch(g){return!1}}()}};function h(g){var y=65536,m=r.getTypeOf(g),v=!0;if(m==="uint8array"?v=d.applyCanBeUsed.uint8array:m==="nodebuffer"&&(v=d.applyCanBeUsed.nodebuffer),v)for(;1<y;)try{return d.stringifyByChunk(g,m,y)}catch(x){y=Math.floor(y/2)}return d.stringifyByChar(g)}function f(g,y){for(var m=0;m<g.length;m++)y[m]=g[m];return y}r.applyFromCharCode=h;var p={};p.string={string:c,array:function(g){return u(g,new Array(g.length))},arraybuffer:function(g){return p.string.uint8array(g).buffer},uint8array:function(g){return u(g,new Uint8Array(g.length))},nodebuffer:function(g){return u(g,a.allocBuffer(g.length))}},p.array={string:h,array:c,arraybuffer:function(g){return new Uint8Array(g).buffer},uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return a.newBufferFrom(g)}},p.arraybuffer={string:function(g){return h(new Uint8Array(g))},array:function(g){return f(new Uint8Array(g),new Array(g.byteLength))},arraybuffer:c,uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return a.newBufferFrom(new Uint8Array(g))}},p.uint8array={string:h,array:function(g){return f(g,new Array(g.length))},arraybuffer:function(g){return g.buffer},uint8array:c,nodebuffer:function(g){return a.newBufferFrom(g)}},p.nodebuffer={string:h,array:function(g){return f(g,new Array(g.length))},arraybuffer:function(g){return p.nodebuffer.uint8array(g).buffer},uint8array:function(g){return f(g,new Uint8Array(g.length))},nodebuffer:c},r.transformTo=function(g,y){if(y=y||"",!g)return y;r.checkSupport(g);var m=r.getTypeOf(y);return p[m][g](y)},r.resolve=function(g){for(var y=g.split("/"),m=[],v=0;v<y.length;v++){var x=y[v];x==="."||x===""&&v!==0&&v!==y.length-1||(x===".."?m.pop():m.push(x))}return m.join("/")},r.getTypeOf=function(g){return typeof g=="string"?"string":Object.prototype.toString.call(g)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(g)?"nodebuffer":s.uint8array&&g instanceof Uint8Array?"uint8array":s.arraybuffer&&g instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(g){if(!s[g.toLowerCase()])throw new Error(g+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(g){var y,m,v="";for(m=0;m<(g||"").length;m++)v+="\\x"+((y=g.charCodeAt(m))<16?"0":"")+y.toString(16).toUpperCase();return v},r.delay=function(g,y,m){setImmediate(function(){g.apply(m||null,y||[])})},r.inherits=function(g,y){function m(){}m.prototype=y.prototype,g.prototype=new m},r.extend=function(){var g,y,m={};for(g=0;g<arguments.length;g++)for(y in arguments[g])Object.prototype.hasOwnProperty.call(arguments[g],y)&&m[y]===void 0&&(m[y]=arguments[g][y]);return m},r.prepareContent=function(g,y,m,v,x){return l.Promise.resolve(y).then(function(_){return s.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(S,E){var A=new FileReader;A.onload=function(R){S(R.target.result)},A.onerror=function(R){E(R.target.error)},A.readAsArrayBuffer(_)}):_}).then(function(_){var S=r.getTypeOf(_);return S?(S==="arraybuffer"?_=r.transformTo("uint8array",_):S==="string"&&(x?_=o.decode(_):m&&v!==!0&&(_=function(E){return u(E,s.uint8array?new Uint8Array(E.length):new Array(E.length))}(_))),_):l.Promise.reject(new Error("Can't read the data of '"+g+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i,r){var s=t("./reader/readerFor"),o=t("./utils"),a=t("./signature"),l=t("./zipEntry"),c=t("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(h)+", expected "+o.pretty(d)+")")}},isSignature:function(d,h){var f=this.reader.index;this.reader.setIndex(d);var p=this.reader.readString(4)===h;return this.reader.setIndex(f),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),h=c.uint8array?"uint8array":"array",f=o.transformTo(h,d);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,h,f,p=this.zip64EndOfCentralSize-44;0<p;)d=this.reader.readInt(2),h=this.reader.readInt(4),f=this.reader.readData(h),this.zip64ExtensibleData[d]={id:d,length:h,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,h;for(d=0;d<this.files.length;d++)h=this.files[d],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var h=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var p=h-f;if(0<p)this.isSignature(h,a.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i,r){var s=t("./reader/readerFor"),o=t("./utils"),a=t("./compressedObject"),l=t("./crc32"),c=t("./utf8"),u=t("./compressions"),d=t("./support");function h(f,p){this.options=f,this.loadOptions=p}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var p,g;if(f.skip(22),this.fileNameLength=f.readInt(2),g=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(g),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=function(y){for(var m in u)if(Object.prototype.hasOwnProperty.call(u,m)&&u[m].magic===y)return u[m];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,p,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var p=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(p),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,y,m=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<m;)p=f.readInt(2),g=f.readInt(2),y=f.readData(g),this.extraFields[p]={id:p,length:g,value:y};f.setIndex(m)},handleUTF8:function(){var f=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var g=o.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var m=o.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(m)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var p=s(f.value);return p.readInt(1)!==1||l(this.fileName)!==p.readInt(4)?null:c.utf8decode(p.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var p=s(f.value);return p.readInt(1)!==1||l(this.fileComment)!==p.readInt(4)?null:c.utf8decode(p.readData(f.length-5))}return null}},i.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i,r){function s(p,g,y){this.name=p,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=g,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var o=t("./stream/StreamHelper"),a=t("./stream/DataWorker"),l=t("./utf8"),c=t("./compressedObject"),u=t("./stream/GenericWorker");s.prototype={internalStream:function(p){var g=null,y="string";try{if(!p)throw new Error("No output type specified.");var m=(y=p.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),g=this._decompressWorker();var v=!this._dataBinary;v&&!m&&(g=g.pipe(new l.Utf8EncodeWorker)),!v&&m&&(g=g.pipe(new l.Utf8DecodeWorker))}catch(x){(g=new u("error")).error(x)}return new o(g,y,"")},async:function(p,g){return this.internalStream(p).accumulate(g)},nodeStream:function(p,g){return this.internalStream(p||"nodebuffer").toNodejsStream(g)},_compressWorker:function(p,g){if(this._data instanceof c&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,p,g)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<d.length;f++)s.prototype[d[f]]=h;i.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i,r){(function(s){var o,a,l=s.MutationObserver||s.WebKitMutationObserver;if(l){var c=0,u=new l(p),d=s.document.createTextNode("");u.observe(d,{characterData:!0}),o=function(){d.data=c=++c%2}}else if(s.setImmediate||s.MessageChannel===void 0)o="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var g=s.document.createElement("script");g.onreadystatechange=function(){p(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},s.document.documentElement.appendChild(g)}:function(){setTimeout(p,0)};else{var h=new s.MessageChannel;h.port1.onmessage=p,o=function(){h.port2.postMessage(0)}}var f=[];function p(){var g,y;a=!0;for(var m=f.length;m;){for(y=f,f=[],g=-1;++g<m;)y[g]();m=f.length}a=!1}i.exports=function(g){f.push(g)!==1||a||o()}}).call(this,typeof Bc<"u"?Bc:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,i,r){var s=t("immediate");function o(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function d(m){if(typeof m!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,m!==o&&g(this,m)}function h(m,v,x){this.promise=m,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}function f(m,v,x){s(function(){var _;try{_=v(x)}catch(S){return a.reject(m,S)}_===m?a.reject(m,new TypeError("Cannot resolve promise with itself")):a.resolve(m,_)})}function p(m){var v=m&&m.then;if(m&&(typeof m=="object"||typeof m=="function")&&typeof v=="function")return function(){v.apply(m,arguments)}}function g(m,v){var x=!1;function _(A){x||(x=!0,a.reject(m,A))}function S(A){x||(x=!0,a.resolve(m,A))}var E=y(function(){v(S,_)});E.status==="error"&&_(E.value)}function y(m,v){var x={};try{x.value=m(v),x.status="success"}catch(_){x.status="error",x.value=_}return x}(i.exports=d).prototype.finally=function(m){if(typeof m!="function")return this;var v=this.constructor;return this.then(function(x){return v.resolve(m()).then(function(){return x})},function(x){return v.resolve(m()).then(function(){throw x})})},d.prototype.catch=function(m){return this.then(null,m)},d.prototype.then=function(m,v){if(typeof m!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var x=new this.constructor(o);return this.state!==u?f(x,this.state===c?m:v,this.outcome):this.queue.push(new h(x,m,v)),x},h.prototype.callFulfilled=function(m){a.resolve(this.promise,m)},h.prototype.otherCallFulfilled=function(m){f(this.promise,this.onFulfilled,m)},h.prototype.callRejected=function(m){a.reject(this.promise,m)},h.prototype.otherCallRejected=function(m){f(this.promise,this.onRejected,m)},a.resolve=function(m,v){var x=y(p,v);if(x.status==="error")return a.reject(m,x.value);var _=x.value;if(_)g(m,_);else{m.state=c,m.outcome=v;for(var S=-1,E=m.queue.length;++S<E;)m.queue[S].callFulfilled(v)}return m},a.reject=function(m,v){m.state=l,m.outcome=v;for(var x=-1,_=m.queue.length;++x<_;)m.queue[x].callRejected(v);return m},d.resolve=function(m){return m instanceof this?m:a.resolve(new this(o),m)},d.reject=function(m){var v=new this(o);return a.reject(v,m)},d.all=function(m){var v=this;if(Object.prototype.toString.call(m)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=m.length,_=!1;if(!x)return this.resolve([]);for(var S=new Array(x),E=0,A=-1,R=new this(o);++A<x;)w(m[A],A);return R;function w(M,I){v.resolve(M).then(function(L){S[I]=L,++E!==x||_||(_=!0,a.resolve(R,S))},function(L){_||(_=!0,a.reject(R,L))})}},d.race=function(m){var v=this;if(Object.prototype.toString.call(m)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=m.length,_=!1;if(!x)return this.resolve([]);for(var S=-1,E=new this(o);++S<x;)A=m[S],v.resolve(A).then(function(R){_||(_=!0,a.resolve(E,R))},function(R){_||(_=!0,a.reject(E,R))});var A;return E}},{immediate:36}],38:[function(t,i,r){var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),i.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,r){var s=t("./zlib/deflate"),o=t("./utils/common"),a=t("./utils/strings"),l=t("./zlib/messages"),c=t("./zlib/zstream"),u=Object.prototype.toString,d=0,h=-1,f=0,p=8;function g(m){if(!(this instanceof g))return new g(m);this.options=o.assign({level:h,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},m||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var x=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(x!==d)throw new Error(l[x]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var _;if(_=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(x=s.deflateSetDictionary(this.strm,_))!==d)throw new Error(l[x]);this._dict_set=!0}}function y(m,v){var x=new g(v);if(x.push(m,!0),x.err)throw x.msg||l[x.err];return x.result}g.prototype.push=function(m,v){var x,_,S=this.strm,E=this.options.chunkSize;if(this.ended)return!1;_=v===~~v?v:v===!0?4:0,typeof m=="string"?S.input=a.string2buf(m):u.call(m)==="[object ArrayBuffer]"?S.input=new Uint8Array(m):S.input=m,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new o.Buf8(E),S.next_out=0,S.avail_out=E),(x=s.deflate(S,_))!==1&&x!==d)return this.onEnd(x),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(o.shrinkBuf(S.output,S.next_out))):this.onData(o.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&x!==1);return _===4?(x=s.deflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===d):_!==2||(this.onEnd(d),!(S.avail_out=0))},g.prototype.onData=function(m){this.chunks.push(m)},g.prototype.onEnd=function(m){m===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},r.Deflate=g,r.deflate=y,r.deflateRaw=function(m,v){return(v=v||{}).raw=!0,y(m,v)},r.gzip=function(m,v){return(v=v||{}).gzip=!0,y(m,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,r){var s=t("./zlib/inflate"),o=t("./utils/common"),a=t("./utils/strings"),l=t("./zlib/constants"),c=t("./zlib/messages"),u=t("./zlib/zstream"),d=t("./zlib/gzheader"),h=Object.prototype.toString;function f(g){if(!(this instanceof f))return new f(g);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},g||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||g&&g.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var m=s.inflateInit2(this.strm,y.windowBits);if(m!==l.Z_OK)throw new Error(c[m]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function p(g,y){var m=new f(y);if(m.push(g,!0),m.err)throw m.msg||c[m.err];return m.result}f.prototype.push=function(g,y){var m,v,x,_,S,E,A=this.strm,R=this.options.chunkSize,w=this.options.dictionary,M=!1;if(this.ended)return!1;v=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof g=="string"?A.input=a.binstring2buf(g):h.call(g)==="[object ArrayBuffer]"?A.input=new Uint8Array(g):A.input=g,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new o.Buf8(R),A.next_out=0,A.avail_out=R),(m=s.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&w&&(E=typeof w=="string"?a.string2buf(w):h.call(w)==="[object ArrayBuffer]"?new Uint8Array(w):w,m=s.inflateSetDictionary(this.strm,E)),m===l.Z_BUF_ERROR&&M===!0&&(m=l.Z_OK,M=!1),m!==l.Z_STREAM_END&&m!==l.Z_OK)return this.onEnd(m),!(this.ended=!0);A.next_out&&(A.avail_out!==0&&m!==l.Z_STREAM_END&&(A.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(x=a.utf8border(A.output,A.next_out),_=A.next_out-x,S=a.buf2string(A.output,x),A.next_out=_,A.avail_out=R-_,_&&o.arraySet(A.output,A.output,x,_,0),this.onData(S)):this.onData(o.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(M=!0)}while((0<A.avail_in||A.avail_out===0)&&m!==l.Z_STREAM_END);return m===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(m=s.inflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(g){this.chunks.push(g)},f.prototype.onEnd=function(g){g===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},r.Inflate=f,r.inflate=p,r.inflateRaw=function(g,y){return(y=y||{}).raw=!0,p(g,y)},r.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var d in u)u.hasOwnProperty(d)&&(l[d]=u[d])}}return l},r.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var o={arraySet:function(l,c,u,d,h){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+d),h);else for(var f=0;f<d;f++)l[h+f]=c[u+f]},flattenChunks:function(l){var c,u,d,h,f,p;for(c=d=0,u=l.length;c<u;c++)d+=l[c].length;for(p=new Uint8Array(d),c=h=0,u=l.length;c<u;c++)f=l[c],p.set(f,h),h+=f.length;return p}},a={arraySet:function(l,c,u,d,h){for(var f=0;f<d;f++)l[h+f]=c[u+f]},flattenChunks:function(l){return[].concat.apply([],l)}};r.setTyped=function(l){l?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,o)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(s)},{}],42:[function(t,i,r){var s=t("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(d){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(d){a=!1}for(var l=new s.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(d,h){if(h<65537&&(d.subarray&&a||!d.subarray&&o))return String.fromCharCode.apply(null,s.shrinkBuf(d,h));for(var f="",p=0;p<h;p++)f+=String.fromCharCode(d[p]);return f}l[254]=l[254]=1,r.string2buf=function(d){var h,f,p,g,y,m=d.length,v=0;for(g=0;g<m;g++)(64512&(f=d.charCodeAt(g)))==55296&&g+1<m&&(64512&(p=d.charCodeAt(g+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),g++),v+=f<128?1:f<2048?2:f<65536?3:4;for(h=new s.Buf8(v),g=y=0;y<v;g++)(64512&(f=d.charCodeAt(g)))==55296&&g+1<m&&(64512&(p=d.charCodeAt(g+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),g++),f<128?h[y++]=f:(f<2048?h[y++]=192|f>>>6:(f<65536?h[y++]=224|f>>>12:(h[y++]=240|f>>>18,h[y++]=128|f>>>12&63),h[y++]=128|f>>>6&63),h[y++]=128|63&f);return h},r.buf2binstring=function(d){return u(d,d.length)},r.binstring2buf=function(d){for(var h=new s.Buf8(d.length),f=0,p=h.length;f<p;f++)h[f]=d.charCodeAt(f);return h},r.buf2string=function(d,h){var f,p,g,y,m=h||d.length,v=new Array(2*m);for(f=p=0;f<m;)if((g=d[f++])<128)v[p++]=g;else if(4<(y=l[g]))v[p++]=65533,f+=y-1;else{for(g&=y===2?31:y===3?15:7;1<y&&f<m;)g=g<<6|63&d[f++],y--;1<y?v[p++]=65533:g<65536?v[p++]=g:(g-=65536,v[p++]=55296|g>>10&1023,v[p++]=56320|1023&g)}return u(v,p)},r.utf8border=function(d,h){var f;for((h=h||d.length)>d.length&&(h=d.length),f=h-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?h:f+l[d[f]]>h?f:h}},{"./common":41}],43:[function(t,i,r){i.exports=function(s,o,a,l){for(var c=65535&s|0,u=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;u=u+(c=c+o[l++]|0)|0,--d;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(t,i,r){i.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,i,r){var s=function(){for(var o,a=[],l=0;l<256;l++){o=l;for(var c=0;c<8;c++)o=1&o?3988292384^o>>>1:o>>>1;a[l]=o}return a}();i.exports=function(o,a,l,c){var u=s,d=c+l;o^=-1;for(var h=c;h<d;h++)o=o>>>8^u[255&(o^a[h])];return-1^o}},{}],46:[function(t,i,r){var s,o=t("../utils/common"),a=t("./trees"),l=t("./adler32"),c=t("./crc32"),u=t("./messages"),d=0,h=4,f=0,p=-2,g=-1,y=4,m=2,v=8,x=9,_=286,S=30,E=19,A=2*_+1,R=15,w=3,M=258,I=M+w+1,L=42,k=113,T=1,F=2,V=3,Q=4;function ee(b,oe){return b.msg=u[oe],oe}function se(b){return(b<<1)-(4<b?9:0)}function he(b){for(var oe=b.length;0<=--oe;)b[oe]=0}function ie(b){var oe=b.state,J=oe.pending;J>b.avail_out&&(J=b.avail_out),J!==0&&(o.arraySet(b.output,oe.pending_buf,oe.pending_out,J,b.next_out),b.next_out+=J,oe.pending_out+=J,b.total_out+=J,b.avail_out-=J,oe.pending-=J,oe.pending===0&&(oe.pending_out=0))}function re(b,oe){a._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,oe),b.block_start=b.strstart,ie(b.strm)}function be(b,oe){b.pending_buf[b.pending++]=oe}function le(b,oe){b.pending_buf[b.pending++]=oe>>>8&255,b.pending_buf[b.pending++]=255&oe}function fe(b,oe){var J,H,P=b.max_chain_length,U=b.strstart,j=b.prev_length,B=b.nice_match,D=b.strstart>b.w_size-I?b.strstart-(b.w_size-I):0,W=b.window,G=b.w_mask,X=b.prev,ue=b.strstart+M,z=W[U+j-1],C=W[U+j];b.prev_length>=b.good_match&&(P>>=2),B>b.lookahead&&(B=b.lookahead);do if(W[(J=oe)+j]===C&&W[J+j-1]===z&&W[J]===W[U]&&W[++J]===W[U+1]){U+=2,J++;do;while(W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&W[++U]===W[++J]&&U<ue);if(H=M-(ue-U),U=ue-M,j<H){if(b.match_start=oe,B<=(j=H))break;z=W[U+j-1],C=W[U+j]}}while((oe=X[oe&G])>D&&--P!=0);return j<=b.lookahead?j:b.lookahead}function Te(b){var oe,J,H,P,U,j,B,D,W,G,X=b.w_size;do{if(P=b.window_size-b.lookahead-b.strstart,b.strstart>=X+(X-I)){for(o.arraySet(b.window,b.window,X,X,0),b.match_start-=X,b.strstart-=X,b.block_start-=X,oe=J=b.hash_size;H=b.head[--oe],b.head[oe]=X<=H?H-X:0,--J;);for(oe=J=X;H=b.prev[--oe],b.prev[oe]=X<=H?H-X:0,--J;);P+=X}if(b.strm.avail_in===0)break;if(j=b.strm,B=b.window,D=b.strstart+b.lookahead,W=P,G=void 0,G=j.avail_in,W<G&&(G=W),J=G===0?0:(j.avail_in-=G,o.arraySet(B,j.input,j.next_in,G,D),j.state.wrap===1?j.adler=l(j.adler,B,G,D):j.state.wrap===2&&(j.adler=c(j.adler,B,G,D)),j.next_in+=G,j.total_in+=G,G),b.lookahead+=J,b.lookahead+b.insert>=w)for(U=b.strstart-b.insert,b.ins_h=b.window[U],b.ins_h=(b.ins_h<<b.hash_shift^b.window[U+1])&b.hash_mask;b.insert&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[U+w-1])&b.hash_mask,b.prev[U&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=U,U++,b.insert--,!(b.lookahead+b.insert<w)););}while(b.lookahead<I&&b.strm.avail_in!==0)}function Ce(b,oe){for(var J,H;;){if(b.lookahead<I){if(Te(b),b.lookahead<I&&oe===d)return T;if(b.lookahead===0)break}if(J=0,b.lookahead>=w&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+w-1])&b.hash_mask,J=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),J!==0&&b.strstart-J<=b.w_size-I&&(b.match_length=fe(b,J)),b.match_length>=w)if(H=a._tr_tally(b,b.strstart-b.match_start,b.match_length-w),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=w){for(b.match_length--;b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+w-1])&b.hash_mask,J=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart,--b.match_length!=0;);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else H=a._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(H&&(re(b,!1),b.strm.avail_out===0))return T}return b.insert=b.strstart<w-1?b.strstart:w-1,oe===h?(re(b,!0),b.strm.avail_out===0?V:Q):b.last_lit&&(re(b,!1),b.strm.avail_out===0)?T:F}function Ie(b,oe){for(var J,H,P;;){if(b.lookahead<I){if(Te(b),b.lookahead<I&&oe===d)return T;if(b.lookahead===0)break}if(J=0,b.lookahead>=w&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+w-1])&b.hash_mask,J=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),b.prev_length=b.match_length,b.prev_match=b.match_start,b.match_length=w-1,J!==0&&b.prev_length<b.max_lazy_match&&b.strstart-J<=b.w_size-I&&(b.match_length=fe(b,J),b.match_length<=5&&(b.strategy===1||b.match_length===w&&4096<b.strstart-b.match_start)&&(b.match_length=w-1)),b.prev_length>=w&&b.match_length<=b.prev_length){for(P=b.strstart+b.lookahead-w,H=a._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-w),b.lookahead-=b.prev_length-1,b.prev_length-=2;++b.strstart<=P&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+w-1])&b.hash_mask,J=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),--b.prev_length!=0;);if(b.match_available=0,b.match_length=w-1,b.strstart++,H&&(re(b,!1),b.strm.avail_out===0))return T}else if(b.match_available){if((H=a._tr_tally(b,0,b.window[b.strstart-1]))&&re(b,!1),b.strstart++,b.lookahead--,b.strm.avail_out===0)return T}else b.match_available=1,b.strstart++,b.lookahead--}return b.match_available&&(H=a._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0),b.insert=b.strstart<w-1?b.strstart:w-1,oe===h?(re(b,!0),b.strm.avail_out===0?V:Q):b.last_lit&&(re(b,!1),b.strm.avail_out===0)?T:F}function ze(b,oe,J,H,P){this.good_length=b,this.max_lazy=oe,this.nice_length=J,this.max_chain=H,this.func=P}function Be(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*A),this.dyn_dtree=new o.Buf16(2*(2*S+1)),this.bl_tree=new o.Buf16(2*(2*E+1)),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(R+1),this.heap=new o.Buf16(2*_+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*_+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function it(b){var oe;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=m,(oe=b.state).pending=0,oe.pending_out=0,oe.wrap<0&&(oe.wrap=-oe.wrap),oe.status=oe.wrap?L:k,b.adler=oe.wrap===2?0:1,oe.last_flush=d,a._tr_init(oe),f):ee(b,p)}function te(b){var oe=it(b);return oe===f&&function(J){J.window_size=2*J.w_size,he(J.head),J.max_lazy_match=s[J.level].max_lazy,J.good_match=s[J.level].good_length,J.nice_match=s[J.level].nice_length,J.max_chain_length=s[J.level].max_chain,J.strstart=0,J.block_start=0,J.lookahead=0,J.insert=0,J.match_length=J.prev_length=w-1,J.match_available=0,J.ins_h=0}(b.state),oe}function ne(b,oe,J,H,P,U){if(!b)return p;var j=1;if(oe===g&&(oe=6),H<0?(j=0,H=-H):15<H&&(j=2,H-=16),P<1||x<P||J!==v||H<8||15<H||oe<0||9<oe||U<0||y<U)return ee(b,p);H===8&&(H=9);var B=new Be;return(b.state=B).strm=b,B.wrap=j,B.gzhead=null,B.w_bits=H,B.w_size=1<<B.w_bits,B.w_mask=B.w_size-1,B.hash_bits=P+7,B.hash_size=1<<B.hash_bits,B.hash_mask=B.hash_size-1,B.hash_shift=~~((B.hash_bits+w-1)/w),B.window=new o.Buf8(2*B.w_size),B.head=new o.Buf16(B.hash_size),B.prev=new o.Buf16(B.w_size),B.lit_bufsize=1<<P+6,B.pending_buf_size=4*B.lit_bufsize,B.pending_buf=new o.Buf8(B.pending_buf_size),B.d_buf=1*B.lit_bufsize,B.l_buf=3*B.lit_bufsize,B.level=oe,B.strategy=U,B.method=J,te(b)}s=[new ze(0,0,0,0,function(b,oe){var J=65535;for(J>b.pending_buf_size-5&&(J=b.pending_buf_size-5);;){if(b.lookahead<=1){if(Te(b),b.lookahead===0&&oe===d)return T;if(b.lookahead===0)break}b.strstart+=b.lookahead,b.lookahead=0;var H=b.block_start+J;if((b.strstart===0||b.strstart>=H)&&(b.lookahead=b.strstart-H,b.strstart=H,re(b,!1),b.strm.avail_out===0)||b.strstart-b.block_start>=b.w_size-I&&(re(b,!1),b.strm.avail_out===0))return T}return b.insert=0,oe===h?(re(b,!0),b.strm.avail_out===0?V:Q):(b.strstart>b.block_start&&(re(b,!1),b.strm.avail_out),T)}),new ze(4,4,8,4,Ce),new ze(4,5,16,8,Ce),new ze(4,6,32,32,Ce),new ze(4,4,16,16,Ie),new ze(8,16,32,32,Ie),new ze(8,16,128,128,Ie),new ze(8,32,128,256,Ie),new ze(32,128,258,1024,Ie),new ze(32,258,258,4096,Ie)],r.deflateInit=function(b,oe){return ne(b,oe,v,15,8,0)},r.deflateInit2=ne,r.deflateReset=te,r.deflateResetKeep=it,r.deflateSetHeader=function(b,oe){return b&&b.state?b.state.wrap!==2?p:(b.state.gzhead=oe,f):p},r.deflate=function(b,oe){var J,H,P,U;if(!b||!b.state||5<oe||oe<0)return b?ee(b,p):p;if(H=b.state,!b.output||!b.input&&b.avail_in!==0||H.status===666&&oe!==h)return ee(b,b.avail_out===0?-5:p);if(H.strm=b,J=H.last_flush,H.last_flush=oe,H.status===L)if(H.wrap===2)b.adler=0,be(H,31),be(H,139),be(H,8),H.gzhead?(be(H,(H.gzhead.text?1:0)+(H.gzhead.hcrc?2:0)+(H.gzhead.extra?4:0)+(H.gzhead.name?8:0)+(H.gzhead.comment?16:0)),be(H,255&H.gzhead.time),be(H,H.gzhead.time>>8&255),be(H,H.gzhead.time>>16&255),be(H,H.gzhead.time>>24&255),be(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),be(H,255&H.gzhead.os),H.gzhead.extra&&H.gzhead.extra.length&&(be(H,255&H.gzhead.extra.length),be(H,H.gzhead.extra.length>>8&255)),H.gzhead.hcrc&&(b.adler=c(b.adler,H.pending_buf,H.pending,0)),H.gzindex=0,H.status=69):(be(H,0),be(H,0),be(H,0),be(H,0),be(H,0),be(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),be(H,3),H.status=k);else{var j=v+(H.w_bits-8<<4)<<8;j|=(2<=H.strategy||H.level<2?0:H.level<6?1:H.level===6?2:3)<<6,H.strstart!==0&&(j|=32),j+=31-j%31,H.status=k,le(H,j),H.strstart!==0&&(le(H,b.adler>>>16),le(H,65535&b.adler)),b.adler=1}if(H.status===69)if(H.gzhead.extra){for(P=H.pending;H.gzindex<(65535&H.gzhead.extra.length)&&(H.pending!==H.pending_buf_size||(H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),ie(b),P=H.pending,H.pending!==H.pending_buf_size));)be(H,255&H.gzhead.extra[H.gzindex]),H.gzindex++;H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),H.gzindex===H.gzhead.extra.length&&(H.gzindex=0,H.status=73)}else H.status=73;if(H.status===73)if(H.gzhead.name){P=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),ie(b),P=H.pending,H.pending===H.pending_buf_size)){U=1;break}U=H.gzindex<H.gzhead.name.length?255&H.gzhead.name.charCodeAt(H.gzindex++):0,be(H,U)}while(U!==0);H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),U===0&&(H.gzindex=0,H.status=91)}else H.status=91;if(H.status===91)if(H.gzhead.comment){P=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),ie(b),P=H.pending,H.pending===H.pending_buf_size)){U=1;break}U=H.gzindex<H.gzhead.comment.length?255&H.gzhead.comment.charCodeAt(H.gzindex++):0,be(H,U)}while(U!==0);H.gzhead.hcrc&&H.pending>P&&(b.adler=c(b.adler,H.pending_buf,H.pending-P,P)),U===0&&(H.status=103)}else H.status=103;if(H.status===103&&(H.gzhead.hcrc?(H.pending+2>H.pending_buf_size&&ie(b),H.pending+2<=H.pending_buf_size&&(be(H,255&b.adler),be(H,b.adler>>8&255),b.adler=0,H.status=k)):H.status=k),H.pending!==0){if(ie(b),b.avail_out===0)return H.last_flush=-1,f}else if(b.avail_in===0&&se(oe)<=se(J)&&oe!==h)return ee(b,-5);if(H.status===666&&b.avail_in!==0)return ee(b,-5);if(b.avail_in!==0||H.lookahead!==0||oe!==d&&H.status!==666){var B=H.strategy===2?function(D,W){for(var G;;){if(D.lookahead===0&&(Te(D),D.lookahead===0)){if(W===d)return T;break}if(D.match_length=0,G=a._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,G&&(re(D,!1),D.strm.avail_out===0))return T}return D.insert=0,W===h?(re(D,!0),D.strm.avail_out===0?V:Q):D.last_lit&&(re(D,!1),D.strm.avail_out===0)?T:F}(H,oe):H.strategy===3?function(D,W){for(var G,X,ue,z,C=D.window;;){if(D.lookahead<=M){if(Te(D),D.lookahead<=M&&W===d)return T;if(D.lookahead===0)break}if(D.match_length=0,D.lookahead>=w&&0<D.strstart&&(X=C[ue=D.strstart-1])===C[++ue]&&X===C[++ue]&&X===C[++ue]){z=D.strstart+M;do;while(X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&X===C[++ue]&&ue<z);D.match_length=M-(z-ue),D.match_length>D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=w?(G=a._tr_tally(D,1,D.match_length-w),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(G=a._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),G&&(re(D,!1),D.strm.avail_out===0))return T}return D.insert=0,W===h?(re(D,!0),D.strm.avail_out===0?V:Q):D.last_lit&&(re(D,!1),D.strm.avail_out===0)?T:F}(H,oe):s[H.level].func(H,oe);if(B!==V&&B!==Q||(H.status=666),B===T||B===V)return b.avail_out===0&&(H.last_flush=-1),f;if(B===F&&(oe===1?a._tr_align(H):oe!==5&&(a._tr_stored_block(H,0,0,!1),oe===3&&(he(H.head),H.lookahead===0&&(H.strstart=0,H.block_start=0,H.insert=0))),ie(b),b.avail_out===0))return H.last_flush=-1,f}return oe!==h?f:H.wrap<=0?1:(H.wrap===2?(be(H,255&b.adler),be(H,b.adler>>8&255),be(H,b.adler>>16&255),be(H,b.adler>>24&255),be(H,255&b.total_in),be(H,b.total_in>>8&255),be(H,b.total_in>>16&255),be(H,b.total_in>>24&255)):(le(H,b.adler>>>16),le(H,65535&b.adler)),ie(b),0<H.wrap&&(H.wrap=-H.wrap),H.pending!==0?f:1)},r.deflateEnd=function(b){var oe;return b&&b.state?(oe=b.state.status)!==L&&oe!==69&&oe!==73&&oe!==91&&oe!==103&&oe!==k&&oe!==666?ee(b,p):(b.state=null,oe===k?ee(b,-3):f):p},r.deflateSetDictionary=function(b,oe){var J,H,P,U,j,B,D,W,G=oe.length;if(!b||!b.state||(U=(J=b.state).wrap)===2||U===1&&J.status!==L||J.lookahead)return p;for(U===1&&(b.adler=l(b.adler,oe,G,0)),J.wrap=0,G>=J.w_size&&(U===0&&(he(J.head),J.strstart=0,J.block_start=0,J.insert=0),W=new o.Buf8(J.w_size),o.arraySet(W,oe,G-J.w_size,J.w_size,0),oe=W,G=J.w_size),j=b.avail_in,B=b.next_in,D=b.input,b.avail_in=G,b.next_in=0,b.input=oe,Te(J);J.lookahead>=w;){for(H=J.strstart,P=J.lookahead-(w-1);J.ins_h=(J.ins_h<<J.hash_shift^J.window[H+w-1])&J.hash_mask,J.prev[H&J.w_mask]=J.head[J.ins_h],J.head[J.ins_h]=H,H++,--P;);J.strstart=H,J.lookahead=w-1,Te(J)}return J.strstart+=J.lookahead,J.block_start=J.strstart,J.insert=J.lookahead,J.lookahead=0,J.match_length=J.prev_length=w-1,J.match_available=0,b.next_in=B,b.input=D,b.avail_in=j,J.wrap=U,f},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i,r){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,i,r){i.exports=function(s,o){var a,l,c,u,d,h,f,p,g,y,m,v,x,_,S,E,A,R,w,M,I,L,k,T,F;a=s.state,l=s.next_in,T=s.input,c=l+(s.avail_in-5),u=s.next_out,F=s.output,d=u-(o-s.avail_out),h=u+(s.avail_out-257),f=a.dmax,p=a.wsize,g=a.whave,y=a.wnext,m=a.window,v=a.hold,x=a.bits,_=a.lencode,S=a.distcode,E=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{x<15&&(v+=T[l++]<<x,x+=8,v+=T[l++]<<x,x+=8),R=_[v&E];t:for(;;){if(v>>>=w=R>>>24,x-=w,(w=R>>>16&255)===0)F[u++]=65535&R;else{if(!(16&w)){if((64&w)==0){R=_[(65535&R)+(v&(1<<w)-1)];continue t}if(32&w){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}M=65535&R,(w&=15)&&(x<w&&(v+=T[l++]<<x,x+=8),M+=v&(1<<w)-1,v>>>=w,x-=w),x<15&&(v+=T[l++]<<x,x+=8,v+=T[l++]<<x,x+=8),R=S[v&A];n:for(;;){if(v>>>=w=R>>>24,x-=w,!(16&(w=R>>>16&255))){if((64&w)==0){R=S[(65535&R)+(v&(1<<w)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(I=65535&R,x<(w&=15)&&(v+=T[l++]<<x,(x+=8)<w&&(v+=T[l++]<<x,x+=8)),f<(I+=v&(1<<w)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=w,x-=w,(w=u-d)<I){if(g<(w=I-w)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(k=m,(L=0)===y){if(L+=p-w,w<M){for(M-=w;F[u++]=m[L++],--w;);L=u-I,k=F}}else if(y<w){if(L+=p+y-w,(w-=y)<M){for(M-=w;F[u++]=m[L++],--w;);if(L=0,y<M){for(M-=w=y;F[u++]=m[L++],--w;);L=u-I,k=F}}}else if(L+=y-w,w<M){for(M-=w;F[u++]=m[L++],--w;);L=u-I,k=F}for(;2<M;)F[u++]=k[L++],F[u++]=k[L++],F[u++]=k[L++],M-=3;M&&(F[u++]=k[L++],1<M&&(F[u++]=k[L++]))}else{for(L=u-I;F[u++]=F[L++],F[u++]=F[L++],F[u++]=F[L++],2<(M-=3););M&&(F[u++]=F[L++],1<M&&(F[u++]=F[L++]))}break}}break}}while(l<c&&u<h);l-=M=x>>3,v&=(1<<(x-=M<<3))-1,s.next_in=l,s.next_out=u,s.avail_in=l<c?c-l+5:5-(l-c),s.avail_out=u<h?h-u+257:257-(u-h),a.hold=v,a.bits=x}},{}],49:[function(t,i,r){var s=t("../utils/common"),o=t("./adler32"),a=t("./crc32"),l=t("./inffast"),c=t("./inftrees"),u=1,d=2,h=0,f=-2,p=1,g=852,y=592;function m(L){return(L>>>24&255)+(L>>>8&65280)+((65280&L)<<8)+((255&L)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(L){var k;return L&&L.state?(k=L.state,L.total_in=L.total_out=k.total=0,L.msg="",k.wrap&&(L.adler=1&k.wrap),k.mode=p,k.last=0,k.havedict=0,k.dmax=32768,k.head=null,k.hold=0,k.bits=0,k.lencode=k.lendyn=new s.Buf32(g),k.distcode=k.distdyn=new s.Buf32(y),k.sane=1,k.back=-1,h):f}function _(L){var k;return L&&L.state?((k=L.state).wsize=0,k.whave=0,k.wnext=0,x(L)):f}function S(L,k){var T,F;return L&&L.state?(F=L.state,k<0?(T=0,k=-k):(T=1+(k>>4),k<48&&(k&=15)),k&&(k<8||15<k)?f:(F.window!==null&&F.wbits!==k&&(F.window=null),F.wrap=T,F.wbits=k,_(L))):f}function E(L,k){var T,F;return L?(F=new v,(L.state=F).window=null,(T=S(L,k))!==h&&(L.state=null),T):f}var A,R,w=!0;function M(L){if(w){var k;for(A=new s.Buf32(512),R=new s.Buf32(32),k=0;k<144;)L.lens[k++]=8;for(;k<256;)L.lens[k++]=9;for(;k<280;)L.lens[k++]=7;for(;k<288;)L.lens[k++]=8;for(c(u,L.lens,0,288,A,0,L.work,{bits:9}),k=0;k<32;)L.lens[k++]=5;c(d,L.lens,0,32,R,0,L.work,{bits:5}),w=!1}L.lencode=A,L.lenbits=9,L.distcode=R,L.distbits=5}function I(L,k,T,F){var V,Q=L.state;return Q.window===null&&(Q.wsize=1<<Q.wbits,Q.wnext=0,Q.whave=0,Q.window=new s.Buf8(Q.wsize)),F>=Q.wsize?(s.arraySet(Q.window,k,T-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(F<(V=Q.wsize-Q.wnext)&&(V=F),s.arraySet(Q.window,k,T-F,V,Q.wnext),(F-=V)?(s.arraySet(Q.window,k,T-F,F,0),Q.wnext=F,Q.whave=Q.wsize):(Q.wnext+=V,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave<Q.wsize&&(Q.whave+=V))),0}r.inflateReset=_,r.inflateReset2=S,r.inflateResetKeep=x,r.inflateInit=function(L){return E(L,15)},r.inflateInit2=E,r.inflate=function(L,k){var T,F,V,Q,ee,se,he,ie,re,be,le,fe,Te,Ce,Ie,ze,Be,it,te,ne,b,oe,J,H,P=0,U=new s.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!L||!L.state||!L.output||!L.input&&L.avail_in!==0)return f;(T=L.state).mode===12&&(T.mode=13),ee=L.next_out,V=L.output,he=L.avail_out,Q=L.next_in,F=L.input,se=L.avail_in,ie=T.hold,re=T.bits,be=se,le=he,oe=h;e:for(;;)switch(T.mode){case p:if(T.wrap===0){T.mode=13;break}for(;re<16;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(2&T.wrap&&ie===35615){U[T.check=0]=255&ie,U[1]=ie>>>8&255,T.check=a(T.check,U,2,0),re=ie=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&ie)<<8)+(ie>>8))%31){L.msg="incorrect header check",T.mode=30;break}if((15&ie)!=8){L.msg="unknown compression method",T.mode=30;break}if(re-=4,b=8+(15&(ie>>>=4)),T.wbits===0)T.wbits=b;else if(b>T.wbits){L.msg="invalid window size",T.mode=30;break}T.dmax=1<<b,L.adler=T.check=1,T.mode=512&ie?10:12,re=ie=0;break;case 2:for(;re<16;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(T.flags=ie,(255&T.flags)!=8){L.msg="unknown compression method",T.mode=30;break}if(57344&T.flags){L.msg="unknown header flags set",T.mode=30;break}T.head&&(T.head.text=ie>>8&1),512&T.flags&&(U[0]=255&ie,U[1]=ie>>>8&255,T.check=a(T.check,U,2,0)),re=ie=0,T.mode=3;case 3:for(;re<32;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.head&&(T.head.time=ie),512&T.flags&&(U[0]=255&ie,U[1]=ie>>>8&255,U[2]=ie>>>16&255,U[3]=ie>>>24&255,T.check=a(T.check,U,4,0)),re=ie=0,T.mode=4;case 4:for(;re<16;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.head&&(T.head.xflags=255&ie,T.head.os=ie>>8),512&T.flags&&(U[0]=255&ie,U[1]=ie>>>8&255,T.check=a(T.check,U,2,0)),re=ie=0,T.mode=5;case 5:if(1024&T.flags){for(;re<16;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.length=ie,T.head&&(T.head.extra_len=ie),512&T.flags&&(U[0]=255&ie,U[1]=ie>>>8&255,T.check=a(T.check,U,2,0)),re=ie=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(se<(fe=T.length)&&(fe=se),fe&&(T.head&&(b=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),s.arraySet(T.head.extra,F,Q,fe,b)),512&T.flags&&(T.check=a(T.check,F,fe,Q)),se-=fe,Q+=fe,T.length-=fe),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(se===0)break e;for(fe=0;b=F[Q+fe++],T.head&&b&&T.length<65536&&(T.head.name+=String.fromCharCode(b)),b&&fe<se;);if(512&T.flags&&(T.check=a(T.check,F,fe,Q)),se-=fe,Q+=fe,b)break e}else T.head&&(T.head.name=null);T.length=0,T.mode=8;case 8:if(4096&T.flags){if(se===0)break e;for(fe=0;b=F[Q+fe++],T.head&&b&&T.length<65536&&(T.head.comment+=String.fromCharCode(b)),b&&fe<se;);if(512&T.flags&&(T.check=a(T.check,F,fe,Q)),se-=fe,Q+=fe,b)break e}else T.head&&(T.head.comment=null);T.mode=9;case 9:if(512&T.flags){for(;re<16;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(ie!==(65535&T.check)){L.msg="header crc mismatch",T.mode=30;break}re=ie=0}T.head&&(T.head.hcrc=T.flags>>9&1,T.head.done=!0),L.adler=T.check=0,T.mode=12;break;case 10:for(;re<32;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}L.adler=T.check=m(ie),re=ie=0,T.mode=11;case 11:if(T.havedict===0)return L.next_out=ee,L.avail_out=he,L.next_in=Q,L.avail_in=se,T.hold=ie,T.bits=re,2;L.adler=T.check=1,T.mode=12;case 12:if(k===5||k===6)break e;case 13:if(T.last){ie>>>=7&re,re-=7&re,T.mode=27;break}for(;re<3;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}switch(T.last=1&ie,re-=1,3&(ie>>>=1)){case 0:T.mode=14;break;case 1:if(M(T),T.mode=20,k!==6)break;ie>>>=2,re-=2;break e;case 2:T.mode=17;break;case 3:L.msg="invalid block type",T.mode=30}ie>>>=2,re-=2;break;case 14:for(ie>>>=7&re,re-=7&re;re<32;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if((65535&ie)!=(ie>>>16^65535)){L.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&ie,re=ie=0,T.mode=15,k===6)break e;case 15:T.mode=16;case 16:if(fe=T.length){if(se<fe&&(fe=se),he<fe&&(fe=he),fe===0)break e;s.arraySet(V,F,Q,fe,ee),se-=fe,Q+=fe,he-=fe,ee+=fe,T.length-=fe;break}T.mode=12;break;case 17:for(;re<14;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(T.nlen=257+(31&ie),ie>>>=5,re-=5,T.ndist=1+(31&ie),ie>>>=5,re-=5,T.ncode=4+(15&ie),ie>>>=4,re-=4,286<T.nlen||30<T.ndist){L.msg="too many length or distance symbols",T.mode=30;break}T.have=0,T.mode=18;case 18:for(;T.have<T.ncode;){for(;re<3;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.lens[j[T.have++]]=7&ie,ie>>>=3,re-=3}for(;T.have<19;)T.lens[j[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,J={bits:T.lenbits},oe=c(0,T.lens,0,19,T.lencode,0,T.work,J),T.lenbits=J.bits,oe){L.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have<T.nlen+T.ndist;){for(;ze=(P=T.lencode[ie&(1<<T.lenbits)-1])>>>16&255,Be=65535&P,!((Ie=P>>>24)<=re);){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(Be<16)ie>>>=Ie,re-=Ie,T.lens[T.have++]=Be;else{if(Be===16){for(H=Ie+2;re<H;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(ie>>>=Ie,re-=Ie,T.have===0){L.msg="invalid bit length repeat",T.mode=30;break}b=T.lens[T.have-1],fe=3+(3&ie),ie>>>=2,re-=2}else if(Be===17){for(H=Ie+3;re<H;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}re-=Ie,b=0,fe=3+(7&(ie>>>=Ie)),ie>>>=3,re-=3}else{for(H=Ie+7;re<H;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}re-=Ie,b=0,fe=11+(127&(ie>>>=Ie)),ie>>>=7,re-=7}if(T.have+fe>T.nlen+T.ndist){L.msg="invalid bit length repeat",T.mode=30;break}for(;fe--;)T.lens[T.have++]=b}}if(T.mode===30)break;if(T.lens[256]===0){L.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,J={bits:T.lenbits},oe=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,J),T.lenbits=J.bits,oe){L.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,J={bits:T.distbits},oe=c(d,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,J),T.distbits=J.bits,oe){L.msg="invalid distances set",T.mode=30;break}if(T.mode=20,k===6)break e;case 20:T.mode=21;case 21:if(6<=se&&258<=he){L.next_out=ee,L.avail_out=he,L.next_in=Q,L.avail_in=se,T.hold=ie,T.bits=re,l(L,le),ee=L.next_out,V=L.output,he=L.avail_out,Q=L.next_in,F=L.input,se=L.avail_in,ie=T.hold,re=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;ze=(P=T.lencode[ie&(1<<T.lenbits)-1])>>>16&255,Be=65535&P,!((Ie=P>>>24)<=re);){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(ze&&(240&ze)==0){for(it=Ie,te=ze,ne=Be;ze=(P=T.lencode[ne+((ie&(1<<it+te)-1)>>it)])>>>16&255,Be=65535&P,!(it+(Ie=P>>>24)<=re);){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}ie>>>=it,re-=it,T.back+=it}if(ie>>>=Ie,re-=Ie,T.back+=Ie,T.length=Be,ze===0){T.mode=26;break}if(32&ze){T.back=-1,T.mode=12;break}if(64&ze){L.msg="invalid literal/length code",T.mode=30;break}T.extra=15&ze,T.mode=22;case 22:if(T.extra){for(H=T.extra;re<H;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.length+=ie&(1<<T.extra)-1,ie>>>=T.extra,re-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;ze=(P=T.distcode[ie&(1<<T.distbits)-1])>>>16&255,Be=65535&P,!((Ie=P>>>24)<=re);){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if((240&ze)==0){for(it=Ie,te=ze,ne=Be;ze=(P=T.distcode[ne+((ie&(1<<it+te)-1)>>it)])>>>16&255,Be=65535&P,!(it+(Ie=P>>>24)<=re);){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}ie>>>=it,re-=it,T.back+=it}if(ie>>>=Ie,re-=Ie,T.back+=Ie,64&ze){L.msg="invalid distance code",T.mode=30;break}T.offset=Be,T.extra=15&ze,T.mode=24;case 24:if(T.extra){for(H=T.extra;re<H;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}T.offset+=ie&(1<<T.extra)-1,ie>>>=T.extra,re-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){L.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(he===0)break e;if(fe=le-he,T.offset>fe){if((fe=T.offset-fe)>T.whave&&T.sane){L.msg="invalid distance too far back",T.mode=30;break}Te=fe>T.wnext?(fe-=T.wnext,T.wsize-fe):T.wnext-fe,fe>T.length&&(fe=T.length),Ce=T.window}else Ce=V,Te=ee-T.offset,fe=T.length;for(he<fe&&(fe=he),he-=fe,T.length-=fe;V[ee++]=Ce[Te++],--fe;);T.length===0&&(T.mode=21);break;case 26:if(he===0)break e;V[ee++]=T.length,he--,T.mode=21;break;case 27:if(T.wrap){for(;re<32;){if(se===0)break e;se--,ie|=F[Q++]<<re,re+=8}if(le-=he,L.total_out+=le,T.total+=le,le&&(L.adler=T.check=T.flags?a(T.check,V,le,ee-le):o(T.check,V,le,ee-le)),le=he,(T.flags?ie:m(ie))!==T.check){L.msg="incorrect data check",T.mode=30;break}re=ie=0}T.mode=28;case 28:if(T.wrap&&T.flags){for(;re<32;){if(se===0)break e;se--,ie+=F[Q++]<<re,re+=8}if(ie!==(4294967295&T.total)){L.msg="incorrect length check",T.mode=30;break}re=ie=0}T.mode=29;case 29:oe=1;break e;case 30:oe=-3;break e;case 31:return-4;case 32:default:return f}return L.next_out=ee,L.avail_out=he,L.next_in=Q,L.avail_in=se,T.hold=ie,T.bits=re,(T.wsize||le!==L.avail_out&&T.mode<30&&(T.mode<27||k!==4))&&I(L,L.output,L.next_out,le-L.avail_out)?(T.mode=31,-4):(be-=L.avail_in,le-=L.avail_out,L.total_in+=be,L.total_out+=le,T.total+=le,T.wrap&&le&&(L.adler=T.check=T.flags?a(T.check,V,le,L.next_out-le):o(T.check,V,le,L.next_out-le)),L.data_type=T.bits+(T.last?64:0)+(T.mode===12?128:0)+(T.mode===20||T.mode===15?256:0),(be==0&&le===0||k===4)&&oe===h&&(oe=-5),oe)},r.inflateEnd=function(L){if(!L||!L.state)return f;var k=L.state;return k.window&&(k.window=null),L.state=null,h},r.inflateGetHeader=function(L,k){var T;return L&&L.state?(2&(T=L.state).wrap)==0?f:((T.head=k).done=!1,h):f},r.inflateSetDictionary=function(L,k){var T,F=k.length;return L&&L.state?(T=L.state).wrap!==0&&T.mode!==11?f:T.mode===11&&o(1,k,F,0)!==T.check?-3:I(L,k,F,F)?(T.mode=31,-4):(T.havedict=1,h):f},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i,r){var s=t("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(u,d,h,f,p,g,y,m){var v,x,_,S,E,A,R,w,M,I=m.bits,L=0,k=0,T=0,F=0,V=0,Q=0,ee=0,se=0,he=0,ie=0,re=null,be=0,le=new s.Buf16(16),fe=new s.Buf16(16),Te=null,Ce=0;for(L=0;L<=15;L++)le[L]=0;for(k=0;k<f;k++)le[d[h+k]]++;for(V=I,F=15;1<=F&&le[F]===0;F--);if(F<V&&(V=F),F===0)return p[g++]=20971520,p[g++]=20971520,m.bits=1,0;for(T=1;T<F&&le[T]===0;T++);for(V<T&&(V=T),L=se=1;L<=15;L++)if(se<<=1,(se-=le[L])<0)return-1;if(0<se&&(u===0||F!==1))return-1;for(fe[1]=0,L=1;L<15;L++)fe[L+1]=fe[L]+le[L];for(k=0;k<f;k++)d[h+k]!==0&&(y[fe[d[h+k]]++]=k);if(A=u===0?(re=Te=y,19):u===1?(re=o,be-=257,Te=a,Ce-=257,256):(re=l,Te=c,-1),L=T,E=g,ee=k=ie=0,_=-1,S=(he=1<<(Q=V))-1,u===1&&852<he||u===2&&592<he)return 1;for(;;){for(R=L-ee,M=y[k]<A?(w=0,y[k]):y[k]>A?(w=Te[Ce+y[k]],re[be+y[k]]):(w=96,0),v=1<<L-ee,T=x=1<<Q;p[E+(ie>>ee)+(x-=v)]=R<<24|w<<16|M|0,x!==0;);for(v=1<<L-1;ie&v;)v>>=1;if(v!==0?(ie&=v-1,ie+=v):ie=0,k++,--le[L]==0){if(L===F)break;L=d[h+y[k]]}if(V<L&&(ie&S)!==_){for(ee===0&&(ee=V),E+=T,se=1<<(Q=L-ee);Q+ee<F&&!((se-=le[Q+ee])<=0);)Q++,se<<=1;if(he+=1<<Q,u===1&&852<he||u===2&&592<he)return 1;p[_=ie&S]=V<<24|Q<<16|E-g|0}}return ie!==0&&(p[E+ie]=L-ee<<24|64<<16|0),m.bits=V,0}},{"../utils/common":41}],51:[function(t,i,r){i.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,i,r){var s=t("../utils/common"),o=0,a=1;function l(P){for(var U=P.length;0<=--U;)P[U]=0}var c=0,u=29,d=256,h=d+1+u,f=30,p=19,g=2*h+1,y=15,m=16,v=7,x=256,_=16,S=17,E=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],R=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(h+2));l(I);var L=new Array(2*f);l(L);var k=new Array(512);l(k);var T=new Array(256);l(T);var F=new Array(u);l(F);var V,Q,ee,se=new Array(f);function he(P,U,j,B,D){this.static_tree=P,this.extra_bits=U,this.extra_base=j,this.elems=B,this.max_length=D,this.has_stree=P&&P.length}function ie(P,U){this.dyn_tree=P,this.max_code=0,this.stat_desc=U}function re(P){return P<256?k[P]:k[256+(P>>>7)]}function be(P,U){P.pending_buf[P.pending++]=255&U,P.pending_buf[P.pending++]=U>>>8&255}function le(P,U,j){P.bi_valid>m-j?(P.bi_buf|=U<<P.bi_valid&65535,be(P,P.bi_buf),P.bi_buf=U>>m-P.bi_valid,P.bi_valid+=j-m):(P.bi_buf|=U<<P.bi_valid&65535,P.bi_valid+=j)}function fe(P,U,j){le(P,j[2*U],j[2*U+1])}function Te(P,U){for(var j=0;j|=1&P,P>>>=1,j<<=1,0<--U;);return j>>>1}function Ce(P,U,j){var B,D,W=new Array(y+1),G=0;for(B=1;B<=y;B++)W[B]=G=G+j[B-1]<<1;for(D=0;D<=U;D++){var X=P[2*D+1];X!==0&&(P[2*D]=Te(W[X]++,X))}}function Ie(P){var U;for(U=0;U<h;U++)P.dyn_ltree[2*U]=0;for(U=0;U<f;U++)P.dyn_dtree[2*U]=0;for(U=0;U<p;U++)P.bl_tree[2*U]=0;P.dyn_ltree[2*x]=1,P.opt_len=P.static_len=0,P.last_lit=P.matches=0}function ze(P){8<P.bi_valid?be(P,P.bi_buf):0<P.bi_valid&&(P.pending_buf[P.pending++]=P.bi_buf),P.bi_buf=0,P.bi_valid=0}function Be(P,U,j,B){var D=2*U,W=2*j;return P[D]<P[W]||P[D]===P[W]&&B[U]<=B[j]}function it(P,U,j){for(var B=P.heap[j],D=j<<1;D<=P.heap_len&&(D<P.heap_len&&Be(U,P.heap[D+1],P.heap[D],P.depth)&&D++,!Be(U,B,P.heap[D],P.depth));)P.heap[j]=P.heap[D],j=D,D<<=1;P.heap[j]=B}function te(P,U,j){var B,D,W,G,X=0;if(P.last_lit!==0)for(;B=P.pending_buf[P.d_buf+2*X]<<8|P.pending_buf[P.d_buf+2*X+1],D=P.pending_buf[P.l_buf+X],X++,B===0?fe(P,D,U):(fe(P,(W=T[D])+d+1,U),(G=A[W])!==0&&le(P,D-=F[W],G),fe(P,W=re(--B),j),(G=R[W])!==0&&le(P,B-=se[W],G)),X<P.last_lit;);fe(P,x,U)}function ne(P,U){var j,B,D,W=U.dyn_tree,G=U.stat_desc.static_tree,X=U.stat_desc.has_stree,ue=U.stat_desc.elems,z=-1;for(P.heap_len=0,P.heap_max=g,j=0;j<ue;j++)W[2*j]!==0?(P.heap[++P.heap_len]=z=j,P.depth[j]=0):W[2*j+1]=0;for(;P.heap_len<2;)W[2*(D=P.heap[++P.heap_len]=z<2?++z:0)]=1,P.depth[D]=0,P.opt_len--,X&&(P.static_len-=G[2*D+1]);for(U.max_code=z,j=P.heap_len>>1;1<=j;j--)it(P,W,j);for(D=ue;j=P.heap[1],P.heap[1]=P.heap[P.heap_len--],it(P,W,1),B=P.heap[1],P.heap[--P.heap_max]=j,P.heap[--P.heap_max]=B,W[2*D]=W[2*j]+W[2*B],P.depth[D]=(P.depth[j]>=P.depth[B]?P.depth[j]:P.depth[B])+1,W[2*j+1]=W[2*B+1]=D,P.heap[1]=D++,it(P,W,1),2<=P.heap_len;);P.heap[--P.heap_max]=P.heap[1],function(C,N){var q,Z,$,ae,ke,Le,Ve=N.dyn_tree,Je=N.max_code,st=N.stat_desc.static_tree,pe=N.stat_desc.has_stree,Ze=N.stat_desc.extra_bits,we=N.stat_desc.extra_base,De=N.stat_desc.max_length,Ke=0;for(ae=0;ae<=y;ae++)C.bl_count[ae]=0;for(Ve[2*C.heap[C.heap_max]+1]=0,q=C.heap_max+1;q<g;q++)De<(ae=Ve[2*Ve[2*(Z=C.heap[q])+1]+1]+1)&&(ae=De,Ke++),Ve[2*Z+1]=ae,Je<Z||(C.bl_count[ae]++,ke=0,we<=Z&&(ke=Ze[Z-we]),Le=Ve[2*Z],C.opt_len+=Le*(ae+ke),pe&&(C.static_len+=Le*(st[2*Z+1]+ke)));if(Ke!==0){do{for(ae=De-1;C.bl_count[ae]===0;)ae--;C.bl_count[ae]--,C.bl_count[ae+1]+=2,C.bl_count[De]--,Ke-=2}while(0<Ke);for(ae=De;ae!==0;ae--)for(Z=C.bl_count[ae];Z!==0;)Je<($=C.heap[--q])||(Ve[2*$+1]!==ae&&(C.opt_len+=(ae-Ve[2*$+1])*Ve[2*$],Ve[2*$+1]=ae),Z--)}}(P,U),Ce(W,z,P.bl_count)}function b(P,U,j){var B,D,W=-1,G=U[1],X=0,ue=7,z=4;for(G===0&&(ue=138,z=3),U[2*(j+1)+1]=65535,B=0;B<=j;B++)D=G,G=U[2*(B+1)+1],++X<ue&&D===G||(X<z?P.bl_tree[2*D]+=X:D!==0?(D!==W&&P.bl_tree[2*D]++,P.bl_tree[2*_]++):X<=10?P.bl_tree[2*S]++:P.bl_tree[2*E]++,W=D,z=(X=0)===G?(ue=138,3):D===G?(ue=6,3):(ue=7,4))}function oe(P,U,j){var B,D,W=-1,G=U[1],X=0,ue=7,z=4;for(G===0&&(ue=138,z=3),B=0;B<=j;B++)if(D=G,G=U[2*(B+1)+1],!(++X<ue&&D===G)){if(X<z)for(;fe(P,D,P.bl_tree),--X!=0;);else D!==0?(D!==W&&(fe(P,D,P.bl_tree),X--),fe(P,_,P.bl_tree),le(P,X-3,2)):X<=10?(fe(P,S,P.bl_tree),le(P,X-3,3)):(fe(P,E,P.bl_tree),le(P,X-11,7));W=D,z=(X=0)===G?(ue=138,3):D===G?(ue=6,3):(ue=7,4)}}l(se);var J=!1;function H(P,U,j,B){le(P,(c<<1)+(B?1:0),3),function(D,W,G,X){ze(D),be(D,G),be(D,~G),s.arraySet(D.pending_buf,D.window,W,G,D.pending),D.pending+=G}(P,U,j)}r._tr_init=function(P){J||(function(){var U,j,B,D,W,G=new Array(y+1);for(D=B=0;D<u-1;D++)for(F[D]=B,U=0;U<1<<A[D];U++)T[B++]=D;for(T[B-1]=D,D=W=0;D<16;D++)for(se[D]=W,U=0;U<1<<R[D];U++)k[W++]=D;for(W>>=7;D<f;D++)for(se[D]=W<<7,U=0;U<1<<R[D]-7;U++)k[256+W++]=D;for(j=0;j<=y;j++)G[j]=0;for(U=0;U<=143;)I[2*U+1]=8,U++,G[8]++;for(;U<=255;)I[2*U+1]=9,U++,G[9]++;for(;U<=279;)I[2*U+1]=7,U++,G[7]++;for(;U<=287;)I[2*U+1]=8,U++,G[8]++;for(Ce(I,h+1,G),U=0;U<f;U++)L[2*U+1]=5,L[2*U]=Te(U,5);V=new he(I,A,d+1,h,y),Q=new he(L,R,0,f,y),ee=new he(new Array(0),w,0,p,v)}(),J=!0),P.l_desc=new ie(P.dyn_ltree,V),P.d_desc=new ie(P.dyn_dtree,Q),P.bl_desc=new ie(P.bl_tree,ee),P.bi_buf=0,P.bi_valid=0,Ie(P)},r._tr_stored_block=H,r._tr_flush_block=function(P,U,j,B){var D,W,G=0;0<P.level?(P.strm.data_type===2&&(P.strm.data_type=function(X){var ue,z=4093624447;for(ue=0;ue<=31;ue++,z>>>=1)if(1&z&&X.dyn_ltree[2*ue]!==0)return o;if(X.dyn_ltree[18]!==0||X.dyn_ltree[20]!==0||X.dyn_ltree[26]!==0)return a;for(ue=32;ue<d;ue++)if(X.dyn_ltree[2*ue]!==0)return a;return o}(P)),ne(P,P.l_desc),ne(P,P.d_desc),G=function(X){var ue;for(b(X,X.dyn_ltree,X.l_desc.max_code),b(X,X.dyn_dtree,X.d_desc.max_code),ne(X,X.bl_desc),ue=p-1;3<=ue&&X.bl_tree[2*M[ue]+1]===0;ue--);return X.opt_len+=3*(ue+1)+5+5+4,ue}(P),D=P.opt_len+3+7>>>3,(W=P.static_len+3+7>>>3)<=D&&(D=W)):D=W=j+5,j+4<=D&&U!==-1?H(P,U,j,B):P.strategy===4||W===D?(le(P,2+(B?1:0),3),te(P,I,L)):(le(P,4+(B?1:0),3),function(X,ue,z,C){var N;for(le(X,ue-257,5),le(X,z-1,5),le(X,C-4,4),N=0;N<C;N++)le(X,X.bl_tree[2*M[N]+1],3);oe(X,X.dyn_ltree,ue-1),oe(X,X.dyn_dtree,z-1)}(P,P.l_desc.max_code+1,P.d_desc.max_code+1,G+1),te(P,P.dyn_ltree,P.dyn_dtree)),Ie(P),B&&ze(P)},r._tr_tally=function(P,U,j){return P.pending_buf[P.d_buf+2*P.last_lit]=U>>>8&255,P.pending_buf[P.d_buf+2*P.last_lit+1]=255&U,P.pending_buf[P.l_buf+P.last_lit]=255&j,P.last_lit++,U===0?P.dyn_ltree[2*j]++:(P.matches++,U--,P.dyn_ltree[2*(T[j]+d+1)]++,P.dyn_dtree[2*re(U)]++),P.last_lit===P.lit_bufsize-1},r._tr_align=function(P){le(P,2,3),fe(P,x,I),function(U){U.bi_valid===16?(be(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)}(P)}},{"../utils/common":41}],53:[function(t,i,r){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,i,r){(function(s){(function(o,a){if(!o.setImmediate){var l,c,u,d,h=1,f={},p=!1,g=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,l={}.toString.call(o.process)==="[object process]"?function(_){process.nextTick(function(){v(_)})}:function(){if(o.postMessage&&!o.importScripts){var _=!0,S=o.onmessage;return o.onmessage=function(){_=!1},o.postMessage("","*"),o.onmessage=S,_}}()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(_){o.postMessage(d+_,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(_){v(_.data)},function(_){u.port2.postMessage(_)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(_){var S=g.createElement("script");S.onreadystatechange=function(){v(_),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(_){setTimeout(v,0,_)},y.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var S=new Array(arguments.length-1),E=0;E<S.length;E++)S[E]=arguments[E+1];var A={callback:_,args:S};return f[h]=A,l(h),h++},y.clearImmediate=m}function m(_){delete f[_]}function v(_){if(p)setTimeout(v,0,_);else{var S=f[_];if(S){p=!0;try{(function(E){var A=E.callback,R=E.args;switch(R.length){case 0:A();break;case 1:A(R[0]);break;case 2:A(R[0],R[1]);break;case 3:A(R[0],R[1],R[2]);break;default:A.apply(a,R)}})(S)}finally{m(_),p=!1}}}}function x(_){_.source===o&&typeof _.data=="string"&&_.data.indexOf(d)===0&&v(+_.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof Bc<"u"?Bc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(u1)),u1.exports}var wq=Tq(),d1,kb;function Cq(){return kb||(kb=1,d1=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}),d1}var sp={},Ub;function Eq(){if(Ub)return sp;Ub=1;var n=Object.prototype.hasOwnProperty,e;function t(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch(a){return null}}function i(o){try{return encodeURIComponent(o)}catch(a){return null}}function r(o){for(var a=/([^=?#&]+)=?([^&]*)/g,l={},c;c=a.exec(o);){var u=t(c[1]),d=t(c[2]);u===null||d===null||u in l||(l[u]=d)}return l}function s(o,a){a=a||"";var l=[],c,u;typeof a!="string"&&(a="?");for(u in o)if(n.call(o,u)){if(c=o[u],!c&&(c===null||c===e||isNaN(c))&&(c=""),u=i(u),c=i(c),u===null||c===null)continue;l.push(u+"="+c)}return l.length?a+l.join("&"):""}return sp.stringify=s,sp.parse=r,sp}var h1,zb;function Mq(){if(zb)return h1;zb=1;var n=Cq(),e=Eq(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,r=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,o=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function l(v){return(v||"").toString().replace(t,"")}var c=[["#","hash"],["?","query"],function(x,_){return h(_.protocol)?x.replace(/\\/g,"/"):x},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],u={hash:1,query:1};function d(v){var x;typeof window<"u"?x=window:typeof Bc<"u"?x=Bc:typeof self<"u"?x=self:x={};var _=x.location||{};v=v||_;var S={},E=typeof v,A;if(v.protocol==="blob:")S=new g(unescape(v.pathname),{});else if(E==="string"){S=new g(v,{});for(A in u)delete S[A]}else if(E==="object"){for(A in v)A in u||(S[A]=v[A]);S.slashes===void 0&&(S.slashes=r.test(v.href))}return S}function h(v){return v==="file:"||v==="ftp:"||v==="http:"||v==="https:"||v==="ws:"||v==="wss:"}function f(v,x){v=l(v),v=v.replace(i,""),x=x||{};var _=o.exec(v),S=_[1]?_[1].toLowerCase():"",E=!!_[2],A=!!_[3],R=0,w;return E?A?(w=_[2]+_[3]+_[4],R=_[2].length+_[3].length):(w=_[2]+_[4],R=_[2].length):A?(w=_[3]+_[4],R=_[3].length):w=_[4],S==="file:"?R>=2&&(w=w.slice(2)):h(S)?w=_[4]:S?E&&(w=w.slice(2)):R>=2&&h(x.protocol)&&(w=_[4]),{protocol:S,slashes:E||h(S),slashesCount:R,rest:w}}function p(v,x){if(v==="")return x;for(var _=(x||"/").split("/").slice(0,-1).concat(v.split("/")),S=_.length,E=_[S-1],A=!1,R=0;S--;)_[S]==="."?_.splice(S,1):_[S]===".."?(_.splice(S,1),R++):R&&(S===0&&(A=!0),_.splice(S,1),R--);return A&&_.unshift(""),(E==="."||E==="..")&&_.push(""),_.join("/")}function g(v,x,_){if(v=l(v),v=v.replace(i,""),!(this instanceof g))return new g(v,x,_);var S,E,A,R,w,M,I=c.slice(),L=typeof x,k=this,T=0;for(L!=="object"&&L!=="string"&&(_=x,x=null),_&&typeof _!="function"&&(_=e.parse),x=d(x),E=f(v||"",x),S=!E.protocol&&!E.slashes,k.slashes=E.slashes||S&&x.slashes,k.protocol=E.protocol||x.protocol||"",v=E.rest,(E.protocol==="file:"&&(E.slashesCount!==2||a.test(v))||!E.slashes&&(E.protocol||E.slashesCount<2||!h(k.protocol)))&&(I[3]=[/(.*)/,"pathname"]);T<I.length;T++){if(R=I[T],typeof R=="function"){v=R(v,k);continue}A=R[0],M=R[1],A!==A?k[M]=v:typeof A=="string"?(w=A==="@"?v.lastIndexOf(A):v.indexOf(A),~w&&(typeof R[2]=="number"?(k[M]=v.slice(0,w),v=v.slice(w+R[2])):(k[M]=v.slice(w),v=v.slice(0,w)))):(w=A.exec(v))&&(k[M]=w[1],v=v.slice(0,w.index)),k[M]=k[M]||S&&R[3]&&x[M]||"",R[4]&&(k[M]=k[M].toLowerCase())}_&&(k.query=_(k.query)),S&&x.slashes&&k.pathname.charAt(0)!=="/"&&(k.pathname!==""||x.pathname!=="")&&(k.pathname=p(k.pathname,x.pathname)),k.pathname.charAt(0)!=="/"&&h(k.protocol)&&(k.pathname="/"+k.pathname),n(k.port,k.protocol)||(k.host=k.hostname,k.port=""),k.username=k.password="",k.auth&&(w=k.auth.indexOf(":"),~w?(k.username=k.auth.slice(0,w),k.username=encodeURIComponent(decodeURIComponent(k.username)),k.password=k.auth.slice(w+1),k.password=encodeURIComponent(decodeURIComponent(k.password))):k.username=encodeURIComponent(decodeURIComponent(k.auth)),k.auth=k.password?k.username+":"+k.password:k.username),k.origin=k.protocol!=="file:"&&h(k.protocol)&&k.host?k.protocol+"//"+k.host:"null",k.href=k.toString()}function y(v,x,_){var S=this;switch(v){case"query":typeof x=="string"&&x.length&&(x=(_||e.parse)(x)),S[v]=x;break;case"port":S[v]=x,n(x,S.protocol)?x&&(S.host=S.hostname+":"+x):(S.host=S.hostname,S[v]="");break;case"hostname":S[v]=x,S.port&&(x+=":"+S.port),S.host=x;break;case"host":S[v]=x,s.test(x)?(x=x.split(":"),S.port=x.pop(),S.hostname=x.join(":")):(S.hostname=x,S.port="");break;case"protocol":S.protocol=x.toLowerCase(),S.slashes=!_;break;case"pathname":case"hash":if(x){var E=v==="pathname"?"/":"#";S[v]=x.charAt(0)!==E?E+x:x}else S[v]=x;break;case"username":case"password":S[v]=encodeURIComponent(x);break;case"auth":var A=x.indexOf(":");~A?(S.username=x.slice(0,A),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=x.slice(A+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(x))}for(var R=0;R<c.length;R++){var w=c[R];w[4]&&(S[w[1]]=S[w[1]].toLowerCase())}return S.auth=S.password?S.username+":"+S.password:S.username,S.origin=S.protocol!=="file:"&&h(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString(),S}function m(v){(!v||typeof v!="function")&&(v=e.stringify);var x,_=this,S=_.host,E=_.protocol;E&&E.charAt(E.length-1)!==":"&&(E+=":");var A=E+(_.protocol&&_.slashes||h(_.protocol)?"//":"");return _.username?(A+=_.username,_.password&&(A+=":"+_.password),A+="@"):_.password?(A+=":"+_.password,A+="@"):_.protocol!=="file:"&&h(_.protocol)&&!S&&_.pathname!=="/"&&(A+="@"),(S[S.length-1]===":"||s.test(_.hostname)&&!_.port)&&(S+=":"),A+=S+_.pathname,x=typeof _.query=="object"?v(_.query):_.query,x&&(A+=x.charAt(0)!=="?"?"?"+x:x),_.hash&&(A+=_.hash),A}return g.prototype={set:y,toString:m},g.extractProtocol=f,g.location=d,g.trimLeft=l,g.qs=e,h1=g,h1}var Rq=Mq(),Iq=n6(Rq),Op={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */var Nq=Op.exports,Vb;function Pq(){return Vb||(Vb=1,function(n,e){(function(t,i){n.exports=i()})(Nq,function(){var t={};t.version="0.2.0";var i=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(p){var g,y;for(g in p)y=p[g],y!==void 0&&p.hasOwnProperty(g)&&(i[g]=y);return this},t.status=null,t.set=function(p){var g=t.isStarted();p=r(p,i.minimum,1),t.status=p===1?null:p;var y=t.render(!g),m=y.querySelector(i.barSelector),v=i.speed,x=i.easing;return y.offsetWidth,a(function(_){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,v,x)),p===1?(l(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){l(y,{transition:"all "+v+"ms linear",opacity:0}),setTimeout(function(){t.remove(),_()},v)},v)):setTimeout(_,v)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var g=t.status;return g?(typeof p!="number"&&(p=(1-g)*r(Math.random()*g,.1,.95)),g=r(g+p,0,.994),t.set(g)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,g=0;t.promise=function(y){return!y||y.state()==="resolved"?this:(g===0&&t.start(),p++,g++,y.always(function(){g--,g===0?(p=0,t.done()):t.set((p-g)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var g=document.createElement("div");g.id="nprogress",g.innerHTML=i.template;var y=g.querySelector(i.barSelector),m=p?"-100":s(t.status||0),v=document.querySelector(i.parent),x;return l(y,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(x=g.querySelector(i.spinnerSelector),x&&f(x)),v!=document.body&&u(v,"nprogress-custom-parent"),v.appendChild(g),g},t.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&f(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,g="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return g+"Perspective"in p?"translate3d":g+"Transform"in p?"translate":"margin"};function r(p,g,y){return p<g?g:p>y?y:p}function s(p){return(-1+p)*100}function o(p,g,y){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+s(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+s(p)+"%,0)"}:m={"margin-left":s(p)+"%"},m.transition="all "+g+"ms "+y,m}var a=function(){var p=[];function g(){var y=p.shift();y&&y(g)}return function(y){p.push(y),p.length==1&&g()}}(),l=function(){var p=["Webkit","O","Moz","ms"],g={};function y(_){return _.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(S,E){return E.toUpperCase()})}function m(_){var S=document.body.style;if(_ in S)return _;for(var E=p.length,A=_.charAt(0).toUpperCase()+_.slice(1),R;E--;)if(R=p[E]+A,R in S)return R;return _}function v(_){return _=y(_),g[_]||(g[_]=m(_))}function x(_,S,E){S=v(S),_.style[S]=E}return function(_,S){var E=arguments,A,R;if(E.length==2)for(A in S)R=S[A],R!==void 0&&S.hasOwnProperty(A)&&x(_,A,R);else x(_,E[1],E[2])}}();function c(p,g){var y=typeof p=="string"?p:h(p);return y.indexOf(" "+g+" ")>=0}function u(p,g){var y=h(p),m=y+g;c(y,g)||(p.className=m.substring(1))}function d(p,g){var y=h(p),m;c(p,g)&&(m=y.replace(" "+g+" "," "),p.className=m.substring(1,m.length-1))}function h(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function f(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Op)),Op.exports}var Lq=Pq(),f1=n6(Lq),bt;(function(n){n.Idle="Idle",n.Listening="Listening",n.Responding="Responding",n.Thinking="Thinking"})(bt||(bt={}));var Hb;(function(n){n.cpu="cpu",n.gpu="gpu"})(Hb||(Hb={}));var $b;(function(n){n.High="High",n.Low="Low",n.Standard="Standard"})($b||($b={}));var Gb;(function(n){n.GAUSSIAN_SPLATTING_3D="GAUSSIAN_SPLATTING_3D",n.REALTIME_AVATAR_3D="REALTIME_AVATAR_3D",n.REALTIME_AVATAR_LIVE2D="REALTIME_AVATAR_LIVE2D",n.REALTIME_AVATAR_MOBILE2D="REALTIME_AVATAR_MOBILE2D"})(Gb||(Gb={}));var Wb;(function(n){n.Idle="idle",n.Listening="listen",n.Responding="speak",n.Thinking="think"})(Wb||(Wb={}));class je{static SetWeight(e,t){e.enabled=!0,e.setEffectiveTimeScale(1),e.setEffectiveWeight(t)}static PrepareCrossFade(e,t,i){const r=i;je.UnPauseAllActions(),je.ExecuteCrossFade(e,t,r),je.IsBlending=!0,setTimeout(()=>{je.IsBlending=!1},i+.1)}static PauseAllActions(){je.actions.forEach(function(e){e.paused=!0})}static UnPauseAllActions(){je.actions.forEach(function(e){e.paused=!1})}static ExecuteCrossFade(e,t,i){je.SetWeight(t,1),t.time=0,e.crossFadeTo(t,i,!0)}constructor(e,t,i){const r=[],s=[],o=[],a=[],l=[];this.mixer=e;const c=i.hello.size,u=i.idle.size+c,d=i.listen.size+u,h=i.speak.size+d,f=i.think.size+h;for(let p=0;p<t.length;p++){const g=t[p],y=e.clipAction(g);if(p<c)r.push(y);else if(p<u){if(s.push(y),d==u){const m=e.clipAction(g.clone());o.push(m)}if(a==o){const m=e.clipAction(g.clone());a.push(m)}if(f==h){const m=e.clipAction(g.clone());l.push(m)}}else p<d?o.push(y):p<h?a.push(y):p<f&&l.push(y);je.actions.push(y),je.SetWeight(y,0)}this.hello=new Dq(r,i.hello.isGroup),this.idle=new Fq(s,i.idle.isGroup),this.listen=new Oq(o,i.listen.isGroup),this.think=new Bq(l,i.think.isGroup),this.speak=new kq(a,i.speak.isGroup)}curPlaying(){if(this.hello.isPlaying||this.idle.isPlaying)return bt.Idle;if(this.listen.isPlaying)return bt.Listening;if(this.think.isPlaying)return bt.Thinking;if(this.speak.isPlaying)return bt.Responding}dispose(){this.hello.dispose(),this.idle.dispose(),this.listen.dispose(),this.think.dispose(),this.speak.dispose()}resetAllActions(e=!1){switch(this.curPlaying()){case bt.Idle:je.LastAction=this.hello.actions[this.hello.stage];break;case bt.Listening:je.LastAction=this.listen.actions[this.listen.stage];break;case bt.Thinking:je.LastAction=this.think.actions[this.think.stage];break;case bt.Responding:je.LastAction=this.speak.actions[this.speak.stage];break;default:je.LastAction=void 0;break}je.LastAction&&(je.LastAction.loop=Jr,je.LastAction.clampWhenFinished=!0,je.SetWeight(je.LastAction,1)),e&&(je.PauseAllActions(),je.actions.forEach(function(i){i.time=0,je.SetWeight(i,0)}),je.LastAction=void 0),this.hello.isPlaying=!1,this.idle.isPlaying=!1,this.listen.isPlaying=!1,this.think.isPlaying=!1,this.speak.isPlaying=!1}update(e){if(!je.IsBlending)if(je.CurPlaying=this.curPlaying(),je.CurPlaying==null)switch(e){case bt.Idle:this.idle.update(e);break;case bt.Listening:this.listen.update(e);break;case bt.Thinking:this.think.update(e);break;case bt.Responding:this.speak.update(e);break;default:this.idle.update(e);break}else switch(je.CurPlaying){case bt.Idle:this.idle.update(e);break;case bt.Listening:this.listen.update(e);break;case bt.Thinking:this.think.update(e);break;case bt.Responding:this.speak.update(e);break;default:this.idle.update(e);break}}updateBS(e){let t={browDownLeft:0,browDownRight:0,browInnerUp:0,browOuterUpLeft:0,browOuterUpRight:0,mouthCheekPuff:0,cheekSquintLeft:0,cheekSquintRight:0,eyeBlinkLeft:0,eyeBlinkRight:0,eyeLookDownLeft:0,eyeLookDownRight:0,eyeLookInLeft:0,eyeLookInRight:0,eyeLookOutLeft:0,eyeLookOutRight:0,eyeLookUpLeft:0,eyeLookUpRight:0,eyeSquintLeft:0,eyeSquintRight:0,eyeWideLeft:0,eyeWideRight:0,jawForward:0,jawLeft:0,jawOpen:0,jawRight:0,mouthClose:0,mouthDimpleLeft:0,mouthDimpleRight:0,mouthFrownLeft:0,mouthFrownRight:0,mouthFunnel:0,mouthLeft:0,mouthLowerDownLeft:0,mouthLowerDownRight:0,mouthPressLeft:0,mouthPressRight:0,mouthPucker:0,mouthRight:0,mouthRollLower:0,mouthRollUpper:0,mouthShrugLower:0,mouthShrugUpper:0,mouthSmileLeft:0,mouthSmileRight:0,mouthStretchLeft:0,mouthStretchRight:0,mouthUpperUpLeft:0,mouthUpperUpRight:0,noseSneerLeft:0,noseSneerRight:0,tongueOut:0};return e!=null&&(t=e),t}}je.IsBlending=!1;je.actions=[];je.NeedReset=!1;je.NeedFullReset=!1;class rf{constructor(e,t){this.isPlaying=!1,this.stage=0,this.actions=[],this.blendingTime=.5,this.isGroup=!1,this.actions=e,this.isGroup=t}dispose(){this.actions=[]}update(e){}}class Dq extends rf{constructor(e,t){super(e,t)}update(e){if(je.CurPlaying==null&&e==bt.Idle&&this.isPlaying==!1&&(this.stage=0,this.actions[this.stage].time=0,je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=zl,this.actions[this.stage].clampWhenFinished=!1,this.actions[this.stage].paused=!1,this.actions[this.stage].play(),je.LastAction!=null&&je.PrepareCrossFade(je.LastAction,this.actions[this.stage],this.blendingTime),this.isPlaying=!0),je.CurPlaying==bt.Idle&&e==bt.Idle&&this.isPlaying==!0&&this.actions[this.stage].time>this.actions[this.stage].getClip().duration-this.blendingTime){let t=this.stage+1;t>=this.actions.length&&(t=0),this.actions[t].time=0,je.SetWeight(this.actions[t],1),this.actions[t].loop=zl,this.actions[t].play(),je.PrepareCrossFade(this.actions[this.stage],this.actions[t],this.blendingTime),this.stage=t}}}class Fq extends rf{constructor(e,t){super(e,t)}update(e){je.CurPlaying==null&&e==bt.Idle&&this.isPlaying==!1&&(this.stage=0,this.actions[this.stage].time=0,je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=zl,this.actions[this.stage].clampWhenFinished=!1,this.actions[this.stage].paused=!1,this.actions[this.stage].play(),je.LastAction!=null&&je.PrepareCrossFade(je.LastAction,this.actions[this.stage],this.blendingTime),this.isPlaying=!0),je.CurPlaying==bt.Idle&&e!=bt.Idle&&this.isPlaying==!0&&this.stage==0&&(this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,this.isPlaying=!1,je.LastAction=this.actions[this.stage])}}class Oq extends rf{constructor(e,t){super(e,t)}update(e){je.CurPlaying==null&&e==bt.Listening&&this.isPlaying==!1&&(this.stage=0,this.actions[this.stage].time=0,this.actions[this.stage].play(),je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=this.isGroup?Jr:zl,this.actions[this.stage].clampWhenFinished=!!this.isGroup,je.LastAction!=null&&je.PrepareCrossFade(je.LastAction,this.actions[this.stage],this.blendingTime),this.isPlaying=!0),this.isGroup&&(je.CurPlaying==bt.Listening&&e==bt.Listening&&this.isPlaying==!0&&this.stage==0&&this.actions[this.stage].time>this.actions[this.stage].getClip().duration-this.blendingTime&&(this.actions[this.stage+1].time=0,je.SetWeight(this.actions[this.stage+1],1),this.actions[this.stage+1].loop=zl,this.actions[this.stage+1].play(),je.PrepareCrossFade(this.actions[this.stage],this.actions[this.stage+1],this.blendingTime),this.stage=1),je.CurPlaying==bt.Listening&&e!=bt.Listening&&this.isPlaying==!0&&(this.stage==0||this.stage==1)&&(this.actions[2].time=0,this.actions[2].play(),je.SetWeight(this.actions[2],1),this.actions[2].loop=Jr,je.PrepareCrossFade(this.actions[this.stage],this.actions[2],this.blendingTime),this.stage=2)),je.CurPlaying==bt.Listening&&e!=bt.Listening&&this.isPlaying==!0&&this.stage==(this.isGroup?this.actions.length-1:0)&&(this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,this.isPlaying=!1,je.LastAction=this.actions[this.stage])}}class Bq extends rf{constructor(e,t){super(e,t)}update(e){je.CurPlaying==null&&e==bt.Thinking&&this.isPlaying==!1&&(this.stage=0,this.actions[this.stage].time=0,this.actions[this.stage].play(),je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=Jr,je.LastAction!=null&&je.PrepareCrossFade(je.LastAction,this.actions[this.stage],this.blendingTime),this.isPlaying=!0),this.isGroup&&(je.CurPlaying==bt.Thinking&&e==bt.Thinking&&this.isPlaying==!0&&this.stage==0&&this.actions[this.stage].time>this.actions[this.stage].getClip().duration-this.blendingTime&&(this.actions[this.stage+1].time=0,this.actions[this.stage+1].play(),je.SetWeight(this.actions[this.stage+1],1),this.actions[this.stage+1].loop=zl,je.PrepareCrossFade(this.actions[this.stage],this.actions[this.stage+1],this.blendingTime),this.stage=1),je.CurPlaying==bt.Thinking&&e!=bt.Thinking&&this.isPlaying==!0&&(this.stage==0||this.stage==1)&&(this.actions[2].time=0,this.actions[2].play(),je.SetWeight(this.actions[2],1),this.actions[2].loop=Jr,je.PrepareCrossFade(this.actions[this.stage],this.actions[2],this.blendingTime),this.stage=2)),je.CurPlaying==bt.Thinking&&e!=bt.Thinking&&this.isPlaying==!0&&this.stage==(this.isGroup?this.actions.length-1:0)&&(this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,this.actions[this.stage].time>this.actions[this.stage].getClip().duration-.3&&(this.isPlaying=!1,je.LastAction=this.actions[this.stage]))}}class kq extends rf{constructor(e,t){super(e,t)}getRandonNumber(e,t){const i=e-t;return t+Math.round(Math.random()*i)}update(e){if(je.CurPlaying==null&&e==bt.Responding&&this.isPlaying==!1&&(this.stage=Math.ceil(this.getRandonNumber(0,this.actions.length-1)),this.actions[this.stage].time=0,this.actions[this.stage].play(),je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,je.LastAction!=null&&je.PrepareCrossFade(je.LastAction,this.actions[this.stage],this.blendingTime),this.isPlaying=!0),je.CurPlaying==bt.Responding&&e==bt.Responding&&this.isPlaying==!0&&this.actions[this.stage].time>=this.actions[this.stage].getClip().duration-this.blendingTime){const t=this.actions[this.stage];this.stage=(this.stage+Math.ceil(this.getRandonNumber(1,this.actions.length-1)))%this.actions.length,this.actions[this.stage].time=0,this.actions[this.stage].play(),je.SetWeight(this.actions[this.stage],1),this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,je.PrepareCrossFade(t,this.actions[this.stage],this.blendingTime)}je.CurPlaying==bt.Responding&&e!=bt.Responding&&this.isPlaying==!0&&(this.actions[this.stage].loop=Jr,this.actions[this.stage].clampWhenFinished=!0,this.isPlaying=!1,je.LastAction=this.actions[this.stage])}}function Qb(n,e){if(e===iP)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Py||e===S5){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Py)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}class Uq extends Fu{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Gq(t)}),this.register(function(t){return new Wq(t)}),this.register(function(t){return new eX(t)}),this.register(function(t){return new tX(t)}),this.register(function(t){return new nX(t)}),this.register(function(t){return new jq(t)}),this.register(function(t){return new qq(t)}),this.register(function(t){return new Xq(t)}),this.register(function(t){return new Kq(t)}),this.register(function(t){return new $q(t)}),this.register(function(t){return new Yq(t)}),this.register(function(t){return new Qq(t)}),this.register(function(t){return new Jq(t)}),this.register(function(t){return new Zq(t)}),this.register(function(t){return new Vq(t)}),this.register(function(t){return new iX(t)}),this.register(function(t){return new rX(t)})}load(e,t,i,r){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const c=kd.extractUrlBase(e);o=kd.resolveURL(c,this.path)}else o=kd.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){r?r(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new z5(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let s;const o={},a={},l=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===i6){try{o[Pt.KHR_BINARY_GLTF]=new sX(e)}catch(d){r&&r(d);return}s=JSON.parse(o[Pt.KHR_BINARY_GLTF].content)}else s=JSON.parse(l.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new vX(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](c);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[d.name]=d,o[d.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const d=s.extensionsUsed[u],h=s.extensionsRequired||[];switch(d){case Pt.KHR_MATERIALS_UNLIT:o[d]=new Hq;break;case Pt.KHR_DRACO_MESH_COMPRESSION:o[d]=new oX(s,this.dracoLoader);break;case Pt.KHR_TEXTURE_TRANSFORM:o[d]=new aX;break;case Pt.KHR_MESH_QUANTIZATION:o[d]=new lX;break;default:h.indexOf(d)>=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function zq(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Pt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Vq{constructor(e){this.parser=e,this.name=Pt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){const s=t[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let r=t.cache.get(i);if(r)return r;const s=t.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const u=new gt(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],Bi);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new DL(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new PL(u),c.distance=d;break;case"spot":c=new IL(u),c.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),To(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=t.createUniqueName(l.name||"light_"+e),r=Promise.resolve(c),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return i._getNodeRef(t.cache,a,l)})}}class Hq{constructor(){this.name=Pt.KHR_MATERIALS_UNLIT}getMaterialType(){return Yr}extendParams(e,t,i){const r=[];e.color=new gt(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Bi),e.opacity=o[3]}s.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",s.baseColorTexture,fi))}return Promise.all(r)}}class $q{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class Gq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new qe(a,a)}return Promise.all(s)}}class Wq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class Qq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class jq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new gt(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],Bi)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,fi)),o.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class qq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class Xq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new gt().setRGB(a[0],a[1],a[2],Bi),Promise.all(s)}}class Kq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class Yq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new gt().setRGB(a[0],a[1],a[2],Bi),o.specularColorTexture!==void 0&&s.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,fi)),Promise.all(s)}}class Zq{constructor(e){this.parser=e,this.name=Pt.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(i.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class Jq{constructor(e){this.parser=e,this.name=Pt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:oo}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class eX{constructor(e){this.parser=e,this.name=Pt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class tX{constructor(e){this.parser=e,this.name=Pt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class nX{constructor(e){this.parser=e,this.name=Pt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class iX{constructor(e){this.name=Pt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,d=r.byteStride,h=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,h,r.mode,r.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(f),u,d,h,r.mode,r.filter),f})})}else return null}}class rX{constructor(e){this.name=Pt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==$r.TRIANGLES&&c.mode!==$r.TRIANGLE_STRIP&&c.mode!==$r.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],h=c[0].count,f=[];for(const p of d){const g=new Xe,y=new Y,m=new Qt,v=new Y(1,1,1),x=new cL(p.geometry,p.material,h);for(let _=0;_<h;_++)l.TRANSLATION&&y.fromBufferAttribute(l.TRANSLATION,_),l.ROTATION&&m.fromBufferAttribute(l.ROTATION,_),l.SCALE&&v.fromBufferAttribute(l.SCALE,_),x.setMatrixAt(_,g.compose(y,m,v));for(const _ in l)if(_==="_COLOR_0"){const S=l[_];x.instanceColor=new jo(S.array,S.itemSize,S.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&p.geometry.setAttribute(_,l[_]);nn.prototype.copy.call(x,p),this.parser.assignFinalMaterial(x),f.push(x)}return u.isGroup?(u.clear(),u.add(...f),u):f[0]}))}}const i6="glTF",vd=12,jb={JSON:1313821514,BIN:5130562};class sX{constructor(e){this.name=Pt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,vd),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==i6)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-vd,s=new DataView(e,vd);let o=0;for(;o<r;){const a=s.getUint32(o,!0);o+=4;const l=s.getUint32(o,!0);if(o+=4,l===jb.JSON){const c=new Uint8Array(e,vd+o,a);this.content=i.decode(c)}else if(l===jb.BIN){const c=vd+o;this.body=e.slice(c,c+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class oX{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},c={};for(const u in o){const d=cv[u]||u.toLowerCase();a[d]=o[u]}for(const u in e.attributes){const d=cv[u]||u.toLowerCase();if(o[u]!==void 0){const h=i.accessors[e.attributes[u]],f=Kc[h.componentType];c[d]=f.name,l[d]=h.normalized===!0}}return t.getDependency("bufferView",s).then(function(u){return new Promise(function(d,h){r.decodeDracoFile(u,function(f){for(const p in f.attributes){const g=f.attributes[p],y=l[p];y!==void 0&&(g.normalized=y)}d(f)},a,c,Bi,h)})})}}class aX{constructor(){this.name=Pt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class lX{constructor(){this.name=Pt.KHR_MESH_QUANTIZATION}}class r6 extends Bh{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,c=a*3,u=r-t,d=(i-t)/u,h=d*d,f=h*d,p=e*c,g=p-c,y=-2*f+3*h,m=f-h,v=1-y,x=m-h+d;for(let _=0;_!==a;_++){const S=o[g+_+a],E=o[g+_+l]*u,A=o[p+_+a],R=o[p+_]*u;s[_]=v*S+x*E+y*A+m*R}return s}}const cX=new Qt;class uX extends r6{interpolate_(e,t,i,r){const s=super.interpolate_(e,t,i,r);return cX.fromArray(s).normalize().toArray(s),s}}const $r={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Kc={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qb={9728:_i,9729:Rr,9984:h5,9985:bp,9986:bd,9987:Hs},Xb={33071:Aa,33648:om,10497:cu},p1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cv={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},da={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},dX={CUBICSPLINE:void 0,LINEAR:lh,STEP:ah},m1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function hX(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new T_({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:bs})),n.DefaultMaterial}function ll(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function To(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function fX(n,e,t){let i=!1,r=!1,s=!1;for(let c=0,u=e.length;c<u;c++){const d=e[c];if(d.POSITION!==void 0&&(i=!0),d.NORMAL!==void 0&&(r=!0),d.COLOR_0!==void 0&&(s=!0),i&&r&&s)break}if(!i&&!r&&!s)return Promise.resolve(n);const o=[],a=[],l=[];for(let c=0,u=e.length;c<u;c++){const d=e[c];if(i){const h=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):n.attributes.position;o.push(h)}if(r){const h=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):n.attributes.normal;a.push(h)}if(s){const h=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):n.attributes.color;l.push(h)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(c){const u=c[0],d=c[1],h=c[2];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=d),s&&(n.morphAttributes.color=h),n.morphTargetsRelative=!0,n})}function pX(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function mX(n){let e;const t=n.extensions&&n.extensions[Pt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+g1(t.attributes):e=n.indices+":"+g1(n.attributes)+":"+n.mode,n.targets!==void 0)for(let i=0,r=n.targets.length;i<r;i++)e+=":"+g1(n.targets[i]);return e}function g1(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function uv(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function gX(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const yX=new Xe;class vX{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new zq,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);r=i&&l?parseInt(l[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&r<17||s&&o<98?this.textureLoader=new ML(this.options.manager):this.textureLoader=new OL(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new z5(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return ll(s,a,r),To(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone(),s=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())s(u,a.children[c])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Pt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(kd.resolveURL(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const o=p1[r.type],a=Kc[r.componentType],l=r.normalized===!0,c=new a(r.count*o);return Promise.resolve(new xi(c,o,l))}const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],l=p1[r.type],c=Kc[r.componentType],u=c.BYTES_PER_ELEMENT,d=u*l,h=r.byteOffset||0,f=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,p=r.normalized===!0;let g,y;if(f&&f!==d){const m=Math.floor(h/f),v="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+m+":"+r.count;let x=t.cache.get(v);x||(g=new c(a,m*f,r.count*f/u),x=new x_(g,f/u),t.cache.add(v,x)),y=new e0(x,l,h%f/u,p)}else a===null?g=new c(r.count*l):g=new c(a,h,r.count*l),y=new xi(g,l,p);if(r.sparse!==void 0){const m=p1.SCALAR,v=Kc[r.sparse.indices.componentType],x=r.sparse.indices.byteOffset||0,_=r.sparse.values.byteOffset||0,S=new v(o[1],x,r.sparse.count*m),E=new c(o[2],_,r.sparse.count*l);a!==null&&(y=new xi(y.array.slice(),y.itemSize,y.normalized)),y.normalized=!1;for(let A=0,R=S.length;A<R;A++){const w=S[A];if(y.setX(w,E[A*l]),l>=2&&y.setY(w,E[A*l+1]),l>=3&&y.setZ(w,E[A*l+2]),l>=4&&y.setW(w,E[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}y.normalized=p}return y})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(s.samplers||{})[o.sampler]||{};return u.magFilter=qb[h.magFilter]||Rr,u.minFilter=qb[h.minFilter]||Hs,u.wrapS=Xb[h.wrapS]||cu,u.wrapT=Xb[h.wrapT]||cu,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==_i&&u.minFilter!==Rr,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){c=!0;const h=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(h),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(h,f){let p=h;t.isImageBitmapLoader===!0&&(p=function(g){const y=new Wn(g);y.needsUpdate=!0,h(y)}),t.load(kd.resolveURL(d,s.path),p,void 0,f)})}).then(function(d){return c===!0&&a.revokeObjectURL(l),To(d,o),d.userData.mimeType=o.mimeType||gX(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Pt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Pt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Pt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new F5,es.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new D5,es.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return T_}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[Pt.KHR_MATERIALS_UNLIT]){const d=r[Pt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new gt(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const h=d.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],Bi),a.opacity=h[3]}d.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",d.baseColorTexture,fi)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Cr);const u=s.alphaMode||m1.OPAQUE;if(u===m1.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===m1.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Yr&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new qe(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}if(s.occlusionTexture!==void 0&&o!==Yr&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Yr){const d=s.emissiveFactor;a.emissive=new gt().setRGB(d[0],d[1],d[2],Bi)}return s.emissiveTexture!==void 0&&o!==Yr&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,fi)),Promise.all(c).then(function(){const d=new o(a);return s.name&&(d.name=s.name),To(d,s),t.associations.set(d,{materials:e}),s.extensions&&ll(r,d,s),d})}createUniqueName(e){const t=en.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Pt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return Kb(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const c=e[a],u=mX(c),d=r[u];if(d)o.push(d.promise);else{let h;c.extensions&&c.extensions[Pt.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=Kb(new ki,c,t),r[u]={primitive:c,promise:h},o.push(h)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,a=[];for(let l=0,c=o.length;l<c;l++){const u=o[l].material===void 0?hX(this.cache):this.getDependency("material",o[l].material);a.push(u)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const c=l.slice(0,l.length-1),u=l[l.length-1],d=[];for(let f=0,p=u.length;f<p;f++){const g=u[f],y=o[f];let m;const v=c[f];if(y.mode===$r.TRIANGLES||y.mode===$r.TRIANGLE_STRIP||y.mode===$r.TRIANGLE_FAN||y.mode===void 0)m=s.isSkinnedMesh===!0?new oL(g,v):new pn(g,v),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),y.mode===$r.TRIANGLE_STRIP?m.geometry=Qb(m.geometry,S5):y.mode===$r.TRIANGLE_FAN&&(m.geometry=Qb(m.geometry,Py));else if(y.mode===$r.LINES)m=new hL(g,v);else if(y.mode===$r.LINE_STRIP)m=new A_(g,v);else if(y.mode===$r.LINE_LOOP)m=new fL(g,v);else if(y.mode===$r.POINTS)m=new pL(g,v);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(m.geometry.morphAttributes).length>0&&pX(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),To(m,s),y.extensions&&ll(r,m,y),t.assignFinalMaterial(m),d.push(m)}for(let f=0,p=d.length;f<p;f++)t.associations.set(d[f],{meshes:e,primitives:f});if(d.length===1)return s.extensions&&ll(r,d[0],s),d[0];const h=new xl;s.extensions&&ll(r,h,s),t.associations.set(h,{meshes:e});for(let f=0,p=d.length;f<p;f++)h.add(d[f]);return h})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Ki(Ta.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new Ou(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),To(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let r=0,s=t.joints.length;r<s;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const s=r.pop(),o=r,a=[],l=[];for(let c=0,u=o.length;c<u;c++){const d=o[c];if(d){a.push(d);const h=new Xe;s!==null&&h.fromArray(s.array,c*16),l.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new t0(a,l)})}loadAnimation(e){const t=this.json,i=this,r=t.animations[e],s=r.name?r.name:"animation_"+e,o=[],a=[],l=[],c=[],u=[];for(let d=0,h=r.channels.length;d<h;d++){const f=r.channels[d],p=r.samplers[f.sampler],g=f.target,y=g.node,m=r.parameters!==void 0?r.parameters[p.input]:p.input,v=r.parameters!==void 0?r.parameters[p.output]:p.output;g.node!==void 0&&(o.push(this.getDependency("node",y)),a.push(this.getDependency("accessor",m)),l.push(this.getDependency("accessor",v)),c.push(p),u.push(g))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(c),Promise.all(u)]).then(function(d){const h=d[0],f=d[1],p=d[2],g=d[3],y=d[4],m=[];for(let v=0,x=h.length;v<x;v++){const _=h[v],S=f[v],E=p[v],A=g[v],R=y[v];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();const w=i._createAnimationTracks(_,S,E,A,R);if(w)for(let M=0;M<w.length;M++)m.push(w[M])}return new Dy(s,void 0,m)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,c=r.weights.length;l<c;l++)a.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){const t=this.json,i=this,r=t.nodes[e],s=i._loadNodeShallow(e),o=[],a=r.children||[];for(let c=0,u=a.length;c<u;c++)o.push(i.getDependency("node",a[c]));const l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([s,Promise.all(o),l]).then(function(c){const u=c[0],d=c[1],h=c[2];h!==null&&u.traverse(function(f){f.isSkinnedMesh&&f.bind(h,yX)});for(let f=0,p=d.length;f<p;f++)u.add(d[f]);return u})}_loadNodeShallow(e){const t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"",a=[],l=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return l&&a.push(l),s.camera!==void 0&&a.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let u;if(s.isBone===!0?u=new dh:c.length>1?u=new xl:c.length===1?u=c[0]:u=new nn,u!==c[0])for(let d=0,h=c.length;d<h;d++)u.add(c[d]);if(s.name&&(u.userData.name=s.name,u.name=o),To(u,s),s.extensions&&ll(i,u,s),s.matrix!==void 0){const d=new Xe;d.fromArray(s.matrix),u.applyMatrix4(d)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.has(u)||r.associations.set(u,{}),r.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],r=this,s=new xl;i.name&&(s.name=r.createUniqueName(i.name)),To(s,i),i.extensions&&ll(t,s,i);const o=i.nodes||[],a=[];for(let l=0,c=o.length;l<c;l++)a.push(r.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let u=0,d=l.length;u<d;u++)s.add(l[u]);const c=u=>{const d=new Map;for(const[h,f]of r.associations)(h instanceof es||h instanceof Wn)&&d.set(h,f);return u.traverse(h=>{const f=r.associations.get(h);f!=null&&d.set(h,f)}),d};return r.associations=c(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];da[s.path]===da.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(a);let c;switch(da[s.path]){case da.weights:c=mu;break;case da.rotation:c=gu;break;case da.position:case da.scale:c=yu;break;default:switch(i.itemSize){case 1:c=mu;break;case 2:case 3:default:c=yu;break}break}const u=r.interpolation!==void 0?dX[r.interpolation]:lh,d=this._getArrayFromAccessor(i);for(let h=0,f=l.length;h<f;h++){const p=new c(l[h]+"."+da[s.path],t.array,d,u);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(p),o.push(p)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=uv(t.constructor),r=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)r[s]=t[s]*i;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const r=this instanceof gu?uX:r6;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function _X(n,e,t){const i=e.attributes,r=new rr;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,c=a.max;if(l!==void 0&&c!==void 0){if(r.set(new Y(l[0],l[1],l[2]),new Y(c[0],c[1],c[2])),a.normalized){const u=uv(Kc[a.componentType]);r.min.multiplyScalar(u),r.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new Y,l=new Y;for(let c=0,u=s.length;c<u;c++){const d=s[c];if(d.POSITION!==void 0){const h=t.json.accessors[d.POSITION],f=h.min,p=h.max;if(f!==void 0&&p!==void 0){if(l.setX(Math.max(Math.abs(f[0]),Math.abs(p[0]))),l.setY(Math.max(Math.abs(f[1]),Math.abs(p[1]))),l.setZ(Math.max(Math.abs(f[2]),Math.abs(p[2]))),h.normalized){const g=uv(Kc[h.componentType]);l.multiplyScalar(g)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}n.boundingBox=r;const o=new so;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function Kb(n,e,t){const i=e.attributes,r=[];function s(o,a){return t.getDependency("accessor",o).then(function(l){n.setAttribute(a,l)})}for(const o in i){const a=cv[o]||o.toLowerCase();a in n.attributes||r.push(s(i[o],a))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(a){n.setIndex(a)});r.push(o)}return wt.workingColorSpace!==Bi&&"COLOR_0"in i&&console.warn('THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat(wt.workingColorSpace,'" not supported.')),To(n,e),_X(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?fX(n,e.targets,t):n})}var xX={browDownLeft:0,browDownRight:0,browInnerUp:0,browOuterUpLeft:0,browOuterUpRight:0,cheekPuff:0,cheekSquintLeft:0,cheekSquintRight:0,eyeBlinkLeft:0,eyeBlinkRight:0,eyeLookDownLeft:0,eyeLookDownRight:0,eyeLookInLeft:0,eyeLookInRight:0,eyeLookOutLeft:0,eyeLookOutRight:0,eyeLookUpLeft:0,eyeLookUpRight:0,eyeSquintLeft:0,eyeSquintRight:0,eyeWideLeft:0,eyeWideRight:0,jawForward:0,jawLeft:0,jawOpen:0,jawRight:0,mouthClose:0,mouthDimpleLeft:0,mouthDimpleRight:0,mouthFrownLeft:0,mouthFrownRight:0,mouthFunnel:0,mouthLeft:0,mouthLowerDownLeft:0,mouthLowerDownRight:0,mouthPressLeft:0,mouthPressRight:0,mouthPucker:0,mouthRight:0,mouthRollLower:0,mouthRollUpper:0,mouthShrugLower:0,mouthShrugUpper:0,mouthSmileLeft:0,mouthSmileRight:0,mouthStretchLeft:0,mouthStretchRight:0,mouthUpperUpLeft:0,mouthUpperUpRight:0,noseSneerLeft:0,noseSneerRight:0,tongueOut:0},SX={browDownLeft:1,browDownRight:1,browInnerUp:1,browOuterUpLeft:1,browOuterUpRight:1,cheekPuff:1,cheekSquintLeft:1,cheekSquintRight:1,eyeBlinkLeft:1,eyeBlinkRight:1,eyeLookDownLeft:1,eyeLookDownRight:1,eyeLookInLeft:1,eyeLookInRight:1,eyeLookOutLeft:1,eyeLookOutRight:1,eyeLookUpLeft:1,eyeLookUpRight:1,eyeSquintLeft:1,eyeSquintRight:1,eyeWideLeft:1,eyeWideRight:1,jawForward:1,jawLeft:1,jawOpen:1.2,jawRight:1,mouthClose:.2,mouthDimpleLeft:1.3,mouthDimpleRight:1.3,mouthFrownLeft:1.3,mouthFrownRight:1.3,mouthFunnel:1.3,mouthLeft:1.3,mouthLowerDownLeft:.7,mouthLowerDownRight:.7,mouthPressLeft:1.3,mouthPressRight:1.3,mouthPucker:1,mouthRight:1.3,mouthRollLower:1.3,mouthRollUpper:1.3,mouthShrugLower:1.3,mouthShrugUpper:.1,mouthSmileLeft:1,mouthSmileRight:1,mouthStretchLeft:1.3,mouthStretchRight:1.3,mouthUpperUpLeft:1.3,mouthUpperUpRight:1.3,noseSneerLeft:1,noseSneerRight:1,tongueOut:1},Yb={offset:xX,scale:SX},AX={size:2,isGroup:!1},bX={size:1,isGroup:!1},TX={size:0,isGroup:!1},wX={size:6,isGroup:!1},CX={size:3,isGroup:!0},EX=[],MX={hello:AX,idle:bX,listen:TX,speak:wX,think:CX,other:EX},RX="",IX={x:0,y:0,z:0},NX={x:1,y:1,z:1},PX={x:0,y:1.8,z:1},LX={x:-10,y:0,z:0},DX="0xffffff",FX="false",Ns={name:RX,position:IX,scale:NX,camPos:PX,camRot:LX,backgroundColor:DX,useFlame:FX};class Os{static getInstance(e,t,i){var r,s,o,a,l,c;return al(this,void 0,void 0,function*(){if(this.instance!=null)return this.instance;try{const u=t,{pathname:d}=Iq(u),h=d.match(/\/([^/]+?)\.zip/);if(!(h&&h[1]))throw new Error("character model is not found");f1.start();const p=yield Bn.get(u,{responseType:"arraybuffer",timeout:1e5,onDownloadProgress:A=>{if(A.lengthComputable&&A&&A.total){const R=A.loaded/A.total;f1.set(R),i!=null&&i.downloadProgress&&(i==null||i.downloadProgress(R))}}});i!=null&&i.loadProgress&&(i==null||i.loadProgress(.1)),f1.done(),console.log("download completed:",p.data);const g=p.data,y=yield wq.loadAsync(g);let m="";if(Object.values(y.files).forEach(A=>{var R,w;A.dir&&(m=(R=A.name)===null||R===void 0?void 0:R.slice(0,((w=A.name)===null||w===void 0?void 0:w.length)-1))}),!m)throw new Error("file fold is not found");const v=new Os(e,y),x=new Y;x.x=((r=Ns.camPos)===null||r===void 0?void 0:r.x)||0,x.y=((s=Ns.camPos)===null||s===void 0?void 0:s.y)||0,x.z=((o=Ns.camPos)===null||o===void 0?void 0:o.z)||1;const _=new Y;_.x=((a=Ns.camRot)===null||a===void 0?void 0:a.x)||0,_.y=((l=Ns.camRot)===null||l===void 0?void 0:l.y)||0,_.z=((c=Ns.camRot)===null||c===void 0?void 0:c.z)||0;let S=16777215;Ns.backgroundColor&&(S=parseInt(Ns.backgroundColor,16)),i&&i.backgroundColor&&v.isHexColorStrict(i.backgroundColor)&&(S=parseInt(i.backgroundColor,16)),v.getChatState=i==null?void 0:i.getChatState,v.getExpressionData=i==null?void 0:i.getExpressionData,Ns.useFlame&&(v.useFlame=Ns.useFlame!="false"),console.log(x,S),v.viewer=new nv({rootElement:e,threejsCanvas:Os._canvas,cameraUp:[0,1,0],initialCameraPosition:[x.x,x.y,x.z],initialCameraRotation:[_.x,_.y,_.z],sphericalHarmonicsDegree:0,backgroundColor:S}),v.viewer.useFlame=v.useFlame,v.viewer.useFlame==!0?yield v.loadFlameModel(m,Yb):yield v.loadModel(m,MX,Yb),i!=null&&i.loadProgress&&(i==null||i.loadProgress(.2));const E=yield v.unpackFileAsBlob(m+"/offset.ply");return i!=null&&i.loadProgress&&(i==null||i.loadProgress(.3)),v.viewer.addSplatScene(E,{progressiveLoad:!0,sharedMemoryForWorkers:!1,showLoadingUI:!1,format:zs.Ply}).then(()=>{v.render(),i!=null&&i.loadProgress&&(i==null||i.loadProgress(1))}),v}catch(u){console.error(u)}})}constructor(e,t){this.zipUrls={urls:new Map},this.useFlame=!1,this.lastTime=0,this.startTime=0,this.expressionData={},this.chatState=bt.Idle,Object.assign(this.zipUrls,{zip:t});const{width:i,height:r}=e.getBoundingClientRect();Os._canvas.style.visibility="visible",Os._canvas.width=i,Os._canvas.height=r,e.appendChild(Os._canvas),this.clock=new kL,this.startTime=performance.now()/1e3}dispose(){Os._canvas.style.visibility="hidden",this.disposeModel(),this.zipUrls.urls.forEach(e=>{URL.revokeObjectURL(e)})}disposeModel(){var e,t;this.mixer&&(this.mixer.stopAllAction(),this.viewer&&this.viewer.avatarMesh&&this.mixer.uncacheRoot(this.viewer.avatarMesh),this.mixer=void 0,(e=this.animManager)===null||e===void 0||e.dispose()),(t=this.viewer)===null||t===void 0||t.dispose()}getCamera(){var e;return(e=this.viewer)===null||e===void 0?void 0:e.camera}updateBS(e){let t={browDownLeft:0,browDownRight:0,browInnerUp:0,browOuterUpLeft:0,browOuterUpRight:0,mouthCheekPuff:0,cheekSquintLeft:0,cheekSquintRight:0,eyeBlinkLeft:0,eyeBlinkRight:0,eyeLookDownLeft:0,eyeLookDownRight:0,eyeLookInLeft:0,eyeLookInRight:0,eyeLookOutLeft:0,eyeLookOutRight:0,eyeLookUpLeft:0,eyeLookUpRight:0,eyeSquintLeft:0,eyeSquintRight:0,eyeWideLeft:0,eyeWideRight:0,jawForward:0,jawLeft:0,jawOpen:0,jawRight:0,mouthClose:0,mouthDimpleLeft:0,mouthDimpleRight:0,mouthFrownLeft:0,mouthFrownRight:0,mouthFunnel:0,mouthLeft:0,mouthLowerDownLeft:0,mouthLowerDownRight:0,mouthPressLeft:0,mouthPressRight:0,mouthPucker:0,mouthRight:0,mouthRollLower:0,mouthRollUpper:0,mouthShrugLower:0,mouthShrugUpper:0,mouthSmileLeft:0,mouthSmileRight:0,mouthStretchLeft:0,mouthStretchRight:0,mouthUpperUpLeft:0,mouthUpperUpRight:0,noseSneerLeft:0,noseSneerRight:0,tongueOut:0};return e!=null&&(t=e),t}render(){var e;if(this.viewer&&this.viewer.selfDrivenMode){if(this.viewer.webXRMode)this.viewer.renderer.setAnimationLoop(this.viewer.selfDrivenUpdateFunc);else{this.viewer.requestFrameId=requestAnimationFrame(()=>this.render());const t=1/30,r=(performance.now()/1e3-this.startTime)%(this.viewer.totalFrames*t),s=Math.floor(r/t);if(this.viewer.frame=s,this.getChatState&&(this.chatState=this.getChatState(),(e=this.animManager)===null||e===void 0||e.update(this.chatState)),this.getExpressionData&&(this.expressionData=this.updateBS(this.getExpressionData())),this.viewer.useFlame==!1){if(!this.mixer||!this.animManager)return;const o=this.clock.getDelta();if(this.mixer.update(o),this.motioncfg)for(const a in this.expressionData){const l=this.motioncfg.offset[a],c=this.motioncfg.scale[a];l!==void 0&&c!==void 0&&(this.expressionData[a]=this.expressionData[a]*c+l)}this.setExpression()}this.viewer.update(this.viewer.renderer,this.viewer.camera),this.viewer.shouldRender()?(this.viewer.render(),this.viewer.consecutiveRenderFrames++):this.viewer.consecutiveRenderFrames=0,this.viewer.renderNextFrame=!1}this.viewer.selfDrivenModeRunning=!0}else throw new Error("Cannot start viewer unless it is in self driven mode.")}isHexColorStrict(e){return typeof e!="string"?!1:/^(#|0x)[0-9A-Fa-f]{6}$/i.test(e)}setExpression(){this.viewer&&this.viewer.splatMesh&&(this.viewer.splatMesh.bsWeight=this.expressionData),this.model&&this.model.traverse(e=>{if(e.isMesh||e.isSkinnedMesh){const t=e.geometry.morphAttributes;if(Object.keys(t).length>0===!0){const r=e.morphTargetDictionary;for(const s in r){const o=r[s],a=this.expressionData[s];a!==void 0&&(e.morphTargetInfluences[o]=Math.max(0,Math.min(1,a)))}}}})}loadFlameModel(e,t){return al(this,void 0,void 0,function*(){const[i,r,s,o,a]=yield Promise.all([this.unpackAndLoadGlb(e+"/skin.glb"),this.unpackAndLoadJson(e+"/lbs_weight_20k.json"),this.unpackAndLoadJson(e+"/flame_params.json"),this.unpackAndLoadJson(e+"/vertex_order.json"),this.unpackAndLoadJson(e+"/bone_tree.json")]);if(!this.viewer)throw new Error("render viewer is not initialized");let l,c;i.traverse(u=>{u.isSkinnedMesh&&(l=u),u instanceof dh&&u.name=="hip"&&(c=u)}),this.viewer.sortedIndexes=o,this.viewer.flame_params=s,this.viewer.lbs_weight_80k=r,this.viewer.bone_tree=a,this.viewer.totalFrames=s.expr.length,l!=null&&(this.viewer.gaussianSplatCount=l.geometry.attributes.position.count),this.viewer.avatarMesh=i,this.viewer.skinModel=l,this.viewer.boneRoot=c,this.motioncfg=t,l!=null&&this.viewer.updateMorphTarget(l),this.viewer.threeScene.add(i),i.visible=!1,l!=null&&l.skeleton.computeBoneTexture()})}loadModel(e,t,i){return al(this,void 0,void 0,function*(){const[r,s,o]=yield Promise.all([this.unpackAndLoadGlb(e+"/skin.glb"),this.unpackAndLoadGlb(e+"/animation.glb"),this.unpackAndLoadJson(e+"/vertex_order.json")]);if(!this.viewer)throw new Error("render viewer is not initialized");let a,l;r.traverse(c=>{c.isSkinnedMesh&&(a=c),c instanceof dh&&c.name=="hip"&&(l=c)}),this.viewer.sortedIndexes=o,a!=null&&(this.viewer.gaussianSplatCount=a.geometry.attributes.position.count),this.viewer.avatarMesh=r,this.viewer.skinModel=a,this.viewer.boneRoot=l,this.mixer=new YL(r),this.animManager=new je(this.mixer,s,t),this.motioncfg=i,a!=null&&this.viewer.updateMorphTarget(a),this.viewer.threeScene.add(r),r.visible=!1,a!=null&&a.skeleton.computeBoneTexture()})}unpackFileAsBlob(e){var t,i;return al(this,void 0,void 0,function*(){if(!this.zipUrls.urls.has(e)){const r=yield(i=(t=this.zipUrls.zip)===null||t===void 0?void 0:t.file(e))===null||i===void 0?void 0:i.async("blob"),s=URL.createObjectURL(r);this.zipUrls.urls.set(e,s)}return this.zipUrls.urls.get(e)})}unpackAndLoadGlb(e){var t,i;return al(this,void 0,void 0,function*(){if(!this.zipUrls.urls.has(e)){const r=yield(i=(t=this.zipUrls.zip)===null||t===void 0?void 0:t.file(e))===null||i===void 0?void 0:i.async("arraybuffer"),s=new Blob([r],{type:"model/gltf-binary"}),o=URL.createObjectURL(s);this.zipUrls.urls.set(e,o)}return this.LoadGLTF(this.zipUrls.urls.get(e))})}unpackAndLoadJson(e){var t,i;return al(this,void 0,void 0,function*(){const r=yield(i=(t=this.zipUrls.zip)===null||t===void 0?void 0:t.file(e))===null||i===void 0?void 0:i.async("string");return JSON.parse(r)})}LoadGLTF(e){return al(this,void 0,void 0,function*(){return new Promise((t,i)=>{new Uq(void 0).load(e,s=>{s.animations.length>0?t(s.animations):t(s.scene)},void 0,s=>{i(s)})})})}}Os._canvas=document.createElement("canvas");class OX extends o_{constructor(t){const{container:i,assetsPath:r,ws:s,downloadProgress:o,loadProgress:a}=t;super();xe(this,"_avatarDivEle");xe(this,"_assetsPath","");xe(this,"_ws");xe(this,"_downloadProgress");xe(this,"_loadProgress");xe(this,"_loadPercent",0);xe(this,"_downloadPercent",0);xe(this,"_processor");xe(this,"_renderer");xe(this,"_audioMute",!1);xe(this,"curState",ma.Idle);this._avatarDivEle=i,this._assetsPath=r,this._ws=s,o?this._downloadProgress=l=>{this._downloadPercent=l,o(l)}:this._downloadProgress=l=>{this._downloadPercent=l},a?this._loadProgress=l=>{this._loadPercent=l,a(l)}:this._loadProgress=l=>{this._loadPercent=l},this._init()}_init(){if(!this._avatarDivEle||!this._assetsPath||!this._ws)throw new Error("Lack of necessary initialization parameters for gaussian render");this._processor=new xN(this),this._bindEventTypes()}start(){this.getData(),this.render()}async getData(){this._ws.on(Kr.WS_MESSAGE,t=>{this._downloadPercent<1||this._loadPercent<1||(this.emit(xr.MessageReceived,this.curState),this._processor.add({avatar_motion_data:{first_package:!0,segment_num:1,binary_size:t.size,use_binary_frame:!1}}),this._processor.add({avatar_motion_data:{first_package:!1,motion_data_slice:t,is_audio_mute:this._audioMute}}))})}async render(){this._renderer=await Os.getInstance(this._avatarDivEle,this._assetsPath,{getChatState:this.getChatState.bind(this),getExpressionData:this.getArkitFaceFrame.bind(this),downloadProgress:this._downloadProgress.bind(this),loadProgress:this._loadProgress.bind(this)})}setAvatarMute(t){this._processor.setMute(t),this._audioMute=t}getChatState(){return this.curState}getArkitFaceFrame(){var t;return(t=this._processor)==null?void 0:t.getArkitFaceFrame().arkitFace}interrupt(){var t;this._ws.send("%interrupt%"),(t=this._processor)==null||t.interrupt(),this.curState=ma.Idle,this.emit(xr.StateChanged,this.curState)}sendSpeech(t){var i;this._ws.send(t),this.curState=ma.Listening,this.emit(xr.StateChanged,this.curState),(i=this._processor)==null||i.clear()}exit(){var t,i;(t=this._renderer)==null||t.dispose(),this.curState=ma.Idle,this._downloadPercent=0,this._loadPercent=0,(i=this._processor)==null||i.clear(),this.removeAllListeners()}_bindEventTypes(){this.on(Bl.Player_StartSpeaking,t=>{console.log("startSpeach"),this.curState=ma.Responding,this.emit(xr.StateChanged,this.curState),this._ws.send(JSON.stringify({header:{name:xr.StartSpeech},payload:{}}))}),this.on(Bl.Player_EndSpeaking,t=>{console.log("endSpeach"),this.curState=ma.Idle,this.emit(xr.StateChanged,this.curState),this._ws.send(JSON.stringify({header:{name:xr.EndSpeech},payload:{}}))}),this.on(xr.ErrorReceived,t=>{console.log("ErrorReceived",t),this.curState=ma.Idle,this.emit(xr.StateChanged,this.curState),this._ws.send(JSON.stringify({header:{name:xr.ErrorReceived},payload:{...t}}))}),this._ws.on(Kr.WS_CLOSE,()=>{this.exit()})}}function y1(){return navigator.mediaDevices.enumerateDevices()}async function BX(n,e,t){const i=(t==null?void 0:t.video)||t||{width:{ideal:500},height:{ideal:500}},r=(t==null?void 0:t.audio)||t||{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},s={video:typeof e=="object"?{...e,...i}:e,audio:typeof n=="object"?{...n,...r}:n};return console.log(s,"constraints"),navigator.mediaDevices.getUserMedia(s).then(o=>(console.log(o),o))}function Zb(n,e="videoinput"){return n.filter(i=>i.kind===e)}let cl=null,_o=null;function kX(n=1,e=1){const t=document.createElement("canvas");document.body.appendChild(t),t.width=n||500,t.height=e||500,t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.visibility="hidden";const i=t.getContext("2d");i.fillStyle="hsl(0,0, 0, 1)",i.fillRect(0,0,t.width,t.height);function r(){i.fillStyle="rgb(255, 255, 255)",i.fillRect(0,0,t.width,t.height),requestAnimationFrame(r)}return r(),cl=t.captureStream(30).getVideoTracks()[0],cl.stop=()=>{t.remove()},cl.onended=()=>{cl==null||cl.stop()},cl}function UX(){if(_o)return _o;const n=new(window.AudioContext||window.webkitAudioContext),e=n.createOscillator();e.frequency.setValueAtTime(0,n.currentTime);const t=n.createGain();t.gain.setValueAtTime(0,n.currentTime);const i=n.createMediaStreamDestination();return e.connect(t),t.connect(i),e.start(),_o=i.stream.getAudioTracks()[0],_o.stop=()=>{n.close()},_o.onended=()=>{_o==null||_o.stop()},_o}function Jb(n){console.debug("Stopping peer connection"),n.getTransceivers&&n.getTransceivers().forEach(e=>{e.stop&&e.stop()}),n.getSenders()&&n.getSenders().forEach(e=>{console.log("sender",e),e.track&&e.track.stop&&e.track.stop()}),setTimeout(()=>{n.close()},500)}async function zX(n,e,t){n.getTracks().forEach(async l=>{e.addTrack(l,n)}),e.addEventListener("track",l=>{t&&t.srcObject!==l.streams[0]&&(t.srcObject=l.streams[0])});const i=e.createDataChannel("text"),r=await e.createOffer();await e.setLocalDescription(r);const s=Math.random().toString(36).substring(7);e.onicecandidate=({candidate:l})=>{l&&(console.debug("Sending ICE candidate",l),fetch("/webrtc/offer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidate:l.toJSON(),webrtc_id:s,type:"ice-candidate"})}))};const a=await(await fetch("/webrtc/offer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sdp:r.sdp,type:r.type,webrtc_id:s})})).json();return await e.setRemoteDescription(a),[i,s]}function _h(n){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_h(n)}function VX(n,e){if(_h(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(_h(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function HX(n){var e=VX(n,"string");return _h(e)=="symbol"?e:e+""}function $X(n,e,t){return(e=HX(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function e3(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function yi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?e3(Object(t),!0).forEach(function(i){$X(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):e3(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ue(){return Ue=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ue.apply(null,arguments)}const GX=Array.isArray,WX=n=>typeof n=="string",QX=n=>n!==null&&typeof n=="object";function kc(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return typeof n=="function"?n(e):n!=null?n:t}function jX(n){let e;const t=new Promise(r=>{e=n(()=>{r(!0)})}),i=()=>{e==null||e()};return i.then=(r,s)=>t.then(r,s),i.promise=t,i}function kr(){const n=[];for(let e=0;e<arguments.length;e++){const t=e<0||arguments.length<=e?void 0:arguments[e];if(t){if(WX(t))n.push(t);else if(GX(t))for(let i=0;i<t.length;i++){const r=kr(t[i]);r&&n.push(r)}else if(QX(t))for(const i in t)t[i]&&n.push(i)}}return n.join(" ")}function qX(n){return n&&(n.type===Zs||n.type===Hn&&n.children.length===0||n.type===Iu&&n.children.trim()==="")}function s6(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];return n.forEach(t=>{Array.isArray(t)?e.push(...t):(t==null?void 0:t.type)===Hn?e.push(...s6(t.children)):e.push(t)}),e.filter(t=>!qX(t))}const XX=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e},Ox=n=>{const e=n;return e.install=function(t){t.component(e.displayName||e.name,n)},n};function Sr(n){return{type:Object,default:n}}function v1(n){return{type:Boolean,default:n}}function dv(n,e){const t={validator:()=>!0,default:n};return t}function t3(n){return{type:Array,default:n}}function n3(n){return{type:String,default:n}}function KX(n,e){return n?{type:n,default:e}:dv(e)}const Bx="anticon",YX=Symbol("GlobalFormContextKey"),ZX=n=>{ta(YX,n)},JX=()=>({iconPrefixCls:String,getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:Sr(),input:Sr(),autoInsertSpaceInButton:{type:Boolean,default:void 0},locale:Sr(),pageHeader:Sr(),componentSize:{type:String},componentDisabled:{type:Boolean,default:void 0},direction:{type:String,default:"ltr"},space:Sr(),virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:Sr(),pagination:Sr(),theme:Sr(),select:Sr(),wave:Sr()}),kx=Symbol("configProvider"),o6={getPrefixCls:(n,e)=>e||(n?"ant-".concat(n):"ant"),iconPrefixCls:Ge(()=>Bx),getPopupContainer:Ge(()=>()=>document.body),direction:Ge(()=>"ltr")},a6=()=>Ji(kx,o6),eK=n=>ta(kx,n),l6=Symbol("DisabledContextKey"),c6=()=>Ji(l6,Dn(void 0)),tK=n=>{const e=c6();return ta(l6,Ge(()=>{var t;return(t=n.value)!==null&&t!==void 0?t:e.value})),n},nK={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages"},iK={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"Ok",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"},u6={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},i3={lang:Ue({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},iK),timePickerLocale:Ue({},u6)},mr="${label} is not a valid ${type}",Su={locale:"en",Pagination:nK,DatePicker:i3,TimePicker:u6,Calendar:i3,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:mr,method:mr,array:mr,object:mr,number:mr,date:mr,boolean:mr,integer:mr,float:mr,regexp:mr,email:mr,url:mr,hex:mr},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"}},d6=rn({compatConfig:{MODE:3},name:"LocaleReceiver",props:{componentName:String,defaultLocale:{type:[Object,Function]},children:{type:Function}},setup(n,e){let{slots:t}=e;const i=Ji("localeData",{}),r=Ge(()=>{const{componentName:o="global",defaultLocale:a}=n,l=a||Su[o||"global"],{antLocale:c}=i,u=o&&c?c[o]:{};return Ue(Ue({},typeof l=="function"?l():l),u||{})}),s=Ge(()=>{const{antLocale:o}=i,a=o&&o.locale;return o&&o.exist&&!a?Su.locale:a});return()=>{const o=n.children||t.default,{antLocale:a}=i;return o==null?void 0:o(r.value,s.value,a)}}});function Ux(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}const r3="%";class rK{constructor(e){this.cache=new Map,this.instanceId=e}get(e){return this.cache.get(Array.isArray(e)?e.join(r3):e)||null}update(e,t){const i=Array.isArray(e)?e.join(r3):e,r=this.cache.get(i),s=t(r);s===null?this.cache.delete(i):this.cache.set(i,s)}}const h6="data-token-hash",Ll="data-css-hash",Uc="__cssinjs_instance__";function xh(){const n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const e=document.body.querySelectorAll("style[".concat(Ll,"]"))||[],{firstChild:t}=document.head;Array.from(e).forEach(r=>{r[Uc]=r[Uc]||n,r[Uc]===n&&document.head.insertBefore(r,t)});const i={};Array.from(document.querySelectorAll("style[".concat(Ll,"]"))).forEach(r=>{var s;const o=r.getAttribute(Ll);i[o]?r[Uc]===n&&((s=r.parentNode)===null||s===void 0||s.removeChild(r)):i[o]=!0})}return new rK(n)}const f6=Symbol("StyleContextKey"),sK=()=>{var n,e,t;const i=Wo();let r;if(i&&i.appContext){const s=(t=(e=(n=i.appContext)===null||n===void 0?void 0:n.config)===null||e===void 0?void 0:e.globalProperties)===null||t===void 0?void 0:t.__ANTDV_CSSINJS_CACHE__;s?r=s:(r=xh(),i.appContext.config.globalProperties&&(i.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__=r))}else r=xh();return r},p6={cache:xh(),defaultCache:!0,hashPriority:"low"},b0=()=>{const n=sK();return Ji(f6,Nr(Ue(Ue({},p6),{cache:n})))},oK=n=>{const e=b0(),t=Nr(Ue(Ue({},p6),{cache:xh()}));return ci([()=>We(n),e],()=>{const i=Ue({},e.value),r=We(n);Object.keys(r).forEach(o=>{const a=r[o];r[o]!==void 0&&(i[o]=a)});const{cache:s}=r;i.cache=i.cache||xh(),i.defaultCache=!s&&e.value.defaultCache,t.value=i},{immediate:!0}),ta(f6,t),t},aK=()=>({autoClear:v1(),mock:n3(),cache:Sr(),defaultCache:v1(),hashPriority:n3(),container:KX(),ssrInline:v1(),transformers:t3(),linters:t3()});Ox(rn({name:"AStyleProvider",inheritAttrs:!1,props:aK(),setup(n,e){let{slots:t}=e;return oK(n),()=>{var i;return(i=t.default)===null||i===void 0?void 0:i.call(t)}}}));function m6(n,e,t,i){const r=b0(),s=Nr(""),o=Nr();jm(()=>{s.value=[n,...e.value].join("%")});const a=l=>{r.value.cache.update(l,c=>{const[u=0,d]=c||[];return u-1===0?(i==null||i(d,!1),null):[u-1,d]})};return ci(s,(l,c)=>{c&&a(c),r.value.cache.update(l,u=>{const[d=0,h]=u||[],p=h||t();return[d+1,p]}),o.value=r.value.cache.get(s.value)[1]},{immediate:!0}),Jv(()=>{a(s.value)}),o}function $u(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function lK(n,e){return n&&n.contains?n.contains(e):!1}const s3="data-vc-order",cK="vc-util-key",hv=new Map;function g6(){let{mark:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n?n.startsWith("data-")?n:"data-".concat(n):cK}function T0(n){return n.attachTo?n.attachTo:document.querySelector("head")||document.body}function uK(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function y6(n){return Array.from((hv.get(n)||n).children).filter(e=>e.tagName==="STYLE")}function v6(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!$u())return null;const{csp:t,prepend:i}=e,r=document.createElement("style");r.setAttribute(s3,uK(i)),t!=null&&t.nonce&&(r.nonce=t==null?void 0:t.nonce),r.innerHTML=n;const s=T0(e),{firstChild:o}=s;if(i){if(i==="queue"){const a=y6(s).filter(l=>["prepend","prependQueue"].includes(l.getAttribute(s3)));if(a.length)return s.insertBefore(r,a[a.length-1].nextSibling),r}s.insertBefore(r,o)}else s.appendChild(r);return r}function _6(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const t=T0(e);return y6(t).find(i=>i.getAttribute(g6(e))===n)}function x6(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const t=_6(n,e);t&&T0(e).removeChild(t)}function dK(n,e){const t=hv.get(n);if(!t||!lK(document,t)){const i=v6("",e),{parentNode:r}=i;hv.set(n,r),n.removeChild(i)}}function Nm(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i,r,s;const o=T0(t);dK(o,t);const a=_6(e,t);if(a)return!((i=t.csp)===null||i===void 0)&&i.nonce&&a.nonce!==((r=t.csp)===null||r===void 0?void 0:r.nonce)&&(a.nonce=(s=t.csp)===null||s===void 0?void 0:s.nonce),a.innerHTML!==n&&(a.innerHTML=n),a;const l=v6(n,t);return l.setAttribute(g6(t),e),l}function hK(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}class Au{constructor(){this.cache=new Map,this.keys=[],this.cacheCallTimes=0}size(){return this.keys.length}internalGet(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i={map:this.cache};return e.forEach(r=>{var s;i?i=(s=i==null?void 0:i.map)===null||s===void 0?void 0:s.get(r):i=void 0}),i!=null&&i.value&&t&&(i.value[1]=this.cacheCallTimes++),i==null?void 0:i.value}get(e){var t;return(t=this.internalGet(e,!0))===null||t===void 0?void 0:t[0]}has(e){return!!this.internalGet(e)}set(e,t){if(!this.has(e)){if(this.size()+1>Au.MAX_CACHE_SIZE+Au.MAX_CACHE_OFFSET){const[r]=this.keys.reduce((s,o)=>{const[,a]=s;return this.internalGet(o)[1]<a?[o,this.internalGet(o)[1]]:s},[this.keys[0],this.cacheCallTimes]);this.delete(r)}this.keys.push(e)}let i=this.cache;e.forEach((r,s)=>{if(s===e.length-1)i.set(r,{value:[t,this.cacheCallTimes++]});else{const o=i.get(r);o?o.map||(o.map=new Map):i.set(r,{map:new Map}),i=i.get(r).map}})}deleteByPath(e,t){var i;const r=e.get(t[0]);if(t.length===1)return r.map?e.set(t[0],{map:r.map}):e.delete(t[0]),(i=r.value)===null||i===void 0?void 0:i[0];const s=this.deleteByPath(r.map,t.slice(1));return(!r.map||r.map.size===0)&&!r.value&&e.delete(t[0]),s}delete(e){if(this.has(e))return this.keys=this.keys.filter(t=>!hK(t,e)),this.deleteByPath(this.cache,e)}}Au.MAX_CACHE_SIZE=20;Au.MAX_CACHE_OFFSET=5;function fK(){}let S6=fK,o3=0;class A6{constructor(e){this.derivatives=Array.isArray(e)?e:[e],this.id=o3,e.length===0&&S6(e.length>0),o3+=1}getDerivativeToken(e){return this.derivatives.reduce((t,i)=>i(e,t),void 0)}}const _1=new Au;function b6(n){const e=Array.isArray(n)?n:[n];return _1.has(e)||_1.set(e,new A6(e)),_1.get(e)}const a3=new WeakMap;function Pm(n){let e=a3.get(n)||"";return e||(Object.keys(n).forEach(t=>{const i=n[t];e+=t,i instanceof A6?e+=i.id:i&&typeof i=="object"?e+=Pm(i):e+=i}),a3.set(n,e)),e}function pK(n,e){return Ux("".concat(e,"_").concat(Pm(n)))}const Wd="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),T6="_bAmBoO_";function mK(n,e,t){var i,r;if($u()){Nm(n,Wd);const s=document.createElement("div");s.style.position="fixed",s.style.left="0",s.style.top="0",e==null||e(s),document.body.appendChild(s);const o=t?t(s):(i=getComputedStyle(s).content)===null||i===void 0?void 0:i.includes(T6);return(r=s.parentNode)===null||r===void 0||r.removeChild(s),x6(Wd),o}return!1}let x1;function gK(){return x1===void 0&&(x1=mK("@layer ".concat(Wd," { .").concat(Wd,' { content: "').concat(T6,'"!important; } }'),n=>{n.className=Wd})),x1}const l3={},yK="css",gl=new Map;function vK(n){gl.set(n,(gl.get(n)||0)+1)}function _K(n,e){typeof document<"u"&&document.querySelectorAll("style[".concat(h6,'="').concat(n,'"]')).forEach(i=>{var r;i[Uc]===e&&((r=i.parentNode)===null||r===void 0||r.removeChild(i))})}const xK=0;function SK(n,e){gl.set(n,(gl.get(n)||0)-1);const t=Array.from(gl.keys()),i=t.filter(r=>(gl.get(r)||0)<=0);t.length-i.length>xK&&i.forEach(r=>{_K(r,e),gl.delete(r)})}const AK=(n,e,t,i)=>{const r=t.getDerivativeToken(n);let s=Ue(Ue({},r),e);return i&&(s=i(s)),s};function bK(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dn({});const i=b0(),r=Ge(()=>Ue({},...e.value)),s=Ge(()=>Pm(r.value)),o=Ge(()=>Pm(t.value.override||l3));return m6("token",Ge(()=>[t.value.salt||"",n.value.id,s.value,o.value]),()=>{const{salt:l="",override:c=l3,formatToken:u,getComputedToken:d}=t.value,h=d?d(r.value,c,n.value):AK(r.value,c,n.value,u),f=pK(h,l);h._tokenKey=f,vK(f);const p="".concat(yK,"-").concat(Ux(f));return h._hashId=p,[h,p]},l=>{var c;SK(l[0]._tokenKey,(c=i.value)===null||c===void 0?void 0:c.cache.instanceId)})}var TK={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},w6="comm",C6="rule",E6="decl",wK="@import",CK="@namespace",EK="@keyframes",MK="@layer",M6=Math.abs,zx=String.fromCharCode;function R6(n){return n.trim()}function Bp(n,e,t){return n.replace(e,t)}function RK(n,e,t){return n.indexOf(e,t)}function Yc(n,e){return n.charCodeAt(e)|0}function bu(n,e,t){return n.slice(e,t)}function Bs(n){return n.length}function IK(n){return n.length}function op(n,e){return e.push(n),n}var w0=1,Tu=1,I6=0,rs=0,$n=0,Gu="";function Vx(n,e,t,i,r,s,o,a){return{value:n,root:e,parent:t,type:i,props:r,children:s,line:w0,column:Tu,length:o,return:"",siblings:a}}function NK(){return $n}function PK(){return $n=rs>0?Yc(Gu,--rs):0,Tu--,$n===10&&(Tu=1,w0--),$n}function Ss(){return $n=rs<I6?Yc(Gu,rs++):0,Tu++,$n===10&&(Tu=1,w0++),$n}function Ea(){return Yc(Gu,rs)}function kp(){return rs}function C0(n,e){return bu(Gu,n,e)}function Sh(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function LK(n){return w0=Tu=1,I6=Bs(Gu=n),rs=0,[]}function DK(n){return Gu="",n}function S1(n){return R6(C0(rs-1,fv(n===91?n+2:n===40?n+1:n)))}function FK(n){for(;($n=Ea())&&$n<33;)Ss();return Sh(n)>2||Sh($n)>3?"":" "}function OK(n,e){for(;--e&&Ss()&&!($n<48||$n>102||$n>57&&$n<65||$n>70&&$n<97););return C0(n,kp()+(e<6&&Ea()==32&&Ss()==32))}function fv(n){for(;Ss();)switch($n){case n:return rs;case 34:case 39:n!==34&&n!==39&&fv($n);break;case 40:n===41&&fv(n);break;case 92:Ss();break}return rs}function BK(n,e){for(;Ss()&&n+$n!==57;)if(n+$n===84&&Ea()===47)break;return"/*"+C0(e,rs-1)+"*"+zx(n===47?n:Ss())}function kK(n){for(;!Sh(Ea());)Ss();return C0(n,rs)}function UK(n){return DK(Up("",null,null,null,[""],n=LK(n),0,[0],n))}function Up(n,e,t,i,r,s,o,a,l){for(var c=0,u=0,d=o,h=0,f=0,p=0,g=1,y=1,m=1,v=0,x="",_=r,S=s,E=i,A=x;y;)switch(p=v,v=Ss()){case 40:if(p!=108&&Yc(A,d-1)==58){RK(A+=Bp(S1(v),"&","&\f"),"&\f",M6(c?a[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:A+=S1(v);break;case 9:case 10:case 13:case 32:A+=FK(p);break;case 92:A+=OK(kp()-1,7);continue;case 47:switch(Ea()){case 42:case 47:op(zK(BK(Ss(),kp()),e,t,l),l),(Sh(p||1)==5||Sh(Ea()||1)==5)&&Bs(A)&&bu(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*g:a[c++]=Bs(A)*m;case 125*g:case 59:case 0:switch(v){case 0:case 125:y=0;case 59+u:m==-1&&(A=Bp(A,/\f/g,"")),f>0&&(Bs(A)-d||g===0&&p===47)&&op(f>32?u3(A+";",i,t,d-1,l):u3(Bp(A," ","")+";",i,t,d-2,l),l);break;case 59:A+=";";default:if(op(E=c3(A,e,t,c,u,r,a,x,_=[],S=[],d,s),s),v===123)if(u===0)Up(A,e,E,E,_,s,d,a,S);else{switch(h){case 99:if(Yc(A,3)===110)break;case 108:if(Yc(A,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Up(n,E,E,i&&op(c3(n,E,E,0,0,r,a,x,r,_=[],d,S),S),r,S,d,a,i?_:S):Up(A,E,E,E,[""],S,0,a,S)}}c=u=f=0,g=m=1,x=A="",d=o;break;case 58:d=1+Bs(A),f=p;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&PK()==125)continue}switch(A+=zx(v),v*g){case 38:m=u>0?1:(A+="\f",-1);break;case 44:a[c++]=(Bs(A)-1)*m,m=1;break;case 64:Ea()===45&&(A+=S1(Ss())),h=Ea(),u=d=Bs(x=A+=kK(kp())),v++;break;case 45:p===45&&Bs(A)==2&&(g=0)}}return s}function c3(n,e,t,i,r,s,o,a,l,c,u,d){for(var h=r-1,f=r===0?s:[""],p=IK(f),g=0,y=0,m=0;g<i;++g)for(var v=0,x=bu(n,h+1,h=M6(y=o[g])),_=n;v<p;++v)(_=R6(y>0?f[v]+" "+x:Bp(x,/&\f/g,f[v])))&&(l[m++]=_);return Vx(n,e,t,r===0?C6:a,l,c,u,d)}function zK(n,e,t,i){return Vx(n,e,t,w6,zx(NK()),bu(n,2,-2),0,i)}function u3(n,e,t,i,r){return Vx(n,e,t,E6,bu(n,0,i),bu(n,i+1,-1),i,r)}function pv(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function VK(n,e,t,i){switch(n.type){case MK:if(n.children.length)break;case wK:case CK:case E6:return n.return=n.return||n.value;case w6:return"";case EK:return n.return=n.value+"{"+pv(n.children,i)+"}";case C6:if(!Bs(n.value=n.props.join(",")))return""}return Bs(t=pv(n.children,i))?n.return=n.value+"{"+t+"}":""}const d3="data-ant-cssinjs-cache-path",HK="_FILE_STYLE__";let Dl,N6=!0;function $K(){var n;if(!Dl&&(Dl={},$u())){const e=document.createElement("div");e.className=d3,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);let t=getComputedStyle(e).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(r=>{const[s,o]=r.split(":");Dl[s]=o});const i=document.querySelector("style[".concat(d3,"]"));i&&(N6=!1,(n=i.parentNode)===null||n===void 0||n.removeChild(i)),document.body.removeChild(e)}}function GK(n){return $K(),!!Dl[n]}function WK(n){const e=Dl[n];let t=null;if(e&&$u())if(N6)t=HK;else{const i=document.querySelector("style[".concat(Ll,'="').concat(Dl[n],'"]'));i?t=i.innerHTML:delete Dl[n]}return[t,e]}const h3=$u(),QK="_skip_check_",P6="_multi_value_";function f3(n){return pv(UK(n),VK).replace(/\{%%%\:[^;];}/g,";")}function jK(n){return typeof n=="object"&&n&&(QK in n||P6 in n)}function qK(n,e,t){if(!e)return n;const i=".".concat(e),r=t==="low"?":where(".concat(i,")"):i;return n.split(",").map(o=>{var a;const l=o.trim().split(/\s+/);let c=l[0]||"";const u=((a=c.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return c="".concat(u).concat(r).concat(c.slice(u.length)),[c,...l.slice(1)].join(" ")}).join(",")}const p3=new Set,mv=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{root:t,injectHash:i,parentSelectors:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]};const{hashId:s,layer:o,path:a,hashPriority:l,transformers:c=[],linters:u=[]}=e;let d="",h={};function f(y){const m=y.getName(s);if(!h[m]){const[v]=mv(y.style,e,{root:!1,parentSelectors:r});h[m]="@keyframes ".concat(y.getName(s)).concat(v)}}function p(y){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(v=>{Array.isArray(v)?p(v,m):v&&m.push(v)}),m}if(p(Array.isArray(n)?n:[n]).forEach(y=>{const m=typeof y=="string"&&!t?{}:y;if(typeof m=="string")d+="".concat(m,"\n");else if(m._keyframe)f(m);else{const v=c.reduce((x,_)=>{var S;return((S=_==null?void 0:_.visit)===null||S===void 0?void 0:S.call(_,x))||x},m);Object.keys(v).forEach(x=>{var _;const S=v[x];if(typeof S=="object"&&S&&(x!=="animationName"||!S._keyframe)&&!jK(S)){let E=!1,A=x.trim(),R=!1;(t||i)&&s?A.startsWith("@")?E=!0:A=qK(x,s,l):t&&!s&&(A==="&"||A==="")&&(A="",R=!0);const[w,M]=mv(S,e,{root:R,injectHash:E,parentSelectors:[...r,A]});h=Ue(Ue({},h),M),d+="".concat(A).concat(w)}else{let E=function(R,w){const M=R.replace(/[A-Z]/g,L=>"-".concat(L.toLowerCase()));let I=w;!TK[R]&&typeof I=="number"&&I!==0&&(I="".concat(I,"px")),R==="animationName"&&(w!=null&&w._keyframe)&&(f(w),I=w.getName(s)),d+="".concat(M,":").concat(I,";")};const A=(_=S==null?void 0:S.value)!==null&&_!==void 0?_:S;typeof S=="object"&&(S!=null&&S[P6])&&Array.isArray(A)?A.forEach(R=>{E(x,R)}):E(x,A)}})}}),!t)d="{".concat(d,"}");else if(o&&gK()){const y=o.split(","),m=y[y.length-1].trim();d="@layer ".concat(m," {").concat(d,"}"),y.length>1&&(d="@layer ".concat(o,"{%%%:%}").concat(d))}return[d,h]};function XK(n,e){return Ux("".concat(n.join("%")).concat(e))}function gv(n,e){const t=b0(),i=Ge(()=>n.value.token._tokenKey),r=Ge(()=>[i.value,...n.value.path]);let s=h3;return m6("style",r,()=>{const{path:o,hashId:a,layer:l,nonce:c,clientOnly:u,order:d=0}=n.value,h=r.value.join("|");if(GK(h)){const[A,R]=WK(h);if(A)return[A,i.value,R,{},u,d]}const f=e(),{hashPriority:p,container:g,transformers:y,linters:m,cache:v}=t.value,[x,_]=mv(f,{hashId:a,hashPriority:p,layer:l,path:o.join("-"),transformers:y,linters:m}),S=f3(x),E=XK(r.value,S);if(s){const A={mark:Ll,prepend:"queue",attachTo:g,priority:d},R=typeof c=="function"?c():c;R&&(A.csp={nonce:R});const w=Nm(S,E,A);w[Uc]=v.instanceId,w.setAttribute(h6,i.value),Object.keys(_).forEach(M=>{p3.has(M)||(p3.add(M),Nm(f3(_[M]),"_effect-".concat(M),{mark:Ll,prepend:"queue",attachTo:g}))})}return[S,i.value,E,_,u,d]},(o,a)=>{let[,,l]=o;(a||t.value.autoClear)&&h3&&x6(l,{mark:Ll})}),o=>o}class Fl{constructor(e,t){this._keyframe=!0,this.name=e,this.style=t}getName(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}const KK="4.2.6";function Ai(n,e){YK(n)&&(n="100%");var t=ZK(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function ap(n){return Math.min(1,Math.max(0,n))}function YK(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function ZK(n){return typeof n=="string"&&n.indexOf("%")!==-1}function L6(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function lp(n){return n<=1?"".concat(Number(n)*100,"%"):n}function bl(n){return n.length===1?"0"+n:String(n)}function JK(n,e,t){return{r:Ai(n,255)*255,g:Ai(e,255)*255,b:Ai(t,255)*255}}function m3(n,e,t){n=Ai(n,255),e=Ai(e,255),t=Ai(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,a=(i+r)/2;if(i===r)o=0,s=0;else{var l=i-r;switch(o=a>.5?l/(2-i-r):l/(i+r),i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:o,l:a}}function A1(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function eY(n,e,t){var i,r,s;if(n=Ai(n,360),e=Ai(e,100),t=Ai(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;i=A1(a,o,n+1/3),r=A1(a,o,n),s=A1(a,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function yv(n,e,t){n=Ai(n,255),e=Ai(e,255),t=Ai(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,a=i-r,l=i===0?0:a/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/a+(e<t?6:0);break;case e:s=(t-n)/a+2;break;case t:s=(n-e)/a+4;break}s/=6}return{h:s,s:l,v:o}}function tY(n,e,t){n=Ai(n,360)*6,e=Ai(e,100),t=Ai(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),l=i%6,c=[t,o,s,s,a,t][l],u=[a,t,t,o,s,s][l],d=[s,s,a,t,t,o][l];return{r:c*255,g:u*255,b:d*255}}function vv(n,e,t,i){var r=[bl(Math.round(n).toString(16)),bl(Math.round(e).toString(16)),bl(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function nY(n,e,t,i,r){var s=[bl(Math.round(n).toString(16)),bl(Math.round(e).toString(16)),bl(Math.round(t).toString(16)),bl(iY(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function iY(n){return Math.round(parseFloat(n)*255).toString(16)}function g3(n){return yr(n)/255}function yr(n){return parseInt(n,16)}function rY(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var _v={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ic(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,a=!1;return typeof n=="string"&&(n=aY(n)),typeof n=="object"&&(xo(n.r)&&xo(n.g)&&xo(n.b)?(e=JK(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):xo(n.h)&&xo(n.s)&&xo(n.v)?(i=lp(n.s),r=lp(n.v),e=tY(n.h,i,r),o=!0,a="hsv"):xo(n.h)&&xo(n.s)&&xo(n.l)&&(i=lp(n.s),s=lp(n.l),e=eY(n.h,i,s),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=L6(t),{ok:o,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var sY="[-\\+]?\\d+%?",oY="[-\\+]?\\d*\\.\\d+%?",Ma="(?:".concat(oY,")|(?:").concat(sY,")"),b1="[\\s|\\(]+(".concat(Ma,")[,|\\s]+(").concat(Ma,")[,|\\s]+(").concat(Ma,")\\s*\\)?"),T1="[\\s|\\(]+(".concat(Ma,")[,|\\s]+(").concat(Ma,")[,|\\s]+(").concat(Ma,")[,|\\s]+(").concat(Ma,")\\s*\\)?"),ds={CSS_UNIT:new RegExp(Ma),rgb:new RegExp("rgb"+b1),rgba:new RegExp("rgba"+T1),hsl:new RegExp("hsl"+b1),hsla:new RegExp("hsla"+T1),hsv:new RegExp("hsv"+b1),hsva:new RegExp("hsva"+T1),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function aY(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(_v[n])n=_v[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ds.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=ds.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ds.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=ds.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ds.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=ds.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ds.hex8.exec(n),t?{r:yr(t[1]),g:yr(t[2]),b:yr(t[3]),a:g3(t[4]),format:e?"name":"hex8"}:(t=ds.hex6.exec(n),t?{r:yr(t[1]),g:yr(t[2]),b:yr(t[3]),format:e?"name":"hex"}:(t=ds.hex4.exec(n),t?{r:yr(t[1]+t[1]),g:yr(t[2]+t[2]),b:yr(t[3]+t[3]),a:g3(t[4]+t[4]),format:e?"name":"hex8"}:(t=ds.hex3.exec(n),t?{r:yr(t[1]+t[1]),g:yr(t[2]+t[2]),b:yr(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function xo(n){return!!ds.CSS_UNIT.exec(String(n))}var vi=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=rY(e)),this.originalInput=e;var r=Ic(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,a=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=L6(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=yv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=yv(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=m3(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=m3(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),vv(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),nY(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Ai(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Ai(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+vv(this.r,this.g,this.b,!1),t=0,i=Object.entries(_v);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e!=null?e:this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=ap(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=ap(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=ap(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=ap(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],a=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+a)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}(),cp=2,y3=.16,lY=.05,cY=.05,uY=.15,D6=5,F6=4,dY=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function v3(n){var e=n.r,t=n.g,i=n.b,r=yv(e,t,i);return{h:r.h*360,s:r.s,v:r.v}}function up(n){var e=n.r,t=n.g,i=n.b;return"#".concat(vv(e,t,i,!1))}function hY(n,e,t){var i=t/100,r={r:(e.r-n.r)*i+n.r,g:(e.g-n.g)*i+n.g,b:(e.b-n.b)*i+n.b};return r}function _3(n,e,t){var i;return Math.round(n.h)>=60&&Math.round(n.h)<=240?i=t?Math.round(n.h)-cp*e:Math.round(n.h)+cp*e:i=t?Math.round(n.h)+cp*e:Math.round(n.h)-cp*e,i<0?i+=360:i>=360&&(i-=360),i}function x3(n,e,t){if(n.h===0&&n.s===0)return n.s;var i;return t?i=n.s-y3*e:e===F6?i=n.s+y3:i=n.s+lY*e,i>1&&(i=1),t&&e===D6&&i>.1&&(i=.1),i<.06&&(i=.06),Number(i.toFixed(2))}function S3(n,e,t){var i;return t?i=n.v+cY*e:i=n.v-uY*e,i>1&&(i=1),Number(i.toFixed(2))}function $l(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],i=Ic(n),r=D6;r>0;r-=1){var s=v3(i),o=up(Ic({h:_3(s,r,!0),s:x3(s,r,!0),v:S3(s,r,!0)}));t.push(o)}t.push(up(i));for(var a=1;a<=F6;a+=1){var l=v3(i),c=up(Ic({h:_3(l,a),s:x3(l,a),v:S3(l,a)}));t.push(c)}return e.theme==="dark"?dY.map(function(u){var d=u.index,h=u.opacity,f=up(hY(Ic(e.backgroundColor||"#141414"),Ic(t[d]),h*100));return f}):t}var w1={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},zp={},C1={};Object.keys(w1).forEach(function(n){zp[n]=$l(w1[n]),zp[n].primary=zp[n][5],C1[n]=$l(w1[n],{theme:"dark",backgroundColor:"#141414"}),C1[n].primary=C1[n][5]});var fY=zp.blue;const pY=n=>{const{controlHeight:e}=n;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function mY(n){const{sizeUnit:e,sizeStep:t}=n;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const O6={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},E0=Ue(Ue({},O6),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1});function gY(n,e){let{generateColorPalettes:t,generateNeutralColorPalettes:i}=e;const{colorSuccess:r,colorWarning:s,colorError:o,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=n,d=t(l),h=t(r),f=t(s),p=t(o),g=t(a),y=i(c,u);return Ue(Ue({},y),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:g[1],colorInfoBgHover:g[2],colorInfoBorder:g[3],colorInfoBorderHover:g[4],colorInfoHover:g[4],colorInfo:g[6],colorInfoActive:g[7],colorInfoTextHover:g[8],colorInfoText:g[9],colorInfoTextActive:g[10],colorBgMask:new vi("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const yY=n=>{let e=n,t=n,i=n,r=n;return n<6&&n>=5?e=n+1:n<16&&n>=6?e=n+2:n>=16&&(e=16),n<7&&n>=5?t=4:n<8&&n>=7?t=5:n<14&&n>=8?t=6:n<16&&n>=14?t=7:n>=16&&(t=8),n<6&&n>=2?i=1:n>=6&&(i=2),n>4&&n<8?r=4:n>=8&&(r=6),{borderRadius:n>16?16:n,borderRadiusXS:i,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}};function vY(n){const{motionUnit:e,motionBase:t,borderRadius:i,lineWidth:r}=n;return Ue({motionDurationFast:"".concat((t+e).toFixed(1),"s"),motionDurationMid:"".concat((t+e*2).toFixed(1),"s"),motionDurationSlow:"".concat((t+e*3).toFixed(1),"s"),lineWidthBold:r+1},yY(i))}const So=(n,e)=>new vi(n).setAlpha(e).toRgbString(),_d=(n,e)=>new vi(n).darken(e).toHexString(),_Y=n=>{const e=$l(n);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},xY=(n,e)=>{const t=n||"#fff",i=e||"#000";return{colorBgBase:t,colorTextBase:i,colorText:So(i,.88),colorTextSecondary:So(i,.65),colorTextTertiary:So(i,.45),colorTextQuaternary:So(i,.25),colorFill:So(i,.15),colorFillSecondary:So(i,.06),colorFillTertiary:So(i,.04),colorFillQuaternary:So(i,.02),colorBgLayout:_d(t,4),colorBgContainer:_d(t,0),colorBgElevated:_d(t,0),colorBgSpotlight:So(i,.85),colorBorder:_d(t,15),colorBorderSecondary:_d(t,6)}};function SY(n){const e=new Array(10).fill(null).map((t,i)=>{const r=i-1,s=n*Math.pow(2.71828,r/5),o=i>1?Math.floor(s):Math.ceil(s);return Math.floor(o/2)*2});return e[1]=n,e.map(t=>{const i=t+8;return{size:t,lineHeight:i/t}})}const AY=n=>{const e=SY(n),t=e.map(r=>r.size),i=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:i[1],lineHeightLG:i[2],lineHeightSM:i[0],lineHeightHeading1:i[6],lineHeightHeading2:i[5],lineHeightHeading3:i[4],lineHeightHeading4:i[3],lineHeightHeading5:i[2]}};function bY(n){const e=Object.keys(O6).map(t=>{const i=$l(n[t]);return new Array(10).fill(1).reduce((r,s,o)=>(r["".concat(t,"-").concat(o+1)]=i[o],r),{})}).reduce((t,i)=>(t=Ue(Ue({},t),i),t),{});return Ue(Ue(Ue(Ue(Ue(Ue(Ue({},n),e),gY(n,{generateColorPalettes:_Y,generateNeutralColorPalettes:xY})),AY(n.fontSize)),mY(n)),pY(n)),vY(n))}function E1(n){return n>=0&&n<=255}function dp(n,e){const{r:t,g:i,b:r,a:s}=new vi(n).toRgb();if(s<1)return n;const{r:o,g:a,b:l}=new vi(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-o*(1-c))/c),d=Math.round((i-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if(E1(u)&&E1(d)&&E1(h))return new vi({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new vi({r:t,g:i,b:r,a:1}).toRgbString()}var TY=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function wY(n){const{override:e}=n,t=TY(n,["override"]),i=Ue({},e);Object.keys(E0).forEach(f=>{delete i[f]});const r=Ue(Ue({},t),i),s=480,o=576,a=768,l=992,c=1200,u=1600,d=2e3;return Ue(Ue(Ue({},r),{colorLink:r.colorInfoText,colorLinkHover:r.colorInfoHover,colorLinkActive:r.colorInfoActive,colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:dp(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:dp(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:dp(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:dp(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:s,screenXSMin:s,screenXSMax:o-1,screenSM:o,screenSMMin:o,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,screenXXLMax:d-1,screenXXXL:d,screenXXXLMin:d,boxShadowPopoverArrow:"3px 3px 7px rgba(0, 0, 0, 0.1)",boxShadowCard:"\n 0 1px 2px -2px ".concat(new vi("rgba(0, 0, 0, 0.16)").toRgbString(),",\n 0 3px 6px 0 ").concat(new vi("rgba(0, 0, 0, 0.12)").toRgbString(),",\n 0 5px 12px 4px ").concat(new vi("rgba(0, 0, 0, 0.09)").toRgbString(),"\n "),boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),i)}const B6=n=>({boxSizing:"border-box",margin:0,padding:0,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,listStyle:"none",fontFamily:n.fontFamily}),CY=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),EY=n=>({a:{color:n.colorLink,textDecoration:n.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:"color ".concat(n.motionDurationSlow),"-webkit-text-decoration-skip":"objects","&:hover":{color:n.colorLinkHover},"&:active":{color:n.colorLinkActive},"&:active,\n &:hover":{textDecoration:n.linkHoverDecoration,outline:0},"&:focus":{textDecoration:n.linkFocusDecoration,outline:0},"&[disabled]":{color:n.colorTextDisabled,cursor:"not-allowed"}}}),MY=(n,e)=>{const{fontFamily:t,fontSize:i}=n,r='[class^="'.concat(e,'"], [class*=" ').concat(e,'"]');return{[r]:{fontFamily:t,fontSize:i,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}};function Hx(n,e,t){return i=>{const r=Ge(()=>i==null?void 0:i.value),[s,o,a]=R0(),{getPrefixCls:l,iconPrefixCls:c}=a6(),u=Ge(()=>l()),d=Ge(()=>({theme:s.value,token:o.value,hashId:a.value,path:["Shared",u.value]}));gv(d,()=>[{"&":EY(o.value)}]);const h=Ge(()=>({theme:s.value,token:o.value,hashId:a.value,path:[n,r.value,c.value]}));return[gv(h,()=>{const{token:f,flush:p}=IY(o.value),g=typeof t=="function"?t(f):t,y=Ue(Ue({},g),o.value[n]),m=".".concat(r.value),v=M0(f,{componentCls:m,prefixCls:r.value,iconCls:".".concat(c.value),antCls:".".concat(u.value)},y),x=e(v,{hashId:a.value,prefixCls:r.value,rootPrefixCls:u.value,iconPrefixCls:c.value,overrideComponentToken:o.value[n]});return p(n,y),[MY(o.value,r.value),x]}),a]}}const k6=typeof CSSINJS_STATISTIC<"u";let xv=!0;function M0(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(!k6)return Ue({},...e);xv=!1;const i={};return e.forEach(r=>{Object.keys(r).forEach(o=>{Object.defineProperty(i,o,{configurable:!0,enumerable:!0,get:()=>r[o]})})}),xv=!0,i}function RY(){}function IY(n){let e,t=n,i=RY;return k6&&(e=new Set,t=new Proxy(n,{get(r,s){return xv&&e.add(s),r[s]}}),i=(r,s)=>{Array.from(e)}),{token:t,keys:e,flush:i}}const NY=b6(bY),U6={token:E0,hashed:!0},z6=Symbol("DesignTokenContext"),Sv=Nr(),PY=n=>{ta(z6,n),ci(n,()=>{Sv.value=We(n),XI(Sv)},{immediate:!0,deep:!0})},LY=rn({props:{value:Sr()},setup(n,e){let{slots:t}=e;return PY(Ge(()=>n.value)),()=>{var i;return(i=t.default)===null||i===void 0?void 0:i.call(t)}}});function R0(){const n=Ji(z6,Ge(()=>Sv.value||U6)),e=Ge(()=>"".concat(KK,"-").concat(n.value.hashed||"")),t=Ge(()=>n.value.theme||NY),i=bK(t,Ge(()=>[E0,n.value.token]),Ge(()=>({salt:e.value,override:Ue({override:n.value.token},n.value.components),formatToken:wY})));return[t,Ge(()=>i.value[0]),Ge(()=>n.value.hashed?i.value[1]:"")]}const $x=rn({compatConfig:{MODE:3},setup(){const[,n]=R0(),e=Ge(()=>new vi(n.value.colorBgBase).toHsl().l<.5?{opacity:.65}:{});return()=>Re("svg",{style:e.value,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},[Re("g",{fill:"none","fill-rule":"evenodd"},[Re("g",{transform:"translate(24 31.67)"},[Re("ellipse",{"fill-opacity":".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"},null),Re("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"},null),Re("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"},null),Re("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"},null),Re("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"},null)]),Re("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"},null),Re("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},[Re("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"},null),Re("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"},null)])])])}});$x.PRESENTED_IMAGE_DEFAULT=!0;const V6=rn({compatConfig:{MODE:3},setup(){const[,n]=R0(),e=Ge(()=>{const{colorFill:t,colorFillTertiary:i,colorFillQuaternary:r,colorBgContainer:s}=n.value;return{borderColor:new vi(t).onBackground(s).toHexString(),shadowColor:new vi(i).onBackground(s).toHexString(),contentColor:new vi(r).onBackground(s).toHexString()}});return()=>Re("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},[Re("g",{transform:"translate(0 1)",fill:"none","fill-rule":"evenodd"},[Re("ellipse",{fill:e.value.shadowColor,cx:"32",cy:"33",rx:"32",ry:"7"},null),Re("g",{"fill-rule":"nonzero",stroke:e.value.borderColor},[Re("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"},null),Re("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:e.value.contentColor},null)])])])}});V6.PRESENTED_IMAGE_SIMPLE=!0;const DY=n=>{const{componentCls:e,margin:t,marginXS:i,marginXL:r,fontSize:s,lineHeight:o}=n;return{[e]:{marginInline:i,fontSize:s,lineHeight:o,textAlign:"center",["".concat(e,"-image")]:{height:n.emptyImgHeight,marginBottom:i,opacity:n.opacityImage,img:{height:"100%"},svg:{height:"100%",margin:"auto"}},["".concat(e,"-footer")]:{marginTop:t},"&-normal":{marginBlock:r,color:n.colorTextDisabled,["".concat(e,"-image")]:{height:n.emptyImgHeightMD}},"&-small":{marginBlock:i,color:n.colorTextDisabled,["".concat(e,"-image")]:{height:n.emptyImgHeightSM}}}}},FY=Hx("Empty",n=>{const{componentCls:e,controlHeightLG:t}=n,i=M0(n,{emptyImgCls:"".concat(e,"-img"),emptyImgHeight:t*2.5,emptyImgHeightMD:t,emptyImgHeightSM:t*.875});return[DY(i)]});var OY=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const BY=()=>({prefixCls:String,imageStyle:Sr(),image:dv(),description:dv()}),Gx=rn({name:"AEmpty",compatConfig:{MODE:3},inheritAttrs:!1,props:BY(),setup(n,e){let{slots:t={},attrs:i}=e;const{direction:r,prefixCls:s}=I0("empty",n),[o,a]=FY(s);return()=>{var l,c;const u=s.value,d=Ue(Ue({},n),i),{image:h=((l=t.image)===null||l===void 0?void 0:l.call(t))||Da($x),description:f=((c=t.description)===null||c===void 0?void 0:c.call(t))||void 0,imageStyle:p,class:g=""}=d,y=OY(d,["image","description","imageStyle","class"]),m=typeof h=="function"?h():h,v=typeof m=="object"&&"type"in m&&m.type.PRESENTED_IMAGE_SIMPLE;return o(Re(d6,{componentName:"Empty",children:x=>{const _=typeof f<"u"?f:x.description,S=typeof _=="string"?_:"empty";let E=null;return typeof m=="string"?E=Re("img",{alt:S,src:m},null):E=m,Re("div",yi({class:kr(u,g,a.value,{["".concat(u,"-normal")]:v,["".concat(u,"-rtl")]:r.value==="rtl"})},y),[Re("div",{class:"".concat(u,"-image"),style:p},[E]),_&&Re("p",{class:"".concat(u,"-description")},[_]),t.default&&Re("div",{class:"".concat(u,"-footer")},[s6(t.default())])])}},null))}}});Gx.PRESENTED_IMAGE_DEFAULT=()=>Da($x);Gx.PRESENTED_IMAGE_SIMPLE=()=>Da(V6);const xd=Ox(Gx),H6=n=>{const{prefixCls:e}=I0("empty",n);return(i=>{switch(i){case"Table":case"List":return Re(xd,{image:xd.PRESENTED_IMAGE_SIMPLE},null);case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Re(xd,{image:xd.PRESENTED_IMAGE_SIMPLE,class:"".concat(e.value,"-small")},null);default:return Re(xd,null,null)}})(n.componentName)};function kY(n){return Re(H6,{componentName:n},null)}const $6=Symbol("SizeContextKey"),G6=()=>Ji($6,Dn(void 0)),UY=n=>{const e=G6();return ta($6,Ge(()=>n.value||e.value)),n},I0=(n,e)=>{const t=G6(),i=c6(),r=Ji(kx,Ue(Ue({},o6),{renderEmpty:A=>Da(H6,{componentName:A})})),s=Ge(()=>r.getPrefixCls(n,e.prefixCls)),o=Ge(()=>{var A,R;return(A=e.direction)!==null&&A!==void 0?A:(R=r.direction)===null||R===void 0?void 0:R.value}),a=Ge(()=>{var A;return(A=e.iconPrefixCls)!==null&&A!==void 0?A:r.iconPrefixCls.value}),l=Ge(()=>r.getPrefixCls()),c=Ge(()=>{var A;return(A=r.autoInsertSpaceInButton)===null||A===void 0?void 0:A.value}),u=r.renderEmpty,d=r.space,h=r.pageHeader,f=r.form,p=Ge(()=>{var A,R;return(A=e.getTargetContainer)!==null&&A!==void 0?A:(R=r.getTargetContainer)===null||R===void 0?void 0:R.value}),g=Ge(()=>{var A,R,w;return(R=(A=e.getContainer)!==null&&A!==void 0?A:e.getPopupContainer)!==null&&R!==void 0?R:(w=r.getPopupContainer)===null||w===void 0?void 0:w.value}),y=Ge(()=>{var A,R;return(A=e.dropdownMatchSelectWidth)!==null&&A!==void 0?A:(R=r.dropdownMatchSelectWidth)===null||R===void 0?void 0:R.value}),m=Ge(()=>{var A;return(e.virtual===void 0?((A=r.virtual)===null||A===void 0?void 0:A.value)!==!1:e.virtual!==!1)&&y.value!==!1}),v=Ge(()=>e.size||t.value),x=Ge(()=>{var A,R,w;return(A=e.autocomplete)!==null&&A!==void 0?A:(w=(R=r.input)===null||R===void 0?void 0:R.value)===null||w===void 0?void 0:w.autocomplete}),_=Ge(()=>{var A;return(A=e.disabled)!==null&&A!==void 0?A:i.value}),S=Ge(()=>{var A;return(A=e.csp)!==null&&A!==void 0?A:r.csp}),E=Ge(()=>{var A,R;return(A=e.wave)!==null&&A!==void 0?A:(R=r.wave)===null||R===void 0?void 0:R.value});return{configProvider:r,prefixCls:s,direction:o,size:v,getTargetContainer:p,getPopupContainer:g,space:d,pageHeader:h,form:f,autoInsertSpaceInButton:c,renderEmpty:u,virtual:m,dropdownMatchSelectWidth:y,rootPrefixCls:l,getPrefixCls:r.getPrefixCls,autocomplete:x,csp:S,iconPrefixCls:a,disabled:_,select:r.select,wave:E}};function zY(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function W6(n,e,t){return t&&zY(n,t),n}function Vp(){return(Vp=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}function Q6(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function j6(n,e){if(n==null)return{};var t,i,r={},s=Object.keys(n);for(i=0;i<s.length;i++)e.indexOf(t=s[i])>=0||(r[t]=n[t]);return r}function A3(n){return((e=n)!=null&&typeof e=="object"&&Array.isArray(e)===!1)==1&&Object.prototype.toString.call(n)==="[object Object]";var e}var q6=Object.prototype,X6=q6.toString,VY=q6.hasOwnProperty,K6=/^\s*function (\w+)/;function b3(n){var e,t=(e=n==null?void 0:n.type)!==null&&e!==void 0?e:n;if(t){var i=t.toString().match(K6);return i?i[1]:""}return""}var Gl=function(n){var e,t;return A3(n)!==!1&&typeof(e=n.constructor)=="function"&&A3(t=e.prototype)!==!1&&t.hasOwnProperty("isPrototypeOf")!==!1},HY=function(n){return n},Dr=HY,Ah=function(n,e){return VY.call(n,e)},$Y=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},wu=Array.isArray||function(n){return X6.call(n)==="[object Array]"},Cu=function(n){return X6.call(n)==="[object Function]"},Lm=function(n){return Gl(n)&&Ah(n,"_vueTypes_name")},Y6=function(n){return Gl(n)&&(Ah(n,"type")||["_vueTypes_name","validator","default","required"].some(function(e){return Ah(n,e)}))};function Wx(n,e){return Object.defineProperty(n.bind(e),"__original",{value:n})}function Xl(n,e,t){var i,r=!0,s="";i=Gl(n)?n:{type:n};var o=Lm(i)?i._vueTypes_name+" - ":"";if(Y6(i)&&i.type!==null){if(i.type===void 0||i.type===!0||!i.required&&e===void 0)return r;wu(i.type)?(r=i.type.some(function(d){return Xl(d,e)===!0}),s=i.type.map(function(d){return b3(d)}).join(" or ")):r=(s=b3(i))==="Array"?wu(e):s==="Object"?Gl(e):s==="String"||s==="Number"||s==="Boolean"||s==="Function"?function(d){if(d==null)return"";var h=d.constructor.toString().match(K6);return h?h[1]:""}(e)===s:e instanceof i.type}if(!r){var a=o+'value "'+e+'" should be of type "'+s+'"';return a}if(Ah(i,"validator")&&Cu(i.validator)){var l=Dr,c=[];if(Dr=function(d){c.push(d)},r=i.validator(e),Dr=l,!r){var u=(c.length>1?"* ":"")+c.join("\n* ");return c.length=0,u}}return r}function Or(n,e){var t=Object.defineProperties(e,{_vueTypes_name:{value:n,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(r){return r!==void 0||this.default?Cu(r)||Xl(this,r)===!0?(this.default=wu(r)?function(){return[].concat(r)}:Gl(r)?function(){return Object.assign({},r)}:r,this):(Dr(this._vueTypes_name+' - invalid default value: "'+r+'"'),this):this}}}),i=t.validator;return Cu(i)&&(t.validator=Wx(i,t)),t}function io(n,e){var t=Or(n,e);return Object.defineProperty(t,"validate",{value:function(i){return Cu(this.validator)&&Dr(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=Wx(i,this),this}})}function T3(n,e,t){var i,r,s=(i=e,r={},Object.getOwnPropertyNames(i).forEach(function(d){r[d]=Object.getOwnPropertyDescriptor(i,d)}),Object.defineProperties({},r));if(s._vueTypes_name=n,!Gl(t))return s;var o,a,l=t.validator,c=j6(t,["validator"]);if(Cu(l)){var u=s.validator;u&&(u=(a=(o=u).__original)!==null&&a!==void 0?a:o),s.validator=Wx(u?function(d){return u.call(this,d)&&l.call(this,d)}:l,s)}return Object.assign(s,c)}function N0(n){return n.replace(/^(?!\s*$)/gm," ")}var GY=function(){return io("any",{})},WY=function(){return io("function",{type:Function})},QY=function(){return io("boolean",{type:Boolean})},jY=function(){return io("string",{type:String})},qY=function(){return io("number",{type:Number})},XY=function(){return io("array",{type:Array})},KY=function(){return io("object",{type:Object})},YY=function(){return Or("integer",{type:Number,validator:function(n){return $Y(n)}})},ZY=function(){return Or("symbol",{validator:function(n){return typeof n=="symbol"}})};function JY(n,e){if(e===void 0&&(e="custom validation failed"),typeof n!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return Or(n.name||"<<anonymous function>>",{validator:function(t){var i=n(t);return i||Dr(this._vueTypes_name+" - "+e),i}})}function eZ(n){if(!wu(n))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var e='oneOf - value should be one of "'+n.join('", "')+'".',t=n.reduce(function(i,r){if(r!=null){var s=r.constructor;i.indexOf(s)===-1&&i.push(s)}return i},[]);return Or("oneOf",{type:t.length>0?t:void 0,validator:function(i){var r=n.indexOf(i)!==-1;return r||Dr(e),r}})}function tZ(n){if(!wu(n))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var e=!1,t=[],i=0;i<n.length;i+=1){var r=n[i];if(Y6(r)){if(Lm(r)&&r._vueTypes_name==="oneOf"){t=t.concat(r.type);continue}if(Cu(r.validator)&&(e=!0),r.type!==!0&&r.type){t=t.concat(r.type);continue}}t.push(r)}return t=t.filter(function(s,o){return t.indexOf(s)===o}),Or("oneOfType",e?{type:t,validator:function(s){var o=[],a=n.some(function(l){var c=Xl(Lm(l)&&l._vueTypes_name==="oneOf"?l.type||null:l,s);return typeof c=="string"&&o.push(c),c===!0});return a||Dr("oneOfType - provided value does not match any of the "+o.length+" passed-in validators:\n"+N0(o.join("\n"))),a}}:{type:t})}function nZ(n){return Or("arrayOf",{type:Array,validator:function(e){var t,i=e.every(function(r){return(t=Xl(n,r))===!0});return i||Dr("arrayOf - value validation error:\n"+N0(t)),i}})}function iZ(n){return Or("instanceOf",{type:n})}function rZ(n){return Or("objectOf",{type:Object,validator:function(e){var t,i=Object.keys(e).every(function(r){return(t=Xl(n,e[r]))===!0});return i||Dr("objectOf - value validation error:\n"+N0(t)),i}})}function sZ(n){var e=Object.keys(n),t=e.filter(function(r){var s;return!!(!((s=n[r])===null||s===void 0)&&s.required)}),i=Or("shape",{type:Object,validator:function(r){var s=this;if(!Gl(r))return!1;var o=Object.keys(r);if(t.length>0&&t.some(function(l){return o.indexOf(l)===-1})){var a=t.filter(function(l){return o.indexOf(l)===-1});return Dr(a.length===1?'shape - required property "'+a[0]+'" is not defined.':'shape - required properties "'+a.join('", "')+'" are not defined.'),!1}return o.every(function(l){if(e.indexOf(l)===-1)return s._vueTypes_isLoose===!0||(Dr('shape - shape definition does not include a "'+l+'" property. Allowed keys: "'+e.join('", "')+'".'),!1);var c=Xl(n[l],r[l]);return typeof c=="string"&&Dr('shape - "'+l+'" property validation error:\n '+N0(c)),c===!0})}});return Object.defineProperty(i,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(i,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),i}var Ds=function(){function n(){}return n.extend=function(e){var t=this;if(wu(e))return e.forEach(function(d){return t.extend(d)}),this;var i=e.name,r=e.validate,s=r!==void 0&&r,o=e.getter,a=o!==void 0&&o,l=j6(e,["name","validate","getter"]);if(Ah(this,i))throw new TypeError('[VueTypes error]: Type "'+i+'" already defined');var c,u=l.type;return Lm(u)?(delete l.type,Object.defineProperty(this,i,a?{get:function(){return T3(i,u,l)}}:{value:function(){var d,h=T3(i,u,l);return h.validator&&(h.validator=(d=h.validator).bind.apply(d,[h].concat([].slice.call(arguments)))),h}})):(c=a?{get:function(){var d=Object.assign({},l);return s?io(i,d):Or(i,d)},enumerable:!0}:{value:function(){var d,h,f=Object.assign({},l);return d=s?io(i,f):Or(i,f),f.validator&&(d.validator=(h=f.validator).bind.apply(h,[d].concat([].slice.call(arguments)))),d},enumerable:!0},Object.defineProperty(this,i,c))},W6(n,null,[{key:"any",get:function(){return GY()}},{key:"func",get:function(){return WY().def(this.defaults.func)}},{key:"bool",get:function(){return QY().def(this.defaults.bool)}},{key:"string",get:function(){return jY().def(this.defaults.string)}},{key:"number",get:function(){return qY().def(this.defaults.number)}},{key:"array",get:function(){return XY().def(this.defaults.array)}},{key:"object",get:function(){return KY().def(this.defaults.object)}},{key:"integer",get:function(){return YY().def(this.defaults.integer)}},{key:"symbol",get:function(){return ZY()}}]),n}();function Z6(n){var e;return n===void 0&&(n={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(e=function(t){function i(){return t.apply(this,arguments)||this}return Q6(i,t),W6(i,null,[{key:"sensibleDefaults",get:function(){return Vp({},this.defaults)},set:function(r){this.defaults=r!==!1?Vp({},r!==!0?r:n):{}}}]),i}(Ds)).defaults=Vp({},n),e}Ds.defaults={},Ds.custom=JY,Ds.oneOf=eZ,Ds.instanceOf=iZ,Ds.oneOfType=tZ,Ds.arrayOf=nZ,Ds.objectOf=rZ,Ds.shape=sZ,Ds.utils={validate:function(n,e){return Xl(e,n)===!0},toType:function(n,e,t){return t===void 0&&(t=!1),t?io(n,e):Or(n,e)}};(function(n){function e(){return n.apply(this,arguments)||this}return Q6(e,n),e})(Z6());const J6=Z6({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});J6.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);function oZ(n){let{prefixCls:e,animation:t,transitionName:i}=n;return t?{name:"".concat(e,"-").concat(t)}:i?{name:i}:{}}XX("bottomLeft","bottomRight","topLeft","topRight");const eR=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ue(n?{name:n,appear:!0,appearActiveClass:"".concat(n),appearToClass:"".concat(n,"-appear ").concat(n,"-appear-active"),enterFromClass:"".concat(n,"-appear ").concat(n,"-enter ").concat(n,"-appear-prepare ").concat(n,"-enter-prepare"),enterActiveClass:"".concat(n),enterToClass:"".concat(n,"-enter ").concat(n,"-appear ").concat(n,"-appear-active ").concat(n,"-enter-active"),leaveActiveClass:"".concat(n," ").concat(n,"-leave"),leaveToClass:"".concat(n,"-leave-active")}:{css:!1},e)},tR=Symbol("PortalContextKey"),aZ=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};ta(tR,{inTriggerContext:e.inTriggerContext,shouldRender:Ge(()=>{const{sPopupVisible:t,popupRef:i,forceRender:r,autoDestroy:s}=n||{};let o=!1;return(t||i||r)&&(o=!0),!t&&s&&(o=!1),o})})},lZ=()=>{aZ({},{inTriggerContext:!1});const n=Ji(tR,{shouldRender:Ge(()=>!1),inTriggerContext:!1});return{shouldRender:Ge(()=>n.shouldRender.value||n.inTriggerContext===!1)}},cZ=rn({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:J6.func.isRequired,didUpdate:Function},setup(n,e){let{slots:t}=e,i=!0,r;const{shouldRender:s}=lZ();function o(){s.value&&(r=n.getContainer())}yw(()=>{i=!1,o()}),ka(()=>{r||o()});const a=ci(s,()=>{s.value&&!r&&(r=n.getContainer()),r&&a()});return Zv(()=>{Ph(()=>{var l;s.value&&((l=n.didUpdate)===null||l===void 0||l.call(n,n))})}),()=>{var l;return s.value?i?(l=t.default)===null||l===void 0?void 0:l.call(t):r?Re(dw,{to:r},t):null:null}}});var uZ=Symbol("iconContext"),nR=function(){return Ji(uZ,{prefixCls:Dn("anticon"),rootClassName:Dn(""),csp:Dn()})};function Qx(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function dZ(n,e){return n&&n.contains?n.contains(e):!1}var w3="data-vc-order",hZ="vc-icon-key",Av=new Map;function iR(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.mark;return e?e.startsWith("data-")?e:"data-".concat(e):hZ}function jx(n){if(n.attachTo)return n.attachTo;var e=document.querySelector("head");return e||document.body}function fZ(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function rR(n){return Array.from((Av.get(n)||n).children).filter(function(e){return e.tagName==="STYLE"})}function sR(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Qx())return null;var t=e.csp,i=e.prepend,r=document.createElement("style");r.setAttribute(w3,fZ(i)),t&&t.nonce&&(r.nonce=t.nonce),r.innerHTML=n;var s=jx(e),o=s.firstChild;if(i){if(i==="queue"){var a=rR(s).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(w3))});if(a.length)return s.insertBefore(r,a[a.length-1].nextSibling),r}s.insertBefore(r,o)}else s.appendChild(r);return r}function pZ(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=jx(e);return rR(t).find(function(i){return i.getAttribute(iR(e))===n})}function mZ(n,e){var t=Av.get(n);if(!t||!dZ(document,t)){var i=sR("",e),r=i.parentNode;Av.set(n,r),n.removeChild(i)}}function gZ(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=jx(t);mZ(i,t);var r=pZ(e,t);if(r)return t.csp&&t.csp.nonce&&r.nonce!==t.csp.nonce&&(r.nonce=t.csp.nonce),r.innerHTML!==n&&(r.innerHTML=n),r;var s=sR(n,t);return s.setAttribute(iR(t),e),s}function C3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){yZ(n,r,t[r])})}return n}function yZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function E3(n){return typeof n=="object"&&typeof n.name=="string"&&typeof n.theme=="string"&&(typeof n.icon=="object"||typeof n.icon=="function")}function bv(n,e,t){return t?Da(n.tag,C3({key:e},t,n.attrs),(n.children||[]).map(function(i,r){return bv(i,"".concat(e,"-").concat(n.tag,"-").concat(r))})):Da(n.tag,C3({key:e},n.attrs),(n.children||[]).map(function(i,r){return bv(i,"".concat(e,"-").concat(n.tag,"-").concat(r))}))}function oR(n){return $l(n)[0]}function aR(n){return n?Array.isArray(n)?n:[n]:[]}var vZ="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";function lR(n){return n&&n.getRootNode&&n.getRootNode()}function _Z(n){return Qx()?lR(n)instanceof ShadowRoot:!1}function xZ(n){return _Z(n)?lR(n):null}var SZ=function(){var e=nR(),t=e.prefixCls,i=e.csp,r=Wo(),s=vZ;t&&(s=s.replace(/anticon/g,t.value)),Ph(function(){if(Qx()){var o=r.vnode.el,a=xZ(o);gZ(s,"@ant-design-vue-icons",{prepend:!0,csp:i.value,attachTo:a})}})},AZ=["icon","primaryColor","secondaryColor"];function bZ(n,e){if(n==null)return{};var t=TZ(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function TZ(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function Hp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){wZ(n,r,t[r])})}return n}function wZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Qd=Ys({primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1});function CZ(n){var e=n.primaryColor,t=n.secondaryColor;Qd.primaryColor=e,Qd.secondaryColor=t||oR(e),Qd.calculated=!!t}function EZ(){return Hp({},Qd)}var Ha=function(e,t){var i=Hp({},e,t.attrs),r=i.icon,s=i.primaryColor,o=i.secondaryColor,a=bZ(i,AZ),l=Qd;if(s&&(l={primaryColor:s,secondaryColor:o||oR(s)}),E3(r),!E3(r))return null;var c=r;return c&&typeof c.icon=="function"&&(c=Hp({},c,{icon:c.icon(l.primaryColor,l.secondaryColor)})),bv(c.icon,"svg-".concat(c.name),Hp({},a,{"data-icon":c.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};Ha.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String};Ha.inheritAttrs=!1;Ha.displayName="IconBase";Ha.getTwoToneColors=EZ;Ha.setTwoToneColors=CZ;function MZ(n,e){return PZ(n)||NZ(n,e)||IZ(n,e)||RZ()}function RZ(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function IZ(n,e){if(n){if(typeof n=="string")return M3(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return M3(n,e)}}function M3(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function NZ(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,s=!1,o,a;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return i}}function PZ(n){if(Array.isArray(n))return n}function cR(n){var e=aR(n),t=MZ(e,2),i=t[0],r=t[1];return Ha.setTwoToneColors({primaryColor:i,secondaryColor:r})}function LZ(){var n=Ha.getTwoToneColors();return n.calculated?[n.primaryColor,n.secondaryColor]:n.primaryColor}var DZ=rn({name:"InsertStyles",setup:function(){return SZ(),function(){return null}}}),FZ=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function OZ(n,e){return zZ(n)||UZ(n,e)||kZ(n,e)||BZ()}function BZ(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kZ(n,e){if(n){if(typeof n=="string")return R3(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return R3(n,e)}}function R3(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function UZ(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,s=!1,o,a;try{for(t=t.call(n);!(r=(o=t.next()).done)&&(i.push(o.value),!(e&&i.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return i}}function zZ(n){if(Array.isArray(n))return n}function I3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){wd(n,r,t[r])})}return n}function wd(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function VZ(n,e){if(n==null)return{};var t=HZ(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function HZ(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}cR(fY.primary);var Ui=function(e,t){var i,r=I3({},e,t.attrs),s=r.class,o=r.icon,a=r.spin,l=r.rotate,c=r.tabindex,u=r.twoToneColor,d=r.onClick,h=VZ(r,FZ),f=nR(),p=f.prefixCls,g=f.rootClassName,y=(i={},wd(i,g.value,!!g.value),wd(i,p.value,!0),wd(i,"".concat(p.value,"-").concat(o.name),!!o.name),wd(i,"".concat(p.value,"-spin"),!!a||o.name==="loading"),i),m=c;m===void 0&&d&&(m=-1);var v=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,x=aR(u),_=OZ(x,2),S=_[0],E=_[1];return Re("span",I3({role:"img","aria-label":o.name},h,{onClick:d,class:[y,s],tabindex:m}),[Re(Ha,{icon:o,primaryColor:S,secondaryColor:E,style:v},null),Re(DZ,null,null)])};Ui.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:[String,Array]};Ui.displayName="AntdIcon";Ui.inheritAttrs=!1;Ui.getTwoToneColor=LZ;Ui.setTwoToneColor=cR;var $Z={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function N3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){GZ(n,r,t[r])})}return n}function GZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var sf=function(e,t){var i=N3({},e,t.attrs);return Re(Ui,N3({},i,{icon:$Z}),null)};sf.displayName="LoadingOutlined";sf.inheritAttrs=!1;var WZ={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"};function P3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){QZ(n,r,t[r])})}return n}function QZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var of=function(e,t){var i=P3({},e,t.attrs);return Re(Ui,P3({},i,{icon:WZ}),null)};of.displayName="CloseOutlined";of.inheritAttrs=!1;var jZ={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};function L3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){qZ(n,r,t[r])})}return n}function qZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Wu=function(e,t){var i=L3({},e,t.attrs);return Re(Ui,L3({},i,{icon:jZ}),null)};Wu.displayName="CloseCircleFilled";Wu.inheritAttrs=!1;var XZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};function D3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){KZ(n,r,t[r])})}return n}function KZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var qx=function(e,t){var i=D3({},e,t.attrs);return Re(Ui,D3({},i,{icon:XZ}),null)};qx.displayName="CheckCircleOutlined";qx.inheritAttrs=!1;var YZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"};function F3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){ZZ(n,r,t[r])})}return n}function ZZ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Xx=function(e,t){var i=F3({},e,t.attrs);return Re(Ui,F3({},i,{icon:YZ}),null)};Xx.displayName="ExclamationCircleOutlined";Xx.inheritAttrs=!1;var JZ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};function O3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){eJ(n,r,t[r])})}return n}function eJ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Kx=function(e,t){var i=O3({},e,t.attrs);return Re(Ui,O3({},i,{icon:JZ}),null)};Kx.displayName="InfoCircleOutlined";Kx.inheritAttrs=!1;var tJ={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};function B3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){nJ(n,r,t[r])})}return n}function nJ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Yx=function(e,t){var i=B3({},e,t.attrs);return Re(Ui,B3({},i,{icon:tJ}),null)};Yx.displayName="CloseCircleOutlined";Yx.inheritAttrs=!1;var iJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function k3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){rJ(n,r,t[r])})}return n}function rJ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Qu=function(e,t){var i=k3({},e,t.attrs);return Re(Ui,k3({},i,{icon:iJ}),null)};Qu.displayName="CheckCircleFilled";Qu.inheritAttrs=!1;var sJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};function U3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){oJ(n,r,t[r])})}return n}function oJ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var ju=function(e,t){var i=U3({},e,t.attrs);return Re(Ui,U3({},i,{icon:sJ}),null)};ju.displayName="ExclamationCircleFilled";ju.inheritAttrs=!1;var aJ={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};function z3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){lJ(n,r,t[r])})}return n}function lJ(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var qu=function(e,t){var i=z3({},e,t.attrs);return Re(Ui,z3({},i,{icon:aJ}),null)};qu.displayName="InfoCircleFilled";qu.inheritAttrs=!1;let M1=Ue({},Su.Modal);function cJ(n){n?M1=Ue(Ue({},M1),n):M1=Ue({},Su.Modal)}const Tv="internalMark",$p=rn({compatConfig:{MODE:3},name:"ALocaleProvider",props:{locale:{type:Object},ANT_MARK__:String},setup(n,e){let{slots:t}=e;S6(n.ANT_MARK__===Tv);const i=Ys({antLocale:Ue(Ue({},n.locale),{exist:!0}),ANT_MARK__:Tv});return ta("localeData",i),ci(()=>n.locale,r=>{cJ(r&&r.Modal),i.antLocale=Ue(Ue({},r),{exist:!0})},{immediate:!0}),()=>{var r;return(r=t.default)===null||r===void 0?void 0:r.call(t)}}});$p.install=function(n){return n.component($p.name,$p),n};const uJ=Ox($p),uR=rn({name:"Notice",inheritAttrs:!1,props:["prefixCls","duration","updateMark","noticeKey","closeIcon","closable","props","onClick","onClose","holder","visible"],setup(n,e){let{attrs:t,slots:i}=e,r,s=!1;const o=Ge(()=>n.duration===void 0?4.5:n.duration),a=()=>{o.value&&!s&&(r=setTimeout(()=>{c()},o.value*1e3))},l=()=>{r&&(clearTimeout(r),r=null)},c=d=>{d&&d.stopPropagation(),l();const{onClose:h,noticeKey:f}=n;h&&h(f)},u=()=>{l(),a()};return ka(()=>{a()}),Lh(()=>{s=!0,l()}),ci([o,()=>n.updateMark,()=>n.visible],(d,h)=>{let[f,p,g]=d,[y,m,v]=h;(f!==y||p!==m||g!==v&&v)&&u()},{flush:"post"}),()=>{var d,h;const{prefixCls:f,closable:p,closeIcon:g=(d=i.closeIcon)===null||d===void 0?void 0:d.call(i),onClick:y,holder:m}=n,{class:v,style:x}=t,_="".concat(f,"-notice"),S=Object.keys(t).reduce((A,R)=>((R.startsWith("data-")||R.startsWith("aria-")||R==="role")&&(A[R]=t[R]),A),{}),E=Re("div",yi({class:kr(_,v,{["".concat(_,"-closable")]:p}),style:x,onMouseenter:l,onMouseleave:a,onClick:y},S),[Re("div",{class:"".concat(_,"-content")},[(h=i.default)===null||h===void 0?void 0:h.call(i)]),p?Re("a",{tabindex:0,onClick:c,class:"".concat(_,"-close")},[g||Re("span",{class:"".concat(_,"-close-x")},null)]):null]);return m?Re(dw,{to:m},{default:()=>E}):E}}});var dJ=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};let V3=0;const hJ=Date.now();function H3(){const n=V3;return V3+=1,"rcNotification_".concat(hJ,"_").concat(n)}const Dm=rn({name:"Notification",inheritAttrs:!1,props:["prefixCls","transitionName","animation","maxCount","closeIcon","hashId"],setup(n,e){let{attrs:t,expose:i,slots:r}=e;const s=new Map,o=Dn([]),a=Ge(()=>{const{prefixCls:u,animation:d="fade"}=n;let h=n.transitionName;return!h&&d&&(h="".concat(u,"-").concat(d)),eR(h)}),l=(u,d)=>{const h=u.key||H3(),f=Ue(Ue({},u),{key:h}),{maxCount:p}=n,g=o.value.map(m=>m.notice.key).indexOf(h),y=o.value.concat();g!==-1?y.splice(g,1,{notice:f,holderCallback:d}):(p&&o.value.length>=p&&(f.key=y[0].notice.key,f.updateMark=H3(),f.userPassKey=h,y.shift()),y.push({notice:f,holderCallback:d})),o.value=y},c=u=>{o.value=Ot(o.value).filter(d=>{let{notice:{key:h,userPassKey:f}}=d;return(f||h)!==u})};return i({add:l,remove:c,notices:o}),()=>{var u;const{prefixCls:d,closeIcon:h=(u=r.closeIcon)===null||u===void 0?void 0:u.call(r,{prefixCls:d})}=n,f=o.value.map((g,y)=>{let{notice:m,holderCallback:v}=g;const x=y===o.value.length-1?m.updateMark:void 0,{key:_,userPassKey:S}=m,{content:E}=m,A=Ue(Ue(Ue({prefixCls:d,closeIcon:typeof h=="function"?h({prefixCls:d}):h},m),m.props),{key:_,noticeKey:S||_,updateMark:x,onClose:R=>{var w;c(R),(w=m.onClose)===null||w===void 0||w.call(m)},onClick:m.onClick});return v?Re("div",{key:_,class:"".concat(d,"-hook-holder"),ref:R=>{typeof _>"u"||(R?(s.set(_,R),v(R,A)):s.delete(_))}},null):Re(uR,yi(yi({},A),{},{class:kr(A.class,n.hashId)}),{default:()=>[typeof E=="function"?E({prefixCls:d}):E]})}),p={[d]:1,[t.class]:!!t.class,[n.hashId]:!0};return Re("div",{class:p,style:t.style||{top:"65px",left:"50%"}},[Re(Qw,yi({tag:"div"},a.value),{default:()=>[f]})])}}});Dm.newInstance=function(e,t){const i=e||{},{name:r="notification",getContainer:s,appContext:o,prefixCls:a,rootPrefixCls:l,transitionName:c,hasTransitionName:u,useStyle:d}=i,h=dJ(i,["name","getContainer","appContext","prefixCls","rootPrefixCls","transitionName","hasTransitionName","useStyle"]),f=document.createElement("div");s?s().appendChild(f):document.body.appendChild(f);const g=Re(rn({compatConfig:{MODE:3},name:"NotificationWrapper",setup(y,m){let{attrs:v}=m;const x=Nr(),_=Ge(()=>Ii.getPrefixCls(r,a)),[,S]=d(_);return ka(()=>{t({notice(E){var A;(A=x.value)===null||A===void 0||A.add(E)},removeNotice(E){var A;(A=x.value)===null||A===void 0||A.remove(E)},destroy(){eS(null,f),f.parentNode&&f.parentNode.removeChild(f)},component:x})}),()=>{const E=Ii,A=E.getRootPrefixCls(l,_.value),R=u?c:"".concat(_.value,"-").concat(c);return Re(Jc,yi(yi({},E),{},{prefixCls:A}),{default:()=>[Re(Dm,yi(yi({ref:x},v),{},{prefixCls:_.value,transitionName:R,hashId:S.value}),null)]})}}}),h);g.appContext=o||g.appContext,eS(g,f)};let $3=0;const fJ=Date.now();function G3(){const n=$3;return $3+=1,"rcNotification_".concat(fJ,"_").concat(n)}const pJ=rn({name:"HookNotification",inheritAttrs:!1,props:["prefixCls","transitionName","animation","maxCount","closeIcon","hashId","remove","notices","getStyles","getClassName","onAllRemoved","getContainer"],setup(n,e){let{attrs:t,slots:i}=e;const r=new Map,s=Ge(()=>n.notices),o=Ge(()=>{let u=n.transitionName;if(!u&&n.animation)switch(typeof n.animation){case"string":u=n.animation;break;case"function":u=n.animation().name;break;case"object":u=n.animation.name;break;default:u="".concat(n.prefixCls,"-fade");break}return eR(u)}),a=u=>n.remove(u),l=Dn({});ci(s,()=>{const u={};Object.keys(l.value).forEach(d=>{u[d]=[]}),n.notices.forEach(d=>{const{placement:h="topRight"}=d.notice;h&&(u[h]=u[h]||[],u[h].push(d))}),l.value=u});const c=Ge(()=>Object.keys(l.value));return()=>{var u;const{prefixCls:d,closeIcon:h=(u=i.closeIcon)===null||u===void 0?void 0:u.call(i,{prefixCls:d})}=n,f=c.value.map(p=>{var g,y;const m=l.value[p],v=(g=n.getClassName)===null||g===void 0?void 0:g.call(n,p),x=(y=n.getStyles)===null||y===void 0?void 0:y.call(n,p),_=m.map((A,R)=>{let{notice:w,holderCallback:M}=A;const I=R===s.value.length-1?w.updateMark:void 0,{key:L,userPassKey:k}=w,{content:T}=w,F=Ue(Ue(Ue({prefixCls:d,closeIcon:typeof h=="function"?h({prefixCls:d}):h},w),w.props),{key:L,noticeKey:k||L,updateMark:I,onClose:V=>{var Q;a(V),(Q=w.onClose)===null||Q===void 0||Q.call(w)},onClick:w.onClick});return M?Re("div",{key:L,class:"".concat(d,"-hook-holder"),ref:V=>{typeof L>"u"||(V?(r.set(L,V),M(V,F)):r.delete(L))}},null):Re(uR,yi(yi({},F),{},{class:kr(F.class,n.hashId)}),{default:()=>[typeof T=="function"?T({prefixCls:d}):T]})}),S={[d]:1,["".concat(d,"-").concat(p)]:1,[t.class]:!!t.class,[n.hashId]:!0,[v]:!!v};function E(){var A;m.length>0||(Reflect.deleteProperty(l.value,p),(A=n.onAllRemoved)===null||A===void 0||A.call(n))}return Re("div",{key:p,class:S,style:t.style||x||{top:"65px",left:"50%"}},[Re(Qw,yi(yi({tag:"div"},o.value),{},{onAfterLeave:E}),{default:()=>[_]})])});return Re(cZ,{getContainer:n.getContainer},{default:()=>[f]})}}});var mJ=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const gJ=()=>document.body;let W3=0;function yJ(){const n={};for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.forEach(r=>{r&&Object.keys(r).forEach(s=>{const o=r[s];o!==void 0&&(n[s]=o)})}),n}function dR(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{getContainer:e=gJ,motion:t,prefixCls:i,maxCount:r,getClassName:s,getStyles:o,onAllRemoved:a}=n,l=mJ(n,["getContainer","motion","prefixCls","maxCount","getClassName","getStyles","onAllRemoved"]),c=Nr([]),u=Nr(),d=(m,v)=>{const x=m.key||G3(),_=Ue(Ue({},m),{key:x}),S=c.value.map(A=>A.notice.key).indexOf(x),E=c.value.concat();S!==-1?E.splice(S,1,{notice:_,holderCallback:v}):(r&&c.value.length>=r&&(_.key=E[0].notice.key,_.updateMark=G3(),_.userPassKey=x,E.shift()),E.push({notice:_,holderCallback:v})),c.value=E},h=m=>{c.value=c.value.filter(v=>{let{notice:{key:x,userPassKey:_}}=v;return(_||x)!==m})},f=()=>{c.value=[]},p=()=>Re(pJ,{ref:u,prefixCls:i,maxCount:r,notices:c.value,remove:h,getClassName:s,getStyles:o,animation:t,hashId:n.hashId,onAllRemoved:a,getContainer:e},null),g=Nr([]),y={open:m=>{const v=yJ(l,m);(v.key===null||v.key===void 0)&&(v.key="vc-notification-".concat(W3),W3+=1),g.value=[...g.value,{type:"open",config:v}]},close:m=>{g.value=[...g.value,{type:"close",key:m}]},destroy:()=>{g.value=[...g.value,{type:"destroy"}]}};return ci(g,()=>{g.value.length&&(g.value.forEach(m=>{switch(m.type){case"open":d(m.config);break;case"close":h(m.key);break;case"destroy":f();break}}),g.value=[])}),[y,p]}const vJ=n=>{const{componentCls:e,iconCls:t,boxShadowSecondary:i,colorBgElevated:r,colorSuccess:s,colorError:o,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:h,paddingXS:f,borderRadiusLG:p,zIndexPopup:g,messageNoticeContentPadding:y}=n,m=new Fl("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),v=new Fl("MessageMoveOut",{"0%":{maxHeight:n.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[e]:Ue(Ue({},B6(n)),{position:"fixed",top:h,left:"50%",transform:"translateX(-50%)",width:"100%",pointerEvents:"none",zIndex:g,["".concat(e,"-move-up")]:{animationFillMode:"forwards"},["\n ".concat(e,"-move-up-appear,\n ").concat(e,"-move-up-enter\n ")]:{animationName:m,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["\n ".concat(e,"-move-up-appear").concat(e,"-move-up-appear-active,\n ").concat(e,"-move-up-enter").concat(e,"-move-up-enter-active\n ")]:{animationPlayState:"running"},["".concat(e,"-move-up-leave")]:{animationName:v,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["".concat(e,"-move-up-leave").concat(e,"-move-up-leave-active")]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{["".concat(e,"-notice")]:{padding:f,textAlign:"center",[t]:{verticalAlign:"text-bottom",marginInlineEnd:h,fontSize:c},["".concat(e,"-notice-content")]:{display:"inline-block",padding:y,background:r,borderRadius:p,boxShadow:i,pointerEvents:"all"},["".concat(e,"-success ").concat(t)]:{color:s},["".concat(e,"-error ").concat(t)]:{color:o},["".concat(e,"-warning ").concat(t)]:{color:a},["\n ".concat(e,"-info ").concat(t,",\n ").concat(e,"-loading ").concat(t)]:{color:l}}},{["".concat(e,"-notice-pure-panel")]:{padding:0,textAlign:"start"}}]},hR=Hx("Message",n=>{const e=M0(n,{messageNoticeContentPadding:"".concat((n.controlHeightLG-n.fontSize*n.lineHeight)/2,"px ").concat(n.paddingSM,"px")});return[vJ(e)]},n=>({height:150,zIndexPopup:n.zIndexPopupBase+10})),_J={info:Re(qu,null,null),success:Re(Qu,null,null),error:Re(Wu,null,null),warning:Re(ju,null,null),loading:Re(sf,null,null)},xJ=rn({name:"PureContent",inheritAttrs:!1,props:["prefixCls","type","icon"],setup(n,e){let{slots:t}=e;return()=>{var i;return Re("div",{class:kr("".concat(n.prefixCls,"-custom-content"),"".concat(n.prefixCls,"-").concat(n.type))},[n.icon||_J[n.type],Re("span",null,[(i=t.default)===null||i===void 0?void 0:i.call(t)])])}}});var SJ=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const AJ=8,bJ=3,TJ=rn({name:"Holder",inheritAttrs:!1,props:["top","prefixCls","getContainer","maxCount","duration","rtl","transitionName","onAllRemoved","animation","staticGetContainer"],setup(n,e){let{expose:t}=e;var i,r;const{getPrefixCls:s,getPopupContainer:o}=I0("message",n),a=Ge(()=>s("message",n.prefixCls)),[,l]=hR(a),c=()=>{var g;const y=(g=n.top)!==null&&g!==void 0?g:AJ;return{left:"50%",transform:"translateX(-50%)",top:typeof y=="number"?"".concat(y,"px"):y}},u=()=>kr(l.value,n.rtl?"".concat(a.value,"-rtl"):""),d=()=>{var g;return oZ({prefixCls:a.value,animation:(g=n.animation)!==null&&g!==void 0?g:"move-up",transitionName:n.transitionName})},h=Re("span",{class:"".concat(a.value,"-close-x")},[Re(of,{class:"".concat(a.value,"-close-icon")},null)]),[f,p]=dR({getStyles:c,prefixCls:a.value,getClassName:u,motion:d,closable:!1,closeIcon:h,duration:(i=n.duration)!==null&&i!==void 0?i:bJ,getContainer:(r=n.staticGetContainer)!==null&&r!==void 0?r:o.value,maxCount:n.maxCount,onAllRemoved:n.onAllRemoved});return t(Ue(Ue({},f),{prefixCls:a,hashId:l})),p}});let Q3=0;function wJ(n){const e=Nr(null),t=Symbol("messageHolderKey"),i=l=>{var c;(c=e.value)===null||c===void 0||c.close(l)},r=l=>{if(!e.value){const S=()=>{};return S.then=()=>{},S}const{open:c,prefixCls:u,hashId:d}=e.value,h="".concat(u,"-notice"),{content:f,icon:p,type:g,key:y,class:m,onClose:v}=l,x=SJ(l,["content","icon","type","key","class","onClose"]);let _=y;return _==null&&(Q3+=1,_="antd-message-".concat(Q3)),jX(S=>(c(Ue(Ue({},x),{key:_,content:()=>Re(xJ,{prefixCls:u,type:g,icon:typeof p=="function"?p():p},{default:()=>[typeof f=="function"?f():f]}),placement:"top",class:kr(g&&"".concat(h,"-").concat(g),d,m),onClose:()=>{v==null||v(),S()}})),()=>{i(_)}))},o={open:r,destroy:l=>{var c;l!==void 0?i(l):(c=e.value)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let p,g;typeof d=="function"?g=d:(p=d,g=h);const y=Ue(Ue({onClose:g,duration:p},f),{type:l});return r(y)};o[l]=c}),[o,()=>Re(TJ,yi(yi({key:t},n),{},{ref:e}),null)]}function CJ(n){return wJ(n)}let fR=3,pR,Yi,EJ=1,mR="",gR="move-up",yR=!1,vR=()=>document.body,_R,xR=!1;function MJ(){return EJ++}function RJ(n){n.top!==void 0&&(pR=n.top,Yi=null),n.duration!==void 0&&(fR=n.duration),n.prefixCls!==void 0&&(mR=n.prefixCls),n.getContainer!==void 0&&(vR=n.getContainer,Yi=null),n.transitionName!==void 0&&(gR=n.transitionName,Yi=null,yR=!0),n.maxCount!==void 0&&(_R=n.maxCount,Yi=null),n.rtl!==void 0&&(xR=n.rtl)}function IJ(n,e){if(Yi){e(Yi);return}Dm.newInstance({appContext:n.appContext,prefixCls:n.prefixCls||mR,rootPrefixCls:n.rootPrefixCls,transitionName:gR,hasTransitionName:yR,style:{top:pR},getContainer:vR||n.getPopupContainer,maxCount:_R,name:"message",useStyle:hR},t=>{if(Yi){e(Yi);return}Yi=t,e(t)})}const SR={info:qu,success:Qu,error:Wu,warning:ju,loading:sf},NJ=Object.keys(SR);function PJ(n){const e=n.duration!==void 0?n.duration:fR,t=n.key||MJ(),i=new Promise(s=>{const o=()=>(typeof n.onClose=="function"&&n.onClose(),s(!0));IJ(n,a=>{a.notice({key:t,duration:e,style:n.style||{},class:n.class,content:l=>{let{prefixCls:c}=l;const u=SR[n.type],d=u?Re(u,null,null):"",h=kr("".concat(c,"-custom-content"),{["".concat(c,"-").concat(n.type)]:n.type,["".concat(c,"-rtl")]:xR===!0});return Re("div",{class:h},[typeof n.icon=="function"?n.icon():n.icon||d,Re("span",null,[typeof n.content=="function"?n.content():n.content])])},onClose:o,onClick:n.onClick})})}),r=()=>{Yi&&Yi.removeNotice(t)};return r.then=(s,o)=>i.then(s,o),r.promise=i,r}function LJ(n){return Object.prototype.toString.call(n)==="[object Object]"&&!!n.content}const Oo={open:PJ,config:RJ,destroy(n){if(Yi)if(n){const{removeNotice:e}=Yi;e(n)}else{const{destroy:e}=Yi;e(),Yi=null}}};function DJ(n,e){n[e]=(t,i,r)=>LJ(t)?n.open(Ue(Ue({},t),{type:e})):(typeof i=="function"&&(r=i,i=void 0),n.open({content:t,duration:i,type:e,onClose:r}))}NJ.forEach(n=>DJ(Oo,n));Oo.warn=Oo.warning;Oo.useMessage=CJ;const FJ=n=>{const{componentCls:e,width:t,notificationMarginEdge:i}=n,r=new Fl("antNotificationTopFadeIn",{"0%":{marginTop:"-100%",opacity:0},"100%":{marginTop:0,opacity:1}}),s=new Fl("antNotificationBottomFadeIn",{"0%":{marginBottom:"-100%",opacity:0},"100%":{marginBottom:0,opacity:1}}),o=new Fl("antNotificationLeftFadeIn",{"0%":{right:{_skip_check_:!0,value:t},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{["&".concat(e,"-top, &").concat(e,"-bottom")]:{marginInline:0},["&".concat(e,"-top")]:{["".concat(e,"-fade-enter").concat(e,"-fade-enter-active, ").concat(e,"-fade-appear").concat(e,"-fade-appear-active")]:{animationName:r}},["&".concat(e,"-bottom")]:{["".concat(e,"-fade-enter").concat(e,"-fade-enter-active, ").concat(e,"-fade-appear").concat(e,"-fade-appear-active")]:{animationName:s}},["&".concat(e,"-topLeft, &").concat(e,"-bottomLeft")]:{marginInlineEnd:0,marginInlineStart:i,["".concat(e,"-fade-enter").concat(e,"-fade-enter-active, ").concat(e,"-fade-appear").concat(e,"-fade-appear-active")]:{animationName:o}}}},OJ=n=>{const{iconCls:e,componentCls:t,boxShadowSecondary:i,fontSizeLG:r,notificationMarginBottom:s,borderRadiusLG:o,colorSuccess:a,colorInfo:l,colorWarning:c,colorError:u,colorTextHeading:d,notificationBg:h,notificationPadding:f,notificationMarginEdge:p,motionDurationMid:g,motionEaseInOut:y,fontSize:m,lineHeight:v,width:x,notificationIconSize:_}=n,S="".concat(t,"-notice"),E=new Fl("antNotificationFadeIn",{"0%":{left:{_skip_check_:!0,value:x},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),A=new Fl("antNotificationFadeOut",{"0%":{maxHeight:n.animationMaxHeight,marginBottom:s,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[t]:Ue(Ue(Ue(Ue({},B6(n)),{position:"fixed",zIndex:n.zIndexPopup,marginInlineEnd:p,["".concat(t,"-hook-holder")]:{position:"relative"},["&".concat(t,"-top, &").concat(t,"-bottom")]:{["".concat(t,"-notice")]:{marginInline:"auto auto"}},["&".concat(t,"-topLeft, &").concat(t,"-bottomLeft")]:{["".concat(t,"-notice")]:{marginInlineEnd:"auto",marginInlineStart:0}},["".concat(t,"-fade-enter, ").concat(t,"-fade-appear")]:{animationDuration:n.motionDurationMid,animationTimingFunction:y,animationFillMode:"both",opacity:0,animationPlayState:"paused"},["".concat(t,"-fade-leave")]:{animationTimingFunction:y,animationFillMode:"both",animationDuration:g,animationPlayState:"paused"},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:E,animationPlayState:"running"},["".concat(t,"-fade-leave").concat(t,"-fade-leave-active")]:{animationName:A,animationPlayState:"running"}}),FJ(n)),{"&-rtl":{direction:"rtl",["".concat(t,"-notice-btn")]:{float:"left"}}})},{[S]:{position:"relative",width:x,maxWidth:"calc(100vw - ".concat(p*2,"px)"),marginBottom:s,marginInlineStart:"auto",padding:f,overflow:"hidden",lineHeight:v,wordWrap:"break-word",background:h,borderRadius:o,boxShadow:i,["".concat(t,"-close-icon")]:{fontSize:m,cursor:"pointer"},["".concat(S,"-message")]:{marginBottom:n.marginXS,color:d,fontSize:r,lineHeight:n.lineHeightLG},["".concat(S,"-description")]:{fontSize:m},["&".concat(S,"-closable ").concat(S,"-message")]:{paddingInlineEnd:n.paddingLG},["".concat(S,"-with-icon ").concat(S,"-message")]:{marginBottom:n.marginXS,marginInlineStart:n.marginSM+_,fontSize:r},["".concat(S,"-with-icon ").concat(S,"-description")]:{marginInlineStart:n.marginSM+_,fontSize:m},["".concat(S,"-icon")]:{position:"absolute",fontSize:_,lineHeight:0,["&-success".concat(e)]:{color:a},["&-info".concat(e)]:{color:l},["&-warning".concat(e)]:{color:c},["&-error".concat(e)]:{color:u}},["".concat(S,"-close")]:{position:"absolute",top:n.notificationPaddingVertical,insetInlineEnd:n.notificationPaddingHorizontal,color:n.colorIcon,outline:"none",width:n.notificationCloseButtonSize,height:n.notificationCloseButtonSize,borderRadius:n.borderRadiusSM,transition:"background-color ".concat(n.motionDurationMid,", color ").concat(n.motionDurationMid),display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:n.colorIconHover,backgroundColor:n.wireframe?"transparent":n.colorFillContent}},["".concat(S,"-btn")]:{float:"right",marginTop:n.marginSM}}},{["".concat(S,"-pure-panel")]:{margin:0}}]},AR=Hx("Notification",n=>{const e=n.paddingMD,t=n.paddingLG,i=M0(n,{notificationBg:n.colorBgElevated,notificationPaddingVertical:e,notificationPaddingHorizontal:t,notificationPadding:"".concat(n.paddingMD,"px ").concat(n.paddingContentHorizontalLG,"px"),notificationMarginBottom:n.margin,notificationMarginEdge:n.marginLG,animationMaxHeight:150,notificationIconSize:n.fontSizeLG*n.lineHeightLG,notificationCloseButtonSize:n.controlHeightLG*.55});return[OJ(i)]},n=>({zIndexPopup:n.zIndexPopupBase+50,width:384}));function BJ(n,e){return e||Re("span",{class:"".concat(n,"-close-x")},[Re(of,{class:"".concat(n,"-close-icon")},null)])}Re(qu,null,null),Re(Qu,null,null),Re(Wu,null,null),Re(ju,null,null),Re(sf,null,null);const kJ={success:Qu,info:qu,error:Wu,warning:ju};function UJ(n){let{prefixCls:e,icon:t,type:i,message:r,description:s,btn:o}=n,a=null;if(t)a=Re("span",{class:"".concat(e,"-icon")},[kc(t)]);else if(i){const l=kJ[i];a=Re(l,{class:"".concat(e,"-icon ").concat(e,"-icon-").concat(i)},null)}return Re("div",{class:kr({["".concat(e,"-with-icon")]:a}),role:"alert"},[a,Re("div",{class:"".concat(e,"-message")},[r]),Re("div",{class:"".concat(e,"-description")},[s]),o&&Re("div",{class:"".concat(e,"-btn")},[o])])}function bR(n,e,t){let i;switch(e=typeof e=="number"?"".concat(e,"px"):e,t=typeof t=="number"?"".concat(t,"px"):t,n){case"top":i={left:"50%",transform:"translateX(-50%)",right:"auto",top:e,bottom:"auto"};break;case"topLeft":i={left:0,top:e,bottom:"auto"};break;case"topRight":i={right:0,top:e,bottom:"auto"};break;case"bottom":i={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:t};break;case"bottomLeft":i={left:0,top:"auto",bottom:t};break;default:i={right:0,top:"auto",bottom:t};break}return i}function zJ(n){return{name:"".concat(n,"-fade")}}var VJ=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const j3=24,HJ=4.5,$J=rn({name:"Holder",inheritAttrs:!1,props:["prefixCls","class","type","icon","content","onAllRemoved"],setup(n,e){let{expose:t}=e;const{getPrefixCls:i,getPopupContainer:r}=I0("notification",n),s=Ge(()=>n.prefixCls||i("notification")),o=h=>{var f,p;return bR(h,(f=n.top)!==null&&f!==void 0?f:j3,(p=n.bottom)!==null&&p!==void 0?p:j3)},[,a]=AR(s),l=()=>kr(a.value,{["".concat(s.value,"-rtl")]:n.rtl}),c=()=>zJ(s.value),[u,d]=dR({prefixCls:s.value,getStyles:o,getClassName:l,motion:c,closable:!0,closeIcon:BJ(s.value),duration:HJ,getContainer:()=>{var h,f;return((h=n.getPopupContainer)===null||h===void 0?void 0:h.call(n))||((f=r.value)===null||f===void 0?void 0:f.call(r))||document.body},maxCount:n.maxCount,hashId:a.value,onAllRemoved:n.onAllRemoved});return t(Ue(Ue({},u),{prefixCls:s.value,hashId:a})),d}});function GJ(n){const e=Nr(null),t=Symbol("notificationHolderKey"),i=a=>{if(!e.value)return;const{open:l,prefixCls:c,hashId:u}=e.value,d="".concat(c,"-notice"),{message:h,description:f,icon:p,type:g,btn:y,class:m}=a,v=VJ(a,["message","description","icon","type","btn","class"]);return l(Ue(Ue({placement:"topRight"},v),{content:()=>Re(UJ,{prefixCls:d,icon:typeof p=="function"?p():p,type:g,message:typeof h=="function"?h():h,description:typeof f=="function"?f():f,btn:typeof y=="function"?y():y},null),class:kr(g&&"".concat(d,"-").concat(g),u,m)}))},s={open:i,destroy:a=>{var l,c;a!==void 0?(l=e.value)===null||l===void 0||l.close(a):(c=e.value)===null||c===void 0||c.destroy()}};return["success","info","warning","error"].forEach(a=>{s[a]=l=>i(Ue(Ue({},l),{type:a}))}),[s,()=>Re($J,yi(yi({key:t},n),{},{ref:e}),null)]}function WJ(n){return GJ(n)}const yl={};let TR=4.5,wR="24px",CR="24px",wv="",ER="topRight",MR=()=>document.body,RR=null,Cv=!1,IR;function QJ(n){const{duration:e,placement:t,bottom:i,top:r,getContainer:s,closeIcon:o,prefixCls:a}=n;a!==void 0&&(wv=a),e!==void 0&&(TR=e),t!==void 0&&(ER=t),i!==void 0&&(CR=typeof i=="number"?"".concat(i,"px"):i),r!==void 0&&(wR=typeof r=="number"?"".concat(r,"px"):r),s!==void 0&&(MR=s),o!==void 0&&(RR=o),n.rtl!==void 0&&(Cv=n.rtl),n.maxCount!==void 0&&(IR=n.maxCount)}function jJ(n,e){let{prefixCls:t,placement:i=ER,getContainer:r=MR,top:s,bottom:o,closeIcon:a=RR,appContext:l}=n;const{getPrefixCls:c}=see(),u=c("notification",t||wv),d="".concat(u,"-").concat(i,"-").concat(Cv),h=yl[d];if(h){Promise.resolve(h).then(p=>{e(p)});return}const f=kr("".concat(u,"-").concat(i),{["".concat(u,"-rtl")]:Cv===!0});Dm.newInstance({name:"notification",prefixCls:t||wv,useStyle:AR,class:f,style:bR(i,s!=null?s:wR,o!=null?o:CR),appContext:l,getContainer:r,closeIcon:p=>{let{prefixCls:g}=p;return Re("span",{class:"".concat(g,"-close-x")},[kc(a,{},Re(of,{class:"".concat(g,"-close-icon")},null))])},maxCount:IR,hasTransitionName:!0},p=>{yl[d]=p,e(p)})}const qJ={success:qx,info:Kx,error:Yx,warning:Xx};function XJ(n){const{icon:e,type:t,description:i,message:r,btn:s}=n,o=n.duration===void 0?TR:n.duration;jJ(n,a=>{a.notice({content:l=>{let{prefixCls:c}=l;const u="".concat(c,"-notice");let d=null;if(e)d=()=>Re("span",{class:"".concat(u,"-icon")},[kc(e)]);else if(t){const h=qJ[t];d=()=>Re(h,{class:"".concat(u,"-icon ").concat(u,"-icon-").concat(t)},null)}return Re("div",{class:d?"".concat(u,"-with-icon"):""},[d&&d(),Re("div",{class:"".concat(u,"-message")},[!i&&d?Re("span",{class:"".concat(u,"-message-single-line-auto-margin")},null):null,kc(r)]),Re("div",{class:"".concat(u,"-description")},[kc(i)]),s?Re("span",{class:"".concat(u,"-btn")},[kc(s)]):null])},duration:o,closable:!0,onClose:n.onClose,onClick:n.onClick,key:n.key,style:n.style||{},class:n.class})})}const Eu={open:XJ,close(n){Object.keys(yl).forEach(e=>Promise.resolve(yl[e]).then(t=>{t.removeNotice(n)}))},config:QJ,destroy(){Object.keys(yl).forEach(n=>{Promise.resolve(yl[n]).then(e=>{e.destroy()}),delete yl[n]})}},KJ=["success","info","warning","error"];KJ.forEach(n=>{Eu[n]=e=>Eu.open(Ue(Ue({},e),{type:n}))});Eu.warn=Eu.warning;Eu.useNotification=WJ;const YJ="-ant-".concat(Date.now(),"-").concat(Math.random());function ZJ(n,e){const t={},i=(o,a)=>{let l=o.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(o,a)=>{const l=new vi(o),c=$l(l.toRgbString());t["".concat(a,"-color")]=i(l),t["".concat(a,"-color-disabled")]=c[1],t["".concat(a,"-color-hover")]=c[4],t["".concat(a,"-color-active")]=c[6],t["".concat(a,"-color-outline")]=l.clone().setAlpha(.2).toRgbString(),t["".concat(a,"-color-deprecated-bg")]=c[0],t["".concat(a,"-color-deprecated-border")]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const o=new vi(e.primaryColor),a=$l(o.toRgbString());a.forEach((c,u)=>{t["primary-".concat(u+1)]=c}),t["primary-color-deprecated-l-35"]=i(o,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=i(o,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=i(o,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=i(o,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=i(o,c=>c.setAlpha(c.getAlpha()*.12));const l=new vi(a[0]);t["primary-color-active-deprecated-f-30"]=i(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=i(l,c=>c.darken(2))}e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info");const s=Object.keys(t).map(o=>"--".concat(n,"-").concat(o,": ").concat(t[o],";"));return"\n :root {\n ".concat(s.join("\n"),"\n }\n ").trim()}function JJ(n,e){const t=ZJ(n,e);$u()&&Nm(t,"".concat(YJ,"-dynamic-theme"))}const eee=n=>{const[e,t]=R0();return gv(Ge(()=>({theme:e.value,token:t.value,hashId:"",path:["ant-design-icons",n.value]})),()=>[{[".".concat(n.value)]:Ue(Ue({},CY()),{[".".concat(n.value," .").concat(n.value,"-icon")]:{display:"block"}})}])};function tee(n,e){const t=Ge(()=>(n==null?void 0:n.value)||{}),i=Ge(()=>t.value.inherit===!1||!(e!=null&&e.value)?U6:e.value);return Ge(()=>{if(!(n!=null&&n.value))return e==null?void 0:e.value;const s=Ue({},i.value.components);return Object.keys(n.value.components||{}).forEach(o=>{s[o]=Ue(Ue({},s[o]),n.value.components[o])}),Ue(Ue(Ue({},i.value),t.value),{token:Ue(Ue({},i.value.token),t.value.token),components:s})})}var nee=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const iee="ant";function Zc(){return Ii.prefixCls||iee}function NR(){return Ii.iconPrefixCls||Bx}const Zx=Ys({}),Ii=Ys({});jm(()=>{Ue(Ii,Zx),Ii.prefixCls=Zc(),Ii.iconPrefixCls=NR(),Ii.getPrefixCls=(n,e)=>e||(n?"".concat(Ii.prefixCls,"-").concat(n):Ii.prefixCls),Ii.getRootPrefixCls=()=>Ii.prefixCls?Ii.prefixCls:Zc()});let R1;const ree=n=>{R1&&R1(),R1=jm(()=>{Ue(Zx,Ys(n)),Ue(Ii,Ys(n))}),n.theme&&JJ(Zc(),n.theme)},see=()=>({getPrefixCls:(n,e)=>e||(n?"".concat(Zc(),"-").concat(n):Zc()),getIconPrefixCls:NR,getRootPrefixCls:()=>Ii.prefixCls?Ii.prefixCls:Zc()}),Jc=rn({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:JX(),setup(n,e){let{slots:t}=e;const i=a6(),r=(F,V)=>{const{prefixCls:Q="ant"}=n;if(V)return V;const ee=Q||i.getPrefixCls("");return F?"".concat(ee,"-").concat(F):ee},s=Ge(()=>n.iconPrefixCls||i.iconPrefixCls.value||Bx),o=Ge(()=>s.value!==i.iconPrefixCls.value),a=Ge(()=>{var F;return n.csp||((F=i.csp)===null||F===void 0?void 0:F.value)}),l=eee(s),c=tee(Ge(()=>n.theme),Ge(()=>{var F;return(F=i.theme)===null||F===void 0?void 0:F.value})),u=F=>(n.renderEmpty||t.renderEmpty||i.renderEmpty||kY)(F),d=Ge(()=>{var F,V;return(F=n.autoInsertSpaceInButton)!==null&&F!==void 0?F:(V=i.autoInsertSpaceInButton)===null||V===void 0?void 0:V.value}),h=Ge(()=>{var F;return n.locale||((F=i.locale)===null||F===void 0?void 0:F.value)});ci(h,()=>{Zx.locale=h.value},{immediate:!0});const f=Ge(()=>{var F;return n.direction||((F=i.direction)===null||F===void 0?void 0:F.value)}),p=Ge(()=>{var F,V;return(F=n.space)!==null&&F!==void 0?F:(V=i.space)===null||V===void 0?void 0:V.value}),g=Ge(()=>{var F,V;return(F=n.virtual)!==null&&F!==void 0?F:(V=i.virtual)===null||V===void 0?void 0:V.value}),y=Ge(()=>{var F,V;return(F=n.dropdownMatchSelectWidth)!==null&&F!==void 0?F:(V=i.dropdownMatchSelectWidth)===null||V===void 0?void 0:V.value}),m=Ge(()=>{var F;return n.getTargetContainer!==void 0?n.getTargetContainer:(F=i.getTargetContainer)===null||F===void 0?void 0:F.value}),v=Ge(()=>{var F;return n.getPopupContainer!==void 0?n.getPopupContainer:(F=i.getPopupContainer)===null||F===void 0?void 0:F.value}),x=Ge(()=>{var F;return n.pageHeader!==void 0?n.pageHeader:(F=i.pageHeader)===null||F===void 0?void 0:F.value}),_=Ge(()=>{var F;return n.input!==void 0?n.input:(F=i.input)===null||F===void 0?void 0:F.value}),S=Ge(()=>{var F;return n.pagination!==void 0?n.pagination:(F=i.pagination)===null||F===void 0?void 0:F.value}),E=Ge(()=>{var F;return n.form!==void 0?n.form:(F=i.form)===null||F===void 0?void 0:F.value}),A=Ge(()=>{var F;return n.select!==void 0?n.select:(F=i.select)===null||F===void 0?void 0:F.value}),R=Ge(()=>n.componentSize),w=Ge(()=>n.componentDisabled),M=Ge(()=>{var F,V;return(F=n.wave)!==null&&F!==void 0?F:(V=i.wave)===null||V===void 0?void 0:V.value}),I={csp:a,autoInsertSpaceInButton:d,locale:h,direction:f,space:p,virtual:g,dropdownMatchSelectWidth:y,getPrefixCls:r,iconPrefixCls:s,theme:Ge(()=>{var F,V;return(F=c.value)!==null&&F!==void 0?F:(V=i.theme)===null||V===void 0?void 0:V.value}),renderEmpty:u,getTargetContainer:m,getPopupContainer:v,pageHeader:x,input:_,pagination:S,form:E,select:A,componentSize:R,componentDisabled:w,transformCellText:Ge(()=>n.transformCellText),wave:M},L=Ge(()=>{const F=c.value||{},{algorithm:V,token:Q}=F,ee=nee(F,["algorithm","token"]),se=V&&(!Array.isArray(V)||V.length>0)?b6(V):void 0;return Ue(Ue({},ee),{theme:se,token:Ue(Ue({},E0),Q)})}),k=Ge(()=>{var F,V;let Q={};return h.value&&(Q=((F=h.value.Form)===null||F===void 0?void 0:F.defaultValidateMessages)||((V=Su.Form)===null||V===void 0?void 0:V.defaultValidateMessages)||{}),n.form&&n.form.validateMessages&&(Q=Ue(Ue({},Q),n.form.validateMessages)),Q});eK(I),ZX({validateMessages:k}),UY(R),tK(w);const T=F=>{var V,Q;let ee=o.value?l((V=t.default)===null||V===void 0?void 0:V.call(t)):(Q=t.default)===null||Q===void 0?void 0:Q.call(t);if(n.theme){const se=function(){return ee}();ee=Re(LY,{value:L.value},{default:()=>[se]})}return Re(uJ,{locale:h.value||F,ANT_MARK__:Tv},{default:()=>[ee]})};return jm(()=>{f.value&&(Oo.config({rtl:f.value==="rtl"}),Eu.config({rtl:f.value==="rtl"}))}),()=>Re(d6,{children:(F,V,Q)=>T(Q)},null)}});Jc.config=ree;Jc.install=function(n){n.component(Jc.name,Jc)};const oee={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页"};var aee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"video-camera",theme:"outlined"};function q3(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.forEach(function(r){lee(n,r,t[r])})}return n}function lee(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Jx=function(e,t){var i=q3({},e,t.attrs);return Re(Ui,q3({},i,{icon:aee}),null)};Jx.displayName="VideoCameraOutlined";Jx.inheritAttrs=!1;const Tl=Zw("visionStore",{state:()=>({wrapperRect:{width:0,height:0},wrapperRef:void 0,localVideoRef:void 0,localVideoContainerRef:void 0,remoteVideoRef:void 0,remoteVideoContainerRef:void 0,isLandscape:!0,showChatRecords:!1}),actions:{}}),cee={video:{width:500,height:500},audio:!0},P0=Zw("videoChatStore",{state:()=>({devices:[],availableVideoDevices:[],availableAudioDevices:[],selectedVideoDevice:null,selectedAudioDevice:null,streamState:qi.closed,stream:null,peerConnection:null,localStream:null,webRTCId:"",webcamAccessed:!1,avatarType:"",avatarWSRoute:"",avatarAssetsPath:"",rtcConfig:void 0,trackConstraints:cee,gsLoadPercent:0,volumeMuted:!1,micMuted:!1,cameraOff:!1,hasCamera:!1,hasCameraPermission:!0,hasMic:!1,hasMicPermission:!0,showChatRecords:!1,localAvatarRenderer:null,chatDataChannel:null,replying:!1,chatRecords:[]}),getters:{},actions:{async accessDevice(){try{const e=Tl().localVideoRef;if(this.micMuted=!1,this.cameraOff=!1,this.volumeMuted=!1,!navigator.mediaDevices){Oo.error("无法获取媒体设备请确保用localhost访问或https协议访问");return}await navigator.mediaDevices.getUserMedia({audio:!0}).catch(()=>{console.log("no audio permission"),this.hasMicPermission=!1}),await navigator.mediaDevices.getUserMedia({video:!0}).catch(()=>{console.log("no video permission"),this.hasCameraPermission=!1});const t=await y1();this.devices=t,console.log("🚀 ~ access_webcam ~ devices:",t);const i=this.selectedVideoDevice&&t.some(s=>{var o;return s.deviceId===((o=this.selectedVideoDevice)==null?void 0:o.deviceId)})?this.selectedVideoDevice.deviceId:"",r=this.selectedAudioDevice&&t.some(s=>{var o;return s.deviceId===((o=this.selectedAudioDevice)==null?void 0:o.deviceId)})?this.selectedAudioDevice.deviceId:"";console.log(i,r," access web device"),this.fillStream(r,i),this.webcamAccessed=!0}catch(n){console.log(n),Oo.error(n.message)}},async init(){fetch("/openavatarchat/init").then(n=>n.json()).then(n=>{n.rtc_configuration&&(this.rtcConfig=n.rtc_configuration),console.log(n),n.avatar_config&&(this.avatarType=n.avatar_config.avatar_type,this.avatarWSRoute=n.avatar_config.avatar_ws_route,this.avatarAssetsPath=n.avatar_config.avatar_assets_path),n.track_constraints&&(this.trackConstraints=n.track_constraints)}).catch(()=>{Oo.error("服务端链接失败,请检查是否能正确访问到 OpenAvatarChat 服务端")})},handleCameraOff(){var n;this.cameraOff=!this.cameraOff,(n=this.stream)==null||n.getTracks().forEach(e=>{e.kind.includes("video")&&(e.enabled=!this.cameraOff)})},handleMicMuted(){var n;this.micMuted=!this.micMuted,(n=this.stream)==null||n.getTracks().forEach(e=>{e.kind.includes("audio")&&(e.enabled=!this.micMuted)})},handleVolumeMute(){var n;this.volumeMuted=!this.volumeMuted,this.avatarType==="lam"&&((n=this.localAvatarRenderer)==null||n.setAvatarMute(this.volumeMuted))},async handleDeviceChange(n){const e=n,t=await y1();this.devices=t,console.log("🚀 ~ handle_device_change ~ devices:",t);let i=this.selectedVideoDevice&&t.some(s=>{var o;return s.deviceId===((o=this.selectedVideoDevice)==null?void 0:o.deviceId)})?this.selectedVideoDevice.deviceId:"",r=this.selectedAudioDevice&&t.some(s=>{var o;return s.deviceId===((o=this.selectedAudioDevice)==null?void 0:o.deviceId)})?this.selectedAudioDevice.deviceId:"";this.availableVideoDevices.find(s=>s.deviceId===e)?(i=e,this.cameraOff=!1):this.availableAudioDevices.find(s=>s.deviceId===e)&&(r=e,this.micMuted=!1),this.fillStream(r,i)},handleSubtitleToggle(){this.showChatRecords=!this.showChatRecords},async updateAvailableDevices(){const n=await y1();this.availableVideoDevices=Zb(n,"videoinput"),this.availableAudioDevices=Zb(n,"audioinput")},async fillStream(n,e){const{devices:t}=this,r=Tl().localVideoRef;this.hasMic=t.some(s=>s.kind==="audioinput"&&s.deviceId)&&this.hasMicPermission,this.hasCamera=t.some(s=>s.kind==="videoinput"&&s.deviceId)&&this.hasCameraPermission,await BX(n&&n!=="default"?{deviceId:{exact:n}}:this.hasMic,e&&e!=="default"?{deviceId:{exact:e}}:this.hasCamera,this.trackConstraints).then(async s=>{console.log("local_stream",s),this.stream=s,this.updateAvailableDevices()}).then(()=>{this.stream.getTracks().map(o=>{var a;return(a=o.getSettings())==null?void 0:a.deviceId}).forEach(o=>{const a=t.find(l=>l.deviceId===o);a&&(a!=null&&a.kind.includes("video"))?this.selectedVideoDevice=a:a&&(a!=null&&a.kind.includes("audio"))&&(this.selectedAudioDevice=a)}),!this.selectedVideoDevice&&(this.selectedVideoDevice=this.availableVideoDevices[0])}).catch(s=>{console.error("image.no_webcam_support",s)}).finally(()=>{console.log(this.stream),this.stream||(this.stream=new MediaStream),console.log(this.stream.getTracks()),this.stream.getTracks().find(s=>s.kind==="audio")||this.stream.addTrack(UX()),this.stream.getTracks().find(s=>s.kind==="video")||this.stream.addTrack(kX()),console.log(this.hasCamera,this.hasMic),this.webcamAccessed=!0,this.localStream=this.stream,r&&(r.srcObject=this.localStream,r.muted=!0,r==null||r.play())})},async startWebRTC(){var e;const n=Tl();this.streamState==="closed"?(this.chatRecords=[],this.peerConnection=new RTCPeerConnection,this.peerConnection.addEventListener("connectionstatechange",async t=>{switch(this.peerConnection.connectionState){case"connected":this.streamState=qi.open;break;case"disconnected":this.streamState=qi.closed,Jb(this.peerConnection);break}}),this.streamState=qi.waiting,await zX(this.stream,this.peerConnection,n.remoteVideoRef).then(([t,i])=>{if(this.streamState=qi.open,this.webRTCId=i,this.chatDataChannel=t,this.avatarType&&this.avatarWSRoute){const r=this.initWebsocket(this.avatarWSRoute,this.webRTCId);this.avatarType==="lam"&&(this.localAvatarRenderer=this.doGaussianRender(r))}}).catch(t=>{console.info("catching",t),this.streamState=qi.closed,Oo.error(t)})):this.streamState==="waiting"||(Jb(this.peerConnection),this.streamState=qi.closed,this.chatRecords=[],this.chatDataChannel=null,this.replying=!1,await this.accessDevice(),this.avatarType==="lam"&&((e=this.localAvatarRenderer)==null||e.exit(),this.gsLoadPercent=0))},initWebsocket(n,e){const t=new tN("".concat(window.location.protocol.includes("https")?"wss":"ws","://").concat(window.location.host).concat(n,"/").concat(e));return t.on(Kr.WS_OPEN,()=>{console.log("socket opened")}),t.on(Kr.WS_CLOSE,()=>{console.log("socket closed")}),t.on(Kr.WS_ERROR,i=>{console.log("socket error",i)}),t.on(Kr.WS_MESSAGE,i=>{console.log("socket on message",i)}),t},doGaussianRender(n){const e=Tl(),t=new OX({container:e.remoteVideoContainerRef,assetsPath:this.avatarAssetsPath,ws:n,loadProgress:i=>{console.log("gs loadProgress",i),this.gsLoadPercent=i}});return t.start(),t}}}),uee={class:"icon-wrap"},dee="点击允许访问摄像头和麦克风",hee=rn({__name:"WebcamPermission",emits:["click"],setup(n,{emit:e}){const t=P0();Tl();const i=async()=>{t.accessDevice()};return ka(()=>{}),(r,s)=>(ft(),xt("div",{class:"access-wrap",onClick:i},[zt("span",uee,[Re(We(Jx))]),em(" "+su(dee))]))}}),ii=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},fee=ii(hee,[["__scopeId","data-v-3e18f301"]]);/*!
* shared v11.1.9
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/const Fm=typeof window<"u",$a=(n,e=!1)=>e?Symbol.for(n):Symbol(n),pee=(n,e,t)=>mee({l:n,k:e,s:t}),mee=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Gn=n=>typeof n=="number"&&isFinite(n),gee=n=>e2(n)==="[object Date]",Mu=n=>e2(n)==="[object RegExp]",L0=n=>Lt(n)&&Object.keys(n).length===0,Zn=Object.assign,yee=Object.create,dn=(n=null)=>yee(n);let X3;const wl=()=>X3||(X3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:dn());function K3(n){return n.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const vee=Object.prototype.hasOwnProperty;function ys(n,e){return vee.call(n,e)}const In=Array.isArray,yn=n=>typeof n=="function",rt=n=>typeof n=="string",$t=n=>typeof n=="boolean",jt=n=>n!==null&&typeof n=="object",_ee=n=>jt(n)&&yn(n.then)&&yn(n.catch),PR=Object.prototype.toString,e2=n=>PR.call(n),Lt=n=>e2(n)==="[object Object]",xee=n=>n==null?"":In(n)||Lt(n)&&n.toString===PR?JSON.stringify(n,null,2):String(n);function t2(n,e=""){return n.reduce((t,i,r)=>r===0?t+i:t+e+i,"")}function See(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const hp=n=>!jt(n)||In(n);function Gp(n,e){if(hp(n)||hp(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:r}=t.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(jt(i[s])&&!jt(r[s])&&(r[s]=Array.isArray(i[s])?[]:dn()),hp(r[s])||hp(i[s])?r[s]=i[s]:t.push({src:i[s],des:r[s]}))})}}/*!
* message-compiler v11.1.9
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/function Aee(n,e,t){return{line:n,column:e,offset:t}}function Ev(n,e,t){return{start:n,end:e}}const an={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},bee=17;function D0(n,e,t={}){const{domain:i,messages:r,args:s}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function Tee(n){throw n}const Ao=" ",wee="\r",Wi="\n",Cee="\u2028",Eee="\u2029";function Mee(n){const e=n;let t=0,i=1,r=1,s=0;const o=A=>e[A]===wee&&e[A+1]===Wi,a=A=>e[A]===Wi,l=A=>e[A]===Eee,c=A=>e[A]===Cee,u=A=>o(A)||a(A)||l(A)||c(A),d=()=>t,h=()=>i,f=()=>r,p=()=>s,g=A=>o(A)||l(A)||c(A)?Wi:e[A],y=()=>g(t),m=()=>g(t+s);function v(){return s=0,u(t)&&(i++,r=0),o(t)&&t++,t++,r++,e[t]}function x(){return o(t+s)&&s++,s++,e[t+s]}function _(){t=0,i=1,r=1,s=0}function S(A=0){s=A}function E(){const A=t+s;for(;A!==t;)v();s=0}return{index:d,line:h,column:f,peekOffset:p,charAt:g,currentChar:y,currentPeek:m,next:v,peek:x,reset:_,resetPeek:S,skipToPeek:E}}const ha=void 0,Ree=".",Y3="'",Iee="tokenizer";function Nee(n,e={}){const t=e.location!==!1,i=Mee(n),r=()=>i.index(),s=()=>Aee(i.line(),i.column(),i.index()),o=s(),a=r(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function d(P,U,j,...B){const D=c();if(U.column+=j,U.offset+=j,u){const W=t?Ev(D.startLoc,U):null,G=D0(P,W,{domain:Iee,args:B});u(G)}}function h(P,U,j){P.endLoc=s(),P.currentType=U;const B={type:U};return t&&(B.loc=Ev(P.startLoc,P.endLoc)),j!=null&&(B.value=j),B}const f=P=>h(P,13);function p(P,U){return P.currentChar()===U?(P.next(),U):(d(an.EXPECTED_TOKEN,s(),0,U),"")}function g(P){let U="";for(;P.currentPeek()===Ao||P.currentPeek()===Wi;)U+=P.currentPeek(),P.peek();return U}function y(P){const U=g(P);return P.skipToPeek(),U}function m(P){if(P===ha)return!1;const U=P.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U===95}function v(P){if(P===ha)return!1;const U=P.charCodeAt(0);return U>=48&&U<=57}function x(P,U){const{currentType:j}=U;if(j!==2)return!1;g(P);const B=m(P.currentPeek());return P.resetPeek(),B}function _(P,U){const{currentType:j}=U;if(j!==2)return!1;g(P);const B=P.currentPeek()==="-"?P.peek():P.currentPeek(),D=v(B);return P.resetPeek(),D}function S(P,U){const{currentType:j}=U;if(j!==2)return!1;g(P);const B=P.currentPeek()===Y3;return P.resetPeek(),B}function E(P,U){const{currentType:j}=U;if(j!==7)return!1;g(P);const B=P.currentPeek()===".";return P.resetPeek(),B}function A(P,U){const{currentType:j}=U;if(j!==8)return!1;g(P);const B=m(P.currentPeek());return P.resetPeek(),B}function R(P,U){const{currentType:j}=U;if(!(j===7||j===11))return!1;g(P);const B=P.currentPeek()===":";return P.resetPeek(),B}function w(P,U){const{currentType:j}=U;if(j!==9)return!1;const B=()=>{const W=P.currentPeek();return W==="{"?m(P.peek()):W==="@"||W==="|"||W===":"||W==="."||W===Ao||!W?!1:W===Wi?(P.peek(),B()):I(P,!1)},D=B();return P.resetPeek(),D}function M(P){g(P);const U=P.currentPeek()==="|";return P.resetPeek(),U}function I(P,U=!0){const j=(D=!1,W="")=>{const G=P.currentPeek();return G==="{"||G==="@"||!G?D:G==="|"?!(W===Ao||W===Wi):G===Ao?(P.peek(),j(!0,Ao)):G===Wi?(P.peek(),j(!0,Wi)):!0},B=j();return U&&P.resetPeek(),B}function L(P,U){const j=P.currentChar();return j===ha?ha:U(j)?(P.next(),j):null}function k(P){const U=P.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36}function T(P){return L(P,k)}function F(P){const U=P.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36||U===45}function V(P){return L(P,F)}function Q(P){const U=P.charCodeAt(0);return U>=48&&U<=57}function ee(P){return L(P,Q)}function se(P){const U=P.charCodeAt(0);return U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102}function he(P){return L(P,se)}function ie(P){let U="",j="";for(;U=ee(P);)j+=U;return j}function re(P){let U="";for(;;){const j=P.currentChar();if(j==="{"||j==="}"||j==="@"||j==="|"||!j)break;if(j===Ao||j===Wi)if(I(P))U+=j,P.next();else{if(M(P))break;U+=j,P.next()}else U+=j,P.next()}return U}function be(P){y(P);let U="",j="";for(;U=V(P);)j+=U;return P.currentChar()===ha&&d(an.UNTERMINATED_CLOSING_BRACE,s(),0),j}function le(P){y(P);let U="";return P.currentChar()==="-"?(P.next(),U+="-".concat(ie(P))):U+=ie(P),P.currentChar()===ha&&d(an.UNTERMINATED_CLOSING_BRACE,s(),0),U}function fe(P){return P!==Y3&&P!==Wi}function Te(P){y(P),p(P,"'");let U="",j="";for(;U=L(P,fe);)U==="\\"?j+=Ce(P):j+=U;const B=P.currentChar();return B===Wi||B===ha?(d(an.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),B===Wi&&(P.next(),p(P,"'")),j):(p(P,"'"),j)}function Ce(P){const U=P.currentChar();switch(U){case"\\":case"'":return P.next(),"\\".concat(U);case"u":return Ie(P,U,4);case"U":return Ie(P,U,6);default:return d(an.UNKNOWN_ESCAPE_SEQUENCE,s(),0,U),""}}function Ie(P,U,j){p(P,U);let B="";for(let D=0;D<j;D++){const W=he(P);if(!W){d(an.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,"\\".concat(U).concat(B).concat(P.currentChar()));break}B+=W}return"\\".concat(U).concat(B)}function ze(P){return P!=="{"&&P!=="}"&&P!==Ao&&P!==Wi}function Be(P){y(P);let U="",j="";for(;U=L(P,ze);)j+=U;return j}function it(P){let U="",j="";for(;U=T(P);)j+=U;return j}function te(P){const U=j=>{const B=P.currentChar();return B==="{"||B==="@"||B==="|"||B==="("||B===")"||!B||B===Ao?j:(j+=B,P.next(),U(j))};return U("")}function ne(P){y(P);const U=p(P,"|");return y(P),U}function b(P,U){let j=null;switch(P.currentChar()){case"{":return U.braceNest>=1&&d(an.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),P.next(),j=h(U,2,"{"),y(P),U.braceNest++,j;case"}":return U.braceNest>0&&U.currentType===2&&d(an.EMPTY_PLACEHOLDER,s(),0),P.next(),j=h(U,3,"}"),U.braceNest--,U.braceNest>0&&y(P),U.inLinked&&U.braceNest===0&&(U.inLinked=!1),j;case"@":return U.braceNest>0&&d(an.UNTERMINATED_CLOSING_BRACE,s(),0),j=oe(P,U)||f(U),U.braceNest=0,j;default:{let D=!0,W=!0,G=!0;if(M(P))return U.braceNest>0&&d(an.UNTERMINATED_CLOSING_BRACE,s(),0),j=h(U,1,ne(P)),U.braceNest=0,U.inLinked=!1,j;if(U.braceNest>0&&(U.currentType===4||U.currentType===5||U.currentType===6))return d(an.UNTERMINATED_CLOSING_BRACE,s(),0),U.braceNest=0,J(P,U);if(D=x(P,U))return j=h(U,4,be(P)),y(P),j;if(W=_(P,U))return j=h(U,5,le(P)),y(P),j;if(G=S(P,U))return j=h(U,6,Te(P)),y(P),j;if(!D&&!W&&!G)return j=h(U,12,Be(P)),d(an.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,j.value),y(P),j;break}}return j}function oe(P,U){const{currentType:j}=U;let B=null;const D=P.currentChar();switch((j===7||j===8||j===11||j===9)&&(D===Wi||D===Ao)&&d(an.INVALID_LINKED_FORMAT,s(),0),D){case"@":return P.next(),B=h(U,7,"@"),U.inLinked=!0,B;case".":return y(P),P.next(),h(U,8,".");case":":return y(P),P.next(),h(U,9,":");default:return M(P)?(B=h(U,1,ne(P)),U.braceNest=0,U.inLinked=!1,B):E(P,U)||R(P,U)?(y(P),oe(P,U)):A(P,U)?(y(P),h(U,11,it(P))):w(P,U)?(y(P),D==="{"?b(P,U)||B:h(U,10,te(P))):(j===7&&d(an.INVALID_LINKED_FORMAT,s(),0),U.braceNest=0,U.inLinked=!1,J(P,U))}}function J(P,U){let j={type:13};if(U.braceNest>0)return b(P,U)||f(U);if(U.inLinked)return oe(P,U)||f(U);switch(P.currentChar()){case"{":return b(P,U)||f(U);case"}":return d(an.UNBALANCED_CLOSING_BRACE,s(),0),P.next(),h(U,3,"}");case"@":return oe(P,U)||f(U);default:{if(M(P))return j=h(U,1,ne(P)),U.braceNest=0,U.inLinked=!1,j;if(I(P))return h(U,0,re(P));break}}return j}function H(){const{currentType:P,offset:U,startLoc:j,endLoc:B}=l;return l.lastType=P,l.lastOffset=U,l.lastStartLoc=j,l.lastEndLoc=B,l.offset=r(),l.startLoc=s(),i.currentChar()===ha?h(l,13):J(i,l)}return{nextToken:H,currentOffset:r,currentPosition:s,context:c}}const Pee="parser",Lee=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Dee(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"<22>"}}}function Fee(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,v,x,_,...S){const E=m.currentPosition();if(E.offset+=_,E.column+=_,t){const A=e?Ev(x,E):null,R=D0(v,A,{domain:Pee,args:S});t(R)}}function r(m,v,x){const _={type:m};return e&&(_.start=v,_.end=v,_.loc={start:x,end:x}),_}function s(m,v,x,_){e&&(m.end=v,m.loc&&(m.loc.end=x))}function o(m,v){const x=m.context(),_=r(3,x.offset,x.startLoc);return _.value=v,s(_,m.currentOffset(),m.currentPosition()),_}function a(m,v){const x=m.context(),{lastOffset:_,lastStartLoc:S}=x,E=r(5,_,S);return E.index=parseInt(v,10),m.nextToken(),s(E,m.currentOffset(),m.currentPosition()),E}function l(m,v){const x=m.context(),{lastOffset:_,lastStartLoc:S}=x,E=r(4,_,S);return E.key=v,m.nextToken(),s(E,m.currentOffset(),m.currentPosition()),E}function c(m,v){const x=m.context(),{lastOffset:_,lastStartLoc:S}=x,E=r(9,_,S);return E.value=v.replace(Lee,Dee),m.nextToken(),s(E,m.currentOffset(),m.currentPosition()),E}function u(m){const v=m.nextToken(),x=m.context(),{lastOffset:_,lastStartLoc:S}=x,E=r(8,_,S);return v.type!==11?(i(m,an.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),E.value="",s(E,_,S),{nextConsumeToken:v,node:E}):(v.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Ps(v)),E.value=v.value||"",s(E,m.currentOffset(),m.currentPosition()),{node:E})}function d(m,v){const x=m.context(),_=r(7,x.offset,x.startLoc);return _.value=v,s(_,m.currentOffset(),m.currentPosition()),_}function h(m){const v=m.context(),x=r(6,v.offset,v.startLoc);let _=m.nextToken();if(_.type===8){const S=u(m);x.modifier=S.node,_=S.nextConsumeToken||m.nextToken()}switch(_.type!==9&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(_)),_=m.nextToken(),_.type===2&&(_=m.nextToken()),_.type){case 10:_.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(_)),x.key=d(m,_.value||"");break;case 4:_.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(_)),x.key=l(m,_.value||"");break;case 5:_.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(_)),x.key=a(m,_.value||"");break;case 6:_.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(_)),x.key=c(m,_.value||"");break;default:{i(m,an.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const S=m.context(),E=r(7,S.offset,S.startLoc);return E.value="",s(E,S.offset,S.startLoc),x.key=E,s(x,S.offset,S.startLoc),{nextConsumeToken:_,node:x}}}return s(x,m.currentOffset(),m.currentPosition()),{node:x}}function f(m){const v=m.context(),x=v.currentType===1?m.currentOffset():v.offset,_=v.currentType===1?v.endLoc:v.startLoc,S=r(2,x,_);S.items=[];let E=null;do{const w=E||m.nextToken();switch(E=null,w.type){case 0:w.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(w)),S.items.push(o(m,w.value||""));break;case 5:w.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(w)),S.items.push(a(m,w.value||""));break;case 4:w.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(w)),S.items.push(l(m,w.value||""));break;case 6:w.value==null&&i(m,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ps(w)),S.items.push(c(m,w.value||""));break;case 7:{const M=h(m);S.items.push(M.node),E=M.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const A=v.currentType===1?v.lastOffset:m.currentOffset(),R=v.currentType===1?v.lastEndLoc:m.currentPosition();return s(S,A,R),S}function p(m,v,x,_){const S=m.context();let E=_.items.length===0;const A=r(1,v,x);A.cases=[],A.cases.push(_);do{const R=f(m);E||(E=R.items.length===0),A.cases.push(R)}while(S.currentType!==13);return E&&i(m,an.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),s(A,m.currentOffset(),m.currentPosition()),A}function g(m){const v=m.context(),{offset:x,startLoc:_}=v,S=f(m);return v.currentType===13?S:p(m,x,_,S)}function y(m){const v=Nee(m,Zn({},n)),x=v.context(),_=r(0,x.offset,x.startLoc);return e&&_.loc&&(_.loc.source=m),_.body=g(v),n.onCacheKey&&(_.cacheKey=n.onCacheKey(m)),x.currentType!==13&&i(v,an.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,m[x.offset]||""),s(_,v.currentOffset(),v.currentPosition()),_}return{parse:y}}function Ps(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Oee(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:s=>(t.helpers.add(s),s)}}function Z3(n,e){for(let t=0;t<n.length;t++)n2(n[t],e)}function n2(n,e){switch(n.type){case 1:Z3(n.cases,e),e.helper("plural");break;case 2:Z3(n.items,e);break;case 6:{n2(n.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function Bee(n,e={}){const t=Oee(n);t.helper("normalize"),n.body&&n2(n.body,t);const i=t.context();n.helpers=Array.from(i.helpers)}function kee(n){const e=n.body;return e.type===2?J3(e):e.cases.forEach(t=>J3(t)),n}function J3(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;t<n.items.length;t++){const i=n.items[t];if(!(i.type===3||i.type===9)||i.value==null)break;e.push(i.value)}if(e.length===n.items.length){n.static=t2(e);for(let t=0;t<n.items.length;t++){const i=n.items[t];(i.type===3||i.type===9)&&delete i.value}}}}function Nc(n){switch(n.t=n.type,n.type){case 0:{const e=n;Nc(e.body),e.b=e.body,delete e.body;break}case 1:{const e=n,t=e.cases;for(let i=0;i<t.length;i++)Nc(t[i]);e.c=t,delete e.cases;break}case 2:{const e=n,t=e.items;for(let i=0;i<t.length;i++)Nc(t[i]);e.i=t,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=n;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=n;Nc(e.key),e.k=e.key,delete e.key,e.modifier&&(Nc(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=n;e.i=e.index,delete e.index;break}case 4:{const e=n;e.k=e.key,delete e.key;break}}delete n.type}function Uee(n,e){const{filename:t,breakLineCode:i,needIndent:r}=e,s=e.location!==!1,o={filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:i,needIndent:r,indentLevel:0};s&&n.loc&&(o.source=n.loc.source);const a=()=>o;function l(g,y){o.code+=g}function c(g,y=!0){const m=y?i:"";l(r?m+" ".repeat(g):m)}function u(g=!0){const y=++o.indentLevel;g&&c(y)}function d(g=!0){const y=--o.indentLevel;g&&c(y)}function h(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:d,newline:h,helper:g=>"_".concat(g),needIndent:()=>o.needIndent}}function zee(n,e){const{helper:t}=n;n.push("".concat(t("linked"),"(")),Ru(n,e.key),e.modifier?(n.push(", "),Ru(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function Vee(n,e){const{helper:t,needIndent:i}=n;n.push("".concat(t("normalize"),"([")),n.indent(i());const r=e.items.length;for(let s=0;s<r&&(Ru(n,e.items[s]),s!==r-1);s++)n.push(", ");n.deindent(i()),n.push("])")}function Hee(n,e){const{helper:t,needIndent:i}=n;if(e.cases.length>1){n.push("".concat(t("plural"),"([")),n.indent(i());const r=e.cases.length;for(let s=0;s<r&&(Ru(n,e.cases[s]),s!==r-1);s++)n.push(", ");n.deindent(i()),n.push("])")}}function $ee(n,e){e.body?Ru(n,e.body):n.push("null")}function Ru(n,e){const{helper:t}=n;switch(e.type){case 0:$ee(n,e);break;case 1:Hee(n,e);break;case 2:Vee(n,e);break;case 6:zee(n,e);break;case 8:n.push(JSON.stringify(e.value),e);break;case 7:n.push(JSON.stringify(e.value),e);break;case 5:n.push("".concat(t("interpolate"),"(").concat(t("list"),"(").concat(e.index,"))"),e);break;case 4:n.push("".concat(t("interpolate"),"(").concat(t("named"),"(").concat(JSON.stringify(e.key),"))"),e);break;case 9:n.push(JSON.stringify(e.value),e);break;case 3:n.push(JSON.stringify(e.value),e);break}}const Gee=(n,e={})=>{const t=rt(e.mode)?e.mode:"normal",i=rt(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":"\n",s=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=Uee(n,{filename:i,breakLineCode:r,needIndent:s});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(s),o.length>0&&(a.push("const { ".concat(t2(o.map(u=>"".concat(u,": _").concat(u)),", ")," } = ctx")),a.newline()),a.push("return "),Ru(a,n),a.deindent(s),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function Wee(n,e={}){const t=Zn({},e),i=!!t.jit,r=!!t.minify,s=t.optimize==null?!0:t.optimize,a=Fee(t).parse(n);return i?(s&&kee(a),r&&Nc(a),{ast:a,code:""}):(Bee(a,t),Gee(a,t))}/*!
* core-base v11.1.9
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/function Qee(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Xs(n){return jt(n)&&i2(n)===0&&(ys(n,"b")||ys(n,"body"))}const LR=["b","body"];function jee(n){return Ga(n,LR)}const DR=["c","cases"];function qee(n){return Ga(n,DR,[])}const FR=["s","static"];function Xee(n){return Ga(n,FR)}const OR=["i","items"];function Kee(n){return Ga(n,OR,[])}const BR=["t","type"];function i2(n){return Ga(n,BR)}const kR=["v","value"];function fp(n,e){const t=Ga(n,kR);if(t!=null)return t;throw bh(e)}const UR=["m","modifier"];function Yee(n){return Ga(n,UR)}const zR=["k","key"];function Zee(n){const e=Ga(n,zR);if(e)return e;throw bh(6)}function Ga(n,e,t){for(let i=0;i<e.length;i++){const r=e[i];if(ys(n,r)&&n[r]!=null)return n[r]}return t}const VR=[...LR,...DR,...FR,...OR,...zR,...UR,...kR,...BR];function bh(n){return new Error("unhandled node type: ".concat(n))}function I1(n){return t=>Jee(t,n)}function Jee(n,e){const t=jee(e);if(t==null)throw bh(0);if(i2(t)===1){const s=qee(t);return n.plural(s.reduce((o,a)=>[...o,eT(n,a)],[]))}else return eT(n,t)}function eT(n,e){const t=Xee(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=Kee(e).reduce((r,s)=>[...r,Mv(n,s)],[]);return n.normalize(i)}}function Mv(n,e){const t=i2(e);switch(t){case 3:return fp(e,t);case 9:return fp(e,t);case 4:{const i=e;if(ys(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(ys(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw bh(t)}case 5:{const i=e;if(ys(i,"i")&&Gn(i.i))return n.interpolate(n.list(i.i));if(ys(i,"index")&&Gn(i.index))return n.interpolate(n.list(i.index));throw bh(t)}case 6:{const i=e,r=Yee(i),s=Zee(i);return n.linked(Mv(n,s),r?Mv(n,r):void 0,n.type)}case 7:return fp(e,t);case 8:return fp(e,t);default:throw new Error("unhandled node on format message part: ".concat(t))}}const ete=n=>n;let pp=dn();function tte(n,e={}){let t=!1;const i=e.onError||Tee;return e.onError=r=>{t=!0,i(r)},{...Wee(n,e),detectError:t}}function nte(n,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&rt(n)){$t(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||ete)(n),r=pp[i];if(r)return r;const{ast:s,detectError:o}=tte(n,{...e,location:!1,jit:!0}),a=I1(s);return o?a:pp[i]=a}else{const t=n.cacheKey;if(t){const i=pp[t];return i||(pp[t]=I1(n))}else return I1(n)}}let Th=null;function ite(n){Th=n}function rte(n,e,t){Th&&Th.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const ste=ote("function:translate");function ote(n){return e=>Th&&Th.emit(n,e)}const Bo={INVALID_ARGUMENT:bee,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},ate=24;function ko(n){return D0(n,null,void 0)}function r2(n,e){return e.locale!=null?tT(e.locale):tT(n.locale)}let N1;function tT(n){if(rt(n))return n;if(yn(n)){if(n.resolvedOnce&&N1!=null)return N1;if(n.constructor.name==="Function"){const e=n();if(_ee(e))throw ko(Bo.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return N1=e}else throw ko(Bo.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ko(Bo.NOT_SUPPORT_LOCALE_TYPE)}function lte(n,e,t){return[...new Set([t,...In(e)?e:jt(e)?Object.keys(e):rt(e)?[e]:[t]])]}function HR(n,e,t){const i=rt(t)?t:wh,r=n;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(i);if(!s){s=[];let o=[t];for(;In(o);)o=nT(s,o,e);const a=In(e)||!Lt(e)?e:e.default?e.default:null;o=rt(a)?[a]:a,In(o)&&nT(s,o,!1),r.__localeChainCache.set(i,s)}return s}function nT(n,e,t){let i=!0;for(let r=0;r<e.length&&$t(i);r++){const s=e[r];rt(s)&&(i=cte(n,e[r],t))}return i}function cte(n,e,t){let i;const r=e.split("-");do{const s=r.join("-");i=ute(n,s,t),r.splice(-1,1)}while(r.length&&i===!0);return i}function ute(n,e,t){let i=!1;if(!n.includes(e)&&(i=!0,e)){i=e[e.length-1]!=="!";const r=e.replace(/!/g,"");n.push(r),(In(t)||Lt(t))&&t[r]&&(i=t[r])}return i}const Wa=[];Wa[0]={w:[0],i:[3,0],"[":[4],o:[7]};Wa[1]={w:[1],".":[2],"[":[4],o:[7]};Wa[2]={w:[2],i:[3,0],0:[3,0]};Wa[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Wa[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Wa[5]={"'":[4,0],o:8,l:[5,0]};Wa[6]={'"':[4,0],o:8,l:[6,0]};const dte=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function hte(n){return dte.test(n)}function fte(n){const e=n.charCodeAt(0),t=n.charCodeAt(n.length-1);return e===t&&(e===34||e===39)?n.slice(1,-1):n}function pte(n){if(n==null)return"o";switch(n.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return n;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function mte(n){const e=n.trim();return n.charAt(0)==="0"&&isNaN(parseInt(n))?!1:hte(e)?fte(e):"*"+e}function gte(n){const e=[];let t=-1,i=0,r=0,s,o,a,l,c,u,d;const h=[];h[0]=()=>{o===void 0?o=a:o+=a},h[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},h[2]=()=>{h[0](),r++},h[3]=()=>{if(r>0)r--,i=4,h[0]();else{if(r=0,o===void 0||(o=mte(o),o===!1))return!1;h[1]()}};function f(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,h[0](),!0}for(;i!==null;)if(t++,s=n[t],!(s==="\\"&&f())){if(l=pte(s),d=Wa[i],c=d[l]||d.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(a=s,u()===!1))))return;if(i===7)return e}}const iT=new Map;function yte(n,e){return jt(n)?n[e]:null}function vte(n,e){if(!jt(n))return null;let t=iT.get(e);if(t||(t=gte(e),t&&iT.set(e,t)),!t)return null;const i=t.length;let r=n,s=0;for(;s<i;){const o=t[s];if(VR.includes(o)&&Xs(r))return null;const a=r[o];if(a===void 0||yn(r))return null;r=a,s++}return r}const _te="11.1.9",F0=-1,wh="en-US",rT="",sT=n=>"".concat(n.charAt(0).toLocaleUpperCase()).concat(n.substr(1));function xte(){return{upper:(n,e)=>e==="text"&&rt(n)?n.toUpperCase():e==="vnode"&&jt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&rt(n)?n.toLowerCase():e==="vnode"&&jt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&rt(n)?sT(n):e==="vnode"&&jt(n)&&"__v_isVNode"in n?sT(n.children):n}}let $R;function Ste(n){$R=n}let GR;function Ate(n){GR=n}let WR;function bte(n){WR=n}let QR=null;const Tte=n=>{QR=n},wte=()=>QR;let jR=null;const oT=n=>{jR=n},Cte=()=>jR;let aT=0;function Ete(n={}){const e=yn(n.onWarn)?n.onWarn:See,t=rt(n.version)?n.version:_te,i=rt(n.locale)||yn(n.locale)?n.locale:wh,r=yn(i)?wh:i,s=In(n.fallbackLocale)||Lt(n.fallbackLocale)||rt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:r,o=Lt(n.messages)?n.messages:P1(r),a=Lt(n.datetimeFormats)?n.datetimeFormats:P1(r),l=Lt(n.numberFormats)?n.numberFormats:P1(r),c=Zn(dn(),n.modifiers,xte()),u=n.pluralRules||dn(),d=yn(n.missing)?n.missing:null,h=$t(n.missingWarn)||Mu(n.missingWarn)?n.missingWarn:!0,f=$t(n.fallbackWarn)||Mu(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,g=!!n.unresolving,y=yn(n.postTranslation)?n.postTranslation:null,m=Lt(n.processor)?n.processor:null,v=$t(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter,_=yn(n.messageCompiler)?n.messageCompiler:$R,S=yn(n.messageResolver)?n.messageResolver:GR||yte,E=yn(n.localeFallbacker)?n.localeFallbacker:WR||lte,A=jt(n.fallbackContext)?n.fallbackContext:void 0,R=n,w=jt(R.__datetimeFormatters)?R.__datetimeFormatters:new Map,M=jt(R.__numberFormatters)?R.__numberFormatters:new Map,I=jt(R.__meta)?R.__meta:{};aT++;const L={version:t,cid:aT,locale:i,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:d,missingWarn:h,fallbackWarn:f,fallbackFormat:p,unresolving:g,postTranslation:y,processor:m,warnHtmlMessage:v,escapeParameter:x,messageCompiler:_,messageResolver:S,localeFallbacker:E,fallbackContext:A,onWarn:e,__meta:I};return L.datetimeFormats=a,L.numberFormats=l,L.__datetimeFormatters=w,L.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&rte(L,t,I),L}const P1=n=>({[n]:dn()});function s2(n,e,t,i,r){const{missing:s,onWarn:o}=n;if(s!==null){const a=s(n,t,e,r);return rt(a)?a:e}else return e}function Sd(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function Mte(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function Rte(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i<e.length;i++)if(Mte(n,e[i]))return!0;return!1}function lT(n,...e){const{datetimeFormats:t,unresolving:i,fallbackLocale:r,onWarn:s,localeFallbacker:o}=n,{__datetimeFormatters:a}=n,[l,c,u,d]=Rv(...e),h=$t(u.missingWarn)?u.missingWarn:n.missingWarn;$t(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const f=!!u.part,p=r2(n,u),g=o(n,r,p);if(!rt(l)||l==="")return new Intl.DateTimeFormat(p,d).format(c);let y={},m,v=null;const x="datetime format";for(let E=0;E<g.length&&(m=g[E],y=t[m]||{},v=y[l],!Lt(v));E++)s2(n,l,m,h,x);if(!Lt(v)||!rt(m))return i?F0:l;let _="".concat(m,"__").concat(l);L0(d)||(_="".concat(_,"__").concat(JSON.stringify(d)));let S=a.get(_);return S||(S=new Intl.DateTimeFormat(m,Zn({},v,d)),a.set(_,S)),f?S.formatToParts(c):S.format(c)}const qR=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Rv(...n){const[e,t,i,r]=n,s=dn();let o=dn(),a;if(rt(e)){const l=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!l)throw ko(Bo.INVALID_ISO_DATE_ARGUMENT);const c=l[3]?l[3].trim().startsWith("T")?"".concat(l[1].trim()).concat(l[3].trim()):"".concat(l[1].trim(),"T").concat(l[3].trim()):l[1].trim();a=new Date(c);try{a.toISOString()}catch(u){throw ko(Bo.INVALID_ISO_DATE_ARGUMENT)}}else if(gee(e)){if(isNaN(e.getTime()))throw ko(Bo.INVALID_DATE_ARGUMENT);a=e}else if(Gn(e))a=e;else throw ko(Bo.INVALID_ARGUMENT);return rt(t)?s.key=t:Lt(t)&&Object.keys(t).forEach(l=>{qR.includes(l)?o[l]=t[l]:s[l]=t[l]}),rt(i)?s.locale=i:Lt(i)&&(o=i),Lt(r)&&(o=r),[s.key||"",a,s,o]}function cT(n,e,t){const i=n;for(const r in t){const s="".concat(e,"__").concat(r);i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function uT(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:r,onWarn:s,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,d]=Iv(...e),h=$t(u.missingWarn)?u.missingWarn:n.missingWarn;$t(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const f=!!u.part,p=r2(n,u),g=o(n,r,p);if(!rt(l)||l==="")return new Intl.NumberFormat(p,d).format(c);let y={},m,v=null;const x="number format";for(let E=0;E<g.length&&(m=g[E],y=t[m]||{},v=y[l],!Lt(v));E++)s2(n,l,m,h,x);if(!Lt(v)||!rt(m))return i?F0:l;let _="".concat(m,"__").concat(l);L0(d)||(_="".concat(_,"__").concat(JSON.stringify(d)));let S=a.get(_);return S||(S=new Intl.NumberFormat(m,Zn({},v,d)),a.set(_,S)),f?S.formatToParts(c):S.format(c)}const XR=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Iv(...n){const[e,t,i,r]=n,s=dn();let o=dn();if(!Gn(e))throw ko(Bo.INVALID_ARGUMENT);const a=e;return rt(t)?s.key=t:Lt(t)&&Object.keys(t).forEach(l=>{XR.includes(l)?o[l]=t[l]:s[l]=t[l]}),rt(i)?s.locale=i:Lt(i)&&(o=i),Lt(r)&&(o=r),[s.key||"",a,s,o]}function dT(n,e,t){const i=n;for(const r in t){const s="".concat(e,"__").concat(r);i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const Ite=n=>n,Nte=n=>"",Pte="text",Lte=n=>n.length===0?"":t2(n),Dte=xee;function hT(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function Fte(n){const e=Gn(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Gn(n.named.count)||Gn(n.named.n))?Gn(n.named.count)?n.named.count:Gn(n.named.n)?n.named.n:e:e}function Ote(n,e){e.count||(e.count=n),e.n||(e.n=n)}function Bte(n={}){const e=n.locale,t=Fte(n),i=jt(n.pluralRules)&&rt(e)&&yn(n.pluralRules[e])?n.pluralRules[e]:hT,r=jt(n.pluralRules)&&rt(e)&&yn(n.pluralRules[e])?hT:void 0,s=m=>m[i(t,m.length,r)],o=n.list||[],a=m=>o[m],l=n.named||dn();Gn(n.pluralIndex)&&Ote(t,l);const c=m=>l[m];function u(m,v){const x=yn(n.messages)?n.messages(m,!!v):jt(n.messages)?n.messages[m]:!1;return x||(n.parent?n.parent.message(m):Nte)}const d=m=>n.modifiers?n.modifiers[m]:Ite,h=Lt(n.processor)&&yn(n.processor.normalize)?n.processor.normalize:Lte,f=Lt(n.processor)&&yn(n.processor.interpolate)?n.processor.interpolate:Dte,p=Lt(n.processor)&&rt(n.processor.type)?n.processor.type:Pte,y={list:a,named:c,plural:s,linked:(m,...v)=>{const[x,_]=v;let S="text",E="";v.length===1?jt(x)?(E=x.modifier||E,S=x.type||S):rt(x)&&(E=x||E):v.length===2&&(rt(x)&&(E=x||E),rt(_)&&(S=_||S));const A=u(m,!0)(y),R=S==="vnode"&&In(A)&&E?A[0]:A;return E?d(E)(R,S):R},message:u,type:p,interpolate:f,normalize:h,values:Zn(dn(),o,l)};return y}const fT=()=>"",Xr=n=>yn(n);function pT(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:a}=n,[l,c]=Nv(...e),u=$t(c.missingWarn)?c.missingWarn:n.missingWarn,d=$t(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=$t(c.escapeParameter)?c.escapeParameter:n.escapeParameter,f=!!c.resolvedMessage,p=rt(c.default)||$t(c.default)?$t(c.default)?s?l:()=>l:c.default:t?s?l:()=>l:null,g=t||p!=null&&(rt(p)||yn(p)),y=r2(n,c);h&&kte(c);let[m,v,x]=f?[l,y,a[y]||dn()]:KR(n,l,y,o,d,u),_=m,S=l;if(!f&&!(rt(_)||Xs(_)||Xr(_))&&g&&(_=p,S=_),!f&&(!(rt(_)||Xs(_)||Xr(_))||!rt(v)))return r?F0:l;let E=!1;const A=()=>{E=!0},R=Xr(_)?_:YR(n,l,v,_,S,A);if(E)return _;const w=Vte(n,v,x,c),M=Bte(w),I=Ute(n,R,M),L=i?i(I,l):I;if(__INTLIFY_PROD_DEVTOOLS__){const k={timestamp:Date.now(),key:rt(l)?l:Xr(_)?_.key:"",locale:v||(Xr(_)?_.locale:""),format:rt(_)?_:Xr(_)?_.source:"",message:L};k.meta=Zn({},n.__meta,wte()||{}),ste(k)}return L}function kte(n){In(n.list)?n.list=n.list.map(e=>rt(e)?K3(e):e):jt(n.named)&&Object.keys(n.named).forEach(e=>{rt(n.named[e])&&(n.named[e]=K3(n.named[e]))})}function KR(n,e,t,i,r,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let d=dn(),h,f=null;const p="translate";for(let g=0;g<u.length&&(h=u[g],d=o[h]||dn(),(f=l(d,e))===null&&(f=d[e]),!(rt(f)||Xs(f)||Xr(f)));g++)if(!Rte(h,u)){const y=s2(n,e,h,s,p);y!==e&&(f=y)}return[f,h,d]}function YR(n,e,t,i,r,s){const{messageCompiler:o,warnHtmlMessage:a}=n;if(Xr(i)){const c=i;return c.locale=c.locale||t,c.key=c.key||e,c}if(o==null){const c=()=>i;return c.locale=t,c.key=e,c}const l=o(i,zte(n,t,r,i,a,s));return l.locale=t,l.key=e,l.source=i,l}function Ute(n,e,t){return e(t)}function Nv(...n){const[e,t,i]=n,r=dn();if(!rt(e)&&!Gn(e)&&!Xr(e)&&!Xs(e))throw ko(Bo.INVALID_ARGUMENT);const s=Gn(e)?String(e):(Xr(e),e);return Gn(t)?r.plural=t:rt(t)?r.default=t:Lt(t)&&!L0(t)?r.named=t:In(t)&&(r.list=t),Gn(i)?r.plural=i:rt(i)?r.default=i:Lt(i)&&Zn(r,i),[s,r]}function zte(n,e,t,i,r,s){return{locale:e,key:t,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>pee(e,t,o)}}function Vte(n,e,t,i){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,h={locale:e,modifiers:r,pluralRules:s,messages:(f,p)=>{let g=o(t,f);if(g==null&&(u||p)){const[,,y]=KR(u||n,f,e,a,l,c);g=o(y,f)}if(rt(g)||Xs(g)){let y=!1;const v=YR(n,f,e,g,f,()=>{y=!0});return y?fT:v}else return Xr(g)?g:fT}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),Gn(i.plural)&&(h.pluralIndex=i.plural),h}Qee();/*!
* vue-i18n v11.1.9
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/const Hte="11.1.9";function $te(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(wl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(wl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wl().__INTLIFY_PROD_DEVTOOLS__=!1)}const ur={UNEXPECTED_RETURN_TYPE:ate,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Br(n,...e){return D0(n,null,void 0)}const Pv=$a("__translateVNode"),Lv=$a("__datetimeParts"),Dv=$a("__numberParts"),ZR=$a("__setPluralRules"),JR=$a("__injectWithOption"),Fv=$a("__dispose");function Ch(n){if(!jt(n)||Xs(n))return n;for(const e in n)if(ys(n,e))if(!e.includes("."))jt(n[e])&&Ch(n[e]);else{const t=e.split("."),i=t.length-1;let r=n,s=!1;for(let o=0;o<i;o++){if(t[o]==="__proto__")throw new Error("unsafe key: ".concat(t[o]));if(t[o]in r||(r[t[o]]=dn()),!jt(r[t[o]])){s=!0;break}r=r[t[o]]}if(s||(Xs(r)?VR.includes(t[i])||delete n[e]:(r[t[i]]=n[e],delete n[e])),!Xs(r)){const o=r[t[i]];jt(o)&&Ch(o)}}return n}function o2(n,e){const{messages:t,__i18n:i,messageResolver:r,flatJson:s}=e,o=Lt(t)?t:In(i)?dn():{[n]:dn()};if(In(i)&&i.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||dn(),Gp(c,o[l])):Gp(c,o)}else rt(a)&&Gp(JSON.parse(a),o)}),r==null&&s)for(const a in o)ys(o,a)&&Ch(o[a]);return o}function eI(n){return n.type}function tI(n,e,t){let i=jt(e.messages)?e.messages:dn();"__i18nGlobal"in t&&(i=o2(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const r=Object.keys(i);r.length&&r.forEach(s=>{n.mergeLocaleMessage(s,i[s])});{if(jt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(jt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function mT(n){return Re(Iu,null,n,0)}const gT="__INTLIFY_META__",yT=()=>[],Gte=()=>!1;let vT=0;function _T(n){return(e,t,i,r)=>n(t,i,Wo()||void 0,r)}const Wte=()=>{const n=Wo();let e=null;return n&&(e=eI(n)[gT])?{[gT]:e}:null};function a2(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,r=n.flatJson,s=Fm?Dn:Nr;let o=$t(n.inheritLocale)?n.inheritLocale:!0;const a=s(e&&o?e.locale.value:rt(n.locale)?n.locale:wh),l=s(e&&o?e.fallbackLocale.value:rt(n.fallbackLocale)||In(n.fallbackLocale)||Lt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=s(o2(a.value,n)),u=s(Lt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),d=s(Lt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:$t(n.missingWarn)||Mu(n.missingWarn)?n.missingWarn:!0,f=e?e.fallbackWarn:$t(n.fallbackWarn)||Mu(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:$t(n.fallbackRoot)?n.fallbackRoot:!0,g=!!n.fallbackFormat,y=yn(n.missing)?n.missing:null,m=yn(n.missing)?_T(n.missing):null,v=yn(n.postTranslation)?n.postTranslation:null,x=e?e.warnHtmlMessage:$t(n.warnHtmlMessage)?n.warnHtmlMessage:!0,_=!!n.escapeParameter;const S=e?e.modifiers:Lt(n.modifiers)?n.modifiers:{};let E=n.pluralRules||e&&e.pluralRules,A;A=(()=>{i&&oT(null);const G={version:Hte,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:S,pluralRules:E,missing:m===null?void 0:m,missingWarn:h,fallbackWarn:f,fallbackFormat:g,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:x,escapeParameter:_,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};G.datetimeFormats=u.value,G.numberFormats=d.value,G.__datetimeFormatters=Lt(A)?A.__datetimeFormatters:void 0,G.__numberFormatters=Lt(A)?A.__numberFormatters:void 0;const X=Ete(G);return i&&oT(X),X})(),Sd(A,a.value,l.value);function w(){return[a.value,l.value,c.value,u.value,d.value]}const M=Ge({get:()=>a.value,set:G=>{A.locale=G,a.value=G}}),I=Ge({get:()=>l.value,set:G=>{A.fallbackLocale=G,l.value=G,Sd(A,a.value,G)}}),L=Ge(()=>c.value),k=Ge(()=>u.value),T=Ge(()=>d.value);function F(){return yn(v)?v:null}function V(G){v=G,A.postTranslation=G}function Q(){return y}function ee(G){G!==null&&(m=_T(G)),y=G,A.missing=m}const se=(G,X,ue,z,C,N)=>{w();let q;try{__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=e?Cte():void 0),q=G(A)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(ue!=="translate exists"&&Gn(q)&&q===F0||ue==="translate exists"&&!q){const[Z,$]=X();return e&&p?z(e):C(Z)}else{if(N(q))return q;throw Br(ur.UNEXPECTED_RETURN_TYPE)}};function he(...G){return se(X=>Reflect.apply(pT,null,[X,...G]),()=>Nv(...G),"translate",X=>Reflect.apply(X.t,X,[...G]),X=>X,X=>rt(X))}function ie(...G){const[X,ue,z]=G;if(z&&!jt(z))throw Br(ur.INVALID_ARGUMENT);return he(X,ue,Zn({resolvedMessage:!0},z||{}))}function re(...G){return se(X=>Reflect.apply(lT,null,[X,...G]),()=>Rv(...G),"datetime format",X=>Reflect.apply(X.d,X,[...G]),()=>rT,X=>rt(X)||In(X))}function be(...G){return se(X=>Reflect.apply(uT,null,[X,...G]),()=>Iv(...G),"number format",X=>Reflect.apply(X.n,X,[...G]),()=>rT,X=>rt(X)||In(X))}function le(G){return G.map(X=>rt(X)||Gn(X)||$t(X)?mT(String(X)):X)}const Te={normalize:le,interpolate:G=>G,type:"vnode"};function Ce(...G){return se(X=>{let ue;const z=X;try{z.processor=Te,ue=Reflect.apply(pT,null,[z,...G])}finally{z.processor=null}return ue},()=>Nv(...G),"translate",X=>X[Pv](...G),X=>[mT(X)],X=>In(X))}function Ie(...G){return se(X=>Reflect.apply(uT,null,[X,...G]),()=>Iv(...G),"number format",X=>X[Dv](...G),yT,X=>rt(X)||In(X))}function ze(...G){return se(X=>Reflect.apply(lT,null,[X,...G]),()=>Rv(...G),"datetime format",X=>X[Lv](...G),yT,X=>rt(X)||In(X))}function Be(G){E=G,A.pluralRules=E}function it(G,X){return se(()=>{if(!G)return!1;const ue=rt(X)?X:a.value,z=b(ue),C=A.messageResolver(z,G);return Xs(C)||Xr(C)||rt(C)},()=>[G],"translate exists",ue=>Reflect.apply(ue.te,ue,[G,X]),Gte,ue=>$t(ue))}function te(G){let X=null;const ue=HR(A,l.value,a.value);for(let z=0;z<ue.length;z++){const C=c.value[ue[z]]||{},N=A.messageResolver(C,G);if(N!=null){X=N;break}}return X}function ne(G){const X=te(G);return X!=null?X:e?e.tm(G)||{}:{}}function b(G){return c.value[G]||{}}function oe(G,X){if(r){const ue={[G]:X};for(const z in ue)ys(ue,z)&&Ch(ue[z]);X=ue[G]}c.value[G]=X,A.messages=c.value}function J(G,X){c.value[G]=c.value[G]||{};const ue={[G]:X};if(r)for(const z in ue)ys(ue,z)&&Ch(ue[z]);X=ue[G],Gp(X,c.value[G]),A.messages=c.value}function H(G){return u.value[G]||{}}function P(G,X){u.value[G]=X,A.datetimeFormats=u.value,cT(A,G,X)}function U(G,X){u.value[G]=Zn(u.value[G]||{},X),A.datetimeFormats=u.value,cT(A,G,X)}function j(G){return d.value[G]||{}}function B(G,X){d.value[G]=X,A.numberFormats=d.value,dT(A,G,X)}function D(G,X){d.value[G]=Zn(d.value[G]||{},X),A.numberFormats=d.value,dT(A,G,X)}vT++,e&&Fm&&(ci(e.locale,G=>{o&&(a.value=G,A.locale=G,Sd(A,a.value,l.value))}),ci(e.fallbackLocale,G=>{o&&(l.value=G,A.fallbackLocale=G,Sd(A,a.value,l.value))}));const W={id:vT,locale:M,fallbackLocale:I,get inheritLocale(){return o},set inheritLocale(G){o=G,G&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Sd(A,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:L,get modifiers(){return S},get pluralRules(){return E||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(G){h=G,A.missingWarn=h},get fallbackWarn(){return f},set fallbackWarn(G){f=G,A.fallbackWarn=f},get fallbackRoot(){return p},set fallbackRoot(G){p=G},get fallbackFormat(){return g},set fallbackFormat(G){g=G,A.fallbackFormat=g},get warnHtmlMessage(){return x},set warnHtmlMessage(G){x=G,A.warnHtmlMessage=G},get escapeParameter(){return _},set escapeParameter(G){_=G,A.escapeParameter=G},t:he,getLocaleMessage:b,setLocaleMessage:oe,mergeLocaleMessage:J,getPostTranslationHandler:F,setPostTranslationHandler:V,getMissingHandler:Q,setMissingHandler:ee,[ZR]:Be};return W.datetimeFormats=k,W.numberFormats=T,W.rt=ie,W.te=it,W.tm=ne,W.d=re,W.n=be,W.getDateTimeFormat=H,W.setDateTimeFormat=P,W.mergeDateTimeFormat=U,W.getNumberFormat=j,W.setNumberFormat=B,W.mergeNumberFormat=D,W[JR]=t,W[Pv]=Ce,W[Lv]=ze,W[Dv]=Ie,W}function Qte(n){const e=rt(n.locale)?n.locale:wh,t=rt(n.fallbackLocale)||In(n.fallbackLocale)||Lt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:e,i=yn(n.missing)?n.missing:void 0,r=$t(n.silentTranslationWarn)||Mu(n.silentTranslationWarn)?!n.silentTranslationWarn:!0,s=$t(n.silentFallbackWarn)||Mu(n.silentFallbackWarn)?!n.silentFallbackWarn:!0,o=$t(n.fallbackRoot)?n.fallbackRoot:!0,a=!!n.formatFallbackMessages,l=Lt(n.modifiers)?n.modifiers:{},c=n.pluralizationRules,u=yn(n.postTranslation)?n.postTranslation:void 0,d=rt(n.warnHtmlInMessage)?n.warnHtmlInMessage!=="off":!0,h=!!n.escapeParameterHtml,f=$t(n.sync)?n.sync:!0;let p=n.messages;if(Lt(n.sharedMessages)){const S=n.sharedMessages;p=Object.keys(S).reduce((A,R)=>{const w=A[R]||(A[R]={});return Zn(w,S[R]),A},p||{})}const{__i18n:g,__root:y,__injectWithOption:m}=n,v=n.datetimeFormats,x=n.numberFormats,_=n.flatJson;return{locale:e,fallbackLocale:t,messages:p,flatJson:_,datetimeFormats:v,numberFormats:x,missing:i,missingWarn:r,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:h,messageResolver:n.messageResolver,inheritLocale:f,__i18n:g,__root:y,__injectWithOption:m}}function Ov(n={}){const e=a2(Qte(n)),{__extender:t}=n,i={id:e.id,get locale(){return e.locale.value},set locale(r){e.locale.value=r},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(r){e.fallbackLocale.value=r},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(r){e.setMissingHandler(r)},get silentTranslationWarn(){return $t(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(r){e.missingWarn=$t(r)?!r:r},get silentFallbackWarn(){return $t(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(r){e.fallbackWarn=$t(r)?!r:r},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(r){e.fallbackFormat=r},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(r){e.setPostTranslationHandler(r)},get sync(){return e.inheritLocale},set sync(r){e.inheritLocale=r},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){e.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(r){e.escapeParameter=r},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...r){return Reflect.apply(e.t,e,[...r])},rt(...r){return Reflect.apply(e.rt,e,[...r])},te(r,s){return e.te(r,s)},tm(r){return e.tm(r)},getLocaleMessage(r){return e.getLocaleMessage(r)},setLocaleMessage(r,s){e.setLocaleMessage(r,s)},mergeLocaleMessage(r,s){e.mergeLocaleMessage(r,s)},d(...r){return Reflect.apply(e.d,e,[...r])},getDateTimeFormat(r){return e.getDateTimeFormat(r)},setDateTimeFormat(r,s){e.setDateTimeFormat(r,s)},mergeDateTimeFormat(r,s){e.mergeDateTimeFormat(r,s)},n(...r){return Reflect.apply(e.n,e,[...r])},getNumberFormat(r){return e.getNumberFormat(r)},setNumberFormat(r,s){e.setNumberFormat(r,s)},mergeNumberFormat(r,s){e.mergeNumberFormat(r,s)}};return i.__extender=t,i}function jte(n,e,t){return{beforeCreate(){const i=Wo();if(!i)throw Br(ur.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=e,this===this.$root)this.$i18n=xT(n,s);else{s.__injectWithOption=!0,s.__extender=t.__vueI18nExtend,this.$i18n=Ov(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=xT(n,r);else{this.$i18n=Ov({__i18n:r.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=n;r.__i18nGlobal&&tI(e,r,r),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=Wo();if(!i)throw Br(ur.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),t.__deleteInstance(i),delete this.$i18n}}}function xT(n,e){n.locale=e.locale||n.locale,n.fallbackLocale=e.fallbackLocale||n.fallbackLocale,n.missing=e.missing||n.missing,n.silentTranslationWarn=e.silentTranslationWarn||n.silentFallbackWarn,n.silentFallbackWarn=e.silentFallbackWarn||n.silentFallbackWarn,n.formatFallbackMessages=e.formatFallbackMessages||n.formatFallbackMessages,n.postTranslation=e.postTranslation||n.postTranslation,n.warnHtmlInMessage=e.warnHtmlInMessage||n.warnHtmlInMessage,n.escapeParameterHtml=e.escapeParameterHtml||n.escapeParameterHtml,n.sync=e.sync||n.sync,n.__composer[ZR](e.pluralizationRules||n.pluralizationRules);const t=o2(n.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(i=>n.mergeLocaleMessage(i,t[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>n.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>n.mergeNumberFormat(i,e.numberFormats[i])),n}const l2={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function qte({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,r)=>[...i,...r.type===Hn?r.children:[r]],[]):e.reduce((t,i)=>{const r=n[i];return r&&(t[i]=r()),t},dn())}function nI(){return Hn}const Xte=rn({name:"i18n-t",props:Zn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Gn(n)||!isNaN(n)}},l2),setup(n,e){const{slots:t,attrs:i}=e,r=n.i18n||c2({useScope:n.scope,__useComponent:!0});return()=>{const s=Object.keys(t).filter(d=>d[0]!=="_"),o=dn();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=rt(n.plural)?+n.plural:n.plural);const a=qte(e,s),l=r[Pv](n.keypath,a,o),c=Zn(dn(),i),u=rt(n.tag)||jt(n.tag)?n.tag:nI();return Da(u,c,l)}}}),ST=Xte;function Kte(n){return In(n)&&!rt(n[0])}function iI(n,e,t,i){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let a=dn();n.locale&&(o.locale=n.locale),rt(n.format)?o.key=n.format:jt(n.format)&&(rt(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,f)=>t.includes(f)?Zn(dn(),h,{[f]:n.format[f]}):h,dn()));const l=i(n.value,o,a);let c=[o.key];In(l)?c=l.map((h,f)=>{const p=r[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return Kte(g)&&(g[0].key="".concat(h.type,"-").concat(f)),g}):rt(l)&&(c=[l]);const u=Zn(dn(),s),d=rt(n.tag)||jt(n.tag)?n.tag:nI();return Da(d,u,c)}}const Yte=rn({name:"i18n-n",props:Zn({value:{type:Number,required:!0},format:{type:[String,Object]}},l2),setup(n,e){const t=n.i18n||c2({useScope:n.scope,__useComponent:!0});return iI(n,e,XR,(...i)=>t[Dv](...i))}}),AT=Yte;function Zte(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function Jte(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Br(ur.UNEXPECTED_ERROR);const c=Zte(n,a.$),u=bT(l);return[Reflect.apply(c.t,c,[...TT(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);Fm&&n.global===c&&(o.__i18nWatcher=ci(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{Fm&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=bT(a);o.textContent=Reflect.apply(l.t,l,[...TT(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function bT(n){if(rt(n))return{path:n};if(Lt(n)){if(!("path"in n))throw Br(ur.REQUIRED_VALUE,"path");return n}else throw Br(ur.INVALID_VALUE)}function TT(n){const{path:e,locale:t,args:i,choice:r,plural:s}=n,o={},a=i||{};return rt(t)&&(o.locale=t),Gn(r)&&(o.plural=r),Gn(s)&&(o.plural=s),[e,a,o]}function ene(n,e,...t){const i=Lt(t[0])?t[0]:{};($t(i.globalInstall)?i.globalInstall:!0)&&([ST.name,"I18nT"].forEach(s=>n.component(s,ST)),[AT.name,"I18nN"].forEach(s=>n.component(s,AT)),[CT.name,"I18nD"].forEach(s=>n.component(s,CT))),n.directive("t",Jte(e))}const tne=$a("global-vue-i18n");function nne(n={}){const e=__VUE_I18N_LEGACY_API__&&$t(n.legacy)?n.legacy:__VUE_I18N_LEGACY_API__,t=$t(n.globalInjection)?n.globalInjection:!0,i=new Map,[r,s]=ine(n,e),o=$a("");function a(d){return i.get(d)||null}function l(d,h){i.set(d,h)}function c(d){i.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=o,d.provide(d.__VUE_I18N_SYMBOL__,u),Lt(h[0])){const g=h[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let f=null;!e&&t&&(f=dne(d,u.global)),__VUE_I18N_FULL_INSTALL__&&ene(d,u,...h),__VUE_I18N_LEGACY_API__&&e&&d.mixin(jte(s,s.__composer,u));const p=d.unmount;d.unmount=()=>{f&&f(),u.dispose(),p()}},get global(){return s},dispose(){r.stop()},__instances:i,__getInstance:a,__setInstance:l,__deleteInstance:c};return u}function c2(n={}){const e=Wo();if(e==null)throw Br(ur.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Br(ur.NOT_INSTALLED);const t=rne(e),i=one(t),r=eI(e),s=sne(n,r);if(s==="global")return tI(i,n,r),i;if(s==="parent"){let l=ane(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=Zn({},n);"__i18n"in r&&(l.__i18n=r.__i18n),i&&(l.__root=i),a=a2(l),o.__composerExtend&&(a[Fv]=o.__composerExtend(a)),cne(o,e,a),o.__setInstance(e,a)}return a}function ine(n,e){const t=Hv(),i=__VUE_I18N_LEGACY_API__&&e?t.run(()=>Ov(n)):t.run(()=>a2(n));if(i==null)throw Br(ur.UNEXPECTED_ERROR);return[t,i]}function rne(n){const e=Ji(n.isCE?tne:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Br(n.isCE?ur.NOT_INSTALLED_WITH_PROVIDE:ur.UNEXPECTED_ERROR);return e}function sne(n,e){return L0(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function one(n){return n.mode==="composition"?n.global:n.global.__composer}function ane(n,e,t=!1){let i=null;const r=e.root;let s=lne(e,t);for(;s!=null;){const o=n;if(n.mode==="composition")i=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(i=a.__composer,t&&i&&!i[JR]&&(i=null))}if(i!=null||r===s)break;s=s.parent}return i}function lne(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function cne(n,e,t){ka(()=>{},e),Lh(()=>{const i=t;n.__deleteInstance(e);const r=i[Fv];r&&(r(),delete i[Fv])},e)}const une=["locale","fallbackLocale","availableLocales"],wT=["t","rt","d","n","tm","te"];function dne(n,e){const t=Object.create(null);return une.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw Br(ur.UNEXPECTED_ERROR);const o=bn(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(t,r,o)}),n.config.globalProperties.$i18n=t,wT.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw Br(ur.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,"$".concat(r),s)}),()=>{delete n.config.globalProperties.$i18n,wT.forEach(r=>{delete n.config.globalProperties["$".concat(r)]})}}const hne=rn({name:"i18n-d",props:Zn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},l2),setup(n,e){const t=n.i18n||c2({useScope:n.scope,__useComponent:!0});return iI(n,e,qR,(...i)=>t[Lv](...i))}}),CT=hne;$te();Ste(nte);Ate(vte);bte(HR);if(__INTLIFY_PROD_DEVTOOLS__){const n=wl();n.__INTLIFY__=!0,ite(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const fne={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},rI={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Bv={lang:Ue({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},fne),timePickerLocale:Ue({},rI)};Bv.lang.ok="确定";const gr="${label}不是一个有效的${type}",pne={locale:"zh-cn",Pagination:oee,DatePicker:Bv,TimePicker:rI,Calendar:Bv,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:gr,method:gr,array:gr,object:gr,number:gr,date:gr,boolean:gr,integer:gr,float:gr,regexp:gr,email:gr,url:gr,hex:gr},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码已过期",refresh:"点击刷新",scanned:"已扫描"}},mne={message:{hello:"hello world"}},gne={message:{hello:"你好,世界"}},sI=Dn("zh"),yne={zh:pne,en:Su},vne={en:mne,zh:gne},_ne=nne({legacy:!1,locale:sI.value,messages:vne}),xne=rn({__name:"index",props:{color:{},fontSize:{},icon:{}},emits:[],setup(n,{emit:e}){return(t,i)=>(ft(),ou(A8(t.icon),{class:"icon",style:Qs({fontSize:t.fontSize+"px",color:t.color})},null,8,["style"]))}}),Cd=ii(xne,[["__scopeId","data-v-91f3cb32"]]),Sne={},Ane={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function bne(n,e){return ft(),xt("svg",Ane,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_13_287/13_279"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath><clipPath id="master_svg1_13_287/13_279/13_018"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_13_287/13_279)"><g clip-path="url(#master_svg1_13_287/13_279/13_018)"><g><rect x="0" y="0" width="20" height="20" rx="0" fill="#FFFFFF" fill-opacity="0.009999999776482582" style="mix-blend-mode:passthrough;"></rect></g><g><path d="M7.55256390625,4.9999589765625Q7.52622390625,5.0016259765625,7.49983390625,5.0016259765625Q7.41759390625,5.0016259765625,7.33693390625,4.9855819765625Q7.25627390625,4.9695369765625,7.18029390625,4.9380649765625Q7.10431390625,4.9065929765625,7.03593390625,4.8609029765625Q6.96755390625,4.8152129765625,6.90940390625,4.7570599765625Q6.85125390625,4.6989069765625,6.80556390625,4.6305269765625Q6.75986390625,4.5621469765625005,6.72839390625,4.4861669765625Q6.69692390625,4.4101859765625,6.68088390625,4.3295259765625Q6.66483390625,4.2488662765625,6.66483390625,4.1666259765625Q6.66483390625,4.0843856765625,6.68088390625,4.0037259765625Q6.69692390625,3.9230659765625,6.72839390625,3.8470849765625Q6.75986390625,3.7711049765625,6.80556390625,3.7027249765625Q6.85125390625,3.6343449765624998,6.90940390625,3.5761919765625Q6.96755390625,3.5180389765625,7.03593390625,3.4723489765625Q7.10431390625,3.4266589765625,7.18029390625,3.3951869765625Q7.25627390625,3.3637149765625,7.33693390625,3.3476699765625Q7.41759390625,3.3316259765625,7.49983390625,3.3316259765625Q7.52622390625,3.3316259765625,7.55256390625,3.3332929765625L14.99980390625,3.3332929765625Q15.08190390625,3.3332929765625,15.16240390625,3.3493049765625003Q15.24290390625,3.3653169765625,15.31870390625,3.3967269765625Q15.39460390625,3.4281359765625,15.46280390625,3.4737349765625Q15.53100390625,3.5193339765625,15.58910390625,3.5773699765625Q15.64710390625,3.6354069765625,15.69270390625,3.7036509765625Q15.73830390625,3.7718949765625,15.76970390625,3.8477229765625Q15.80110390625,3.9235519765625,15.81720390625,4.0040509765625Q15.83320390625,4.0845497765625,15.83320390625,4.1666259765625L15.83320390625,11.1972259765625Q15.83480390625,11.2235659765625,15.83480390625,11.2499559765625Q15.83480390625,11.332195976562499,15.81880390625,11.4128559765625Q15.80270390625,11.493515976562499,15.77130390625,11.5694959765625Q15.73980390625,11.645475976562501,15.69410390625,11.713855976562499Q15.64840390625,11.7822359765625,15.59030390625,11.840395976562501Q15.53210390625,11.898545976562499,15.46370390625,11.9442359765625Q15.39540390625,11.9899259765625,15.31940390625,12.0213959765625Q15.24340390625,12.0528659765625,15.16270390625,12.0689159765625Q15.08210390625,12.084955976562501,14.99980390625,12.084955976562501Q14.91760390625,12.084955976562501,14.83690390625,12.0689159765625Q14.75630390625,12.0528659765625,14.68030390625,12.0213959765625Q14.60430390625,11.9899259765625,14.53590390625,11.9442359765625Q14.46760390625,11.898545976562499,14.40940390625,11.840395976562501Q14.35120390625,11.7822359765625,14.30560390625,11.713855976562499Q14.25990390625,11.645475976562501,14.22840390625,11.5694959765625Q14.19690390625,11.493515976562499,14.18090390625,11.4128559765625Q14.16480390625,11.332195976562499,14.16480390625,11.2499559765625Q14.16480390625,11.2235659765625,14.16650390625,11.1972259765625L14.16650390625,4.9999589765625L7.55256390625,4.9999589765625ZM2.49983690625,5.0526899765625Q2.50150390625,5.0263509765625,2.50150390625,4.9999589765625Q2.50150390625,4.9177189765625,2.48545990625,4.8370589765625Q2.46941490625,4.7563989765625,2.43794290625,4.6804189765625Q2.40647090625,4.6044379765625,2.36078090625,4.5360579765625Q2.31509090625,4.4676779765625,2.25693790625,4.4095249765625Q2.1987849062500002,4.3513719765625,2.13040490625,4.3056819765625Q2.06202490625,4.2599918765625,1.98604490625,4.2285198765625Q1.91006390625,4.1970478765625,1.82940390625,4.1810035765625Q1.74874420625,4.1649593165625,1.66650390625,4.1649593065625Q1.58426360625,4.1649593165625,1.50360390625,4.1810035765625Q1.42294390625,4.1970478765625,1.34696290625,4.2285198765625Q1.27098290625,4.2599918765625,1.20260290625,4.3056819765625Q1.13422290625,4.3513719765625,1.0760699062499999,4.4095249765625Q1.01791690625,4.4676779765625,0.97222690625,4.5360579765625Q0.92653690625,4.6044379765625,0.89506490625,4.6804189765625Q0.86359290625,4.7563989765625,0.84754790625,4.8370589765625Q0.83150390625,4.9177189765625,0.83150390625,4.9999589765625Q0.83150390625,5.0263509765625,0.83317090625,5.0526899765625L0.83317090625,15.8333259765625Q0.83317090625,15.9153259765625,0.84918290625,15.9958259765625Q0.86519490625,16.0763259765625,0.89660490625,16.152225976562498Q0.92801390625,16.2280259765625,0.97361290625,16.2962259765625Q1.01921190625,16.3645259765625,1.07724790625,16.4225259765625Q1.13528490625,16.4806259765625,1.2035289062499999,16.5262259765625Q1.27177290625,16.5718259765625,1.34760090625,16.6032259765625Q1.42342990625,16.6346259765625,1.50392890625,16.6506259765625Q1.58442770625,16.6666259765625,1.66650390625,16.6666259765625L12.44710390625,16.6666259765625Q12.47340390625,16.6683259765625,12.49980390625,16.6683259765625Q12.58210390625,16.6683259765625,12.66270390625,16.652225976562498Q12.74340390625,16.6362259765625,12.81940390625,16.6047259765625Q12.89540390625,16.573225976562497,12.96370390625,16.5275259765625Q13.03210390625,16.4819259765625,13.09030390625,16.4237259765625Q13.14840390625,16.365525976562502,13.19410390625,16.2972259765625Q13.23980390625,16.2288259765625,13.27130390625,16.1528259765625Q13.30270390625,16.0768259765625,13.31880390625,15.9962259765625Q13.33480390625,15.9155259765625,13.33480390625,15.8333259765625Q13.33480390625,15.7510259765625,13.31880390625,15.6704259765625Q13.30270390625,15.5897259765625,13.27130390625,15.5137259765625Q13.23980390625,15.4377259765625,13.19410390625,15.3694259765625Q13.14840390625,15.3010259765625,13.09030390625,15.2428259765625Q13.03210390625,15.1847259765625,12.96370390625,15.1390259765625Q12.89540390625,15.0933259765625,12.81940390625,15.0618259765625Q12.74340390625,15.0304259765625,12.66270390625,15.0143259765625Q12.58210390625,14.9983259765625,12.49980390625,14.9983259765625Q12.47340390625,14.9983259765625,12.44710390625,14.9999259765625L2.49983690625,14.9999259765625L2.49983690625,5.0526899765625Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M18.97024,14.7041040234375Q19.06538,14.5913440234375,19.11602,14.4527940234375Q19.16667,14.3142340234375,19.16667,14.1667040234375L19.16667,5.8333740234375Q19.16667,5.7512978234375,19.15065,5.6707990234375Q19.13464,5.5903000234375,19.10323,5.5144710234375Q19.07182,5.4386430234375,19.026220000000002,5.3703990234375Q18.98063,5.3021550234375,18.92259,5.2441180234375Q18.86455,5.1860820234375,18.79631,5.1404830234375Q18.72806,5.0948840234375,18.65224,5.0634750234375Q18.57641,5.0320650234375,18.49591,5.0160530234375Q18.41541,5.0000410234375,18.33333,5.0000410234375Q18.18581,5.0000410234375,18.04725,5.0506860234375Q17.90869,5.1013300234375,17.79594,5.1964640234375L14.462608,8.0089640234375Q14.393074,8.067634023437499,14.337838,8.1399240234375Q14.282601,8.2122140234375,14.244265,8.2947240234375Q14.205928,8.377224023437499,14.186297,8.4660640234375Q14.166667,8.5548940234375,14.166667,8.6458740234375L14.166667,11.3542040234375Q14.166667,11.4451840234375,14.186297,11.5340240234375Q14.205928,11.622854023437501,14.244265,11.7053640234375Q14.282601,11.7878640234375,14.337838,11.860154023437499Q14.393074,11.932444023437501,14.462608,11.9911140234375L17.79594,14.8036140234375Q17.922629999999998,14.9105140234375,18.08058,14.9607840234375Q18.23853,15.0110640234375,18.4037,14.9970640234375Q18.56887,14.9830640234375,18.71611,14.9069240234375Q18.86335,14.8307940234375,18.97024,14.7041040234375ZM17.5,12.3732440234375L17.5,7.6268340234375L15.833333,9.0330840234375L15.833333,10.9669940234375L17.5,12.3732440234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M1.1145349062499998,2.2931679765625Q0.97958490625,2.1742799765625,0.90554390625,2.0103779765625Q0.83150390625,1.8464759765625,0.83150390625,1.6666259765625Q0.83150390625,1.5843856765625,0.84754790625,1.5037259765625Q0.86359290625,1.4230659765625,0.89506490625,1.3470849765625Q0.92653690625,1.2711049765625,0.97222690625,1.2027249765625Q1.01791690625,1.1343449765625,1.0760699062499999,1.0761919765624999Q1.13422290625,1.0180389765625,1.20260290625,0.9723489765625Q1.27098290625,0.9266589765625,1.34696290625,0.8951869765625Q1.42294390625,0.8637149765625,1.50360390625,0.8476699765625Q1.58426360625,0.8316259765625,1.66650390625,0.8316259765625Q1.84635390625,0.8316259765625,2.01025590625,0.9056659765625Q2.17415790625,0.9797069765625,2.29304590625,1.1146569765624998L18.88520390625,17.7067259765625Q19.02010390625,17.8256259765625,19.09410390625,17.9895259765625Q19.16820390625,18.1534259765625,19.16820390625,18.3333259765625Q19.16820390625,18.4155259765625,19.15210390625,18.4962259765625Q19.13610390625,18.5768259765625,19.10460390625,18.6528259765625Q19.07310390625,18.7288259765625,19.02740390625,18.7972259765625Q18.98170390625,18.8655259765625,18.92360390625,18.9237259765625Q18.86540390625,18.9818259765625,18.79710390625,19.0275259765625Q18.72870390625,19.0732259765625,18.65270390625,19.1047259765625Q18.57670390625,19.1362259765625,18.49610390625,19.1522259765625Q18.41540390625,19.1683259765625,18.33320390625,19.1683259765625Q18.15330390625,19.1683259765625,17.98940390625,19.0942259765625Q17.82550390625,19.0202259765625,17.70660390625,18.8853259765625L1.1145349062499998,2.2931679765625Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g></g>',2)]))}const Tne=ii(Sne,[["render",bne]]),wne={},Cne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function Ene(n,e){return ft(),xt("svg",Cne,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_13_279"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath><clipPath id="master_svg1_13_279/13_007"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_13_279)"><g clip-path="url(#master_svg1_13_279/13_007)"><g><rect x="0" y="0" width="20" height="20" rx="0" fill="#FFFFFF" fill-opacity="0.009999999776482582" style="mix-blend-mode:passthrough;"></rect></g><g><path d="M0.83317090625,15.8333259765625L0.83317090625,4.1666259765625Q0.83317090625,4.0845497765625,0.84918290625,4.0040509765625Q0.86519490625,3.9235519765625,0.89660490625,3.8477229765625Q0.92801390625,3.7718949765625,0.97361290625,3.7036509765625Q1.01921190625,3.6354069765625,1.07724790625,3.5773699765625Q1.13528490625,3.5193339765625,1.2035289062499999,3.4737349765625Q1.27177290625,3.4281359765625,1.34760090625,3.3967269765625Q1.42342990625,3.3653169765625,1.50392890625,3.3493049765625003Q1.58442770625,3.3332929765625,1.66650390625,3.3332929765625L14.99980390625,3.3332929765625Q15.08190390625,3.3332929765625,15.16240390625,3.3493049765625003Q15.24290390625,3.3653169765625,15.31870390625,3.3967269765625Q15.39460390625,3.4281359765625,15.46280390625,3.4737349765625Q15.53100390625,3.5193339765625,15.58910390625,3.5773699765625Q15.64710390625,3.6354069765625,15.69270390625,3.7036509765625Q15.73830390625,3.7718949765625,15.76970390625,3.8477229765625Q15.80110390625,3.9235519765625,15.81720390625,4.0040509765625Q15.83320390625,4.0845497765625,15.83320390625,4.1666259765625L15.83320390625,15.8333259765625Q15.83320390625,15.9153259765625,15.81720390625,15.9958259765625Q15.80110390625,16.0763259765625,15.76970390625,16.152225976562498Q15.73830390625,16.2280259765625,15.69270390625,16.2962259765625Q15.64710390625,16.3645259765625,15.58910390625,16.4225259765625Q15.53100390625,16.4806259765625,15.46280390625,16.5262259765625Q15.39460390625,16.5718259765625,15.31870390625,16.6032259765625Q15.24290390625,16.6346259765625,15.16240390625,16.6506259765625Q15.08190390625,16.6666259765625,14.99980390625,16.6666259765625L1.66650390625,16.6666259765625Q1.58442770625,16.6666259765625,1.50392890625,16.6506259765625Q1.42342990625,16.6346259765625,1.34760090625,16.6032259765625Q1.27177290625,16.5718259765625,1.2035289062499999,16.5262259765625Q1.13528490625,16.4806259765625,1.07724790625,16.4225259765625Q1.01921190625,16.3645259765625,0.97361290625,16.2962259765625Q0.92801390625,16.2280259765625,0.89660490625,16.152225976562498Q0.86519490625,16.0763259765625,0.84918290625,15.9958259765625Q0.83317090625,15.9153259765625,0.83317090625,15.8333259765625ZM2.49983690625,4.9999589765625L2.49983690625,14.9999259765625L14.16650390625,14.9999259765625L14.16650390625,4.9999589765625L2.49983690625,4.9999589765625Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M18.97024,14.7041040234375Q19.06538,14.5913440234375,19.11602,14.4527940234375Q19.16667,14.3142340234375,19.16667,14.1667040234375L19.16667,5.8333740234375Q19.16667,5.7512978234375,19.15065,5.6707990234375Q19.13464,5.5903000234375,19.10323,5.5144710234375Q19.07182,5.4386430234375,19.026220000000002,5.3703990234375Q18.98063,5.3021550234375,18.92259,5.2441180234375Q18.86455,5.1860820234375,18.79631,5.1404830234375Q18.72806,5.0948840234375,18.65224,5.0634750234375Q18.57641,5.0320650234375,18.49591,5.0160530234375Q18.41541,5.0000410234375,18.33333,5.0000410234375Q18.18581,5.0000410234375,18.04725,5.0506860234375Q17.90869,5.1013300234375,17.79594,5.1964640234375L14.462608,8.0089640234375Q14.393074,8.067634023437499,14.337838,8.1399240234375Q14.282601,8.2122140234375,14.244265,8.2947240234375Q14.205928,8.377224023437499,14.186297,8.4660640234375Q14.166667,8.5548940234375,14.166667,8.6458740234375L14.166667,11.3542040234375Q14.166667,11.4451840234375,14.186297,11.5340240234375Q14.205928,11.622854023437501,14.244265,11.7053640234375Q14.282601,11.7878640234375,14.337838,11.860154023437499Q14.393074,11.932444023437501,14.462608,11.9911140234375L17.79594,14.8036140234375Q17.922629999999998,14.9105140234375,18.08058,14.9607840234375Q18.23853,15.0110640234375,18.4037,14.9970640234375Q18.56887,14.9830640234375,18.71611,14.9069240234375Q18.86335,14.8307940234375,18.97024,14.7041040234375ZM17.5,12.3732440234375L17.5,7.6268340234375L15.833333,9.0330840234375L15.833333,10.9669940234375L17.5,12.3732440234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M7.65749209375,7.3101989765625L10.11698609375,9.3597759765625Q10.17518609375,9.4082759765625,10.22367609375,9.4664759765625Q10.32979609375,9.5938159765625,10.37910609375,9.7520659765625Q10.42841609375,9.9103259765625,10.41340609375,10.0754059765625Q10.39839609375,10.2404859765625,10.321366093750001,10.3872559765625Q10.24432609375,10.5340259765625,10.11698609375,10.6401459765625L7.65748809375,12.6897259765625Q7.54118509375,12.7998059765625,7.39241009375,12.8590459765625Q7.24363409375,12.9182959765625,7.08349609375,12.9182959765625Q7.00125579375,12.9182959765625,6.92059609375,12.9022459765625Q6.83993609375,12.8862059765625,6.76395509375,12.8547359765625Q6.6879750937499995,12.8232559765625,6.61959509375,12.7775659765625Q6.55121509375,12.731875976562499,6.49306209375,12.673725976562501Q6.43490909375,12.6155759765625,6.38921909375,12.547195976562499Q6.34352909375,12.478815976562501,6.31205709375,12.4028359765625Q6.28058509375,12.3268559765625,6.26454009375,12.2461959765625Q6.24849609375,12.1655359765625,6.24849609375,12.0832959765625Q6.24849609375,11.9848059765625,6.27141009375,11.8890159765625Q6.29432409375,11.7932359765625,6.33889509375,11.7054159765625Q6.38346609375,11.6175859765625,6.44724609375,11.5425459765625Q6.51102709375,11.4674959765625,6.59051809375,11.4093459765625L8.28178609375,9.9999559765625L6.59051809375,8.5905679765625Q6.51102709375,8.5324209765625,6.44724609375,8.4573769765625Q6.38346509375,8.3823319765625,6.33889509375,8.2945069765625Q6.29432409375,8.2066819765625,6.27141009375,8.1108979765625Q6.24849609375,8.0151131765625,6.24849609375,7.9166259765625Q6.24849609375,7.8343856765625,6.26454009375,7.7537259765625Q6.28058509375,7.6730659765625,6.31205709375,7.5970849765625Q6.34352909375,7.5211049765624995,6.38921909375,7.4527249765625Q6.43490909375,7.3843449765625,6.49306209375,7.3261919765625Q6.55121509375,7.2680389765625,6.61959509375,7.2223489765625Q6.6879750937499995,7.1766589765625,6.76395509375,7.1451869765625Q6.83993609375,7.1137149765625,6.92059609375,7.0976699765625Q7.00125579375,7.0816259765625,7.08349609375,7.0816259765625Q7.24363509375,7.0816259765625,7.39241209375,7.1408709765625Q7.54118909375,7.2001159765625005,7.65749209375,7.3101989765625Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g></g>',2)]))}const Mne=ii(wne,[["render",Ene]]),Rne={},Ine={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"14.000000357627869",height:"10.000000357627869",viewBox:"0 0 14.000000357627869 10.000000357627869"};function Nne(n,e){return ft(),xt("svg",Ine,e[0]||(e[0]=[zt("g",null,[zt("path",{d:"M13.802466686534881,1.1380186865348816Q13.89646668653488,1.0444176865348815,13.947366686534881,0.9218876865348815Q13.998366686534881,0.7993576865348816,13.998366686534881,0.6666666865348816Q13.998366686534881,0.6011698865348816,13.98556668653488,0.5369316865348817Q13.972766686534882,0.4726936865348816,13.947666686534882,0.4121826865348816Q13.922666686534882,0.3516706865348816,13.886266686534881,0.2972126865348816Q13.849866686534881,0.2427536865348816,13.803566686534882,0.19644068653488161Q13.757266686534882,0.15012768653488162,13.702766686534881,0.11373968653488165Q13.648366686534882,0.07735168653488156,13.587866686534882,0.052286686534881555Q13.527266686534881,0.02722268653488158,13.463066686534882,0.014444686534881623Q13.398866686534882,0.0016666865348815563,13.333366686534882,0.0016666865348815563Q13.201466686534882,0.0016666865348815563,13.079566686534882,0.051981686534881555Q12.957666686534882,0.10229768653488158,12.864266686534881,0.1953146865348816L12.863066686534882,0.19413268653488158L4.624996686534882,8.392776686534882L1.1369396865348815,4.921396686534882L1.1357636865348817,4.922586686534881Q1.0422996865348817,4.829566686534881,0.9204146865348816,4.779246686534882Q0.7985286865348816,4.728936686534881,0.6666666865348816,4.728936686534881Q0.6011698865348816,4.728936686534881,0.5369316865348817,4.741706686534882Q0.4726936865348816,4.754486686534881,0.4121826865348816,4.779556686534882Q0.3516706865348816,4.804616686534882,0.2972126865348816,4.8410066865348815Q0.2427536865348816,4.8773966865348815,0.19644068653488161,4.9237066865348815Q0.15012768653488162,4.970016686534882,0.11373968653488165,5.024476686534881Q0.07735168653488156,5.078936686534882,0.052286686534881555,5.139446686534882Q0.02722268653488158,5.199956686534882,0.014444686534881623,5.2641966865348815Q0.0016666865348815563,5.328436686534881,0.0016666865348815563,5.3939366865348815Q0.0016666865348815563,5.526626686534882,0.05259268653488158,5.649156686534882Q0.10351768653488158,5.771686686534881,0.1975696865348816,5.865286686534882L0.1963936865348816,5.866466686534881L4.1547266865348815,9.805866686534882Q4.201126686534882,9.852046686534882,4.255616686534882,9.888306686534882Q4.310106686534882,9.924576686534882,4.3706166865348814,9.949556686534882Q4.431126686534881,9.974536686534881,4.495326686534882,9.987266686534882Q4.559536686534882,9.999996686534882,4.624996686534882,9.999996686534882Q4.690456686534882,9.999996686534882,4.754666686534882,9.987266686534882Q4.818876686534882,9.974536686534881,4.879386686534882,9.949556686534882Q4.939886686534882,9.924576686534882,4.994386686534882,9.888306686534882Q5.048876686534881,9.852046686534882,5.0952766865348815,9.805866686534882L13.803566686534882,1.1392006865348816L13.802466686534881,1.1380186865348816Z","fill-rule":"evenodd",fill:"#E0E0FC","fill-opacity":"1",style:{"mix-blend-mode":"passthrough"}})],-1)]))}const ET=ii(Rne,[["render",Nne]]),Pne={},Lne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function Dne(n,e){return ft(),xt("svg",Lne,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_13_287/13_278"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath><clipPath id="master_svg1_13_287/13_278/13_040"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_13_287/13_278)"><g clip-path="url(#master_svg1_13_287/13_278/13_040)"><g><path d="M7.34851109375,12.6516259765625Q8.44685609375,13.7499259765625,10.00016609375,13.7499259765625Q11.55346609375,13.7499259765625,12.65181609375,12.6516259765625Q13.75016609375,11.5532659765625,13.75016609375,9.9999559765625L13.75016609375,4.5832959765625Q13.75016609375,3.0299959765624997,12.65181609375,1.9316429765625Q11.55346609375,0.8332929765625,10.00016609375,0.8332919765625Q8.44685609375,0.8332929765625,7.34851109375,1.9316429765625Q6.25016309375,3.0299959765624997,6.25016309375,4.5832959765625L6.25016309375,9.9999559765625Q6.25016309375,11.5532659765625,7.34851109375,12.6516259765625ZM11.47330609375,11.4730959765625Q10.86310609375,12.0833259765625,10.00016609375,12.0833259765625Q9.13721609375,12.0833259765625,8.527026093749999,11.4730959765625Q7.91682909375,10.8629059765625,7.91682909375,9.9999559765625L7.91683009375,4.5832959765625Q7.91683009375,3.7203459765625,8.527026093749999,3.1101559765625Q9.13721609375,2.4999589765625,10.00016609375,2.4999589765625Q10.86310609375,2.4999589765625,11.47330609375,3.1101559765625Q12.08349609375,3.7203459765625,12.08349609375,4.5832959765625L12.08349609375,9.9999559765625Q12.08349609375,10.8629059765625,11.47330609375,11.4730959765625Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M17.08315046875,9.6393233234375Q17.08502046875,9.6113801234375,17.08502046875,9.5833740234375Q17.08502046875,9.5011337234375,17.06898046875,9.4204740234375Q17.05293046875,9.3398140234375,17.02146046875,9.2638330234375Q16.98999046875,9.1878530234375,16.94430046875,9.1194730234375Q16.89861046875,9.0510930234375,16.84046046875,8.9929400234375Q16.78230046875,8.9347870234375,16.71392346875,8.8890970234375Q16.64554246875,8.8434070234375,16.56956246875,8.8119350234375Q16.49358246875,8.7804630234375,16.41292246875,8.7644180234375Q16.33226246875,8.7483740234375,16.25002246875,8.7483740234375Q16.16778146875,8.7483740234375,16.08712146875,8.7644180234375Q16.00646146875,8.7804630234375,15.93048146875,8.8119350234375Q15.85450146875,8.8434070234375,15.78612106875,8.8890970234375Q15.71774076875,8.9347870234375,15.65958806875,8.9929400234375Q15.60143546875,9.0510930234375,15.55574546875,9.1194730234375Q15.51005446875,9.1878530234375,15.47858246875,9.2638330234375Q15.44711046875,9.3398140234375,15.43106646875,9.4204740234375Q15.41502246875,9.5011337234375,15.41502246875,9.5833740234375Q15.41502246875,9.6080265234375,15.41647646875,9.6326360234375Q15.40712446875,10.7164940234375,14.98582546875,11.7046140234375Q14.89498046875,11.8831040234375,14.89498046875,12.0833740234375Q14.89498046875,12.1656140234375,14.91102446875,12.2462740234375Q14.92706946875,12.3269340234375,14.95854146875,12.4029140234375Q14.99001346875,12.4788940234375,15.03570346875,12.5472740234375Q15.08139346875,12.6156540234375,15.13954646875,12.6738040234375Q15.19769946875,12.7319640234375,15.26607946875,12.7776540234375Q15.33445946875,12.8233440234375,15.41043946875,12.8548140234375Q15.48642046875,12.8862840234375,15.56708046875,12.9023340234375Q15.64774016875,12.9183740234375,15.72998046875,12.9183740234375Q15.79409136875,12.9183740234375,15.85745046875,12.9085840234375Q15.92081046875,12.8988040234375,15.98193346875,12.8794540234375Q16.04305546875,12.8601140234375,16.10050846875,12.8316640234375Q16.15796246875,12.8032140234375,16.21039846875,12.7663240234375Q16.26283546875,12.7294440234375,16.309026468749998,12.6849840234375Q16.35521746875,12.6405240234375,16.39408046875,12.5895340234375Q16.43294246875,12.538544023437499,16.46356646875,12.4822240234375Q16.49418946875,12.4258940234375,16.51585446875,12.3655540234375Q17.07244046875,11.0643540234375,17.08315046875,9.6393233234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M4.583527,9.6329521234375Q4.585,9.6081849234375,4.585,9.5833740234375Q4.585,9.5011337234375,4.568956,9.4204740234375Q4.552911,9.3398140234375,4.521439,9.2638330234375Q4.489967,9.1878530234375,4.444277,9.1194730234375Q4.398587,9.0510930234375,4.340434,8.9929400234375Q4.282281,8.9347870234375,4.213901,8.8890970234375Q4.1455210000000005,8.8434070234375,4.069541,8.8119350234375Q3.99356,8.7804630234375,3.9129,8.7644180234375Q3.8322403,8.7483740234375,3.75,8.7483740234375Q3.6677597,8.7483740234375,3.5871,8.7644180234375Q3.50644,8.7804630234375,3.430459,8.8119350234375Q3.354479,8.8434070234375,3.286099,8.8890970234375Q3.2177189999999998,8.9347870234375,3.159566,8.9929400234375Q3.101413,9.0510930234375,3.055723,9.1194730234375Q3.010033,9.1878530234375,2.978561,9.2638330234375Q2.947089,9.3398140234375,2.931044,9.4204740234375Q2.915,9.5011337234375,2.915,9.5833740234375Q2.915,9.6112012234375,2.916853,9.6389666234375Q2.9363479999999997,12.5370740234375,4.99132,14.5920540234375Q7.06598,16.6667040234375,10,16.6667040234375Q11.1917,16.6667040234375,12.30806,16.2819440234375Q12.37346,16.2636640234375,12.43505,16.235064023437502Q12.49663,16.2064640234375,12.55279,16.1682840234375Q12.60894,16.1301040234375,12.65819,16.0833540234375Q12.70744,16.036604023437498,12.74849,15.9825140234375Q12.78954,15.9284240234375,12.82131,15.868404023437499Q12.85308,15.8083940234375,12.87473,15.7440340234375Q12.89639,15.6796740234375,12.90736,15.6126640234375Q12.91833,15.5456540234375,12.91833,15.4777440234375Q12.91833,15.3955040234375,12.90229,15.3148440234375Q12.88624,15.2341840234375,12.85477,15.1582040234375Q12.8233,15.082224023437501,12.77761,15.0138440234375Q12.73192,14.9454640234375,12.67377,14.8873140234375Q12.61561,14.8291640234375,12.54723,14.783474023437499Q12.47885,14.7377840234375,12.40287,14.7063140234375Q12.32689,14.6748340234375,12.24623,14.658794023437501Q12.16557,14.6427540234375,12.08333,14.642744023437501Q11.91469,14.642744023437501,11.75926,14.7082040234375Q10.9093,15.0000440234375,10,15.0000440234375Q7.75633,15.0000440234375,6.16983,13.413544023437499Q4.6008890000000005,11.8445940234375,4.583527,9.6329521234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M10.833333,15.8861049234375Q10.835,15.8597658234375,10.835,15.8333740234375Q10.835,15.7511337234375,10.818956,15.6704740234375Q10.802911,15.5898140234375,10.771439,15.5138330234375Q10.739967,15.4378530234375,10.694277,15.3694730234375Q10.648587,15.3010930234375,10.590434,15.2429400234375Q10.532281,15.1847870234375,10.463901,15.1390970234375Q10.395521,15.0934070234375,10.319541,15.0619350234375Q10.24356,15.0304630234375,10.1629,15.0144180234375Q10.0822403,14.9983740234375,10,14.9983740234375Q9.9177597,14.9983740234375,9.8371,15.0144180234375Q9.75644,15.0304630234375,9.680459,15.0619350234375Q9.604479,15.0934070234375,9.536099,15.1390970234375Q9.467719,15.1847870234375,9.409566,15.2429400234375Q9.351413,15.3010930234375,9.305723,15.3694730234375Q9.260033,15.4378530234375,9.228561,15.5138330234375Q9.197089,15.5898140234375,9.181044,15.6704740234375Q9.165,15.7511337234375,9.165,15.8333740234375Q9.165,15.8597658234375,9.166667,15.8861049234375L9.166667,18.2806440234375Q9.165,18.3069840234375,9.165,18.3333740234375Q9.165,18.4156140234375,9.181044,18.4962740234375Q9.197089,18.5769340234375,9.228561,18.6529140234375Q9.260033,18.7288940234375,9.305723,18.7972740234375Q9.351413,18.8656540234375,9.409566,18.9238040234375Q9.467719,18.9819640234375,9.536099,19.0276540234375Q9.604479,19.0733440234375,9.680459,19.1048140234375Q9.75644,19.1362840234375,9.8371,19.1523340234375Q9.9177597,19.1683740234375,10,19.1683740234375Q10.0822403,19.1683740234375,10.1629,19.1523340234375Q10.24356,19.1362840234375,10.319541,19.1048140234375Q10.395521,19.0733440234375,10.463901,19.0276540234375Q10.532281,18.9819640234375,10.590434,18.9238040234375Q10.648587,18.8656540234375,10.694277,18.7972740234375Q10.739967,18.7288940234375,10.771439,18.6529140234375Q10.802911,18.5769340234375,10.818956,18.4962740234375Q10.835,18.4156140234375,10.835,18.3333740234375Q10.835,18.3069840234375,10.833333,18.2806440234375L10.833333,15.8861049234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M1.9480309999999998,3.126542Q1.813081,3.007654,1.7390400000000001,2.843752Q1.665,2.67985,1.665,2.5Q1.665,2.4177597,1.681044,2.3371Q1.697089,2.25644,1.728561,2.180459Q1.760033,2.104479,1.805723,2.036099Q1.851413,1.967719,1.9095659999999999,1.9095659999999999Q1.967719,1.851413,2.036099,1.805723Q2.104479,1.760033,2.180459,1.728561Q2.25644,1.697089,2.3371,1.681044Q2.4177597,1.665,2.5,1.665Q2.67985,1.665,2.843752,1.7390400000000001Q3.007654,1.813081,3.126542,1.9480309999999998L18.052,16.8735Q18.1869,16.9923,18.261,17.1562Q18.335,17.3202,18.335,17.5Q18.335,17.5822,18.319000000000003,17.6629Q18.3029,17.7436,18.2714,17.819499999999998Q18.240000000000002,17.8955,18.1943,17.963900000000002Q18.148600000000002,18.0323,18.090400000000002,18.090400000000002Q18.0323,18.148600000000002,17.963900000000002,18.1943Q17.8955,18.240000000000002,17.819499999999998,18.2714Q17.7436,18.3029,17.6629,18.319000000000003Q17.5822,18.335,17.5,18.335Q17.3202,18.335,17.1562,18.261Q16.9923,18.1869,16.8735,18.052L1.9480309999999998,3.126542Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g></g>',2)]))}const Fne=ii(Pne,[["render",Dne]]),One={},Bne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function kne(n,e){return ft(),xt("svg",Bne,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_13_278"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath><clipPath id="master_svg1_13_278/13_029"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_13_278)"><g clip-path="url(#master_svg1_13_278/13_029)"><g><rect x="0" y="0" width="20" height="20" rx="0" fill="#FFFFFF" fill-opacity="0.009999999776482582" style="mix-blend-mode:passthrough;"></rect></g><g><path d="M6.249918953125,9.9999559765625L6.249918953125,4.5832959765625Q6.249918953125,3.0299959765624997,7.348267953125,1.9316419765625Q8.446621953125,0.8332929765625,9.999921953125,0.8332929765625Q11.553221953125,0.8332929765625,12.651571953125,1.9316419765625Q13.749921953125,3.0299959765624997,13.749921953125,4.5832959765625L13.749921953125,9.9999559765625Q13.749921953125,11.5532559765625,12.651571953125,12.6516259765625Q11.553221953125,13.7499259765625,9.999921953125,13.7499259765625Q8.446621953125,13.7499259765625,7.348267953125,12.6516259765625Q6.249918953125,11.5532559765625,6.249918953125,9.9999559765625ZM7.916584953125,9.9999559765625Q7.916584953125,10.8629059765625,8.526781953124999,11.4730959765625Q9.136971953125,12.0833259765625,9.999921953125,12.0833259765625Q10.862861953125,12.0833259765625,11.473061953125,11.4730959765625Q12.083251953125,10.8629059765625,12.083251953125,9.9999559765625L12.083251953125,4.5832959765625Q12.083251953125,3.7203459765625,11.473061953125,3.1101559765625Q10.862861953125,2.4999589765625,9.999921953125,2.4999589765625Q9.136971953125,2.4999589765625,8.526781953124999,3.1101559765625Q7.916584953125,3.7203459765625,7.916584953125,4.5832959765625L7.916584953125,9.9999559765625Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M4.583527,9.6329521234375Q4.585,9.6081849234375,4.585,9.5833740234375Q4.585,9.5011337234375,4.568956,9.4204740234375Q4.552911,9.3398140234375,4.521439,9.2638330234375Q4.489967,9.1878530234375,4.444277,9.1194730234375Q4.398587,9.0510930234375,4.340434,8.9929400234375Q4.282281,8.9347870234375,4.213901,8.8890970234375Q4.1455210000000005,8.8434070234375,4.069541,8.8119350234375Q3.99356,8.7804630234375,3.9129,8.7644180234375Q3.8322403,8.7483740234375,3.75,8.7483740234375Q3.6677597,8.7483740234375,3.5871,8.7644180234375Q3.50644,8.7804630234375,3.430459,8.8119350234375Q3.354479,8.8434070234375,3.286099,8.8890970234375Q3.2177189999999998,8.9347870234375,3.159566,8.9929400234375Q3.101413,9.0510930234375,3.055723,9.1194730234375Q3.010033,9.1878530234375,2.978561,9.2638330234375Q2.947089,9.3398140234375,2.931044,9.4204740234375Q2.915,9.5011337234375,2.915,9.5833740234375Q2.915,9.6112012234375,2.916853,9.6389666234375Q2.9363479999999997,12.5370740234375,4.99132,14.5920540234375Q7.06598,16.6667040234375,10,16.6667040234375Q12.93402,16.6667040234375,15.0087,14.5920540234375Q17.0636,12.5370940234375,17.0831,9.6390003234375Q17.085,9.6112181234375,17.085,9.5833740234375Q17.085,9.5011337234375,17.069000000000003,9.4204740234375Q17.0529,9.3398140234375,17.0214,9.2638330234375Q16.990000000000002,9.1878530234375,16.9443,9.1194730234375Q16.898600000000002,9.0510930234375,16.840400000000002,8.9929400234375Q16.7823,8.9347870234375,16.713900000000002,8.8890970234375Q16.6455,8.8434070234375,16.569499999999998,8.8119350234375Q16.4936,8.7804630234375,16.4129,8.7644180234375Q16.3322,8.7483740234375,16.25,8.7483740234375Q16.1678,8.7483740234375,16.0871,8.7644180234375Q16.0064,8.7804630234375,15.9305,8.8119350234375Q15.8545,8.8434070234375,15.7861,8.8890970234375Q15.7177,8.9347870234375,15.6596,8.9929400234375Q15.6014,9.0510930234375,15.5557,9.1194730234375Q15.51,9.1878530234375,15.4786,9.2638330234375Q15.4471,9.3398140234375,15.431,9.4204740234375Q15.415,9.5011337234375,15.415,9.5833740234375Q15.415,9.6081817234375,15.4165,9.6329456234375Q15.3991,11.8445940234375,13.8302,13.413544023437499Q12.24366,15.0000440234375,10,15.0000440234375Q7.75633,15.0000440234375,6.16983,13.413544023437499Q4.6008890000000005,11.8445940234375,4.583527,9.6329521234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M10.833333,15.8861049234375Q10.835,15.8597658234375,10.835,15.8333740234375Q10.835,15.7511337234375,10.818956,15.6704740234375Q10.802911,15.5898140234375,10.771439,15.5138330234375Q10.739967,15.4378530234375,10.694277,15.3694730234375Q10.648587,15.3010930234375,10.590434,15.2429400234375Q10.532281,15.1847870234375,10.463901,15.1390970234375Q10.395521,15.0934070234375,10.319541,15.0619350234375Q10.24356,15.0304630234375,10.1629,15.0144180234375Q10.0822403,14.9983740234375,10,14.9983740234375Q9.9177597,14.9983740234375,9.8371,15.0144180234375Q9.75644,15.0304630234375,9.680459,15.0619350234375Q9.604479,15.0934070234375,9.536099,15.1390970234375Q9.467719,15.1847870234375,9.409566,15.2429400234375Q9.351413,15.3010930234375,9.305723,15.3694730234375Q9.260033,15.4378530234375,9.228561,15.5138330234375Q9.197089,15.5898140234375,9.181044,15.6704740234375Q9.165,15.7511337234375,9.165,15.8333740234375Q9.165,15.8597658234375,9.166667,15.8861049234375L9.166667,18.2806440234375Q9.165,18.3069840234375,9.165,18.3333740234375Q9.165,18.4156140234375,9.181044,18.4962740234375Q9.197089,18.5769340234375,9.228561,18.6529140234375Q9.260033,18.7288940234375,9.305723,18.7972740234375Q9.351413,18.8656540234375,9.409566,18.9238040234375Q9.467719,18.9819640234375,9.536099,19.0276540234375Q9.604479,19.0733440234375,9.680459,19.1048140234375Q9.75644,19.1362840234375,9.8371,19.1523340234375Q9.9177597,19.1683740234375,10,19.1683740234375Q10.0822403,19.1683740234375,10.1629,19.1523340234375Q10.24356,19.1362840234375,10.319541,19.1048140234375Q10.395521,19.0733440234375,10.463901,19.0276540234375Q10.532281,18.9819640234375,10.590434,18.9238040234375Q10.648587,18.8656540234375,10.694277,18.7972740234375Q10.739967,18.7288940234375,10.771439,18.6529140234375Q10.802911,18.5769340234375,10.818956,18.4962740234375Q10.835,18.4156140234375,10.835,18.3333740234375Q10.835,18.3069840234375,10.833333,18.2806440234375L10.833333,15.8861049234375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g></g>',2)]))}const Une=ii(One,[["render",kne]]),zne={},Vne={class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"};function Hne(n,e){return ft(),xt("svg",Vne,e[0]||(e[0]=[zt("path",{d:"M899.925333 172.080762a48.761905 48.761905 0 0 1 0 28.525714l-207.969523 679.448381a48.761905 48.761905 0 0 1-81.115429 20.187429l-150.552381-150.552381-96.304762 96.329143a24.380952 24.380952 0 0 1-41.593905-17.237334v-214.966857l275.821715-243.370667-355.57181 161.596953-103.253333-103.228953a48.761905 48.761905 0 0 1 20.23619-81.091047L838.997333 139.702857a48.761905 48.761905 0 0 1 60.903619 32.353524z"},null,-1)]))}const $ne=ii(zne,[["render",Hne]]),Gne={},Wne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function Qne(n,e){return ft(),xt("svg",Wne,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_20_113"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_20_113)"><g><path d="M17.52452171875,9.078936578124999Q17.659471718749998,8.960048578125,17.73351171875,8.796145578125Q17.80755171875,8.632242578125,17.80755171875,8.452392578125Q17.80755171875,8.370152278125,17.79151171875,8.289492578125Q17.77546171875,8.208832578125,17.74399171875,8.132851578125Q17.71252171875,8.056871578125,17.66683171875,7.988491578125Q17.62114171875,7.920111578125,17.56299171875,7.861958578125Q17.50483171875,7.803805578125,17.43645171875,7.758115578125Q17.36807171875,7.712425578125,17.29209171875,7.680953578125Q17.21611171875,7.649481578125,17.13545171875,7.633436578125Q17.05479171875,7.617392578125,16.97255171875,7.617392578125Q16.79270171875,7.617392578125,16.62880171875,7.691433578125Q16.46490171875,7.765474578125,16.34601171875,7.900425578125L12.88504271875,11.361392578124999Q12.75009271875,11.480282578125,12.67605171875,11.644182578125001Q12.60201171875,11.808082578125,12.60201171875,11.987932578125001Q12.60201171875,12.070172578125,12.61805571875,12.150832578125Q12.63410071875,12.231492578125,12.66557271875,12.307472578125001Q12.69704471875,12.383452578125,12.74273471875,12.451832578125Q12.78842471875,12.520212578125001,12.84657771875,12.578362578124999Q12.90473071875,12.636522578125,12.97311071875,12.682212578125Q13.04149071875,12.727902578125,13.11747071875,12.759372578125Q13.19345171875,12.790842578125,13.27411171875,12.806892578125Q13.35477141875,12.822932578125,13.43701171875,12.822932578125Q13.61685971875,12.822932578125,13.78076071875,12.748892578125Q13.94466171875,12.674852578125,14.06354971875,12.539902578125L17.52452171875,9.078936578124999Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M12.88553,9.078933578125Q12.75058,8.960045578125,12.67654,8.796143578125Q12.6025,8.632241578125,12.6025,8.452392578125Q12.6025,8.370152278125,12.618544,8.289492578125Q12.634589,8.208832578125,12.666061,8.132851578125Q12.697533,8.056871578125,12.743223,7.988491578125Q12.788913,7.920111578125,12.847066,7.861958578125Q12.905219,7.803805578125,12.973599,7.758115578125Q13.041979,7.712425578125,13.117959,7.680953578125Q13.19394,7.649481578125,13.2746,7.633436578125Q13.3552597,7.617392578125,13.4375,7.617392578125Q13.617349,7.617392578125,13.781251,7.691432578125Q13.945153,7.765472578125,14.064041,7.900422578125L17.52501,11.361392578124999Q17.659959999999998,11.480282578125,17.734,11.644182578125001Q17.80804,11.808082578125,17.80804,11.987932578125001Q17.80804,12.070172578125,17.792,12.150832578125Q17.77595,12.231492578125,17.74448,12.307472578125001Q17.71301,12.383452578125,17.66732,12.451832578125Q17.62163,12.520212578125001,17.56347,12.578362578124999Q17.50532,12.636522578125,17.43694,12.682212578125Q17.36856,12.727902578125,17.29258,12.759372578125Q17.2166,12.790842578125,17.13594,12.806892578125Q17.05528,12.822932578125,16.97304,12.822932578125Q16.79319,12.822932578125,16.62929,12.748892578125Q16.46539,12.674852578125,16.3465,12.539902578125L12.88553,9.078933578125Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M4.44364390625,5.42117L2.49983690625,5.42117Q1.80948090625,5.42117,1.32132890625,5.90931Q0.83317090625,6.39747,0.83317090625,7.08783L0.83317090625,12.8496Q0.83317090625,13.54,1.32132990625,14.0281Q1.80948090625,14.5163,2.49983690625,14.5163L4.43961390625,14.5163Q6.77175390625,18.3333,9.99983390625,18.3333Q10.08191390625,18.3333,10.16241390625,18.3173Q10.24291390625,18.301299999999998,10.31874390625,18.2699Q10.39456390625,18.238500000000002,10.46281390625,18.1929Q10.53105390625,18.1473,10.58909390625,18.0893Q10.64713390625,18.0312,10.69272390625,17.963Q10.73832390625,17.8947,10.76973390625,17.8189Q10.80114390625,17.7431,10.81715390625,17.662599999999998Q10.83317390625,17.5821,10.83317390625,17.5L10.83317390625,2.5Q10.83317390625,2.4179238,10.81715390625,2.337425Q10.80114390625,2.256926,10.76973390625,2.181097Q10.73832390625,2.105269,10.69272390625,2.037025Q10.64712390625,1.968781,10.58909390625,1.910744Q10.53105390625,1.852708,10.46281390625,1.807109Q10.39456390625,1.76151,10.31874390625,1.7301009999999999Q10.24291390625,1.698691,10.16241390625,1.682679Q10.08191390625,1.666667,9.99983390625,1.666667Q6.77619390625,1.666667,4.44364390625,5.42117ZM4.91587390625,7.08783Q5.02559390625,7.08783,5.13157390625,7.05943Q5.23755390625,7.03103,5.3325739062499995,6.97617Q5.42758390625,6.92131,5.50516390625,6.84372Q5.58274390625,6.76614,5.63759390625,6.67111Q7.22859390625,3.91495,9.16650390625,3.434681L9.16650390625,16.563299999999998Q7.23188390625,16.074199999999998,5.6405439062500005,13.2715Q5.58600390625,13.1754,5.50830390625,13.0969Q5.4306139062500005,13.0184,5.33514390625,12.9628Q5.23966390625,12.9072,5.1330139062499995,12.8784Q5.02635390625,12.8496,4.91587390625,12.8496L2.49983690625,12.8496L2.49983790625,7.08783L4.91587390625,7.08783Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g>',2)]))}const jne=ii(Gne,[["render",Qne]]),qne={},Xne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"20",height:"20",viewBox:"0 0 20 20"};function Kne(n,e){return ft(),xt("svg",Xne,e[0]||(e[0]=[Nu('<defs><clipPath id="master_svg0_13_280"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath><clipPath id="master_svg1_13_280/13_053"><rect x="0" y="0" width="20" height="20" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_13_280)"><g clip-path="url(#master_svg1_13_280/13_053)"><g><rect x="0" y="0" width="20" height="20" rx="0" fill="#FFFFFF" fill-opacity="0.009999999776482582" style="mix-blend-mode:passthrough;"></rect></g><g><path d="M4.443888046875,5.42117L2.500081046875,5.42117Q1.809725046875,5.42117,1.321573046875,5.90931Q0.833415046875,6.39747,0.833415046875,7.08783L0.833415046875,12.8496Q0.833415046875,13.54,1.321574046875,14.0281Q1.809725046875,14.5163,2.500081046875,14.5163L4.439858046875,14.5163Q6.771998046875,18.3333,10.000078046875,18.3333Q10.082158046875,18.3333,10.162658046875,18.3173Q10.243158046875,18.301299999999998,10.318988046875,18.2699Q10.394808046875,18.238500000000002,10.463058046875,18.1929Q10.531298046875,18.1473,10.589338046875,18.0893Q10.647378046875,18.0312,10.692968046875,17.963Q10.738568046875,17.8947,10.769978046875,17.8189Q10.801388046875,17.7431,10.817398046875,17.662599999999998Q10.833418046875,17.5821,10.833418046875,17.5L10.833418046875,2.5Q10.833418046875,2.4179238,10.817398046875,2.337425Q10.801388046875,2.256926,10.769978046875,2.181097Q10.738568046875,2.105269,10.692968046875,2.037025Q10.647368046875,1.968781,10.589338046875,1.910744Q10.531298046875,1.852708,10.463058046875,1.807109Q10.394808046875,1.76151,10.318988046875,1.7301009999999999Q10.243158046875,1.698691,10.162658046875,1.682679Q10.082158046875,1.666667,10.000078046875,1.666667Q6.776438046875,1.666667,4.443888046875,5.42117ZM4.916118046875,7.08783Q5.025838046875,7.08783,5.131818046875,7.05943Q5.237798046875,7.03103,5.3328180468749995,6.97617Q5.427828046875,6.92131,5.505408046875,6.84372Q5.582988046875,6.76614,5.637838046875,6.67111Q7.228838046875,3.91495,9.166748046875,3.434681L9.166748046875,16.563299999999998Q7.232128046875,16.074199999999998,5.6407880468750005,13.2715Q5.586248046875,13.1754,5.508548046875,13.0969Q5.4308580468750005,13.0184,5.335388046875,12.9628Q5.239908046875,12.9072,5.1332580468749995,12.8784Q5.026598046875,12.8496,4.916118046875,12.8496L2.500081046875,12.8496L2.500082046875,7.08783L4.916118046875,7.08783Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M12.813896953124999,6.903831Q12.740067953125,6.845187,12.681175953125,6.771557Q12.622282953125,6.697926,12.581291953125,6.613017Q12.540300953125,6.528109,12.519276953125,6.436197Q12.498251953125,6.3442856,12.498251953125,6.25Q12.498251953125,6.1677597,12.514295953125,6.0871Q12.530340953125,6.00644,12.561812953125,5.930459Q12.593284953125,5.8544789999999995,12.638974953125,5.786099Q12.684664953125,5.717719,12.742817953125,5.659566Q12.800970953125,5.601413,12.869350953125,5.555723Q12.937730953125,5.510033,13.013710953125,5.478561Q13.089691953125,5.447089,13.170351953125,5.431044Q13.251011653125,5.415,13.333251953125,5.415Q13.501904953125,5.415,13.657335953125,5.4804580000000005Q13.812766953125,5.545916,13.930607953125,5.66657Q14.362131953125001,6.059567,14.707911953125,6.532997Q15.248111953125001,7.2726299999999995,15.535961953125,8.14354Q15.833251953125,9.04304,15.833251953125,10Q15.833251953125,10.94869,15.540941953125,11.84127Q15.257921953125,12.70551,14.726221953125,13.4418Q14.373671953125,13.92992,13.930609953125,14.33343Q13.812768953125,14.45408,13.657336953125,14.51954Q13.501904953125,14.585,13.333251953125,14.585Q13.251011653125,14.585,13.170351953125,14.56895Q13.089691953125,14.55291,13.013710953125,14.52144Q12.937730953125,14.48997,12.869350953125,14.44428Q12.800970953125,14.39859,12.742817953125,14.34043Q12.684664953125,14.28228,12.638974953125,14.213899999999999Q12.593284953125,14.145520000000001,12.561812953125,14.06954Q12.530340953125,13.99356,12.514295953125,13.9129Q12.498251953125,13.832239999999999,12.498251953125,13.75Q12.498251953125,13.655719999999999,12.519276953125,13.5638Q12.540300953125,13.47189,12.581291953125,13.386980000000001Q12.622282953125,13.30207,12.681174953125,13.228439999999999Q12.740067953125,13.154810000000001,12.813895953125,13.09617Q13.125969953125,12.8109,13.375114153125,12.46595Q14.166584953125,11.36993,14.166584953125,10Q14.166584953125,8.61762,13.362005753125,7.516Q13.117749953125,7.181583,12.813896953124999,6.903831Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M14.863105578125,2.228405984375Q16.823672578125,3.456592984375,17.969842578125,5.468508984375Q19.166602578125,7.569218984375,19.166602578125,10.000018984375Q19.166602578125,12.469708984375,17.933552578125,14.594658984375Q16.751772578125,16.631258984375002,14.739248578125,17.847858984375Q14.525103578125,17.995758984375,14.264892578125,17.995758984375Q14.182652278125,17.995758984375,14.101992578125,17.979658984375Q14.021332578125,17.963658984375,13.945351578125,17.932158984375Q13.869371578125,17.900658984375,13.800991578125,17.854958984375Q13.732611578125,17.809358984375002,13.674458578125,17.751158984375Q13.616305578125,17.692958984375,13.570615578125,17.624658984375Q13.524925578125,17.556258984375,13.493453578125,17.480258984375Q13.461981578125,17.404258984374998,13.445936578125,17.323658984375Q13.429892578125,17.242958984375,13.429892578125,17.160758984375Q13.429892578125,17.045958984374998,13.460862578124999,16.935458984375Q13.491831578125,16.824858984375,13.551473578125,16.726858984375Q13.611115578125,16.628758984375,13.695005578125,16.550458984375Q13.778896578125,16.472058984375,13.880811578125,16.419258984375Q15.525652578125,15.423558984375,16.492012578125,13.758158984375Q17.499932578125,12.021168984375,17.499932578125,10.000018984375Q17.499932578125,8.010658984374999,16.521692578125,6.293508984375Q15.584492578125,4.648418984375,13.982075578125,3.643182984375Q13.882499578125,3.589574984375,13.800770578125,3.511412984375Q13.719041578125,3.433249984375,13.661047578125,3.336162984375Q13.603053578125,3.239076984375,13.572972578125,3.130062984375Q13.542891578125,3.021047984375,13.542891578125,2.907958984375Q13.542891578125,2.825718684375,13.558936578125,2.745058984375Q13.574980578125,2.664398984375,13.606452578125,2.588417984375Q13.637924578125,2.512437984375,13.683614578125,2.444057984375Q13.729305578125,2.3756779843749998,13.787457578125,2.317524984375Q13.845610578125,2.259371984375,13.913990578125,2.213681984375Q13.982370578125,2.167991984375,14.058351578125,2.136519984375Q14.134331578125,2.105047984375,14.214991478125,2.089002984375Q14.295651478125,2.072958984375,14.377891578125,2.072958984375Q14.508378578125,2.072958984375,14.632644578125,2.112769984375Q14.756910578125,2.152579984375,14.863105578125,2.228405984375Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g></g>',2)]))}const Yne=ii(qne,[["render",Kne]]),Zne={},Jne={t:"1744352112173",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"16533","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"200",height:"200"};function eie(n,e){return ft(),xt("svg",Jne,e[0]||(e[0]=[zt("path",{d:"M824 466.56V213.12q0-13.6512-5.2928-26.1632-5.104-12.064-14.3904-21.3536-9.2864-9.2864-21.3504-14.3872-12.5152-5.2928-26.1664-5.2928H246.4q-13.6512 0-26.1664 5.2928-12.064 5.1008-21.3504 14.3872-9.2864 9.2864-14.3904 21.3536Q179.2 199.4688 179.2 213.12v607.296q0 12.8448 5.0592 24.608 4.8576 11.2896 13.6704 19.9552 8.7616 8.6176 20.1184 13.344Q229.7792 883.2 242.56 883.2h217.6a28.8 28.8 0 0 0 0-57.6h-217.6q-2.528 0-4.2432-1.6864-1.5168-1.4912-1.5168-3.4976V213.12q0-3.9744 2.8128-6.784 2.8096-2.816 6.7872-2.816h510.4q3.9776 0 6.7872 2.816 2.8128 2.8096 2.8128 6.784v253.44a28.8 28.8 0 0 0 28.8 28.8 28.8 28.8 0 0 0 28.8-28.8zM466.0064 338.08l-130.2016 278.784A32 32 0 0 0 364.8 662.4h0.176a31.9904 31.9904 0 0 0 28.8192-18.4576L418.048 592h165.4976l15.2896 32.736q3.1008-3.4144 6.3904-6.704 20.3584-20.3616 45.4816-33.472l-115.1168-246.4832q-4.9408-10.5792-14.8704-16.5952-9.168-5.5552-19.9232-5.5552-10.7552 0-19.9232 5.5552-9.9296 6.016-14.8704 16.5952z m34.7936 76.7456L553.6576 528h-105.7152l52.8576-113.1776zM896 750.4c0 87.4816-70.9184 158.4-158.4 158.4S579.2 837.8816 579.2 750.4s70.9184-158.4 158.4-158.4 158.4 70.9184 158.4 158.4z m-116.3648-82.7648a28.9152 28.9152 0 0 1 7.1648-5.232q-5.8048-3.232-12.096-5.7248Q756.8256 649.6 737.6 649.6q-19.2256 0-37.104 7.0784-19.4112 7.6832-34.1728 22.448-14.7616 14.7616-22.4448 34.1696Q636.8 731.1744 636.8 750.4q0 19.232 7.0784 37.104 2.4896 6.2944 5.7248 12.096a28.7552 28.7552 0 0 1 5.232-7.1648l124.8-124.8zM838.4 750.4q0-19.2256-7.0784-37.104-2.4896-6.2912-5.7248-12.096a28.6944 28.6944 0 0 1-5.232 7.168l-124.8 124.8a28.7552 28.7552 0 0 1-7.1648 5.2288q5.8048 3.2352 12.096 5.728Q718.3744 851.2 737.6 851.2q19.2256 0 37.104-7.072 19.4112-7.6896 34.1728-22.4512 14.7616-14.7616 22.4448-34.1728Q838.4 769.632 838.4 750.4z","p-id":"16534"},null,-1)]))}const tie=ii(Zne,[["render",eie]]),nie={},iie={t:"1744352097285",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"16380","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.60b03a81nz0mun","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"200",height:"200"};function rie(n,e){return ft(),xt("svg",iie,e[0]||(e[0]=[zt("path",{d:"M833.6 213.12v253.44a28.8 28.8 0 0 1-28.8 28.8 28.8 28.8 0 0 1-28.8-28.8V213.12q0-3.9744-2.8128-6.784-2.8096-2.816-6.7872-2.816H256q-3.9776 0-6.7872 2.816Q246.4 209.1424 246.4 213.12v607.296q0 2.0064 1.5168 3.4976 1.7152 1.6864 4.2432 1.6864h217.6a28.8 28.8 0 0 1 0 57.6h-217.6q-12.7808 0-24.512-4.8768-11.3568-4.7232-20.1184-13.3408-8.8128-8.6656-13.6704-19.9584Q188.8 833.264 188.8 820.416V213.12q0-13.6512 5.2928-26.1632 5.104-12.064 14.3904-21.3536 9.2864-9.2864 21.3504-14.3872Q242.3456 145.92 256 145.92h510.4q13.6512 0 26.1664 5.2928 12.064 5.1008 21.3504 14.3872 9.2864 9.2864 14.3904 21.3536 5.2928 12.512 5.2928 26.1664zM345.408 613.664l130.1984-278.784q4.9408-10.5824 14.8704-16.5984 9.168-5.5552 19.9232-5.5552 10.7552 0 19.9232 5.5552 9.9296 6.016 14.8704 16.5952l130.2016 278.784a32 32 0 0 1-28.672 45.5392l-0.3232 0.0032c-12.4288 0-23.7344-7.2-28.9952-18.4608L593.1488 588.8h-165.4976l-24.256 51.9424a32.0064 32.0064 0 0 1-28.8192 18.4576l-0.176 0.0032a32 32 0 0 1-28.992-45.5424z m164.992-202.0416L457.5424 524.8h105.7152L510.4 411.6224z m120.2784 329.44l61.3216 61.5872 162.1248-162.8256a31.9936 31.9936 0 0 1 22.608-9.424H876.8a32 32 0 0 1 32 31.936v0.064a32 32 0 0 1-9.3216 22.5792l-184.8 185.6-0.0992 0.0992a31.9936 31.9936 0 0 1-45.2544-0.096l-83.984-84.352-0.016-0.016a31.9904 31.9904 0 0 1-9.2896-21.1104l30.496-33.4336c0.4896-0.0224 0.9792-0.032 1.4688-0.032h0.0704a32 32 0 0 1 22.608 9.4208z","p-id":"16381","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.60b03a81nz0mun",class:"selected"},null,-1)]))}const sie=ii(nie,[["render",rie]]),oie={class:"action-group"},aie={key:0},lie=["onClick"],cie={key:0,class:"active-icon"},uie={key:1},die=["onClick"],hie={key:0,class:"active-icon"},fie={key:2},pie=rn({__name:"ActionGroup",setup(n){const e=P0(),t=Tl(),{hasCamera:i,hasMic:r,cameraOff:s,micMuted:o,volumeMuted:a,showChatRecords:l,streamState:c,selectedAudioDevice:u,selectedVideoDevice:d,availableAudioDevices:h,availableVideoDevices:f}=sm(e),{handleCameraOff:p,handleMicMuted:g,handleVolumeMute:y,handleDeviceChange:m,handleSubtitleToggle:v}=e,{wrapperRect:x,isLandscape:_}=sm(t),S=Dn(!1),E=Dn(!1);return(A,R)=>{const w=b8("click-outside");return ft(),xt("div",oie,[We(i)?(ft(),xt("div",aie,[Pc((ft(),xt("div",{class:"action",onClick:R[1]||(R[1]=(...M)=>We(p)&&We(p)(...M))},[Re(We(Cd),{icon:We(s)?We(Tne):We(Mne)},null,8,["icon"]),We(c)==="closed"?(ft(),xt("div",{key:0,class:"corner",onClick:R[0]||(R[0]=pf(()=>E.value=!E.value,["stop","prevent"]))},R[6]||(R[6]=[zt("div",{class:"corner-inner"},null,-1)]))):br("",!0),Pc(zt("div",{class:Ks(["selectors",{left:We(_)}])},[(ft(!0),xt(Hn,null,Jd(We(f),M=>(ft(),xt("div",{key:M.deviceId,class:"selector",onClick:pf(()=>{We(m)(M.deviceId),E.value=!1},["stop"])},[em(su(M.label)+" ",1),We(d)&&M.deviceId===We(d).deviceId?(ft(),xt("div",cie,[Re(We(ET))])):br("",!0)],8,lie))),128))],2),[[im,E.value&&We(c)==="closed"]])])),[[w,()=>E.value=!1]])])):br("",!0),We(r)?(ft(),xt("div",uie,[Pc((ft(),xt("div",{class:"action",onClick:R[3]||(R[3]=(...M)=>We(g)&&We(g)(...M))},[Re(We(Cd),{icon:We(o)?We(Fne):We(Une)},null,8,["icon"]),We(c)==="closed"?(ft(),xt("div",{key:0,class:"corner",onClick:R[2]||(R[2]=pf(()=>S.value=!S.value,["stop","prevent"]))},R[7]||(R[7]=[zt("div",{class:"corner-inner"},null,-1)]))):br("",!0),Pc(zt("div",{class:Ks(["selectors",{left:We(_)}])},[(ft(!0),xt(Hn,null,Jd(We(h),M=>(ft(),xt("div",{key:M.deviceId,class:"selector",onClick:pf(I=>{We(m)(M.deviceId),S.value=!1},["stop"])},[em(su(M.label)+" ",1),We(u)&&M.deviceId===We(u).deviceId?(ft(),xt("div",hie,[Re(We(ET))])):br("",!0)],8,die))),128))],2),[[im,S.value&&We(c)==="closed"]])])),[[w,()=>S.value=!1]])])):br("",!0),zt("div",{class:"action",onClick:R[4]||(R[4]=(...M)=>We(y)&&We(y)(...M))},[Re(We(Cd),{icon:We(a)?We(jne):We(Yne)},null,8,["icon"])]),We(x).width>300?(ft(),xt("div",fie,[zt("div",{class:"action",onClick:R[5]||(R[5]=(...M)=>We(v)&&We(v)(...M))},[Re(We(Cd),{icon:We(l)?We(sie):We(tie)},null,8,["icon"])])])):br("",!0)])}}}),mie=ii(pie,[["__scopeId","data-v-1bca64ad"]]),gie={class:"gradio-webrtc-waveContainer"},yie=rn({__name:"AudioWave",props:{streamState:{default:qi.closed},audioSourceCallback:{},numBars:{default:16},icon:{},iconButtonColor:{default:"var(--color-accent)"},pulseColor:{default:"var(--color-accent)"},waveColor:{default:"var(--color-accent)"},pulseScale:{default:1}},emits:[],setup(n,{emit:e}){const t=n;let i,r,s,o;const a=Ge(()=>t.icon?"128px":"calc((var(--boxSize) + var(--gutter)) * ".concat(t.numBars," + 80px)"));ci(()=>t.streamState,()=>{console.log(111111),t.streamState==="open"&&l()},{immediate:!0}),Lh(()=>{o&&cancelAnimationFrame(o),i&&i.close()});function l(){i=new(window.AudioContext||window.webkitAudioContext),r=i.createAnalyser();const d=t.audioSourceCallback();if(!d)return;i.createMediaStreamSource(d).connect(r),r.fftSize=64,r.smoothingTimeConstant=.8,s=new Uint8Array(r.frequencyBinCount),c()}function c(){r.getByteFrequencyData(s);const d=document.querySelectorAll(".gradio-webrtc-waveContainer .gradio-webrtc-box");for(let h=0;h<d.length;h++){const f=s[u(h)]/255,p=d[h];p.style.transform="scaleY(".concat(Math.max(.1,f),")"),p.style.background=t.waveColor,p.style.opacity="0.5"}o=requestAnimationFrame(c)}function u(d){const h=[0,2,4,6,8,10,12,14,15,13,11,9,7,5,3,1];if(d<0||d>=h.length)throw new Error("Index must be between 0 and 15");return h[d]}return(d,h)=>(ft(),xt("div",gie,[zt("div",{class:"gradio-webrtc-boxContainer",style:Qs({width:a.value})},[(ft(!0),xt(Hn,null,Jd(Array(d.numBars/2),(f,p)=>(ft(),xt("div",{key:p,class:"gradio-webrtc-box"}))),128)),h[0]||(h[0]=zt("div",{class:"split-container"},null,-1)),(ft(!0),xt(Hn,null,Jd(Array(d.numBars/2),(f,p)=>(ft(),xt("div",{key:p,class:"gradio-webrtc-box"}))),128))],4)]))}}),vie=ii(yie,[["__scopeId","data-v-ba6f2cef"]]),_ie={class:"player-controls"},xie={key:0},Sie={key:1,class:"waiting-icon-text"},Aie={key:2,class:"stop-chat-inner"},bie={key:0,class:"input-audio-wave"},Tie=rn({__name:"ChatBtn",props:{streamState:{default:qi.closed},onStartChat:{},audioSourceCallback:{},waveColor:{}},emits:[],setup(n,{emit:e}){return(t,i)=>(ft(),xt("div",_ie,[zt("div",{class:Ks(["chat-btn",t.streamState===We(qi).closed&&"start-chat",t.streamState===We(qi).open&&"stop-chat"]),onClick:i[0]||(i[0]=(...r)=>t.onStartChat&&t.onStartChat(...r))},[t.streamState===We(qi).closed?(ft(),xt("span",xie,"点击开始对话")):t.streamState===We(qi).waiting?(ft(),xt("div",Sie,i[1]||(i[1]=[zt("div",{class:"icon",title:"spinner"},null,-1),zt("span",null,"等待中",-1)]))):(ft(),xt("div",Aie))],2),t.streamState===We(qi).open?(ft(),xt("div",bie,[Re(vie,{audioSourceCallback:t.audioSourceCallback,streamState:t.streamState,waveColor:t.waveColor},null,8,["audioSourceCallback","streamState","waveColor"])])):br("",!0)]))}}),wie=ii(Tie,[["__scopeId","data-v-b69ee979"]]);function Cie(n,e,t){return t<0||t>n.length?(console.error("索引超出范围"),n):n.substring(0,t)+e+n.substring(t)}const Eie={class:"chat-input-container"},Mie={class:"chat-input-inner"},Rie={class:"chat-input-wrapper"},Iie=rn({__name:"ChatInput",props:{replying:{type:Boolean}},emits:["send","stop","interrupt"],setup(n,{emit:e}){const t=e;let i=24,r=Yp("rowsDivRef"),s=Yp("chatInputRef"),o="";function a(h){h.key==="Enter"&&(h.altKey?s.value&&(s.value.value=Cie(s.value.value,"\n",s.value.selectionStart||0),s.value.dispatchEvent(new InputEvent("input"))):(h.preventDefault(),l()))}async function l(){s.value&&(t("send",s.value.value),s.value.value="")}function c(h){r.value&&(r.value.textContent=h.target.value.replace(/\n$/,"\n\n"),i=r.value.offsetHeight)}function u(){t("stop")}function d(){t("interrupt")}return(h,f)=>(ft(),xt("div",Eie,[zt("div",{class:"stop-chat-btn",onClick:u}),zt("div",Mie,[zt("div",Rie,[zt("textarea",{class:"chat-input",ref_key:"chatInputRef",ref:s,onKeydown:a,onInput:c,style:Qs("height:".concat(We(i),"px"))},null,36),zt("div",{class:"rowsDiv",ref_key:"rowsDivRef",ref:r},su(We(o)),513)]),h.replying?(ft(),xt("button",{key:0,class:"interrupt-btn",onClick:d})):(ft(),xt("button",{key:1,class:"send-btn",onClick:l},[Re(We(Cd),{icon:We($ne),color:"#fff"},null,8,["icon"])]))])]))}}),Nie=ii(Iie,[["__scopeId","data-v-32a58abc"]]),Pie={class:"answer-message-text"},Lie=rn({__name:"ChatMessage",props:{message:{},role:{},style:{}},setup(n){return(e,t)=>(ft(),xt("div",{class:Ks(["answer-message-container",e.role]),style:Qs(e.style)},[zt("div",Pie,su(e.message),1)],6))}}),Die=ii(Lie,[["__scopeId","data-v-dde1c5d3"]]),Fie={class:"chat-records-inner"},MT=rn({__name:"ChatRecords",props:{chatRecords:{}},setup(n,{expose:e}){const t=n;let i=Yp("containerRef");ci(()=>t.chatRecords,s=>{t.chatRecords&&Ph().then(()=>{r()})});function r(){i.value&&(i.value.scrollTop=i.value.scrollHeight)}return e({scrollToBottom:r}),(s,o)=>(ft(),xt("div",{class:"chat-records",ref_key:"containerRef",ref:i},[zt("div",Fie,[(ft(!0),xt(Hn,null,Jd(s.chatRecords,(a,l)=>(ft(),xt("div",{key:a.id,class:Ks("chat-message ".concat(a.role))},[Re(Die,{message:a.message,role:a.role},null,8,["message","role"])],2))),128))])],512))}}),Oie={class:"content-container"},Bie=["muted"],kie={class:"actions"},Uie={key:0,class:"chat-records-container"},zie=rn({__name:"index",setup(n){const e=Tl(),t=P0(),i=Dn(),r=Dn(),s=Dn(),o=Dn(),a=Dn(),l=Dn("9 / 16"),c=()=>{a.value&&(l.value="".concat(a.value.videoWidth," / ").concat(a.value.videoHeight))},u=()=>t.localStream;ka(()=>{const k=i.value;e.wrapperRef=k,k.getBoundingClientRect(),E.value.width=k.clientWidth,E.value.height=k.clientHeight,e.isLandscape=E.value.width>E.value.height,console.log(E),e.remoteVideoContainerRef=s.value,e.localVideoContainerRef=r.value,e.localVideoRef=o.value,e.remoteVideoRef=a.value,e.wrapperRef=i.value});const{hasCamera:d,hasMic:h,micMuted:f,cameraOff:p,webcamAccessed:g,streamState:y,avatarType:m,volumeMuted:v,replying:x,showChatRecords:_,chatRecords:S}=sm(t),{wrapperRect:E,isLandscape:A}=sm(e);function R(){t.startWebRTC().then(()=>{w()})}function w(){t.chatDataChannel&&t.chatDataChannel.addEventListener("message",k=>{const T=JSON.parse(k.data);if(T.type==="chat"){const F=t.chatRecords.findIndex(V=>V.id===T.id);if(F!==-1){const V=t.chatRecords[F];V.message+=T.message,t.chatRecords.splice(F,1,V),t.chatRecords=[...t.chatRecords]}else t.chatRecords=[...t.chatRecords,{id:T.id,role:T.role||"human",message:T.message}]}else T.type==="avatar_end"&&(t.replying=!1)})}function M(){t.chatDataChannel&&t.chatDataChannel.send(JSON.stringify({type:"stop_chat"}))}const I=Yp("chatRecordsInstanceRef");function L(k){var T;k&&t.chatDataChannel&&(t.chatDataChannel.send(JSON.stringify({type:"chat",data:k})),t.replying=!0,(T=I.value)==null||T.scrollToBottom())}return(k,T)=>(ft(),xt("div",{class:"page-container",ref_key:"wrapRef",ref:i},[zt("div",Oie,[zt("div",{class:"video-container",style:Qs({visibility:We(g)?"visible":"hidden",aspectRatio:l.value})},[Pc(zt("div",{class:Ks("local-video-container ".concat(We(y)==="open"?"scaled":"")),ref_key:"localVideoContainerRef",ref:r},[zt("video",{class:"local-video",ref_key:"localVideoRef",ref:o,autoplay:"",muted:"",playsinline:"",style:Qs({visibility:We(p)?"hidden":"visible",display:!We(d)||We(p)?"none":"block"})},null,4)],2),[[im,We(d)&&!We(p)]]),zt("div",{class:"remote-video-container",ref_key:"remoteVideoContainerRef",ref:s},[We(m)?br("",!0):Pc((ft(),xt("video",{key:0,class:"remote-video",onPlaying:c,ref_key:"remoteVideoRef",ref:a,autoplay:"",playsinline:"",muted:We(v)},null,40,Bie)),[[im,We(y)==="open"]]),We(y)==="open"&&We(_)&&!We(A)?(ft(),xt("div",{key:1,class:Ks("chat-records-container inline"),style:Qs(!We(d)||We(p)?"width:80%;padding-bottom:12px;":"padding-bottom:12px;")},[Re(MT,{ref_key:"chatRecordsInstanceRef",ref:I,chatRecords:We(S).filter((F,V)=>V>=We(S).length-4)},null,8,["chatRecords"])],4)):br("",!0)],512),zt("div",kie,[Re(mie)])],4),(!We(h)||We(f))&&We(y)==="open"?(ft(),ou(Nie,{key:0,replying:We(x),onInterrupt:M,onSend:L,onStop:We(t).startWebRTC},null,8,["replying","onStop"])):We(g)?(ft(),ou(wie,{key:1,onStartChat:R,"audio-source-callback":u,streamState:We(y),"wave-color":"#7873F6"},null,8,["streamState"])):br("",!0)]),We(y)==="open"&&We(_)&&We(A)?(ft(),xt("div",Uie,[Re(MT,{ref_key:"chatRecordsInstanceRef",ref:I,chatRecords:We(S)},null,8,["chatRecords"])])):br("",!0)],512))}}),Vie=ii(zie,[["__scopeId","data-v-269b506f"]]),Hie={class:"wrap"},$ie=rn({__name:"App",setup(n){const e=P0();return e.init(),(t,i)=>(ft(),ou(We(Jc),{locale:We(yne)[We(sI)]},{default:lw(()=>[zt("div",Hie,[We(e).webcamAccessed?br("",!0):(ft(),ou(fee,{key:0})),Re(Vie)])]),_:1},8,["locale"]))}}),Gie=ii($ie,[["__scopeId","data-v-746907b0"]]);var Wp={exports:{}},Wie=Wp.exports,RT;function Qie(){return RT||(RT=1,function(n,e){(function(t,i){n.exports=i()})(Wie,function(){var t="__v-click-outside",i=typeof window<"u",r=typeof navigator<"u",s=i&&("ontouchstart"in window||r&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"],o=function(u){var d=u.event,h=u.handler;(0,u.middleware)(d)&&h(d)},a=function(u,d){var h=function(v){var x=typeof v=="function";if(!x&&typeof v!="object")throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:x?v:v.handler,middleware:v.middleware||function(_){return _},events:v.events||s,isActive:v.isActive!==!1,detectIframe:v.detectIframe!==!1,capture:!!v.capture}}(d.value),f=h.handler,p=h.middleware,g=h.detectIframe,y=h.capture;if(h.isActive){if(u[t]=h.events.map(function(v){return{event:v,srcTarget:document.documentElement,handler:function(x){return function(_){var S=_.el,E=_.event,A=_.handler,R=_.middleware,w=E.path||E.composedPath&&E.composedPath();(w?w.indexOf(S)<0:!S.contains(E.target))&&o({event:E,handler:A,middleware:R})}({el:u,event:x,handler:f,middleware:p})},capture:y}}),g){var m={event:"blur",srcTarget:window,handler:function(v){return function(x){var _=x.el,S=x.event,E=x.handler,A=x.middleware;setTimeout(function(){var R=document.activeElement;R&&R.tagName==="IFRAME"&&!_.contains(R)&&o({event:S,handler:E,middleware:A})},0)}({el:u,event:v,handler:f,middleware:p})},capture:y};u[t]=[].concat(u[t],[m])}u[t].forEach(function(v){var x=v.event,_=v.srcTarget,S=v.handler;return setTimeout(function(){u[t]&&_.addEventListener(x,S,y)},0)})}},l=function(u){(u[t]||[]).forEach(function(d){return d.srcTarget.removeEventListener(d.event,d.handler,d.capture)}),delete u[t]},c=i?{beforeMount:a,updated:function(u,d){var h=d.value,f=d.oldValue;JSON.stringify(h)!==JSON.stringify(f)&&(l(u),a(u,{value:h}))},unmounted:l}:{};return{install:function(u){u.directive("click-outside",c)},directive:c}})}(Wp)),Wp.exports}var jie=Qie();const qie=s_(jie),O0=G9(Gie),Xie=j9();O0.use(Xie);O0.use(_ne);O0.use(qie);O0.mount("#app");export{Yie as __vite_legacy_guard};