@abi-software/scaffoldvuer 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Oo=()=>{},Lw=Object.prototype.hasOwnProperty,gp=(n,e)=>Lw.call(n,e),an=Array.isArray,Jt=n=>typeof n=="function",tn=n=>typeof n=="string",nn=n=>n!==null&&typeof n=="object",Pw=Object.prototype.toString,Iw=n=>Pw.call(n),lu=n=>Iw(n).slice(8,-1),cu=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Ow=/-(\w)/g,Nw=cu(n=>n.replace(Ow,(e,t)=>t?t.toUpperCase():"")),Dw=/\B([A-Z])/g,Bw=cu(n=>n.replace(Dw,"-$1").toLowerCase()),Fw=cu(n=>n.charAt(0).toUpperCase()+n.slice(1));var yp=typeof global=="object"&&global&&global.Object===Object&&global,Vw=typeof self=="object"&&self&&self.Object===Object&&self,$n=yp||Vw||Function("return this")(),Zn=$n.Symbol,vp=Object.prototype,kw=vp.hasOwnProperty,zw=vp.toString,No=Zn?Zn.toStringTag:void 0;function Uw(n){var e=kw.call(n,No),t=n[No];try{n[No]=void 0;var i=!0}catch{}var r=zw.call(n);return i&&(e?n[No]=t:delete n[No]),r}var Gw=Object.prototype,Hw=Gw.toString;function Ww(n){return Hw.call(n)}var jw="[object Null]",$w="[object Undefined]",bp=Zn?Zn.toStringTag:void 0;function fs(n){return n==null?n===void 0?$w:jw:bp&&bp in Object(n)?Uw(n):Ww(n)}function ps(n){return n!=null&&typeof n=="object"}var Zw="[object Symbol]";function qa(n){return typeof n=="symbol"||ps(n)&&fs(n)==Zw}function Xw(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var Ln=Array.isArray,Yw=1/0,xp=Zn?Zn.prototype:void 0,wp=xp?xp.toString:void 0;function Mp(n){if(typeof n=="string")return n;if(Ln(n))return Xw(n,Mp)+"";if(qa(n))return wp?wp.call(n):"";var e=n+"";return e=="0"&&1/n==-Yw?"-0":e}var Jw=/\s/;function Kw(n){for(var e=n.length;e--&&Jw.test(n.charAt(e)););return e}var qw=/^\s+/;function Qw(n){return n&&n.slice(0,Kw(n)+1).replace(qw,"")}function zi(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Sp=NaN,e1=/^[-+]0x[0-9a-f]+$/i,t1=/^0b[01]+$/i,n1=/^0o[0-7]+$/i,i1=parseInt;function _p(n){if(typeof n=="number")return n;if(qa(n))return Sp;if(zi(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=zi(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Qw(n);var t=t1.test(n);return t||n1.test(n)?i1(n.slice(2),t?2:8):e1.test(n)?Sp:+n}function Ep(n){return n}var r1="[object AsyncFunction]",s1="[object Function]",o1="[object GeneratorFunction]",a1="[object Proxy]";function Tp(n){if(!zi(n))return!1;var e=fs(n);return e==s1||e==o1||e==r1||e==a1}var uu=$n["__core-js_shared__"],Cp=function(){var n=/[^.]+$/.exec(uu&&uu.keys&&uu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function l1(n){return!!Cp&&Cp in n}var c1=Function.prototype,u1=c1.toString;function _r(n){if(n!=null){try{return u1.call(n)}catch{}try{return n+""}catch{}}return""}var d1=/[\\^$.*+?()[\]{}|]/g,h1=/^\[object .+?Constructor\]$/,f1=Function.prototype,p1=Object.prototype,m1=f1.toString,g1=p1.hasOwnProperty,y1=RegExp("^"+m1.call(g1).replace(d1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v1(n){if(!zi(n)||l1(n))return!1;var e=Tp(n)?y1:h1;return e.test(_r(n))}function b1(n,e){return n==null?void 0:n[e]}function Er(n,e){var t=b1(n,e);return v1(t)?t:void 0}var du=Er($n,"WeakMap");function x1(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var w1=800,M1=16,S1=Date.now;function _1(n){var e=0,t=0;return function(){var i=S1(),r=M1-(i-t);if(t=i,r>0){if(++e>=w1)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function E1(n){return function(){return n}}var Qa=function(){try{var n=Er(Object,"defineProperty");return n({},"",{}),n}catch{}}(),T1=Qa?function(n,e){return Qa(n,"toString",{configurable:!0,enumerable:!1,value:E1(e),writable:!0})}:Ep,C1=_1(T1);function A1(n,e,t,i){n.length;for(var r=t+1;r--;)if(e(n[r],r,n))return r;return-1}var R1=9007199254740991,L1=/^(?:0|[1-9]\d*)$/;function hu(n,e){var t=typeof n;return e=e??R1,!!e&&(t=="number"||t!="symbol"&&L1.test(n))&&n>-1&&n%1==0&&n<e}function P1(n,e,t){e=="__proto__"&&Qa?Qa(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function fu(n,e){return n===e||n!==n&&e!==e}var I1=Object.prototype,O1=I1.hasOwnProperty;function N1(n,e,t){var i=n[e];(!(O1.call(n,e)&&fu(i,t))||t===void 0&&!(e in n))&&P1(n,e,t)}var Ap=Math.max;function D1(n,e,t){return e=Ap(e===void 0?n.length-1:e,0),function(){for(var i=arguments,r=-1,s=Ap(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=t(o),x1(n,this,l)}}var B1=9007199254740991;function pu(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=B1}function F1(n){return n!=null&&pu(n.length)&&!Tp(n)}var V1=Object.prototype;function k1(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||V1;return n===t}function z1(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var U1="[object Arguments]";function Rp(n){return ps(n)&&fs(n)==U1}var Lp=Object.prototype,G1=Lp.hasOwnProperty,H1=Lp.propertyIsEnumerable,mu=Rp(function(){return arguments}())?Rp:function(n){return ps(n)&&G1.call(n,"callee")&&!H1.call(n,"callee")};function W1(){return!1}var Pp=typeof Ht=="object"&&Ht&&!Ht.nodeType&&Ht,Ip=Pp&&typeof module=="object"&&module&&!module.nodeType&&module,j1=Ip&&Ip.exports===Pp,Op=j1?$n.Buffer:void 0,$1=Op?Op.isBuffer:void 0,gu=$1||W1,Z1="[object Arguments]",X1="[object Array]",Y1="[object Boolean]",J1="[object Date]",K1="[object Error]",q1="[object Function]",Q1="[object Map]",eM="[object Number]",tM="[object Object]",nM="[object RegExp]",iM="[object Set]",rM="[object String]",sM="[object WeakMap]",oM="[object ArrayBuffer]",aM="[object DataView]",lM="[object Float32Array]",cM="[object Float64Array]",uM="[object Int8Array]",dM="[object Int16Array]",hM="[object Int32Array]",fM="[object Uint8Array]",pM="[object Uint8ClampedArray]",mM="[object Uint16Array]",gM="[object Uint32Array]",ut={};ut[lM]=ut[cM]=ut[uM]=ut[dM]=ut[hM]=ut[fM]=ut[pM]=ut[mM]=ut[gM]=!0,ut[Z1]=ut[X1]=ut[oM]=ut[Y1]=ut[aM]=ut[J1]=ut[K1]=ut[q1]=ut[Q1]=ut[eM]=ut[tM]=ut[nM]=ut[iM]=ut[rM]=ut[sM]=!1;function yM(n){return ps(n)&&pu(n.length)&&!!ut[fs(n)]}function vM(n){return function(e){return n(e)}}var Np=typeof Ht=="object"&&Ht&&!Ht.nodeType&&Ht,Do=Np&&typeof module=="object"&&module&&!module.nodeType&&module,bM=Do&&Do.exports===Np,yu=bM&&yp.process,Dp=function(){try{var n=Do&&Do.require&&Do.require("util").types;return n||yu&&yu.binding&&yu.binding("util")}catch{}}(),Bp=Dp&&Dp.isTypedArray,Fp=Bp?vM(Bp):yM,xM=Object.prototype,wM=xM.hasOwnProperty;function MM(n,e){var t=Ln(n),i=!t&&mu(n),r=!t&&!i&&gu(n),s=!t&&!i&&!r&&Fp(n),o=t||i||r||s,l=o?z1(n.length,String):[],u=l.length;for(var c in n)wM.call(n,c)&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hu(c,u)))&&l.push(c);return l}function SM(n,e){return function(t){return n(e(t))}}var _M=SM(Object.keys,Object),EM=Object.prototype,TM=EM.hasOwnProperty;function CM(n){if(!k1(n))return _M(n);var e=[];for(var t in Object(n))TM.call(n,t)&&t!="constructor"&&e.push(t);return e}function Vp(n){return F1(n)?MM(n):CM(n)}var AM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RM=/^\w*$/;function vu(n,e){if(Ln(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||qa(n)?!0:RM.test(n)||!AM.test(n)||e!=null&&n in Object(e)}var Bo=Er(Object,"create");function LM(){this.__data__=Bo?Bo(null):{},this.size=0}function PM(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var IM="__lodash_hash_undefined__",OM=Object.prototype,NM=OM.hasOwnProperty;function DM(n){var e=this.__data__;if(Bo){var t=e[n];return t===IM?void 0:t}return NM.call(e,n)?e[n]:void 0}var BM=Object.prototype,FM=BM.hasOwnProperty;function VM(n){var e=this.__data__;return Bo?e[n]!==void 0:FM.call(e,n)}var kM="__lodash_hash_undefined__";function zM(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Bo&&e===void 0?kM:e,this}function Tr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Tr.prototype.clear=LM,Tr.prototype.delete=PM,Tr.prototype.get=DM,Tr.prototype.has=VM,Tr.prototype.set=zM;function UM(){this.__data__=[],this.size=0}function el(n,e){for(var t=n.length;t--;)if(fu(n[t][0],e))return t;return-1}var GM=Array.prototype,HM=GM.splice;function WM(n){var e=this.__data__,t=el(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():HM.call(e,t,1),--this.size,!0}function jM(n){var e=this.__data__,t=el(e,n);return t<0?void 0:e[t][1]}function $M(n){return el(this.__data__,n)>-1}function ZM(n,e){var t=this.__data__,i=el(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function hi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}hi.prototype.clear=UM,hi.prototype.delete=WM,hi.prototype.get=jM,hi.prototype.has=$M,hi.prototype.set=ZM;var Fo=Er($n,"Map");function XM(){this.size=0,this.__data__={hash:new Tr,map:new(Fo||hi),string:new Tr}}function YM(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function tl(n,e){var t=n.__data__;return YM(e)?t[typeof e=="string"?"string":"hash"]:t.map}function JM(n){var e=tl(this,n).delete(n);return this.size-=e?1:0,e}function KM(n){return tl(this,n).get(n)}function qM(n){return tl(this,n).has(n)}function QM(n,e){var t=tl(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function fi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}fi.prototype.clear=XM,fi.prototype.delete=JM,fi.prototype.get=KM,fi.prototype.has=qM,fi.prototype.set=QM;var eS="Expected a function";function bu(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(eS);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=t.cache;if(s.has(r))return s.get(r);var o=n.apply(this,i);return t.cache=s.set(r,o)||s,o};return t.cache=new(bu.Cache||fi),t}bu.Cache=fi;var tS=500;function nS(n){var e=bu(n,function(i){return t.size===tS&&t.clear(),i}),t=e.cache;return e}var iS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rS=/\\(\\)?/g,sS=nS(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(iS,function(t,i,r,s){e.push(r?s.replace(rS,"$1"):i||t)}),e});function oS(n){return n==null?"":Mp(n)}function nl(n,e){return Ln(n)?n:vu(n,e)?[n]:sS(oS(n))}var aS=1/0;function Vo(n){if(typeof n=="string"||qa(n))return n;var e=n+"";return e=="0"&&1/n==-aS?"-0":e}function xu(n,e){e=nl(e,n);for(var t=0,i=e.length;n!=null&&t<i;)n=n[Vo(e[t++])];return t&&t==i?n:void 0}function pi(n,e,t){var i=n==null?void 0:xu(n,e);return i===void 0?t:i}function kp(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var zp=Zn?Zn.isConcatSpreadable:void 0;function lS(n){return Ln(n)||mu(n)||!!(zp&&n&&n[zp])}function cS(n,e,t,i,r){var s=-1,o=n.length;for(t||(t=lS),r||(r=[]);++s<o;){var l=n[s];t(l)?kp(r,l):r[r.length]=l}return r}function uS(n){var e=n==null?0:n.length;return e?cS(n):[]}function dS(n){return C1(D1(n,void 0,uS),n+"")}function Xn(){if(!arguments.length)return[];var n=arguments[0];return Ln(n)?n:[n]}function hS(){this.__data__=new hi,this.size=0}function fS(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function pS(n){return this.__data__.get(n)}function mS(n){return this.__data__.has(n)}var gS=200;function yS(n,e){var t=this.__data__;if(t instanceof hi){var i=t.__data__;if(!Fo||i.length<gS-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new fi(i)}return t.set(n,e),this.size=t.size,this}function mi(n){var e=this.__data__=new hi(n);this.size=e.size}mi.prototype.clear=hS,mi.prototype.delete=fS,mi.prototype.get=pS,mi.prototype.has=mS,mi.prototype.set=yS;function vS(n,e){for(var t=-1,i=n==null?0:n.length,r=0,s=[];++t<i;){var o=n[t];e(o,t,n)&&(s[r++]=o)}return s}function bS(){return[]}var xS=Object.prototype,wS=xS.propertyIsEnumerable,Up=Object.getOwnPropertySymbols,MS=Up?function(n){return n==null?[]:(n=Object(n),vS(Up(n),function(e){return wS.call(n,e)}))}:bS;function SS(n,e,t){var i=e(n);return Ln(n)?i:kp(i,t(n))}function Gp(n){return SS(n,Vp,MS)}var wu=Er($n,"DataView"),Mu=Er($n,"Promise"),Su=Er($n,"Set"),Hp="[object Map]",_S="[object Object]",Wp="[object Promise]",jp="[object Set]",$p="[object WeakMap]",Zp="[object DataView]",ES=_r(wu),TS=_r(Fo),CS=_r(Mu),AS=_r(Su),RS=_r(du),Ui=fs;(wu&&Ui(new wu(new ArrayBuffer(1)))!=Zp||Fo&&Ui(new Fo)!=Hp||Mu&&Ui(Mu.resolve())!=Wp||Su&&Ui(new Su)!=jp||du&&Ui(new du)!=$p)&&(Ui=function(n){var e=fs(n),t=e==_S?n.constructor:void 0,i=t?_r(t):"";if(i)switch(i){case ES:return Zp;case TS:return Hp;case CS:return Wp;case AS:return jp;case RS:return $p}return e});var Xp=$n.Uint8Array,LS="__lodash_hash_undefined__";function PS(n){return this.__data__.set(n,LS),this}function IS(n){return this.__data__.has(n)}function il(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new fi;++e<t;)this.add(n[e])}il.prototype.add=il.prototype.push=PS,il.prototype.has=IS;function OS(n,e){for(var t=-1,i=n==null?0:n.length;++t<i;)if(e(n[t],t,n))return!0;return!1}function NS(n,e){return n.has(e)}var DS=1,BS=2;function Yp(n,e,t,i,r,s){var o=t&DS,l=n.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var c=s.get(n),f=s.get(e);if(c&&f)return c==e&&f==n;var h=-1,p=!0,y=t&BS?new il:void 0;for(s.set(n,e),s.set(e,n);++h<l;){var m=n[h],d=e[h];if(i)var b=o?i(d,m,h,e,n,s):i(m,d,h,n,e,s);if(b!==void 0){if(b)continue;p=!1;break}if(y){if(!OS(e,function(v,g){if(!NS(y,g)&&(m===v||r(m,v,t,i,s)))return y.push(g)})){p=!1;break}}else if(!(m===d||r(m,d,t,i,s))){p=!1;break}}return s.delete(n),s.delete(e),p}function FS(n){var e=-1,t=Array(n.size);return n.forEach(function(i,r){t[++e]=[r,i]}),t}function VS(n){var e=-1,t=Array(n.size);return n.forEach(function(i){t[++e]=i}),t}var kS=1,zS=2,US="[object Boolean]",GS="[object Date]",HS="[object Error]",WS="[object Map]",jS="[object Number]",$S="[object RegExp]",ZS="[object Set]",XS="[object String]",YS="[object Symbol]",JS="[object ArrayBuffer]",KS="[object DataView]",Jp=Zn?Zn.prototype:void 0,_u=Jp?Jp.valueOf:void 0;function qS(n,e,t,i,r,s,o){switch(t){case KS:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case JS:return!(n.byteLength!=e.byteLength||!s(new Xp(n),new Xp(e)));case US:case GS:case jS:return fu(+n,+e);case HS:return n.name==e.name&&n.message==e.message;case $S:case XS:return n==e+"";case WS:var l=FS;case ZS:var u=i&kS;if(l||(l=VS),n.size!=e.size&&!u)return!1;var c=o.get(n);if(c)return c==e;i|=zS,o.set(n,e);var f=Yp(l(n),l(e),i,r,s,o);return o.delete(n),f;case YS:if(_u)return _u.call(n)==_u.call(e)}return!1}var QS=1,e_=Object.prototype,t_=e_.hasOwnProperty;function n_(n,e,t,i,r,s){var o=t&QS,l=Gp(n),u=l.length,c=Gp(e),f=c.length;if(u!=f&&!o)return!1;for(var h=u;h--;){var p=l[h];if(!(o?p in e:t_.call(e,p)))return!1}var y=s.get(n),m=s.get(e);if(y&&m)return y==e&&m==n;var d=!0;s.set(n,e),s.set(e,n);for(var b=o;++h<u;){p=l[h];var v=n[p],g=e[p];if(i)var M=o?i(g,v,p,e,n,s):i(v,g,p,n,e,s);if(!(M===void 0?v===g||r(v,g,t,i,s):M)){d=!1;break}b||(b=p=="constructor")}if(d&&!b){var _=n.constructor,E=e.constructor;_!=E&&"constructor"in n&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof E=="function"&&E instanceof E)&&(d=!1)}return s.delete(n),s.delete(e),d}var i_=1,Kp="[object Arguments]",qp="[object Array]",rl="[object Object]",r_=Object.prototype,Qp=r_.hasOwnProperty;function s_(n,e,t,i,r,s){var o=Ln(n),l=Ln(e),u=o?qp:Ui(n),c=l?qp:Ui(e);u=u==Kp?rl:u,c=c==Kp?rl:c;var f=u==rl,h=c==rl,p=u==c;if(p&&gu(n)){if(!gu(e))return!1;o=!0,f=!1}if(p&&!f)return s||(s=new mi),o||Fp(n)?Yp(n,e,t,i,r,s):qS(n,e,u,t,i,r,s);if(!(t&i_)){var y=f&&Qp.call(n,"__wrapped__"),m=h&&Qp.call(e,"__wrapped__");if(y||m){var d=y?n.value():n,b=m?e.value():e;return s||(s=new mi),r(d,b,t,i,s)}}return p?(s||(s=new mi),n_(n,e,t,i,r,s)):!1}function sl(n,e,t,i,r){return n===e?!0:n==null||e==null||!ps(n)&&!ps(e)?n!==n&&e!==e:s_(n,e,t,i,sl,r)}var o_=1,a_=2;function l_(n,e,t,i){var r=t.length,s=r;if(n==null)return!s;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<s;){o=t[r];var l=o[0],u=n[l],c=o[1];if(o[2]){if(u===void 0&&!(l in n))return!1}else{var f=new mi,h;if(!(h===void 0?sl(c,u,o_|a_,i,f):h))return!1}}return!0}function em(n){return n===n&&!zi(n)}function c_(n){for(var e=Vp(n),t=e.length;t--;){var i=e[t],r=n[i];e[t]=[i,r,em(r)]}return e}function tm(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function u_(n){var e=c_(n);return e.length==1&&e[0][2]?tm(e[0][0],e[0][1]):function(t){return t===n||l_(t,n,e)}}function d_(n,e){return n!=null&&e in Object(n)}function h_(n,e,t){e=nl(e,n);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Vo(e[i]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++i!=r?s:(r=n==null?0:n.length,!!r&&pu(r)&&hu(o,r)&&(Ln(n)||mu(n)))}function nm(n,e){return n!=null&&h_(n,e,d_)}var f_=1,p_=2;function m_(n,e){return vu(n)&&em(e)?tm(Vo(n),e):function(t){var i=pi(t,n);return i===void 0&&i===e?nm(t,n):sl(e,i,f_|p_)}}function g_(n){return function(e){return e==null?void 0:e[n]}}function y_(n){return function(e){return xu(e,n)}}function v_(n){return vu(n)?g_(Vo(n)):y_(n)}function b_(n){return typeof n=="function"?n:n==null?Ep:typeof n=="object"?Ln(n)?m_(n[0],n[1]):u_(n):v_(n)}var Eu=function(){return $n.Date.now()},x_="Expected a function",w_=Math.max,M_=Math.min;function Tu(n,e,t){var i,r,s,o,l,u,c=0,f=!1,h=!1,p=!0;if(typeof n!="function")throw new TypeError(x_);e=_p(e)||0,zi(t)&&(f=!!t.leading,h="maxWait"in t,s=h?w_(_p(t.maxWait)||0,e):s,p="trailing"in t?!!t.trailing:p);function y(S){var w=i,A=r;return i=r=void 0,c=S,o=n.apply(A,w),o}function m(S){return c=S,l=setTimeout(v,e),f?y(S):o}function d(S){var w=S-u,A=S-c,I=e-w;return h?M_(I,s-A):I}function b(S){var w=S-u,A=S-c;return u===void 0||w>=e||w<0||h&&A>=s}function v(){var S=Eu();if(b(S))return g(S);l=setTimeout(v,d(S))}function g(S){return l=void 0,p&&i?y(S):(i=r=void 0,o)}function M(){l!==void 0&&clearTimeout(l),c=0,i=u=r=l=void 0}function _(){return l===void 0?o:g(Eu())}function E(){var S=Eu(),w=b(S);if(i=arguments,r=this,u=S,w){if(l===void 0)return m(u);if(h)return clearTimeout(l),l=setTimeout(v,e),y(u)}return l===void 0&&(l=setTimeout(v,e)),o}return E.cancel=M,E.flush=_,E}function S_(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var r=i-1;return A1(n,b_(e),r)}function ol(n){for(var e=-1,t=n==null?0:n.length,i={};++e<t;){var r=n[e];i[r[0]]=r[1]}return i}function Cu(n,e){return sl(n,e)}function gi(n){return n==null}function __(n){return n===void 0}function E_(n,e,t,i){if(!zi(n))return n;e=nl(e,n);for(var r=-1,s=e.length,o=s-1,l=n;l!=null&&++r<s;){var u=Vo(e[r]),c=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return n;if(r!=o){var f=l[u];c=void 0,c===void 0&&(c=zi(f)?f:hu(e[r+1])?[]:{})}N1(l,u,c),l=l[u]}return n}function T_(n,e,t){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],l=xu(n,o);t(l,o)&&E_(s,nl(o,n),l)}return s}function C_(n,e){return T_(n,e,function(t,i){return nm(n,i)})}var A_=dS(function(n,e){return n==null?{}:C_(n,e)});const Pn=n=>n===void 0,Au=n=>typeof n=="boolean",rt=n=>typeof n=="number",Cr=n=>typeof Element>"u"?!1:n instanceof Element,R_=n=>tn(n)?!Number.isNaN(Number(n)):!1,L_=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Gi=n=>Fw(n),im=n=>Object.keys(n);class rm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function ms(n,e){throw new rm(`[${n}] ${e}`)}function St(n,e){if(process.env.NODE_ENV!=="production"){const t=tn(n)?new rm(`[${n}] ${e}`):n;console.warn(t)}}const P_="utils/dom/style",sm=(n="")=>n.split(" ").filter(e=>!!e.trim()),om=(n,e)=>{!n||!e.trim()||n.classList.add(...sm(e))},al=(n,e)=>{!n||!e.trim()||n.classList.remove(...sm(e))},ko=(n,e)=>{var t;if(!Ot||!n||!e)return"";let i=Nw(e);i==="float"&&(i="cssFloat");try{const r=n.style[i];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return s?s[i]:""}catch{return n.style[i]}};function ll(n,e="px"){if(!n)return"";if(rt(n)||R_(n))return`${n}${e}`;if(tn(n))return n;St(P_,"binding value must be a string or number")}function I_(n,e){if(!Ot)return;if(!e){n.scrollTop=0;return}const t=[];let i=e.offsetParent;for(;i!==null&&n!==i&&n.contains(i);)t.push(i),i=i.offsetParent;const r=e.offsetTop+t.reduce((u,c)=>u+c.offsetTop,0),s=r+e.offsetHeight,o=n.scrollTop,l=o+n.clientHeight;r<o?n.scrollTop=r:s>l&&(n.scrollTop=s-n.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var O_=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Ru=O_,N_=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Hi=N_,D_=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Wi=D_,B_=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),F_=B_,V_=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),k_=V_,z_=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Lu=z_,U_=a.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Pu=U_,G_=a.defineComponent({name:"Delete",__name:"delete",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),cl=G_,H_=a.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),W_=H_,j_=a.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),am=j_,$_=a.defineComponent({name:"Minus",__name:"minus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),Z_=$_,X_=a.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),ul=X_,Y_=a.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),J_=Y_,K_=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),lm=K_;const cm="__epPropKey",Ve=n=>n,q_=n=>nn(n)&&!!n[cm],dl=(n,e)=>{if(!nn(n)||q_(n))return n;const{values:t,required:i,default:r,type:s,validator:o}=n,u={type:s,required:!!i,validator:t||o?c=>{let f=!1,h=[];if(t&&(h=Array.from(t),gp(n,"default")&&h.push(r),f||(f=h.includes(c))),o&&(f||(f=o(c))),!f&&h.length>0){const p=[...new Set(h)].map(y=>JSON.stringify(y)).join(", ");a.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return f}:void 0,[cm]:!0};return gp(n,"default")&&(u.default=r),u},qe=n=>ol(Object.entries(n).map(([e,t])=>[e,dl(t,e)])),ji=Ve([String,Object,Function]),um={validating:am,success:k_,error:Lu},kt=(n,e)=>{if(n.install=t=>{for(const i of[n,...Object.values(e??{})])t.component(i.name,i)},e)for(const[t,i]of Object.entries(e))n[t]=i;return n},Q_=(n,e)=>(n.install=t=>{t.directive(e,n)},n),yi=n=>(n.install=Oo,n),Yn={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ft="update:modelValue",$i="change",Ar="input",dm=["","default","small","large"],hl=n=>{const e=an(n)?n:[n],t=[];return e.forEach(i=>{var r;an(i)?t.push(...hl(i)):a.isVNode(i)&&an(i.children)?t.push(...hl(i.children)):(t.push(i),a.isVNode(i)&&((r=i.component)!=null&&r.subTree)&&t.push(...hl(i.component.subTree)))}),t},eE=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),vi=n=>n,tE=["class","style"],nE=/^on[A-Z]/,iE=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=a.computed(()=>((t==null?void 0:t.value)||[]).concat(tE)),r=a.getCurrentInstance();return r?a.computed(()=>{var s;return ol(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([o])=>!i.value.includes(o)&&!(e&&nE.test(o))))}):(St("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},rE=({from:n,replacement:e,scope:t,version:i,ref:r,type:s="API"},o)=>{a.watch(()=>a.unref(o),l=>{l&&St(t,`[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead.
6
6
  For more detail, please visit: ${r}
7
- `)},{immediate:!0})};var sE={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const oE=n=>(e,t)=>aE(e,t,a.unref(n)),aE=(n,e,t)=>pi(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),lE=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:oE(n)}},hm=Symbol("localeContextKey"),fl=n=>{const e=n||a.inject(hm,a.ref());return lE(a.computed(()=>e.value||sE))},pl="el",cE="is-",Rr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},fm=Symbol("namespaceContextKey"),Iu=n=>{const e=n||(a.getCurrentInstance()?a.inject(fm,a.ref(pl)):a.ref(pl));return a.computed(()=>a.unref(e)||pl)},Ue=(n,e)=>{const t=Iu(e);return{namespace:t,b:(d="")=>Rr(t.value,n,d,"",""),e:d=>d?Rr(t.value,n,"",d,""):"",m:d=>d?Rr(t.value,n,"","",d):"",be:(d,b)=>d&&b?Rr(t.value,n,d,b,""):"",em:(d,b)=>d&&b?Rr(t.value,n,"",d,b):"",bm:(d,b)=>d&&b?Rr(t.value,n,d,"",b):"",bem:(d,b,v)=>d&&b&&v?Rr(t.value,n,d,b,v):"",is:(d,...b)=>{const v=b.length>=1?b[0]:!0;return d&&v?`${cE}${d}`:""},cssVar:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${v}`]=d[v]);return b},cssVarName:d=>`--${t.value}-${d}`,cssVarBlock:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${n}-${v}`]=d[v]);return b},cssVarBlockName:d=>`--${t.value}-${n}-${d}`}},uE=dl({type:Ve(Boolean),default:null}),dE=dl({type:Ve(Function)}),hE=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:uE,[t]:dE};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:h})=>{const p=a.getCurrentInstance(),{emit:y}=p,m=p.props,d=a.computed(()=>Jt(m[t])),b=a.computed(()=>m[n]===null),v=w=>{o.value!==!0&&(o.value=!0,l&&(l.value=w),Jt(f)&&f(w))},g=w=>{o.value!==!1&&(o.value=!1,l&&(l.value=w),Jt(h)&&h(w))},M=w=>{if(m.disabled===!0||Jt(c)&&!c())return;const A=d.value&&Ot;A&&y(e,!0),(b.value||!A)&&v(w)},_=w=>{if(m.disabled===!0||!Ot)return;const A=d.value&&Ot;A&&y(e,!1),(b.value||!A)&&g(w)},E=w=>{Au(w)&&(m.disabled&&w?d.value&&y(e,!1):o.value!==w&&(w?v():g()))},S=()=>{o.value?_():M()};return a.watch(()=>m[n],E),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&_()}),a.onMounted(()=>{E(m[n])}),{hide:_,show:M,toggle:S,hasUpdateHandler:d}},useModelToggleProps:r,useModelToggleEmits:i}},pm=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var ln="top",_n="bottom",En="right",cn="left",Ou="auto",zo=[ln,_n,En,cn],gs="start",Uo="end",fE="clippingParents",mm="viewport",Go="popper",pE="reference",gm=zo.reduce(function(n,e){return n.concat([e+"-"+gs,e+"-"+Uo])},[]),ys=[].concat(zo,[Ou]).reduce(function(n,e){return n.concat([e,e+"-"+gs,e+"-"+Uo])},[]),mE="beforeRead",gE="read",yE="afterRead",vE="beforeMain",bE="main",xE="afterMain",wE="beforeWrite",ME="write",SE="afterWrite",_E=[mE,gE,yE,vE,bE,xE,wE,ME,SE];function Jn(n){return n?(n.nodeName||"").toLowerCase():null}function In(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function vs(n){var e=In(n).Element;return n instanceof e||n instanceof Element}function Tn(n){var e=In(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Nu(n){if(typeof ShadowRoot>"u")return!1;var e=In(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function EE(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!Tn(s)||!Jn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function TE(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!Tn(r)||!Jn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var ym={name:"applyStyles",enabled:!0,phase:"write",fn:EE,effect:TE,requires:["computeStyles"]};function Kn(n){return n.split("-")[0]}var Lr=Math.max,ml=Math.min,bs=Math.round;function xs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(Tn(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=bs(t.width)/o||1),s>0&&(r=bs(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function Du(n){var e=xs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function vm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Nu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function bi(n){return In(n).getComputedStyle(n)}function CE(n){return["table","td","th"].indexOf(Jn(n))>=0}function Zi(n){return((vs(n)?n.ownerDocument:n.document)||window.document).documentElement}function gl(n){return Jn(n)==="html"?n:n.assignedSlot||n.parentNode||(Nu(n)?n.host:null)||Zi(n)}function bm(n){return!Tn(n)||bi(n).position==="fixed"?null:n.offsetParent}function AE(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Tn(n)){var i=bi(n);if(i.position==="fixed")return null}var r=gl(n);for(Nu(r)&&(r=r.host);Tn(r)&&["html","body"].indexOf(Jn(r))<0;){var s=bi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Ho(n){for(var e=In(n),t=bm(n);t&&CE(t)&&bi(t).position==="static";)t=bm(t);return t&&(Jn(t)==="html"||Jn(t)==="body"&&bi(t).position==="static")?e:t||AE(n)||e}function Bu(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wo(n,e,t){return Lr(n,ml(e,t))}function RE(n,e,t){var i=Wo(n,e,t);return i>t?t:i}function xm(){return{top:0,right:0,bottom:0,left:0}}function wm(n){return Object.assign({},xm(),n)}function Mm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var LE=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,wm(typeof n!="number"?n:Mm(n,zo))};function PE(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Kn(t.placement),u=Bu(l),c=[cn,En].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var h=LE(r.padding,t),p=Du(s),y=u==="y"?ln:cn,m=u==="y"?_n:En,d=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],v=Ho(s),g=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,M=d/2-b/2,_=h[y],E=g-p[f]-h[m],S=g/2-p[f]/2+M,w=Wo(_,S,E),A=u;t.modifiersData[i]=(e={},e[A]=w,e.centerOffset=w-S,e)}}function IE(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!vm(e.elements.popper,r)||(e.elements.arrow=r))}var OE={name:"arrow",enabled:!0,phase:"main",fn:PE,effect:IE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ws(n){return n.split("-")[1]}var NE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function DE(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:bs(e*r)/r||0,y:bs(t*r)/r||0}}function Sm(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,h=n.isFixed,p=o.x,y=p===void 0?0:p,m=o.y,d=m===void 0?0:m,b=typeof f=="function"?f({x:y,y:d}):{x:y,y:d};y=b.x,d=b.y;var v=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),M=cn,_=ln,E=window;if(c){var S=Ho(t),w="clientHeight",A="clientWidth";if(S===In(t)&&(S=Zi(t),bi(S).position!=="static"&&l==="absolute"&&(w="scrollHeight",A="scrollWidth")),S=S,r===ln||(r===cn||r===En)&&s===Uo){_=_n;var I=h&&S===E&&E.visualViewport?E.visualViewport.height:S[w];d-=I-i.height,d*=u?1:-1}if(r===cn||(r===ln||r===_n)&&s===Uo){M=En;var T=h&&S===E&&E.visualViewport?E.visualViewport.width:S[A];y-=T-i.width,y*=u?1:-1}}var P=Object.assign({position:l},c&&NE),C=f===!0?DE({x:y,y:d}):{x:y,y:d};if(y=C.x,d=C.y,u){var R;return Object.assign({},P,(R={},R[_]=g?"0":"",R[M]=v?"0":"",R.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+d+"px)":"translate3d("+y+"px, "+d+"px, 0)",R))}return Object.assign({},P,(e={},e[_]=g?d+"px":"",e[M]=v?y+"px":"",e.transform="",e))}function BE(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:Kn(e.placement),variation:ws(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Sm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Sm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var _m={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BE,data:{}},yl={passive:!0};function FE(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=In(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,yl)}),l&&u.addEventListener("resize",t.update,yl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,yl)}),l&&u.removeEventListener("resize",t.update,yl)}}var Em={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:FE,data:{}},VE={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(n){return n.replace(/left|right|bottom|top/g,function(e){return VE[e]})}var kE={start:"end",end:"start"};function Tm(n){return n.replace(/start|end/g,function(e){return kE[e]})}function Fu(n){var e=In(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Vu(n){return xs(Zi(n)).left+Fu(n).scrollLeft}function zE(n){var e=In(n),t=Zi(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Vu(n),y:l}}function UE(n){var e,t=Zi(n),i=Fu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Lr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Lr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Vu(n),u=-i.scrollTop;return bi(r||t).direction==="rtl"&&(l+=Lr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function ku(n){var e=bi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Cm(n){return["html","body","#document"].indexOf(Jn(n))>=0?n.ownerDocument.body:Tn(n)&&ku(n)?n:Cm(gl(n))}function jo(n,e){var t;e===void 0&&(e=[]);var i=Cm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=In(i),o=r?[s].concat(s.visualViewport||[],ku(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(jo(gl(o)))}function zu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function GE(n){var e=xs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Am(n,e){return e===mm?zu(zE(n)):vs(e)?GE(e):zu(UE(Zi(n)))}function HE(n){var e=jo(gl(n)),t=["absolute","fixed"].indexOf(bi(n).position)>=0,i=t&&Tn(n)?Ho(n):n;return vs(i)?e.filter(function(r){return vs(r)&&vm(r,i)&&Jn(r)!=="body"}):[]}function WE(n,e,t){var i=e==="clippingParents"?HE(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=Am(n,u);return l.top=Lr(c.top,l.top),l.right=ml(c.right,l.right),l.bottom=ml(c.bottom,l.bottom),l.left=Lr(c.left,l.left),l},Am(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Rm(n){var e=n.reference,t=n.element,i=n.placement,r=i?Kn(i):null,s=i?ws(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case ln:u={x:o,y:e.y-t.height};break;case _n:u={x:o,y:e.y+e.height};break;case En:u={x:e.x+e.width,y:l};break;case cn:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?Bu(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case gs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Uo:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function $o(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?fE:s,l=t.rootBoundary,u=l===void 0?mm:l,c=t.elementContext,f=c===void 0?Go:c,h=t.altBoundary,p=h===void 0?!1:h,y=t.padding,m=y===void 0?0:y,d=wm(typeof m!="number"?m:Mm(m,zo)),b=f===Go?pE:Go,v=n.rects.popper,g=n.elements[p?b:f],M=WE(vs(g)?g:g.contextElement||Zi(n.elements.popper),o,u),_=xs(n.elements.reference),E=Rm({reference:_,element:v,strategy:"absolute",placement:r}),S=zu(Object.assign({},v,E)),w=f===Go?S:_,A={top:M.top-w.top+d.top,bottom:w.bottom-M.bottom+d.bottom,left:M.left-w.left+d.left,right:w.right-M.right+d.right},I=n.modifiersData.offset;if(f===Go&&I){var T=I[r];Object.keys(A).forEach(function(P){var C=[En,_n].indexOf(P)>=0?1:-1,R=[ln,_n].indexOf(P)>=0?"y":"x";A[P]+=T[R]*C})}return A}function jE(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?ys:u,f=ws(i),h=f?l?gm:gm.filter(function(m){return ws(m)===f}):zo,p=h.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=h);var y=p.reduce(function(m,d){return m[d]=$o(n,{placement:d,boundary:r,rootBoundary:s,padding:o})[Kn(d)],m},{});return Object.keys(y).sort(function(m,d){return y[m]-y[d]})}function $E(n){if(Kn(n)===Ou)return[];var e=vl(n);return[Tm(n),e,Tm(e)]}function ZE(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,h=t.rootBoundary,p=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,d=t.allowedAutoPlacements,b=e.options.placement,v=Kn(b),g=v===b,M=u||(g||!m?[vl(b)]:$E(b)),_=[b].concat(M).reduce(function(re,j){return re.concat(Kn(j)===Ou?jE(e,{placement:j,boundary:f,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:d}):j)},[]),E=e.rects.reference,S=e.rects.popper,w=new Map,A=!0,I=_[0],T=0;T<_.length;T++){var P=_[T],C=Kn(P),R=ws(P)===gs,L=[ln,_n].indexOf(C)>=0,N=L?"width":"height",x=$o(e,{placement:P,boundary:f,rootBoundary:h,altBoundary:p,padding:c}),O=L?R?En:cn:R?_n:ln;E[N]>S[N]&&(O=vl(O));var B=vl(O),D=[];if(s&&D.push(x[C]<=0),l&&D.push(x[O]<=0,x[B]<=0),D.every(function(re){return re})){I=P,A=!1;break}w.set(P,D)}if(A)for(var k=m?3:1,U=function(re){var j=_.find(function(G){var W=w.get(G);if(W)return W.slice(0,re).every(function(q){return q})});if(j)return I=j,"break"},H=k;H>0;H--){var X=U(H);if(X==="break")break}e.placement!==I&&(e.modifiersData[i]._skip=!0,e.placement=I,e.reset=!0)}}var XE={name:"flip",enabled:!0,phase:"main",fn:ZE,requiresIfExists:["offset"],data:{_skip:!1}};function Lm(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Pm(n){return[ln,En,_n,cn].some(function(e){return n[e]>=0})}function YE(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=$o(e,{elementContext:"reference"}),l=$o(e,{altBoundary:!0}),u=Lm(o,i),c=Lm(l,r,s),f=Pm(u),h=Pm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YE};function KE(n,e,t){var i=Kn(n),r=[cn,ln].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[cn,En].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function qE(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ys.reduce(function(f,h){return f[h]=KE(h,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var QE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qE};function eT(n){var e=n.state,t=n.name;e.modifiersData[t]=Rm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Im={name:"popperOffsets",enabled:!0,phase:"read",fn:eT,data:{}};function tT(n){return n==="x"?"y":"x"}function nT(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,h=t.padding,p=t.tether,y=p===void 0?!0:p,m=t.tetherOffset,d=m===void 0?0:m,b=$o(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:f}),v=Kn(e.placement),g=ws(e.placement),M=!g,_=Bu(v),E=tT(_),S=e.modifiersData.popperOffsets,w=e.rects.reference,A=e.rects.popper,I=typeof d=="function"?d(Object.assign({},e.rects,{placement:e.placement})):d,T=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(S){if(s){var R,L=_==="y"?ln:cn,N=_==="y"?_n:En,x=_==="y"?"height":"width",O=S[_],B=O+b[L],D=O-b[N],k=y?-A[x]/2:0,U=g===gs?w[x]:A[x],H=g===gs?-A[x]:-w[x],X=e.elements.arrow,re=y&&X?Du(X):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xm(),G=j[L],W=j[N],q=Wo(0,w[x],re[x]),ee=M?w[x]/2-k-q-G-T.mainAxis:U-q-G-T.mainAxis,K=M?-w[x]/2+k+q+W+T.mainAxis:H+q+W+T.mainAxis,ie=e.elements.arrow&&Ho(e.elements.arrow),Y=ie?_==="y"?ie.clientTop||0:ie.clientLeft||0:0,te=(R=P==null?void 0:P[_])!=null?R:0,F=O+ee-te-Y,$=O+K-te,Q=Wo(y?ml(B,F):B,O,y?Lr(D,$):D);S[_]=Q,C[_]=Q-O}if(l){var V,z=_==="x"?ln:cn,oe=_==="x"?_n:En,ae=S[E],le=E==="y"?"height":"width",fe=ae+b[z],be=ae-b[oe],ye=[ln,cn].indexOf(v)!==-1,he=(V=P==null?void 0:P[E])!=null?V:0,ve=ye?fe:ae-w[le]-A[le]-he+T.altAxis,se=ye?ae+w[le]+A[le]-he-T.altAxis:be,we=y&&ye?RE(ve,ae,se):Wo(y?ve:fe,ae,y?se:be);S[E]=we,C[E]=we-ae}e.modifiersData[i]=C}}var iT={name:"preventOverflow",enabled:!0,phase:"main",fn:nT,requiresIfExists:["offset"]};function rT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function sT(n){return n===In(n)||!Tn(n)?Fu(n):rT(n)}function oT(n){var e=n.getBoundingClientRect(),t=bs(e.width)/n.offsetWidth||1,i=bs(e.height)/n.offsetHeight||1;return t!==1||i!==1}function aT(n,e,t){t===void 0&&(t=!1);var i=Tn(e),r=Tn(e)&&oT(e),s=Zi(e),o=xs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((Jn(e)!=="body"||ku(s))&&(l=sT(e)),Tn(e)?(u=xs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Vu(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function lT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function cT(n){var e=lT(n);return _E.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function uT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function dT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Om={placement:"bottom",modifiers:[],strategy:"absolute"};function Nm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Uu(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?Om:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Om,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:c,setOptions:function(d){var b=typeof d=="function"?d(c.options):d;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:vs(o)?jo(o):o.contextElement?jo(o.contextElement):[],popper:jo(l)};var v=cT(dT([].concat(i,c.options.modifiers)));return c.orderedModifiers=v.filter(function(g){return g.enabled}),y(),p.update()},forceUpdate:function(){if(!h){var d=c.elements,b=d.reference,v=d.popper;if(Nm(b,v)){c.rects={reference:aT(b,Ho(v),c.options.strategy==="fixed"),popper:Du(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(A){return c.modifiersData[A.name]=Object.assign({},A.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var M=c.orderedModifiers[g],_=M.fn,E=M.options,S=E===void 0?{}:E,w=M.name;typeof _=="function"&&(c=_({state:c,options:S,name:w,instance:p})||c)}}}},update:uT(function(){return new Promise(function(d){p.forceUpdate(),d(c)})}),destroy:function(){m(),h=!0}};if(!Nm(o,l))return p;p.setOptions(u).then(function(d){!h&&u.onFirstUpdate&&u.onFirstUpdate(d)});function y(){c.orderedModifiers.forEach(function(d){var b=d.name,v=d.options,g=v===void 0?{}:v,M=d.effect;if(typeof M=="function"){var _=M({state:c,name:b,instance:p,options:g}),E=function(){};f.push(_||E)}})}function m(){f.forEach(function(d){return d()}),f=[]}return p}}Uu();var hT=[Em,Im,_m,ym];Uu({defaultModifiers:hT});var fT=[Em,Im,_m,ym,QE,XE,iT,OE,JE],pT=Uu({defaultModifiers:fT});const mT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=gT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:h}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...h||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=pT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function gT(n){const e=Object.keys(n.elements),t=ol(e.map(r=>[r,n.styles[r]||{}])),i=ol(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function Dm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Ka(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Gu={prefix:Math.floor(Math.random()*1e4),current:0},yT=Symbol("elIdInjection"),Hu=()=>a.getCurrentInstance()?a.inject(yT,Gu):Gu,bl=n=>{const e=Hu();!Ot&&e===Gu&&St("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
7
+ `)},{immediate:!0})};var sE={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const oE=n=>(e,t)=>aE(e,t,a.unref(n)),aE=(n,e,t)=>pi(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),lE=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:oE(n)}},hm=Symbol("localeContextKey"),fl=n=>{const e=n||a.inject(hm,a.ref());return lE(a.computed(()=>e.value||sE))},pl="el",cE="is-",Rr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},fm=Symbol("namespaceContextKey"),Iu=n=>{const e=n||(a.getCurrentInstance()?a.inject(fm,a.ref(pl)):a.ref(pl));return a.computed(()=>a.unref(e)||pl)},Ue=(n,e)=>{const t=Iu(e);return{namespace:t,b:(d="")=>Rr(t.value,n,d,"",""),e:d=>d?Rr(t.value,n,"",d,""):"",m:d=>d?Rr(t.value,n,"","",d):"",be:(d,b)=>d&&b?Rr(t.value,n,d,b,""):"",em:(d,b)=>d&&b?Rr(t.value,n,"",d,b):"",bm:(d,b)=>d&&b?Rr(t.value,n,d,"",b):"",bem:(d,b,v)=>d&&b&&v?Rr(t.value,n,d,b,v):"",is:(d,...b)=>{const v=b.length>=1?b[0]:!0;return d&&v?`${cE}${d}`:""},cssVar:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${v}`]=d[v]);return b},cssVarName:d=>`--${t.value}-${d}`,cssVarBlock:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${n}-${v}`]=d[v]);return b},cssVarBlockName:d=>`--${t.value}-${n}-${d}`}},uE=dl({type:Ve(Boolean),default:null}),dE=dl({type:Ve(Function)}),hE=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:uE,[t]:dE};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:h})=>{const p=a.getCurrentInstance(),{emit:y}=p,m=p.props,d=a.computed(()=>Jt(m[t])),b=a.computed(()=>m[n]===null),v=w=>{o.value!==!0&&(o.value=!0,l&&(l.value=w),Jt(f)&&f(w))},g=w=>{o.value!==!1&&(o.value=!1,l&&(l.value=w),Jt(h)&&h(w))},M=w=>{if(m.disabled===!0||Jt(c)&&!c())return;const A=d.value&&Ot;A&&y(e,!0),(b.value||!A)&&v(w)},_=w=>{if(m.disabled===!0||!Ot)return;const A=d.value&&Ot;A&&y(e,!1),(b.value||!A)&&g(w)},E=w=>{Au(w)&&(m.disabled&&w?d.value&&y(e,!1):o.value!==w&&(w?v():g()))},S=()=>{o.value?_():M()};return a.watch(()=>m[n],E),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&_()}),a.onMounted(()=>{E(m[n])}),{hide:_,show:M,toggle:S,hasUpdateHandler:d}},useModelToggleProps:r,useModelToggleEmits:i}},pm=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var ln="top",_n="bottom",En="right",cn="left",Ou="auto",zo=[ln,_n,En,cn],gs="start",Uo="end",fE="clippingParents",mm="viewport",Go="popper",pE="reference",gm=zo.reduce(function(n,e){return n.concat([e+"-"+gs,e+"-"+Uo])},[]),ys=[].concat(zo,[Ou]).reduce(function(n,e){return n.concat([e,e+"-"+gs,e+"-"+Uo])},[]),mE="beforeRead",gE="read",yE="afterRead",vE="beforeMain",bE="main",xE="afterMain",wE="beforeWrite",ME="write",SE="afterWrite",_E=[mE,gE,yE,vE,bE,xE,wE,ME,SE];function Jn(n){return n?(n.nodeName||"").toLowerCase():null}function In(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function vs(n){var e=In(n).Element;return n instanceof e||n instanceof Element}function Tn(n){var e=In(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Nu(n){if(typeof ShadowRoot>"u")return!1;var e=In(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function EE(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!Tn(s)||!Jn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function TE(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!Tn(r)||!Jn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var ym={name:"applyStyles",enabled:!0,phase:"write",fn:EE,effect:TE,requires:["computeStyles"]};function Kn(n){return n.split("-")[0]}var Lr=Math.max,ml=Math.min,bs=Math.round;function xs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(Tn(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=bs(t.width)/o||1),s>0&&(r=bs(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function Du(n){var e=xs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function vm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Nu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function bi(n){return In(n).getComputedStyle(n)}function CE(n){return["table","td","th"].indexOf(Jn(n))>=0}function Zi(n){return((vs(n)?n.ownerDocument:n.document)||window.document).documentElement}function gl(n){return Jn(n)==="html"?n:n.assignedSlot||n.parentNode||(Nu(n)?n.host:null)||Zi(n)}function bm(n){return!Tn(n)||bi(n).position==="fixed"?null:n.offsetParent}function AE(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Tn(n)){var i=bi(n);if(i.position==="fixed")return null}var r=gl(n);for(Nu(r)&&(r=r.host);Tn(r)&&["html","body"].indexOf(Jn(r))<0;){var s=bi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Ho(n){for(var e=In(n),t=bm(n);t&&CE(t)&&bi(t).position==="static";)t=bm(t);return t&&(Jn(t)==="html"||Jn(t)==="body"&&bi(t).position==="static")?e:t||AE(n)||e}function Bu(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wo(n,e,t){return Lr(n,ml(e,t))}function RE(n,e,t){var i=Wo(n,e,t);return i>t?t:i}function xm(){return{top:0,right:0,bottom:0,left:0}}function wm(n){return Object.assign({},xm(),n)}function Mm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var LE=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,wm(typeof n!="number"?n:Mm(n,zo))};function PE(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Kn(t.placement),u=Bu(l),c=[cn,En].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var h=LE(r.padding,t),p=Du(s),y=u==="y"?ln:cn,m=u==="y"?_n:En,d=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],v=Ho(s),g=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,M=d/2-b/2,_=h[y],E=g-p[f]-h[m],S=g/2-p[f]/2+M,w=Wo(_,S,E),A=u;t.modifiersData[i]=(e={},e[A]=w,e.centerOffset=w-S,e)}}function IE(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!vm(e.elements.popper,r)||(e.elements.arrow=r))}var OE={name:"arrow",enabled:!0,phase:"main",fn:PE,effect:IE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ws(n){return n.split("-")[1]}var NE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function DE(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:bs(e*r)/r||0,y:bs(t*r)/r||0}}function Sm(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,h=n.isFixed,p=o.x,y=p===void 0?0:p,m=o.y,d=m===void 0?0:m,b=typeof f=="function"?f({x:y,y:d}):{x:y,y:d};y=b.x,d=b.y;var v=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),M=cn,_=ln,E=window;if(c){var S=Ho(t),w="clientHeight",A="clientWidth";if(S===In(t)&&(S=Zi(t),bi(S).position!=="static"&&l==="absolute"&&(w="scrollHeight",A="scrollWidth")),S=S,r===ln||(r===cn||r===En)&&s===Uo){_=_n;var I=h&&S===E&&E.visualViewport?E.visualViewport.height:S[w];d-=I-i.height,d*=u?1:-1}if(r===cn||(r===ln||r===_n)&&s===Uo){M=En;var T=h&&S===E&&E.visualViewport?E.visualViewport.width:S[A];y-=T-i.width,y*=u?1:-1}}var P=Object.assign({position:l},c&&NE),C=f===!0?DE({x:y,y:d}):{x:y,y:d};if(y=C.x,d=C.y,u){var R;return Object.assign({},P,(R={},R[_]=g?"0":"",R[M]=v?"0":"",R.transform=(E.devicePixelRatio||1)<=1?"translate("+y+"px, "+d+"px)":"translate3d("+y+"px, "+d+"px, 0)",R))}return Object.assign({},P,(e={},e[_]=g?d+"px":"",e[M]=v?y+"px":"",e.transform="",e))}function BE(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:Kn(e.placement),variation:ws(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Sm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Sm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var _m={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BE,data:{}},yl={passive:!0};function FE(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=In(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,yl)}),l&&u.addEventListener("resize",t.update,yl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,yl)}),l&&u.removeEventListener("resize",t.update,yl)}}var Em={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:FE,data:{}},VE={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(n){return n.replace(/left|right|bottom|top/g,function(e){return VE[e]})}var kE={start:"end",end:"start"};function Tm(n){return n.replace(/start|end/g,function(e){return kE[e]})}function Fu(n){var e=In(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Vu(n){return xs(Zi(n)).left+Fu(n).scrollLeft}function zE(n){var e=In(n),t=Zi(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Vu(n),y:l}}function UE(n){var e,t=Zi(n),i=Fu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Lr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Lr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Vu(n),u=-i.scrollTop;return bi(r||t).direction==="rtl"&&(l+=Lr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function ku(n){var e=bi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Cm(n){return["html","body","#document"].indexOf(Jn(n))>=0?n.ownerDocument.body:Tn(n)&&ku(n)?n:Cm(gl(n))}function jo(n,e){var t;e===void 0&&(e=[]);var i=Cm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=In(i),o=r?[s].concat(s.visualViewport||[],ku(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(jo(gl(o)))}function zu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function GE(n){var e=xs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Am(n,e){return e===mm?zu(zE(n)):vs(e)?GE(e):zu(UE(Zi(n)))}function HE(n){var e=jo(gl(n)),t=["absolute","fixed"].indexOf(bi(n).position)>=0,i=t&&Tn(n)?Ho(n):n;return vs(i)?e.filter(function(r){return vs(r)&&vm(r,i)&&Jn(r)!=="body"}):[]}function WE(n,e,t){var i=e==="clippingParents"?HE(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=Am(n,u);return l.top=Lr(c.top,l.top),l.right=ml(c.right,l.right),l.bottom=ml(c.bottom,l.bottom),l.left=Lr(c.left,l.left),l},Am(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Rm(n){var e=n.reference,t=n.element,i=n.placement,r=i?Kn(i):null,s=i?ws(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case ln:u={x:o,y:e.y-t.height};break;case _n:u={x:o,y:e.y+e.height};break;case En:u={x:e.x+e.width,y:l};break;case cn:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?Bu(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case gs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Uo:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function $o(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?fE:s,l=t.rootBoundary,u=l===void 0?mm:l,c=t.elementContext,f=c===void 0?Go:c,h=t.altBoundary,p=h===void 0?!1:h,y=t.padding,m=y===void 0?0:y,d=wm(typeof m!="number"?m:Mm(m,zo)),b=f===Go?pE:Go,v=n.rects.popper,g=n.elements[p?b:f],M=WE(vs(g)?g:g.contextElement||Zi(n.elements.popper),o,u),_=xs(n.elements.reference),E=Rm({reference:_,element:v,strategy:"absolute",placement:r}),S=zu(Object.assign({},v,E)),w=f===Go?S:_,A={top:M.top-w.top+d.top,bottom:w.bottom-M.bottom+d.bottom,left:M.left-w.left+d.left,right:w.right-M.right+d.right},I=n.modifiersData.offset;if(f===Go&&I){var T=I[r];Object.keys(A).forEach(function(P){var C=[En,_n].indexOf(P)>=0?1:-1,R=[ln,_n].indexOf(P)>=0?"y":"x";A[P]+=T[R]*C})}return A}function jE(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?ys:u,f=ws(i),h=f?l?gm:gm.filter(function(m){return ws(m)===f}):zo,p=h.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=h);var y=p.reduce(function(m,d){return m[d]=$o(n,{placement:d,boundary:r,rootBoundary:s,padding:o})[Kn(d)],m},{});return Object.keys(y).sort(function(m,d){return y[m]-y[d]})}function $E(n){if(Kn(n)===Ou)return[];var e=vl(n);return[Tm(n),e,Tm(e)]}function ZE(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,h=t.rootBoundary,p=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,d=t.allowedAutoPlacements,b=e.options.placement,v=Kn(b),g=v===b,M=u||(g||!m?[vl(b)]:$E(b)),_=[b].concat(M).reduce(function(re,j){return re.concat(Kn(j)===Ou?jE(e,{placement:j,boundary:f,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:d}):j)},[]),E=e.rects.reference,S=e.rects.popper,w=new Map,A=!0,I=_[0],T=0;T<_.length;T++){var P=_[T],C=Kn(P),R=ws(P)===gs,L=[ln,_n].indexOf(C)>=0,N=L?"width":"height",x=$o(e,{placement:P,boundary:f,rootBoundary:h,altBoundary:p,padding:c}),O=L?R?En:cn:R?_n:ln;E[N]>S[N]&&(O=vl(O));var B=vl(O),D=[];if(s&&D.push(x[C]<=0),l&&D.push(x[O]<=0,x[B]<=0),D.every(function(re){return re})){I=P,A=!1;break}w.set(P,D)}if(A)for(var k=m?3:1,U=function(re){var j=_.find(function(G){var W=w.get(G);if(W)return W.slice(0,re).every(function(K){return K})});if(j)return I=j,"break"},H=k;H>0;H--){var X=U(H);if(X==="break")break}e.placement!==I&&(e.modifiersData[i]._skip=!0,e.placement=I,e.reset=!0)}}var XE={name:"flip",enabled:!0,phase:"main",fn:ZE,requiresIfExists:["offset"],data:{_skip:!1}};function Lm(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Pm(n){return[ln,En,_n,cn].some(function(e){return n[e]>=0})}function YE(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=$o(e,{elementContext:"reference"}),l=$o(e,{altBoundary:!0}),u=Lm(o,i),c=Lm(l,r,s),f=Pm(u),h=Pm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YE};function KE(n,e,t){var i=Kn(n),r=[cn,ln].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[cn,En].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function qE(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ys.reduce(function(f,h){return f[h]=KE(h,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var QE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qE};function eT(n){var e=n.state,t=n.name;e.modifiersData[t]=Rm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Im={name:"popperOffsets",enabled:!0,phase:"read",fn:eT,data:{}};function tT(n){return n==="x"?"y":"x"}function nT(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,h=t.padding,p=t.tether,y=p===void 0?!0:p,m=t.tetherOffset,d=m===void 0?0:m,b=$o(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:f}),v=Kn(e.placement),g=ws(e.placement),M=!g,_=Bu(v),E=tT(_),S=e.modifiersData.popperOffsets,w=e.rects.reference,A=e.rects.popper,I=typeof d=="function"?d(Object.assign({},e.rects,{placement:e.placement})):d,T=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(S){if(s){var R,L=_==="y"?ln:cn,N=_==="y"?_n:En,x=_==="y"?"height":"width",O=S[_],B=O+b[L],D=O-b[N],k=y?-A[x]/2:0,U=g===gs?w[x]:A[x],H=g===gs?-A[x]:-w[x],X=e.elements.arrow,re=y&&X?Du(X):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xm(),G=j[L],W=j[N],K=Wo(0,w[x],re[x]),ee=M?w[x]/2-k-K-G-T.mainAxis:U-K-G-T.mainAxis,q=M?-w[x]/2+k+K+W+T.mainAxis:H+K+W+T.mainAxis,ie=e.elements.arrow&&Ho(e.elements.arrow),Y=ie?_==="y"?ie.clientTop||0:ie.clientLeft||0:0,te=(R=P==null?void 0:P[_])!=null?R:0,F=O+ee-te-Y,$=O+q-te,Q=Wo(y?ml(B,F):B,O,y?Lr(D,$):D);S[_]=Q,C[_]=Q-O}if(l){var V,z=_==="x"?ln:cn,oe=_==="x"?_n:En,ae=S[E],le=E==="y"?"height":"width",fe=ae+b[z],be=ae-b[oe],ye=[ln,cn].indexOf(v)!==-1,he=(V=P==null?void 0:P[E])!=null?V:0,ve=ye?fe:ae-w[le]-A[le]-he+T.altAxis,se=ye?ae+w[le]+A[le]-he-T.altAxis:be,we=y&&ye?RE(ve,ae,se):Wo(y?ve:fe,ae,y?se:be);S[E]=we,C[E]=we-ae}e.modifiersData[i]=C}}var iT={name:"preventOverflow",enabled:!0,phase:"main",fn:nT,requiresIfExists:["offset"]};function rT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function sT(n){return n===In(n)||!Tn(n)?Fu(n):rT(n)}function oT(n){var e=n.getBoundingClientRect(),t=bs(e.width)/n.offsetWidth||1,i=bs(e.height)/n.offsetHeight||1;return t!==1||i!==1}function aT(n,e,t){t===void 0&&(t=!1);var i=Tn(e),r=Tn(e)&&oT(e),s=Zi(e),o=xs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((Jn(e)!=="body"||ku(s))&&(l=sT(e)),Tn(e)?(u=xs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Vu(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function lT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function cT(n){var e=lT(n);return _E.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function uT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function dT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Om={placement:"bottom",modifiers:[],strategy:"absolute"};function Nm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Uu(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?Om:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Om,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:c,setOptions:function(d){var b=typeof d=="function"?d(c.options):d;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:vs(o)?jo(o):o.contextElement?jo(o.contextElement):[],popper:jo(l)};var v=cT(dT([].concat(i,c.options.modifiers)));return c.orderedModifiers=v.filter(function(g){return g.enabled}),y(),p.update()},forceUpdate:function(){if(!h){var d=c.elements,b=d.reference,v=d.popper;if(Nm(b,v)){c.rects={reference:aT(b,Ho(v),c.options.strategy==="fixed"),popper:Du(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(A){return c.modifiersData[A.name]=Object.assign({},A.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var M=c.orderedModifiers[g],_=M.fn,E=M.options,S=E===void 0?{}:E,w=M.name;typeof _=="function"&&(c=_({state:c,options:S,name:w,instance:p})||c)}}}},update:uT(function(){return new Promise(function(d){p.forceUpdate(),d(c)})}),destroy:function(){m(),h=!0}};if(!Nm(o,l))return p;p.setOptions(u).then(function(d){!h&&u.onFirstUpdate&&u.onFirstUpdate(d)});function y(){c.orderedModifiers.forEach(function(d){var b=d.name,v=d.options,g=v===void 0?{}:v,M=d.effect;if(typeof M=="function"){var _=M({state:c,name:b,instance:p,options:g}),E=function(){};f.push(_||E)}})}function m(){f.forEach(function(d){return d()}),f=[]}return p}}Uu();var hT=[Em,Im,_m,ym];Uu({defaultModifiers:hT});var fT=[Em,Im,_m,ym,QE,XE,iT,OE,JE],pT=Uu({defaultModifiers:fT});const mT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=gT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:h}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...h||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=pT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function gT(n){const e=Object.keys(n.elements),t=ol(e.map(r=>[r,n.styles[r]||{}])),i=ol(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function Dm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Ka(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Gu={prefix:Math.floor(Math.random()*1e4),current:0},yT=Symbol("elIdInjection"),Hu=()=>a.getCurrentInstance()?a.inject(yT,Gu):Gu,bl=n=>{const e=Hu();!Ot&&e===Gu&&St("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
8
  usage: app.provide(ID_INJECTION_KEY, {
9
9
  prefix: number,
10
10
  current: number,
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,HT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function WT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:HT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Km(n,e=1,t){var i;On||(On=document.createElement("textarea"),document.body.appendChild(On));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=WT(n);On.setAttribute("style",`${l};${GT}`),On.value=n.value||n.placeholder||"";let u=On.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),On.value="";const f=On.scrollHeight-r;if(rt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(rt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=On.parentNode)==null||i.removeChild(On),On=void 0,c}const jT=qe({id:{type:String,default:void 0},size:Ss,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ji},prefixIcon:{type:ji},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>vi({})},autofocus:Boolean,rows:{type:Number,default:2},...Pr(["ariaLabel"])}),$T={[ft]:n=>tn(n),input:n=>tn(n),change:n=>tn(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},ZT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),XT=a.defineComponent({...ZT,props:jT,emits:$T,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const he={};return i.containerRole==="combobox"&&(he["aria-haspopup"]=r["aria-haspopup"],he["aria-owns"]=r["aria-owns"],he["aria-expanded"]=r["aria-expanded"]),he}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(y.value),d.is("disabled",m.value),d.is("exceed",X.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:D.value&&k.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",I.value)]),c=iE({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=Zo(),{inputId:p}=$u(i,{formItemContext:h}),y=_s(),m=Ml(),d=Ue("input"),b=Ue("textarea"),v=a.shallowRef(),g=a.shallowRef(),M=a.ref(!1),_=a.ref(!1),E=a.ref(),S=a.shallowRef(i.inputStyle),w=a.computed(()=>v.value||g.value),{wrapperRef:A,isFocused:I,handleFocus:T,handleBlur:P}=Zm(w,{beforeFocus(){return m.value},afterBlur(){var he;i.validateEvent&&((he=h==null?void 0:h.validate)==null||he.call(h,"blur").catch(ve=>St(ve)))}}),C=a.computed(()=>{var he;return(he=f==null?void 0:f.statusIcon)!=null?he:!1}),R=a.computed(()=>(h==null?void 0:h.validateState)||""),L=a.computed(()=>R.value&&um[R.value]),N=a.computed(()=>_.value?J_:W_),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,S.value,{resize:i.resize}]),B=a.computed(()=>gi(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(I.value||M.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||I.value)),U=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),H=a.computed(()=>B.value.length),X=a.computed(()=>!!U.value&&H.value>Number(i.maxlength)),re=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||U.value||!!R.value&&C.value),[j,G]=ET(v);Sn(g,he=>{if(ee(),!U.value||i.resize!=="both")return;const ve=he[0],{width:se}=ve.contentRect;E.value={right:`calc(100% - ${se+15+6}px)`}});const W=()=>{const{type:he,autosize:ve}=i;if(!(!Ot||he!=="textarea"||!g.value))if(ve){const se=nn(ve)?ve.minRows:void 0,we=nn(ve)?ve.maxRows:void 0,pe=Km(g.value,se,we);S.value={overflowY:"hidden",...pe},a.nextTick(()=>{g.value.offsetHeight,S.value=pe})}else S.value={minHeight:Km(g.value).minHeight}},ee=(he=>{let ve=!1;return()=>{var se;if(ve||!i.autosize)return;((se=g.value)==null?void 0:se.offsetParent)===null||(he(),ve=!0)}})(W),K=()=>{const he=w.value,ve=i.formatter?i.formatter(B.value):B.value;!he||he.value===ve||(he.value=ve)},ie=async he=>{j();let{value:ve}=he.target;if(i.formatter&&(ve=i.parser?i.parser(ve):ve),!te.value){if(ve===B.value){K();return}t(ft,ve),t("input",ve),await a.nextTick(),K(),G()}},Y=he=>{t("change",he.target.value)},{isComposing:te,handleCompositionStart:F,handleCompositionUpdate:$,handleCompositionEnd:Q}=Xm({emit:t,afterComposition:ie}),V=()=>{_.value=!_.value,z()},z=async()=>{var he;await a.nextTick(),(he=w.value)==null||he.focus()},oe=()=>{var he;return(he=w.value)==null?void 0:he.blur()},ae=he=>{M.value=!1,t("mouseleave",he)},le=he=>{M.value=!0,t("mouseenter",he)},fe=he=>{t("keydown",he)},be=()=>{var he;(he=w.value)==null||he.select()},ye=()=>{t(ft,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var he;a.nextTick(()=>W()),i.validateEvent&&((he=h==null?void 0:h.validate)==null||he.call(h,"change").catch(ve=>St(ve)))}),a.watch(B,()=>K()),a.watch(()=>i.type,async()=>{await a.nextTick(),K(),W()}),a.onMounted(()=>{!i.formatter&&i.parser&&St("ElInput","If you set the parser, you also need to set the formatter."),K(),a.nextTick(W)}),e({input:v,textarea:g,ref:w,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:te,focus:z,blur:oe,select:be,clear:ye,resizeTextarea:W}),(he,ve)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:he.$slots.append,[a.unref(d).bm("group","prepend")]:he.$slots.prepend}],style:a.unref(x),role:he.containerRole,onMouseenter:le,onMouseleave:ae}),[a.createCommentVNode(" input "),he.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),he.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(he.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:A,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),he.$slots.prefix||he.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(he.$slots,"prefix"),he.prefixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(he.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:v,class:a.unref(d).e("inner")},a.unref(c),{minlength:he.minlength,maxlength:he.maxlength,type:he.showPassword?_.value?"text":"password":he.type,disabled:a.unref(m),readonly:he.readonly,autocomplete:he.autocomplete,tabindex:he.tabindex,"aria-label":he.ariaLabel,placeholder:he.placeholder,style:he.inputStyle,form:he.form,autofocus:he.autofocus,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(Q),onInput:ie,onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(re)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(D)||!a.unref(k)||!a.unref(U)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(he.$slots,"suffix"),he.suffixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(he.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(Oo),["prevent"]),onClick:ye},{default:a.withCtx(()=>[a.createVNode(a.unref(Lu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(mt),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:V},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(N))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(U)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(H))+" / "+a.toDisplayString(he.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(R)&&a.unref(L)&&a.unref(C)?(a.openBlock(),a.createBlock(a.unref(mt),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(R)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),he.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(he.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(I))]},a.unref(c),{minlength:he.minlength,maxlength:he.maxlength,tabindex:he.tabindex,disabled:a.unref(m),readonly:he.readonly,autocomplete:he.autocomplete,style:a.unref(O),"aria-label":he.ariaLabel,placeholder:he.placeholder,form:he.form,autofocus:he.autofocus,rows:he.rows,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(Q),onInput:ie,onFocus:a.unref(T),onBlur:a.unref(P),onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(U)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(E.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(H))+" / "+a.toDisplayString(he.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var YT=je(XT,[["__file","input.vue"]]);const JT=kt(YT),Es=4,KT={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},qT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Zu=Symbol("scrollbarContextKey"),QT=qe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),eC="Thumb";var qm=je(a.defineComponent({__name:"thumb",props:QT,setup(n){const e=n,t=a.inject(Zu),i=Ue("scrollbar");t||ms(eC,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Ot?document.onselectstart:null;const h=a.computed(()=>KT[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>qT({size:e.size,move:e.move,bar:h.value})),y=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=S=>{var w;if(S.stopPropagation(),S.ctrlKey||[1,2].includes(S.button))return;(w=window.getSelection())==null||w.removeAllRanges(),b(S);const A=S.currentTarget;A&&(o.value[h.value.axis]=A[h.value.offset]-(S[h.value.client]-A.getBoundingClientRect()[h.value.direction]))},d=S=>{if(!s.value||!r.value||!t.wrapElement)return;const w=Math.abs(S.target.getBoundingClientRect()[h.value.direction]-S[h.value.client]),A=s.value[h.value.offset]/2,I=(w-A)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=I*t.wrapElement[h.value.scrollSize]/100},b=S=>{S.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},v=S=>{if(!r.value||!s.value||u===!1)return;const w=o.value[h.value.axis];if(!w)return;const A=(r.value.getBoundingClientRect()[h.value.direction]-S[h.value.client])*-1,I=s.value[h.value.offset]-w,T=(A-I)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=T*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),E(),c&&(l.value=!1)},M=()=>{c=!1,l.value=!!e.size},_=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{E(),document.removeEventListener("mouseup",g)});const E=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Vt(a.toRef(t,"scrollbarElement"),"mousemove",M),Vt(a.toRef(t,"scrollbarElement"),"mouseleave",_),(S,w)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,S.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const tC=qe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var nC=je(a.defineComponent({__name:"bar",props:tC,setup(n,{expose:e}){const t=n,i=a.inject(Zu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const y=p.offsetHeight-Es,m=p.offsetWidth-Es;s.value=p.scrollTop*100/y*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const y=p.offsetHeight-Es,m=p.offsetWidth-Es,d=y**2/p.scrollHeight,b=m**2/p.scrollWidth,v=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(y-d)/(v/(y-v)),c.value=b/(m-b)/(g/(m-g)),l.value=v+Es<y?`${v}px`:"",o.value=g+Es<m?`${g}px`:""}}),(p,y)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(qm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(qm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const iC=qe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Pr(["ariaLabel","ariaOrientation"])}),rC={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(rt)},Xu="ElScrollbar",sC=a.defineComponent({name:Xu}),oC=a.defineComponent({...sC,props:iC,emits:rC,setup(n,{expose:e,emit:t}){const i=n,r=Ue("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),y=a.computed(()=>{const E={};return i.height&&(E.height=ll(i.height)),i.maxHeight&&(E.maxHeight=ll(i.maxHeight)),[i.wrapStyle,E]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var E;f.value&&((E=p.value)==null||E.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function v(E,S){nn(E)?f.value.scrollTo(E):rt(E)&&rt(S)&&f.value.scrollTo(E,S)}const g=E=>{if(!rt(E)){St(Xu,"value must be a number");return}f.value.scrollTop=E},M=E=>{if(!rt(E)){St(Xu,"value must be a number");return}f.value.scrollLeft=E},_=()=>{var E;(E=p.value)==null||E.update()};return a.watch(()=>i.noresize,E=>{E?(s==null||s(),o==null||o()):({stop:s}=Sn(h,_),o=Vt("resize",_))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var E;_(),f.value&&((E=p.value)==null||E.handleScroll(f.value))})}),a.provide(Zu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{_()})}),a.onUpdated(()=>_()),e({wrapRef:f,update:_,scrollTo:v,setScrollTop:g,setScrollLeft:M,handleScroll:b}),(E,S)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(y)),tabindex:E.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(E.tag),{id:E.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(E.viewStyle),role:E.role,"aria-label":E.ariaLabel,"aria-orientation":E.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(E.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),E.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(nC,{key:0,ref_key:"barRef",ref:p,always:E.always,"min-size":E.minSize},null,8,["always","min-size"]))],2))}});var aC=je(oC,[["__file","scrollbar.vue"]]);const lC=kt(aC),Yu=Symbol("popper"),Qm=Symbol("popperContent"),eg=qe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),cC=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),uC=a.defineComponent({...cC,props:eg,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Yu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var dC=je(uC,[["__file","popper.vue"]]);const tg=qe({arrowOffset:{type:Number,default:5}}),hC=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),fC=a.defineComponent({...hC,props:tg,setup(n,{expose:e}){const t=n,i=Ue("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Qm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var pC=je(fC,[["__file","arrow.vue"]]);const Ju="ElOnlyChild",mC=a.defineComponent({name:Ju,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(km),s=_T((i=r==null?void 0:r.setForwardRef)!=null?i:Oo);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return St(Ju,"requires exact only one valid child."),null;const u=ng(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(St(Ju,"no valid child node found"),null)}}});function ng(n){if(!n)return null;const e=n;for(const t of e){if(nn(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return ig(t);case a.Fragment:return ng(t.children);default:return t}return ig(t)}return null}function ig(n){const e=Ue("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const rg=qe({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),gC=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),yC=a.defineComponent({...gC,props:rg,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Yu,void 0);ST(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=di(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,Cr(h)&&(f.forEach(y=>{var m;const d=t[y];d&&(h.addEventListener(y.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,y.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{gi(y[d])?h.removeAttribute(m):h.setAttribute(m,y[d])})},{immediate:!0})),Cr(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>p.removeAttribute(y))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Cr(r.value)){const h=r.value;f.forEach(p=>{const y=t[p];y&&h.removeEventListener(p.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(mC),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var vC=je(yC,[["__file","trigger.vue"]]);const Ku="focus-trap.focus-after-trapped",qu="focus-trap.focus-after-released",bC="focus-trap.focusout-prevented",sg={cancelable:!0,bubbles:!1},xC={cancelable:!0,bubbles:!1},og="focusAfterTrapped",ag="focusAfterReleased",wC=Symbol("elFocusTrap"),Qu=a.ref(),Sl=a.ref(0),ed=a.ref(0);let _l=0;const lg=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},cg=(n,e)=>{for(const t of n)if(!MC(t,e))return t},MC=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},SC=n=>{const e=lg(n),t=cg(e,n),i=cg(e.reverse(),n);return[t,i]},_C=n=>n instanceof HTMLInputElement&&"select"in n,Xi=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ed.value=window.performance.now(),n!==t&&_C(n)&&e&&n.select()}};function ug(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const EC=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=ug(n,i),n.unshift(i)},remove:i=>{var r,s;n=ug(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},TC=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Xi(i,e),document.activeElement!==t)return},dg=EC(),CC=()=>Sl.value>ed.value,El=()=>{Qu.value="pointer",Sl.value=window.performance.now()},hg=()=>{Qu.value="keyboard",Sl.value=window.performance.now()},AC=()=>(a.onMounted(()=>{_l===0&&(document.addEventListener("mousedown",El),document.addEventListener("touchstart",El),document.addEventListener("keydown",hg)),_l++}),a.onBeforeUnmount(()=>{_l--,_l<=0&&(document.removeEventListener("mousedown",El),document.removeEventListener("touchstart",El),document.removeEventListener("keydown",hg))}),{focusReason:Qu,lastUserFocusTimestamp:Sl,lastAutomatedFocusTimestamp:ed}),Tl=n=>new CustomEvent(bC,{...xC,detail:n}),RC=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[og,ag,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=AC();vT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:v,metaKey:g,currentTarget:M,shiftKey:_}=m,{loop:E}=n,S=d===Yn.tab&&!b&&!v&&!g,w=document.activeElement;if(S&&w){const A=M,[I,T]=SC(A);if(I&&T){if(!_&&w===T){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||(m.preventDefault(),E&&Xi(I,!0))}else if(_&&[I,A].includes(w)){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||(m.preventDefault(),E&&Xi(T,!0))}}else if(w===A){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||m.preventDefault()}}};a.provide(wC,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(og,m)},c=m=>e(ag,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,v=m.relatedTarget,g=b&&d.contains(b);n.trapped||v&&d.contains(v)||(i=v),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:Xi(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!gi(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const v=Tl({focusReason:s.value});e("focusout-prevented",v),v.defaultPrevented||Xi(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){dg.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const v=new Event(Ku,sg);m.addEventListener(Ku,u),m.dispatchEvent(v),v.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;tn(g)||(Xi(g),document.activeElement!==g&&(g="first")),g==="first"&&TC(lg(m),!0),(document.activeElement===d||g==="container")&&Xi(m)})}}}function y(){const m=a.unref(t);if(m){m.removeEventListener(Ku,u);const d=new CustomEvent(qu,{...sg,detail:{focusReason:s.value}});m.addEventListener(qu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!CC()||m.contains(document.activeElement))&&Xi(i??document.body),m.removeEventListener(qu,c),dg.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():y()})}),a.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function LC(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var PC=je(RC,[["render",LC],["__file","focus-trap.vue"]]);const IC=["fixed","absolute"],OC=qe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ys,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:IC,default:"absolute"}}),fg=qe({...OC,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Pr(["ariaLabel"])}),NC={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},DC=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...FC(n),...e]};return VC(s,r==null?void 0:r.modifiers),s},BC=n=>{if(Ot)return di(n)};function FC(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function VC(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const kC=0,zC=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Yu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var v;const g=a.unref(s),M=(v=a.unref(o))!=null?v:kC;return{name:"arrow",enabled:!__(g),options:{element:g,padding:M}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...DC(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>BC(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:y,update:m,forceUpdate:d,instanceRef:b}=mT(f,t,c);return a.watch(b,v=>e.value=v),a.onMounted(()=>{a.watch(()=>{var v;return(v=a.unref(f))==null?void 0:v.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:y,role:r,forceUpdate:d,update:m}},UC=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=jm(),s=Ue("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(rt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=rt(n.zIndex)?n.zIndex:r()}}},GC=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},HC=a.defineComponent({name:"ElPopperContent"}),WC=a.defineComponent({...HC,props:fg,emits:NC,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=GC(i,t),{attributes:h,arrowRef:p,contentRef:y,styles:m,instanceRef:d,role:b,update:v}=zC(i),{ariaModal:g,arrowStyle:M,contentAttrs:_,contentClass:E,contentStyle:S,updateZIndex:w}=UC(i,{styles:m,attributes:h,role:b}),A=a.inject(wl,void 0),I=a.ref();a.provide(Qm,{arrowStyle:M,arrowRef:p,arrowOffset:I}),A&&a.provide(wl,{...A,addInputId:Oo,removeInputId:Oo});let T;const P=(R=!0)=>{v(),R&&w()},C=()=>{P(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(R,L)=>{T==null||T(),T=void 0;const N=a.unref(R||y.value),x=a.unref(L||y.value);Cr(N)&&(T=a.watch([b,()=>i.ariaLabel,g,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{gi(O[D])?N.removeAttribute(B):N.setAttribute(B,O[D])})},{immediate:!0})),x!==N&&Cr(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,C,{immediate:!0})}),a.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:y,popperInstanceRef:d,updatePopper:P,contentStyle:S}),(R,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:y},a.unref(_),{style:a.unref(S),class:a.unref(E),tabindex:"-1",onMouseenter:N=>R.$emit("mouseenter",N),onMouseleave:N=>R.$emit("mouseleave",N)}),[a.createVNode(a.unref(PC),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(y),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var jC=je(WC,[["__file","content.vue"]]);const $C=kt(dC),td=Symbol("elTooltip"),fn=qe({...wT,...fg,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Pr(["ariaLabel"])}),Xo=qe({...rg,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[Yn.enter,Yn.space]}}),{useModelToggleProps:ZC,useModelToggleEmits:XC,useModelToggle:YC}=hE("visible"),JC=qe({...eg,...ZC,...fn,...Xo,...tg,showArrow:{type:Boolean,default:!0}}),KC=[...XC,"before-show","before-hide","show","hide","open","close"],qC=(n,e)=>an(n)?n.includes(e):n===e,Ts=(n,e,t)=>i=>{qC(a.unref(n),e)&&t(i)},QC=a.defineComponent({name:"ElTooltipTrigger"}),eA=a.defineComponent({...QC,props:Xo,setup(n,{expose:e}){const t=n,i=Ue("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(td,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),y=ui(h,Ts(p,"hover",l)),m=ui(h,Ts(p,"hover",u)),d=ui(h,Ts(p,"click",_=>{_.button===0&&c(_)})),b=ui(h,Ts(p,"focus",l)),v=ui(h,Ts(p,"focus",u)),g=ui(h,Ts(p,"contextmenu",_=>{_.preventDefault(),c(_)})),M=ui(h,_=>{const{code:E}=_;t.triggerKeys.includes(E)&&(_.preventDefault(),c(_))});return e({triggerRef:f}),(_,E)=>(a.openBlock(),a.createBlock(a.unref(vC),{id:a.unref(s),"virtual-ref":_.virtualRef,open:a.unref(o),"virtual-triggering":_.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(v),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(y),onMouseleave:a.unref(m),onKeydown:a.unref(M)},{default:a.withCtx(()=>[a.renderSlot(_.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var tA=je(eA,[["__file","trigger.vue"]]);const nA=qe({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var iA=je(a.defineComponent({__name:"teleport",props:nA,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const rA=kt(iA),sA=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),oA=a.defineComponent({...sA,props:fn,setup(n,{expose:e}){const t=n,{selector:i}=Vm(),r=Ue("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:y,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(td,void 0),v=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const M=a.computed(()=>a.unref(g)?!0:a.unref(c)),_=a.computed(()=>t.disabled?!1:a.unref(c)),E=a.computed(()=>t.appendTo||i.value),S=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),w=a.ref(!0),A=()=>{m(),w.value=!0},I=()=>{if(a.unref(l))return!0},T=ui(I,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),P=ui(I,()=>{a.unref(f)==="hover"&&h()}),C=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),d==null||d()},R=()=>{b==null||b()},L=()=>{y(),o=mw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},N=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?w.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(rA),{disabled:!x.teleported,to:a.unref(E)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(v),onAfterLeave:A,onBeforeEnter:C,onAfterEnter:L,onBeforeLeave:R},{default:a.withCtx(()=>[a.unref(M)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(jC),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":w.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(S)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(_),"z-index":x.zIndex,onMouseenter:a.unref(T),onMouseleave:a.unref(P),onBlur:N,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(_)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var aA=je(oA,[["__file","content.vue"]]);const lA=a.defineComponent({name:"ElTooltip"}),cA=a.defineComponent({...lA,props:JC,emits:KC,setup(n,{expose:e,emit:t}){const i=n;xT();const r=bl(),s=a.ref(),o=a.ref(),l=()=>{var v;const g=a.unref(s);g&&((v=g.popperInstanceRef)==null||v.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=YC({indicator:u,toggleReason:c}),{onOpen:y,onClose:m}=MT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>Au(i.visible)&&!p.value);a.provide(td,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:v=>{y(v)},onClose:v=>{m(v)},onToggle:v=>{a.unref(u)?m(v):y(v)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,v=>{v&&u.value&&(u.value=!1)});const b=v=>{var g,M;const _=(M=(g=o.value)==null?void 0:g.contentRef)==null?void 0:M.popperContentRef,E=(v==null?void 0:v.relatedTarget)||document.activeElement;return _&&_.contains(E)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:y,onClose:m,hide:h}),(v,g)=>(a.openBlock(),a.createBlock(a.unref($C),{ref_key:"popperRef",ref:s,role:v.role},{default:a.withCtx(()=>[a.createVNode(tA,{disabled:v.disabled,trigger:v.trigger,"trigger-keys":v.triggerKeys,"virtual-ref":v.virtualRef,"virtual-triggering":v.virtualTriggering},{default:a.withCtx(()=>[v.$slots.default?a.renderSlot(v.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(aA,{ref_key:"contentRef",ref:o,"aria-label":v.ariaLabel,"boundaries-padding":v.boundariesPadding,content:v.content,disabled:v.disabled,effect:v.effect,enterable:v.enterable,"fallback-placements":v.fallbackPlacements,"hide-after":v.hideAfter,"gpu-acceleration":v.gpuAcceleration,offset:v.offset,persistent:v.persistent,"popper-class":v.popperClass,"popper-style":v.popperStyle,placement:v.placement,"popper-options":v.popperOptions,pure:v.pure,"raw-content":v.rawContent,"reference-el":v.referenceEl,"trigger-target-el":v.triggerTargetEl,"show-after":v.showAfter,strategy:v.strategy,teleported:v.teleported,transition:v.transition,"virtual-triggering":v.virtualTriggering,"z-index":v.zIndex,"append-to":v.appendTo},{default:a.withCtx(()=>[a.renderSlot(v.$slots,"content",{},()=>[v.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:v.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(v.content),1))]),v.showArrow?(a.openBlock(),a.createBlock(a.unref(pC),{key:0,"arrow-offset":v.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var uA=je(cA,[["__file","tooltip.vue"]]);const nd=kt(uA),pg=Symbol("buttonGroupContextKey"),dA=(n,e)=>{rE({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(pg,void 0),i=Wu("button"),{form:r}=Zo(),s=_s(a.computed(()=>t==null?void 0:t.size)),o=Ml(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const v=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(v.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},id=qe({size:Ss,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ji},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ji,default:()=>am},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),hA={click:n=>n instanceof MouseEvent};function Wt(n,e){fA(n)&&(n="100%");var t=pA(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 Cl(n){return Math.min(1,Math.max(0,n))}function fA(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function pA(n){return typeof n=="string"&&n.indexOf("%")!==-1}function mg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Al(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Ir(n){return n.length===1?"0"+n:String(n)}function mA(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function gg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function rd(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 gA(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=rd(l,o,n+1/3),r=rd(l,o,n),s=rd(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function yg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(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:u,v:o}}function yA(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function vg(n,e,t,i){var r=[Ir(Math.round(n).toString(16)),Ir(Math.round(e).toString(16)),Ir(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 vA(n,e,t,i,r){var s=[Ir(Math.round(n).toString(16)),Ir(Math.round(e).toString(16)),Ir(Math.round(t).toString(16)),Ir(bA(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 bA(n){return Math.round(parseFloat(n)*255).toString(16)}function bg(n){return pn(n)/255}function pn(n){return parseInt(n,16)}function xA(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var sd={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 wA(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=_A(n)),typeof n=="object"&&(xi(n.r)&&xi(n.g)&&xi(n.b)?(e=mA(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):xi(n.h)&&xi(n.s)&&xi(n.v)?(i=Al(n.s),r=Al(n.v),e=yA(n.h,i,r),o=!0,l="hsv"):xi(n.h)&&xi(n.s)&&xi(n.l)&&(i=Al(n.s),s=Al(n.l),e=gA(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=mg(t),{ok:o,format:n.format||l,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 MA="[-\\+]?\\d+%?",SA="[-\\+]?\\d*\\.\\d+%?",Yi="(?:".concat(SA,")|(?:").concat(MA,")"),od="[\\s|\\(]+(".concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")\\s*\\)?"),ad="[\\s|\\(]+(".concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")\\s*\\)?"),Nn={CSS_UNIT:new RegExp(Yi),rgb:new RegExp("rgb"+od),rgba:new RegExp("rgba"+ad),hsl:new RegExp("hsl"+od),hsla:new RegExp("hsla"+ad),hsv:new RegExp("hsv"+od),hsva:new RegExp("hsva"+ad),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 _A(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(sd[n])n=sd[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Nn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Nn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Nn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Nn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Nn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Nn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Nn.hex8.exec(n),t?{r:pn(t[1]),g:pn(t[2]),b:pn(t[3]),a:bg(t[4]),format:e?"name":"hex8"}:(t=Nn.hex6.exec(n),t?{r:pn(t[1]),g:pn(t[2]),b:pn(t[3]),format:e?"name":"hex"}:(t=Nn.hex4.exec(n),t?{r:pn(t[1]+t[1]),g:pn(t[2]+t[2]),b:pn(t[3]+t[3]),a:bg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Nn.hex3.exec(n),t?{r:pn(t[1]+t[1]),g:pn(t[2]+t[2]),b:pn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function xi(n){return!!Nn.CSS_UNIT.exec(String(n))}var EA=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=xA(e)),this.originalInput=e;var r=wA(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,l=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),l<=.03928?r=l/12.92:r=Math.pow((l+.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=mg(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=yg(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=yg(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=gg(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=gg(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),vg(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),vA(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(Wt(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(Wt(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="#"+vg(this.r,this.g,this.b,!1),t=0,i=Object.entries(sd);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??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=Cl(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=Cl(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=Cl(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=Cl(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=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%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}();function Ji(n,e=20){return n.mix("#141414",e).toString()}function TA(n){const e=Ml(),t=Ue("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new EA(r),l=n.dark?o.tint(20).toString():Ji(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Ji(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Ji(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Ji(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Ji(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Ji(o,80):o.tint(80).toString());else{const u=n.dark?Ji(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Ji(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const CA=a.defineComponent({name:"ElButton"}),AA=a.defineComponent({...CA,props:id,emits:hA,setup(n,{expose:e,emit:t}){const i=n,r=TA(i),s=Ue("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=dA(i,t),y=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(y),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(mt),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var RA=je(AA,[["__file","button.vue"]]);const LA={size:id.size,type:id.type},PA=a.defineComponent({name:"ElButtonGroup"}),IA=a.defineComponent({...PA,props:LA,setup(n){const e=n;a.provide(pg,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ue("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var xg=je(IA,[["__file","button-group.vue"]]);const Cs=kt(RA,{ButtonGroup:xg});yi(xg);var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function OA(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Rl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const qi=new Map;if(Ot){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of qi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function wg(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:Cr(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),y=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||y||e.value(i,r)}}const NA={beforeMount(n,e){qi.has(n)||qi.set(n,[]),qi.get(n).push({documentHandler:wg(n,e),bindingFn:e.value})},updated(n,e){qi.has(n)||qi.set(n,[]);const t=qi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:wg(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){qi.delete(n)}},DA=100,BA=600,Mg={beforeMount(n,e){const t=e.value,{interval:i=DA,delay:r=BA}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},ld=qe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:dm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),FA={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},VA=a.defineComponent({name:"ElTag"}),kA=a.defineComponent({...VA,props:ld,emits:FA,setup(n,{emit:e}){const t=n,i=_s(),r=Ue("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:y}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",y)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var zA=je(kA,[["__file","tag.vue"]]);const UA=kt(zA),Sg=Symbol("rowContextKey"),GA=qe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),HA=a.defineComponent({name:"ElRow"}),WA=a.defineComponent({...HA,props:GA,setup(n){const e=n,t=Ue("row"),i=a.computed(()=>e.gutter);a.provide(Sg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var jA=je(WA,[["__file","row.vue"]]);const qn=kt(jA),$A=qe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>vi({})},sm:{type:Ve([Number,Object]),default:()=>vi({})},md:{type:Ve([Number,Object]),default:()=>vi({})},lg:{type:Ve([Number,Object]),default:()=>vi({})},xl:{type:Ve([Number,Object]),default:()=>vi({})}}),ZA=a.defineComponent({name:"ElCol"}),XA=a.defineComponent({...ZA,props:$A,setup(n){const e=n,{gutter:t}=a.inject(Sg,{gutter:a.computed(()=>0)}),i=Ue("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];rt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{rt(e[c])?o.push(i.b(`${c}-${e[c]}`)):nn(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var YA=je(XA,[["__file","col.vue"]]);const Dn=kt(YA),_g=n=>rt(n)||tn(n)||an(n),JA=qe({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>vi([])}}),KA={[ft]:_g,[$i]:_g},Eg=Symbol("collapseContextKey"),qA=(n,e)=>{const t=a.ref(Xn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(ft,o),e($i,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Xn(n.modelValue),{deep:!0}),a.provide(Eg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},QA=()=>{const n=Ue("collapse");return{rootKls:a.computed(()=>n.b())}},e2=a.defineComponent({name:"ElCollapse"}),t2=a.defineComponent({...e2,props:JA,emits:KA,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=qA(i,t),{rootKls:o}=QA();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var n2=je(t2,[["__file","collapse.vue"]]);const i2=a.defineComponent({name:"ElCollapseTransition"}),r2=a.defineComponent({...i2,setup(n){const e=Ue("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var s2=je(r2,[["__file","collapse-transition.vue"]]);const o2=kt(s2),a2=qe({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:ji,default:Wi},disabled:Boolean}),l2=n=>{const e=a.inject(Eg),{namespace:t}=Ue("collapse"),i=a.ref(!1),r=a.ref(!1),s=Hu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},c2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ue("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},u2=a.defineComponent({name:"ElCollapseItem"}),d2=a.defineComponent({...u2,props:a2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=l2(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:y,scopedContentId:m,scopedHeadId:d}=c2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(mt),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(o2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(y))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var Tg=je(d2,[["__file","collapse-item.vue"]]);const Cg=kt(n2,{CollapseItem:Tg}),Ag=yi(Tg),h2=a.defineComponent({name:"ElContainer"}),f2=a.defineComponent({...h2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ue("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var p2=je(f2,[["__file","container.vue"]]);const m2=a.defineComponent({name:"ElAside"}),g2=a.defineComponent({...m2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ue("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Rg=je(g2,[["__file","aside.vue"]]);const y2=a.defineComponent({name:"ElFooter"}),v2=a.defineComponent({...y2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Lg=je(v2,[["__file","footer.vue"]]);const b2=a.defineComponent({name:"ElHeader"}),x2=a.defineComponent({...b2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Pg=je(x2,[["__file","header.vue"]]);const w2=a.defineComponent({name:"ElMain"}),M2=a.defineComponent({...w2,setup(n){const e=Ue("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Ig=je(M2,[["__file","main.vue"]]);const Qn=kt(p2,{Aside:Rg,Footer:Lg,Header:Pg,Main:Ig});yi(Rg);const Og=yi(Lg),S2=yi(Pg),wi=yi(Ig),_2=a.defineComponent({inheritAttrs:!1});function E2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var T2=je(_2,[["render",E2],["__file","collection.vue"]]);const C2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function A2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var R2=je(C2,[["render",A2],["__file","collection-item.vue"]]);const L2="data-el-collection-item",P2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...T2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${L2}]`));return[...u.values()].sort((y,m)=>h.indexOf(y.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...R2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},cd=qe({trigger:Xo.trigger,effect:{...fn.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:fn.teleported});qe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ji}}),qe({onKeydown:{type:Ve(Function)}}),P2("Dropdown");const I2=qe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Ss,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||rt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Pr(["ariaLabel"])}),O2={[$i]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Ar]:n=>rt(n)||gi(n),[ft]:n=>rt(n)||gi(n)},N2=a.defineComponent({name:"ElInputNumber"}),D2=a.defineComponent({...N2,props:I2,emits:O2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=fl(),s=Ue("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=Zo(),c=a.computed(()=>rt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>rt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const N=v(i.step);return Pn(i.precision)?Math.max(v(i.modelValue),N):(N>i.precision&&St("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),y=_s(),m=Ml(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let N=l.currentValue;if(gi(N))return"";if(rt(N)){if(Number.isNaN(N))return"";Pn(i.precision)||(N=N.toFixed(i.precision))}return N}),b=(N,x)=>{if(Pn(x)&&(x=h.value),x===0)return Math.round(N);let O=String(N);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return N;const U=O.length;return O.charAt(U-1)==="5"&&(O=`${O.slice(0,Math.max(0,U-1))}6`),Number.parseFloat(Number(O).toFixed(x))},v=N=>{if(gi(N))return 0;const x=N.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},g=(N,x=1)=>rt(N)?b(N+i.step*x):l.currentValue,M=()=>{if(i.readonly||m.value||f.value)return;const N=Number(d.value)||0,x=g(N);S(x),t(Ar,l.currentValue),R()},_=()=>{if(i.readonly||m.value||c.value)return;const N=Number(d.value)||0,x=g(N,-1);S(x),t(Ar,l.currentValue),R()},E=(N,x)=>{const{max:O,min:B,step:D,precision:k,stepStrictly:U,valueOnClear:H}=i;O<B&&ms("InputNumber","min should not be greater than max.");let X=Number(N);if(gi(N)||Number.isNaN(X))return null;if(N===""){if(H===null)return null;X=tn(H)?{min:B,max:O}[H]:H}return U&&(X=b(Math.round(X/D)*D,k),X!==N&&x&&t(ft,X)),Pn(k)||(X=b(X,k)),(X>O||X<B)&&(X=X>O?O:B,x&&t(ft,X)),X},S=(N,x=!0)=>{var O;const B=l.currentValue,D=E(N);if(!x){t(ft,D);return}B===D&&N||(l.userInput=null,t(ft,D),B!==D&&t($i,D,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>St(k))),l.currentValue=D)},w=N=>{l.userInput=N;const x=N===""?null:Number(N);t(Ar,x),S(x,!1)},A=N=>{const x=N!==""?Number(N):"";(rt(x)&&!Number.isNaN(x)||N==="")&&S(x),R(),l.userInput=null},I=()=>{var N,x;(x=(N=o.value)==null?void 0:N.focus)==null||x.call(N)},T=()=>{var N,x;(x=(N=o.value)==null?void 0:N.blur)==null||x.call(N)},P=N=>{t("focus",N)},C=N=>{var x;l.userInput=null,t("blur",N),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>St(O)))},R=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=N=>{document.activeElement===N.target&&N.preventDefault()};return a.watch(()=>i.modelValue,(N,x)=>{const O=E(N,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var N;const{min:x,max:O,modelValue:B}=i,D=(N=o.value)==null?void 0:N.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(O)?D.setAttribute("aria-valuemax",String(O)):D.removeAttribute("aria-valuemax"),Number.isFinite(x)?D.setAttribute("aria-valuemin",String(x)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),D.setAttribute("aria-disabled",String(m.value)),!rt(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(ft,k)}D.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var N,x;const O=(N=o.value)==null?void 0:N.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:I,blur:T}),(N,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(y)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!N.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(_,["enter"])},[a.renderSlot(N.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(Ru),{key:0})):(a.openBlock(),a.createBlock(a.unref(Z_),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),_]]):a.createCommentVNode("v-if",!0),N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(M,["enter"])},[a.renderSlot(N.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(F_),{key:0})):(a.openBlock(),a.createBlock(a.unref(ul),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),M]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(JT),{id:N.id,ref_key:"input",ref:o,type:"number",step:N.step,"model-value":a.unref(d),placeholder:N.placeholder,readonly:N.readonly,disabled:a.unref(m),size:a.unref(y),max:N.max,min:N.min,name:N.name,"aria-label":N.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(M,["prevent"]),["up"]),a.withKeys(a.withModifiers(_,["prevent"]),["down"])],onBlur:C,onFocus:P,onInput:w,onChange:A},a.createSlots({_:2},[N.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"prefix")])}:void 0,N.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var B2=je(D2,[["__file","input-number.vue"]]);const Mi=kt(B2),Ng=Symbol("ElSelectGroup"),Ll=Symbol("ElSelect");function F2(n,e){const t=a.inject(Ll),i=a.inject(Ng,{disabled:!1}),r=a.computed(()=>f(Xn(t.props.modelValue),n.value)),s=a.computed(()=>{var y;if(t.props.multiple){const m=Xn((y=t.props.modelValue)!=null?y:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(nn(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(y=[],m)=>{if(nn(n.value)){const d=t.props.valueKey;return y&&y.some(b=>a.toRaw(pi(b,d))===pi(m,d))}else return y&&y.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=y=>{const m=new RegExp(L_(y),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(y,m)=>{const{remote:d,valueKey:b}=t.props;if(y!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&nn(y)&&nn(m)&&y[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const V2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ue("select"),t=bl(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=F2(n,r),{visible:h,hover:p}=a.toRefs(r),y=a.getCurrentInstance().proxy;u.onOptionCreate(y),a.onBeforeUnmount(()=>{const d=y.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(M=>M.value===y.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===y&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,y)});function m(){l.value||u.handleOptionSelect(y)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function k2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var ud=je(V2,[["render",k2],["__file","option.vue"]]);const z2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(Ll),e=Ue("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),Sn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function U2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var G2=je(z2,[["render",U2],["__file","select-dropdown.vue"]]);const H2=11,W2=(n,e)=>{const{t}=fl(),i=bl(),r=Ue("select"),s=Ue("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),y=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),v=a.ref(null),g=a.ref(null),{isComposing:M,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S}=Xm({afterComposition:ue=>se(ue)}),{wrapperRef:w,isFocused:A}=Zm(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!I.value&&(I.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(ue){var xe,Te;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(ue))||((Te=f.value)==null?void 0:Te.isFocusInsideContent(ue))},afterBlur(){I.value=!1,o.menuVisibleOnFocus=!1}}),I=a.ref(!1),T=a.ref(),{form:P,formItem:C}=Zo(),{inputId:R}=$u(n,{formItemContext:C}),{valueOnClear:L,isEmptyValue:N}=OT(n),x=a.computed(()=>n.disabled||(P==null?void 0:P.disabled)),O=a.computed(()=>an(n.modelValue)?n.modelValue.length>0:!N(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",D.value&&I.value)),U=a.computed(()=>(C==null?void 0:C.validateState)||""),H=a.computed(()=>um[U.value]),X=a.computed(()=>n.remote?300:0),re=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&j.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),j=a.computed(()=>G.value.filter(ue=>ue.visible).length),G=a.computed(()=>{const ue=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(Te=>{const Pe=ue.findIndex(Ne=>Ne.value===Te);Pe>-1&&xe.push(ue[Pe])}),xe.length>=ue.length?xe:ue}),W=a.computed(()=>Array.from(o.cachedOptions.values())),q=a.computed(()=>{const ue=G.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!ue}),ee=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||G.value.forEach(ue=>{var xe;(xe=ue.updateOption)==null||xe.call(ue,o.inputValue)})},K=_s(),ie=a.computed(()=>["small"].includes(K.value)?"small":"default"),Y=a.computed({get(){return I.value&&re.value!==!1},set(ue){I.value=ue}}),te=a.computed(()=>{if(n.multiple&&!Pn(n.modelValue))return Xn(n.modelValue).length===0&&!o.inputValue;const ue=an(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||Pn(ue)?!o.inputValue:!0}),F=a.computed(()=>{var ue;const xe=(ue=n.placeholder)!=null?ue:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),$=a.computed(()=>au?null:"mouseenter");a.watch(()=>n.modelValue,(ue,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",Q("")),z(),!Cu(ue,xe)&&n.validateEvent&&(C==null||C.validate("change").catch(Te=>St(Te)))},{flush:"post",deep:!0}),a.watch(()=>I.value,ue=>{ue?Q(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",ue)}),a.watch(()=>o.options.entries(),()=>{var ue;if(!Ot)return;const xe=((ue=l.value)==null?void 0:ue.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!Pn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&z(),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value&&V()},{flush:"post"}),a.watch(()=>o.hoveringIndex,ue=>{rt(ue)&&ue>-1?T.value=G.value[ue]||{}:T.value={},G.value.forEach(xe=>{xe.hover=T.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||ee()});const Q=ue=>{o.previousQuery===ue||M.value||(o.previousQuery=ue,n.filterable&&Jt(n.filterMethod)?n.filterMethod(ue):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(ue),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value?a.nextTick(V):a.nextTick(ae))},V=()=>{const ue=G.value.filter(Pe=>Pe.visible&&!Pe.disabled&&!Pe.states.groupDisabled),xe=ue.find(Pe=>Pe.created),Te=ue[0];o.hoveringIndex=ot(G.value,xe||Te)},z=()=>{if(n.multiple)o.selectedLabel="";else{const xe=an(n.modelValue)?n.modelValue[0]:n.modelValue,Te=oe(xe);o.selectedLabel=Te.currentLabel,o.selected=[Te];return}const ue=[];Pn(n.modelValue)||Xn(n.modelValue).forEach(xe=>{ue.push(oe(xe))}),o.selected=ue},oe=ue=>{let xe;const Te=lu(ue).toLowerCase()==="object",Pe=lu(ue).toLowerCase()==="null",Ne=lu(ue).toLowerCase()==="undefined";for(let Ke=o.cachedOptions.size-1;Ke>=0;Ke--){const It=W.value[Ke];if(Te?pi(It.value,n.valueKey)===pi(ue,n.valueKey):It.value===ue){xe={value:ue,currentLabel:It.currentLabel,get isDisabled(){return It.isDisabled}};break}}if(xe)return xe;const ze=Te?ue.label:!Pe&&!Ne?ue:"";return{value:ue,currentLabel:ze}},ae=()=>{o.hoveringIndex=G.value.findIndex(ue=>o.selected.some(xe=>Me(xe)===Me(ue)))},le=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},fe=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},be=()=>{o.collapseItemWidth=v.value.getBoundingClientRect().width},ye=()=>{var ue,xe;(xe=(ue=c.value)==null?void 0:ue.updatePopper)==null||xe.call(ue)},he=()=>{var ue,xe;(xe=(ue=f.value)==null?void 0:ue.updatePopper)==null||xe.call(ue)},ve=()=>{o.inputValue.length>0&&!I.value&&(I.value=!0),Q(o.inputValue)},se=ue=>{if(o.inputValue=ue.target.value,n.remote)we();else return ve()},we=Tu(()=>{ve()},X.value),pe=ue=>{Cu(n.modelValue,ue)||e($i,ue)},ge=ue=>S_(ue,xe=>!o.disabledOptions.has(xe)),Ee=ue=>{if(n.multiple&&ue.code!==Yn.delete&&ue.target.value.length<=0){const xe=Xn(n.modelValue).slice(),Te=ge(xe);if(Te<0)return;const Pe=xe[Te];xe.splice(Te,1),e(ft,xe),pe(xe),e("remove-tag",Pe)}},He=(ue,xe)=>{const Te=o.selected.indexOf(xe);if(Te>-1&&!x.value){const Pe=Xn(n.modelValue).slice();Pe.splice(Te,1),e(ft,Pe),pe(Pe),e("remove-tag",xe.value)}ue.stopPropagation(),Mt()},tt=ue=>{ue.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const Te of o.selected)Te.isDisabled&&xe.push(Te.value);e(ft,xe),pe(xe),o.hoveringIndex=-1,I.value=!1,e("clear"),Mt()},Ie=ue=>{var xe;if(n.multiple){const Te=Xn((xe=n.modelValue)!=null?xe:[]).slice(),Pe=ot(Te,ue.value);Pe>-1?Te.splice(Pe,1):(n.multipleLimit<=0||Te.length<n.multipleLimit)&&Te.push(ue.value),e(ft,Te),pe(Te),ue.created&&Q(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(ft,ue.value),pe(ue.value),I.value=!1;Mt(),!I.value&&a.nextTick(()=>{Le(ue)})},ot=(ue=[],xe)=>{if(!nn(xe))return ue.indexOf(xe);const Te=n.valueKey;let Pe=-1;return ue.some((Ne,ze)=>a.toRaw(pi(Ne,Te))===pi(xe,Te)?(Pe=ze,!0):!1),Pe},Le=ue=>{var xe,Te,Pe,Ne,ze;const Fe=an(ue)?ue[0]:ue;let Ke=null;if(Fe!=null&&Fe.value){const It=G.value.filter(Gt=>Gt.value===Fe.value);It.length>0&&(Ke=It[0].$el)}if(c.value&&Ke){const It=(Ne=(Pe=(Te=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:Te.contentRef)==null?void 0:Pe.querySelector)==null?void 0:Ne.call(Pe,`.${r.be("dropdown","wrap")}`);It&&I_(It,Ke)}(ze=g.value)==null||ze.handleScroll()},Ye=ue=>{o.options.set(ue.value,ue),o.cachedOptions.set(ue.value,ue),ue.disabled&&o.disabledOptions.set(ue.value,ue)},We=(ue,xe)=>{o.options.get(ue)===xe&&o.options.delete(ue)},it=a.computed(()=>{var ue,xe;return(xe=(ue=c.value)==null?void 0:ue.popperRef)==null?void 0:xe.contentRef}),et=()=>{o.isBeforeHide=!1,a.nextTick(()=>Le(o.selected))},Mt=()=>{var ue;(ue=h.value)==null||ue.focus()},pt=()=>{var ue;(ue=h.value)==null||ue.blur()},hn=ue=>{tt(ue)},Mn=()=>{I.value=!1,A.value&&pt()},jn=()=>{o.inputValue.length>0?o.inputValue="":I.value=!1},us=()=>{x.value||(au&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:I.value=!I.value)},ne=()=>{I.value?G.value[o.hoveringIndex]&&Ie(G.value[o.hoveringIndex]):us()},Me=ue=>nn(ue.value)?pi(ue.value,n.valueKey):ue.value,Ce=a.computed(()=>G.value.filter(ue=>ue.visible).every(ue=>ue.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),Je=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),Z=ue=>{if(!I.value){I.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||M.value)&&!Ce.value){ue==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):ue==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=G.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&Z(ue),a.nextTick(()=>Le(T.value))}},de=()=>{if(!u.value)return 0;const ue=window.getComputedStyle(u.value);return Number.parseFloat(ue.gap||"6px")},ce=a.computed(()=>{const ue=de();return{maxWidth:`${v.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-ue:o.selectionWidth}px`}}),me=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Se=a.computed(()=>({width:`${Math.max(o.calculatorWidth,H2)}px`}));return Sn(u,le),Sn(p,fe),Sn(d,ye),Sn(w,ye),Sn(b,he),Sn(v,be),a.onMounted(()=>{z()}),{inputId:R,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:A,expanded:I,optionsArray:G,hoverOption:T,selectSize:K,filteredOptionsCount:j,resetCalculatorWidth:fe,updateTooltip:ye,updateTagTooltip:he,debouncedOnInputChange:we,onInput:se,deletePrevTag:Ee,deleteTag:He,deleteSelected:tt,handleOptionSelect:Ie,scrollToOption:Le,hasModelValue:O,shouldShowPlaceholder:te,currentPlaceholder:F,mouseEnterEventName:$,showClose:B,iconComponent:D,iconReverse:k,validateState:U,validateIcon:H,showNewOption:q,updateOptions:ee,collapseTagSize:ie,setSelected:z,selectDisabled:x,emptyText:re,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S,onOptionCreate:Ye,onOptionDestroy:We,handleMenuEnter:et,focus:Mt,blur:pt,handleClearClick:hn,handleClickOutside:Mn,handleEsc:jn,toggleMenu:us,selectOption:ne,getValueKey:Me,navigateOptions:Z,dropdownMenuVisible:Y,showTagList:Be,collapseTagList:Je,tagStyle:ce,collapseTagStyle:me,inputStyle:Se,popperRef:it,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:y,suffixRef:m,selectRef:l,wrapperRef:w,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:v}};var j2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(Ll);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){an(c)&&c.forEach(f=>{var h,p,y,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!tn(f.children)&&!an(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(y=f.children)==null?void 0:y.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):an(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),Cu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const $2=qe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ss,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:fn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ji,default:Lu},fitInputWidth:Boolean,suffixIcon:{type:ji,default:Ru},tagType:{...ld.type,default:"info"},tagEffect:{...ld.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:ys,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...IT,...Pr(["ariaLabel"])}),Dg="ElSelect",Z2=a.defineComponent({name:Dg,componentName:Dg,components:{ElSelectMenu:G2,ElOption:ud,ElOptions:j2,ElTag:UA,ElScrollbar:lC,ElTooltip:nd,ElIcon:mt},directives:{ClickOutside:NA},props:$2,emits:[ft,$i,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return an(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=W2(i,e);return a.provide(Ll,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function X2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),y=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[y,n.handleClickOutside,n.popperRef]])}var Y2=je(Z2,[["render",X2],["__file","select.vue"]]);const J2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ue("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Ng,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Xn(c),h=[];return f.forEach(p=>{var y,m;o(p)?h.push(p.component.proxy):(y=p.children)!=null&&y.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Sw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function K2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var Bg=je(J2,[["render",K2],["__file","option-group.vue"]]);const As=kt(Y2,{Option:ud,OptionGroup:Bg}),Rs=yi(ud);yi(Bg);const q2=qe({trigger:Xo.trigger,placement:cd.placement,disabled:Xo.disabled,visible:fn.visible,transition:fn.transition,popperOptions:cd.popperOptions,tabindex:cd.tabindex,content:fn.content,popperStyle:fn.popperStyle,popperClass:fn.popperClass,enterable:{...fn.enterable,default:!0},effect:{...fn.effect,default:"light"},teleported:fn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Q2={"update:visible":n=>Au(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},eR="onUpdate:visible",tR=a.defineComponent({name:"ElPopover"}),nR=a.defineComponent({...tR,props:q2,emits:Q2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[eR]),s=Ue("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:ll(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},y=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,v)=>(a.openBlock(),a.createBlock(a.unref(nd),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:y,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var iR=je(nR,[["__file","popover.vue"]]);const Fg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var rR={mounted(n,e){Fg(n,e)},updated(n,e){Fg(n,e)}};const sR=Q_(rR,"popover"),Pl=kt(iR,{directive:sR}),Vg=Symbol("sliderContextKey"),oR=qe({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Ss,inputSize:Ss,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ys,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},...Pr(["ariaLabel"])}),dd=n=>rt(n)||an(n)&&n.every(rt),aR={[ft]:dd,[Ar]:dd,[$i]:dd},lR=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Vt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},cR=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),uR=(n,e,t)=>{const{form:i,formItem:r}=Zo(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),y=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:y.value}:{width:p.value,left:y.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},v=C=>{const R=n.min+C*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-R)<Math.abs(h.value-R)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},g=C=>{const R=v(C);return R.value.setPosition(C),R},M=C=>{e.firstValue=C??n.min,E(n.range?[f.value,h.value]:C??n.min)},_=C=>{e.secondValue=C,n.range&&E([f.value,h.value])},E=C=>{t(ft,C),t(Ar,C)},S=async()=>{await a.nextTick(),t($i,n.range?[f.value,h.value]:n.modelValue)},w=C=>{var R,L,N,x,O,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const k=(N=(L=(R=C.touches)==null?void 0:R.item(0))==null?void 0:L.clientY)!=null?N:C.clientY;D=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=C.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:C.clientX,U=s.value.getBoundingClientRect().left;D=(k-U)/e.sliderSize*100}if(!(D<0||D>100))return g(D)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:S,onSliderWrapperPrevent:C=>{var R,L;((R=u.firstButton.value)!=null&&R.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&C.preventDefault()},onSliderClick:C=>{w(C)&&S()},onSliderDown:async C=>{const R=w(C);R&&(await a.nextTick(),R.value.onButtonDown(C))},onSliderMarkerDown:C=>{c.value||e.dragging||g(C)},setFirstValue:M,setSecondValue:_}},{left:dR,down:hR,right:fR,up:pR,home:mR,end:gR,pageUp:yR,pageDown:vR}=Yn,bR=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=Tu(()=>{t.value&&(r.value=!0)},50),u=Tu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},xR=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:y}=a.inject(Vg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:v,hideTooltip:g}=bR(n,f,l),M=a.ref(),_=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),E=a.computed(()=>n.vertical?{bottom:_.value}:{left:_.value}),S=()=>{e.hovering=!0,v()},w=()=>{e.hovering=!1,e.dragging||g()},A=H=>{i.value||(H.preventDefault(),B(H),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),M.value.focus())},I=H=>{i.value||(e.newPosition=Number.parseFloat(_.value)+H/(s.value-r.value)*100,U(e.newPosition),h())},T=()=>{I(-o.value)},P=()=>{I(o.value)},C=()=>{I(-o.value*4)},R=()=>{I(o.value*4)},L=()=>{i.value||(U(0),h())},N=()=>{i.value||(U(100),h())},x=H=>{let X=!0;[dR,hR].includes(H.key)?T():[fR,pR].includes(H.key)?P():H.key===mR?L():H.key===gR?N():H.key===vR?C():H.key===yR?R():X=!1,X&&H.preventDefault()},O=H=>{let X,re;return H.type.startsWith("touch")?(re=H.touches[0].clientY,X=H.touches[0].clientX):(re=H.clientY,X=H.clientX),{clientX:X,clientY:re}},B=H=>{e.dragging=!0,e.isClick=!0;const{clientX:X,clientY:re}=O(H);n.vertical?e.startY=re:e.startX=X,e.startPosition=Number.parseFloat(_.value),e.newPosition=e.startPosition},D=H=>{if(e.dragging){e.isClick=!1,v(),p();let X;const{clientX:re,clientY:j}=O(H);n.vertical?(e.currentY=j,X=(e.startY-e.currentY)/c.value*100):(e.currentX=re,X=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+X,U(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||U(e.newPosition),h()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},U=async H=>{if(H===null||Number.isNaN(+H))return;H<0?H=0:H>100&&(H=100);const X=100/((s.value-r.value)/o.value);let j=Math.round(H/X)*X*(s.value-r.value)*.01+r.value;j=Number.parseFloat(j.toFixed(u.value)),j!==n.modelValue&&t(ft,j),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&v(),m.value.updatePopper()};return a.watch(()=>e.dragging,H=>{y(H)}),Vt(M,"touchstart",A,{passive:!1}),{disabled:i,button:M,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:E,formatValue:b,handleMouseEnter:S,handleMouseLeave:w,onButtonDown:A,onKeyDown:x,setPosition:U}},wR=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return St("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),MR=(n,e,t,i,r,s)=>{const o=c=>{r(ft,c),r(Ar,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&ms("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>St(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>St(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},SR=qe({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ys,default:"top"}}),_R={[ft]:n=>rt(n)},ER=a.defineComponent({name:"ElSliderButton"}),TR=a.defineComponent({...ER,props:SR,emits:_R,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:y,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:v}=xR(i,s,t),{hovering:g,dragging:M}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:v,hovering:g,dragging:M}),(_,E)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(M)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(y),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(y),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(nd),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:_.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":_.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(M)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var kg=je(TR,[["__file","button.vue"]]);const CR=qe({mark:{type:Ve([String,Object]),default:void 0}});var AR=a.defineComponent({name:"ElSliderMarker",props:CR,setup(n){const e=Ue("slider"),t=a.computed(()=>tn(n.mark)?n.mark:n.mark.label),i=a.computed(()=>tn(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const RR=a.defineComponent({name:"ElSlider"}),LR=a.defineComponent({...RR,props:oR,emits:aR,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),{t:s}=fl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:y,runwayStyle:m,barStyle:d,resetSize:b,emitChange:v,onSliderWrapperPrevent:g,onSliderClick:M,onSliderDown:_,onSliderMarkerDown:E,setFirstValue:S,setSecondValue:w}=uR(i,o,t),{stops:A,getStopStyle:I}=wR(i,o,p,y),{inputId:T,isLabeledByFormItem:P}=$u(i,{formItemContext:l}),C=_s(),R=a.computed(()=>i.inputSize||C.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),N=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(X.value):`${X.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(re.value):`${re.value}`),D=a.computed(()=>[r.b(),r.m(C.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=cR(i);MR(i,o,p,y,t,l);const U=a.computed(()=>{const W=[i.min,i.max,i.step].map(q=>{const ee=`${q}`.split(".")[1];return ee?ee.length:0});return Math.max.apply(null,W)}),{sliderWrapper:H}=lR(i,o,b),{firstValue:X,secondValue:re,sliderSize:j}=a.toRefs(o),G=W=>{o.dragging=W};return Vt(H,"touchstart",g,{passive:!1}),Vt(H,"touchmove",g,{passive:!1}),a.provide(Vg,{...a.toRefs(i),sliderSize:j,disabled:h,precision:U,emitChange:v,resetSize:b,updateDragging:G}),e({onSliderClick:M}),(W,q)=>{var ee,K;return a.openBlock(),a.createElementBlock("div",{id:W.range?a.unref(T):void 0,ref_key:"sliderWrapper",ref:H,class:a.normalizeClass(a.unref(D)),role:W.range?"group":void 0,"aria-label":W.range&&!a.unref(P)?a.unref(L):void 0,"aria-labelledby":W.range&&a.unref(P)?(ee=a.unref(l))==null?void 0:ee.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":W.showInput&&!W.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(_),onTouchstartPassive:a.unref(_)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(kg,{id:W.range?void 0:a.unref(T),ref_key:"firstButton",ref:c,"model-value":a.unref(X),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":W.range||!a.unref(P)?a.unref(N):void 0,"aria-labelledby":!W.range&&a.unref(P)?(K=a.unref(l))==null?void 0:K.labelId:void 0,"aria-valuemin":W.min,"aria-valuemax":W.range?a.unref(re):W.max,"aria-valuenow":a.unref(X),"aria-valuetext":a.unref(x),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(S)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),W.range?(a.openBlock(),a.createBlock(kg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(re),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(X),"aria-valuemax":W.max,"aria-valuenow":a.unref(re),"aria-valuetext":a.unref(B),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(w)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),W.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(A),(ie,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(I)(ie))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(ie,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,style:a.normalizeStyle(a.unref(I)(ie.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(ie,Y)=>(a.openBlock(),a.createBlock(a.unref(AR),{key:Y,mark:ie.mark,style:a.normalizeStyle(a.unref(I)(ie.position)),onMousedown:a.withModifiers(te=>a.unref(E)(ie.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),W.showInput&&!W.range?(a.openBlock(),a.createBlock(a.unref(Mi),{key:0,ref:"input","model-value":a.unref(X),class:a.normalizeClass(a.unref(r).e("input")),step:W.step,disabled:a.unref(h),controls:W.showInputControls,min:W.min,max:W.max,precision:a.unref(U),debounce:W.debounce,size:a.unref(R),"onUpdate:modelValue":a.unref(S),onChange:a.unref(v)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var PR=je(LR,[["__file","slider.vue"]]);const Cn=kt(PR),Il=Symbol("tabsRootContextKey"),IR=qe({tabs:{type:Ve(Array),default:()=>vi([])}}),zg="ElTabBar",OR=a.defineComponent({name:zg}),NR=a.defineComponent({...OR,props:IR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Il);r||ms(zg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ue("tabs"),o=a.ref(),l=a.ref(),u=()=>{let y=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",v=b==="x"?"left":"top";return t.tabs.every(g=>{var M,_;const E=(_=(M=i.parent)==null?void 0:M.refs)==null?void 0:_[`tab-${g.uid}`];if(!E)return!1;if(!g.active)return!0;y=E[`offset${Gi(v)}`],m=E[`client${Gi(d)}`];const S=window.getComputedStyle(E);return d==="width"&&(m-=Number.parseFloat(S.paddingLeft)+Number.parseFloat(S.paddingRight),y+=Number.parseFloat(S.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Gi(b)}(${y}px)`}},c=()=>l.value=u(),f=[],h=()=>{var y;f.forEach(d=>d.stop()),f.length=0;const m=(y=i.parent)==null?void 0:y.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(Sn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=Sn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(y=>y.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(y,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var DR=je(NR,[["__file","tab-bar.vue"]]);const BR=qe({panes:{type:Ve(Array),default:()=>vi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),FR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Ug="ElTabNav",VR=a.defineComponent({name:Ug,props:BR,emits:FR,setup(n,{expose:e,emit:t}){const i=a.inject(Il);i||ms(Ug,"<el-tabs><tab-nav /></el-tabs>");const r=Ue("tabs"),s=gw(),o=Aw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),y=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),v=()=>{if(!l.value)return;const A=l.value[`offset${Gi(d.value)}`],I=p.value;if(!I)return;const T=I>A?I-A:0;p.value=T},g=()=>{if(!l.value||!u.value)return;const A=u.value[`offset${Gi(d.value)}`],I=l.value[`offset${Gi(d.value)}`],T=p.value;if(A-T<=I)return;const P=A-T>I*2?T+I:A-I;p.value=P},M=async()=>{const A=u.value;if(!h.value||!c.value||!l.value||!A)return;await a.nextTick();const I=c.value.querySelector(".is-active");if(!I)return;const T=l.value,P=["top","bottom"].includes(i.props.tabPosition),C=I.getBoundingClientRect(),R=T.getBoundingClientRect(),L=P?A.offsetWidth-R.width:A.offsetHeight-R.height,N=p.value;let x=N;P?(C.left<R.left&&(x=N-(R.left-C.left)),C.right>R.right&&(x=N+C.right-R.right)):(C.top<R.top&&(x=N-(R.top-C.top)),C.bottom>R.bottom&&(x=N+(C.bottom-R.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},_=()=>{var A;if(!u.value||!l.value)return;n.stretch&&((A=f.value)==null||A.update());const I=u.value[`offset${Gi(d.value)}`],T=l.value[`offset${Gi(d.value)}`],P=p.value;T<I?(h.value=h.value||{},h.value.prev=P,h.value.next=P+T<I,I-P<T&&(p.value=I-T)):(h.value=!1,P>0&&(p.value=0))},E=A=>{const I=A.code,{up:T,down:P,left:C,right:R}=Yn;if(![T,P,C,R].includes(I))return;const L=Array.from(A.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),N=L.indexOf(A.target);let x;I===C||I===T?N===0?x=L.length-1:x=N-1:N<L.length-1?x=N+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),S()},S=()=>{m.value&&(y.value=!0)},w=()=>y.value=!1;return a.watch(s,A=>{A==="hidden"?m.value=!1:A==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,A=>{A?setTimeout(()=>m.value=!0,50):m.value=!1}),Sn(c,_),a.onMounted(()=>setTimeout(()=>M(),0)),a.onUpdated(()=>_()),e({scrollToActiveTab:M,removeFocus:w}),()=>{const A=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:v},[a.createVNode(mt,null,{default:()=>[a.createVNode(Hi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(mt,null,{default:()=>[a.createVNode(Wi,null,null)]})])]:null,I=n.panes.map((T,P)=>{var C,R,L,N;const x=T.uid,O=T.props.disabled,B=(R=(C=T.props.name)!=null?C:T.index)!=null?R:`${P}`,D=!O&&(T.isClosable||n.editable);T.index=`${P}`;const k=D?a.createVNode(mt,{class:"is-icon-close",onClick:X=>t("tabRemove",T,X)},{default:()=>[a.createVNode(Pu,null,null)]}):null,U=((N=(L=T.slots).label)==null?void 0:N.call(L))||T.props.label,H=!O&&T.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",T.active),r.is("disabled",O),r.is("closable",D),r.is("focus",y.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":T.active,tabindex:H,onFocus:()=>S(),onBlur:()=>w(),onClick:X=>{w(),t("tabClick",T,B,X)},onKeydown:X=>{D&&(X.code===Yn.delete||X.code===Yn.backspace)&&t("tabRemove",T,X)}},[U,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[A,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:E},[n.type?null:a.createVNode(DR,{ref:f,tabs:[...n.panes]},null),I])])])}}}),kR=qe({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),hd=n=>tn(n)||rt(n),zR={[ft]:n=>hd(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>hd(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>hd(n),tabAdd:()=>!0},UR=a.defineComponent({name:"ElTabs",props:kR,emits:zR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ue("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=CT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(v,g=!1)=>{var M,_,E;if(!(h.value===v||Pn(v)))try{await((M=n.beforeLeave)==null?void 0:M.call(n,v,h.value))!==!1&&(h.value=v,g&&(e(ft,v),e("tabChange",v)),(E=(_=f.value)==null?void 0:_.removeFocus)==null||E.call(_))}catch{}},y=(v,g,M)=>{v.props.disabled||(p(g,!0),e("tabClick",v,M))},m=(v,g)=>{v.props.disabled||Pn(v.props.name)||(g.stopPropagation(),e("edit",v.props.name,"remove"),e("tabRemove",v.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,v=>p(v)),a.watch(h,async()=>{var v;await a.nextTick(),(v=f.value)==null||v.scrollToActiveTab()}),a.provide(Il,{props:n,currentName:h,registerPane:v=>{l.value.push(v)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:v})=>v();return()=>{const v=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:E=>{E.code===Yn.enter&&d()}},[v?a.renderSlot(t,"add-icon"):a.createVNode(mt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(ul,null,null)]})]):null,M=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const E=l.value.some(S=>S.slots.label);return a.createVNode(VR,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:y,onTabRemove:m},{$stable:!E})}},null),g]),_=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[_,M])}}}),GR=qe({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Gg="ElTabPane",HR=a.defineComponent({name:Gg}),WR=a.defineComponent({...HR,props:GR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Il);r||ms(Gg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ue("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=ip(()=>{var y;return r.currentName.value===((y=e.name)!=null?y:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var y;return(y=e.name)!=null?y:o.value}),h=ip(()=>!e.lazy||c.value||u.value);a.watch(u,y=>{y&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(y,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(y.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Hg=je(WR,[["__file","tab-pane.vue"]]);const Wg=kt(UR,{TabPane:Hg}),jg=yi(Hg);function jR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,y=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(al(p,y.bm("parent","relative")),p.removeAttribute("loading-number")),al(p,y.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,y;(y=(p=h.$el)==null?void 0:p.parentNode)==null||y.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:y}){const{ns:m,zIndex:d}=DT("loading");return y({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,v=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[v,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let Ol;const fd=function(n={}){if(!Ot)return;const e=$R(n);if(e.fullscreen&&Ol)return Ol;const t=jR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Ol=void 0)}});ZR(e,e.parent,t),$g(e,e.parent,t),e.parent.vLoadingAddClassList=()=>$g(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(Ol=t),t},$R=n=>{var e,t,i,r;let s;return tn(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},ZR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=ko(document.body,"position"),t.originalOverflow.value=ko(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=ko(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(ko(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=ko(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},$g=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?al(e,i.bm("parent","relative")):om(e,i.bm("parent","relative")),n.fullscreen&&n.lock?om(e,i.bm("parent","hidden")):al(e,i.bm("parent","hidden"))},Nl=Symbol("ElLoading"),Zg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>nn(e.value)?e.value[p]:void 0,u=p=>{const y=tn(p)&&(o==null?void 0:o[p])||p;return y&&a.ref(y)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Bw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[Nl]={options:h,instance:fd(h)}},XR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},pd={mounted(n,e){e.value&&Zg(n,e)},updated(n,e){const t=n[Nl];e.oldValue!==e.value&&(e.value&&!e.oldValue?Zg(n,e):e.value&&e.oldValue?nn(e.value)&&XR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[Nl])==null||e.instance.close(),n[Nl]=null}},YR={install(n){n.directive("loading",pd),n.config.globalProperties.$loading=fd},directive:pd,service:fd};var Xg={exports:{}},Yg={},Jg;function JR(){return Jg||(Jg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var y=this;h.forEach(function(v,g){y.append(g,v)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var y;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){y=this._entries[m];for(var d=0;d<y.length;d++)h.call(p,y[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,y){h.push(y)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,y){h.push([y,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,y){h.push(r(y)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,y){f.push([y,p]),c._entries||c.delete(y)}),f.sort(function(p,y){return p[0]<y[0]?-1:p[0]>y[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),y,h=0;h<p.length;h++)y=p[h].split("="),this.append(s(y[0]),y.length>1?s(y[1]):"")}})}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(M){throw new Error("URL unable to set base "+c+" due to "+M)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var y=f.createElement("input");if(y.type="url",y.value=u,p.protocol===":"||!/:/.test(p.href)||!y.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,v=this;["append","delete","set"].forEach(function(M){var _=m[M];m[M]=function(){_.apply(m,arguments),d&&(b=!1,v.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki)),Yg}/**
20
+ `,HT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function WT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:HT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Km(n,e=1,t){var i;On||(On=document.createElement("textarea"),document.body.appendChild(On));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=WT(n);On.setAttribute("style",`${l};${GT}`),On.value=n.value||n.placeholder||"";let u=On.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),On.value="";const f=On.scrollHeight-r;if(rt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(rt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=On.parentNode)==null||i.removeChild(On),On=void 0,c}const jT=qe({id:{type:String,default:void 0},size:Ss,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ji},prefixIcon:{type:ji},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>vi({})},autofocus:Boolean,rows:{type:Number,default:2},...Pr(["ariaLabel"])}),$T={[ft]:n=>tn(n),input:n=>tn(n),change:n=>tn(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},ZT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),XT=a.defineComponent({...ZT,props:jT,emits:$T,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const he={};return i.containerRole==="combobox"&&(he["aria-haspopup"]=r["aria-haspopup"],he["aria-owns"]=r["aria-owns"],he["aria-expanded"]=r["aria-expanded"]),he}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(y.value),d.is("disabled",m.value),d.is("exceed",X.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:D.value&&k.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",I.value)]),c=iE({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=Zo(),{inputId:p}=$u(i,{formItemContext:h}),y=_s(),m=Ml(),d=Ue("input"),b=Ue("textarea"),v=a.shallowRef(),g=a.shallowRef(),M=a.ref(!1),_=a.ref(!1),E=a.ref(),S=a.shallowRef(i.inputStyle),w=a.computed(()=>v.value||g.value),{wrapperRef:A,isFocused:I,handleFocus:T,handleBlur:P}=Zm(w,{beforeFocus(){return m.value},afterBlur(){var he;i.validateEvent&&((he=h==null?void 0:h.validate)==null||he.call(h,"blur").catch(ve=>St(ve)))}}),C=a.computed(()=>{var he;return(he=f==null?void 0:f.statusIcon)!=null?he:!1}),R=a.computed(()=>(h==null?void 0:h.validateState)||""),L=a.computed(()=>R.value&&um[R.value]),N=a.computed(()=>_.value?J_:W_),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,S.value,{resize:i.resize}]),B=a.computed(()=>gi(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(I.value||M.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||I.value)),U=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),H=a.computed(()=>B.value.length),X=a.computed(()=>!!U.value&&H.value>Number(i.maxlength)),re=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||U.value||!!R.value&&C.value),[j,G]=ET(v);Sn(g,he=>{if(ee(),!U.value||i.resize!=="both")return;const ve=he[0],{width:se}=ve.contentRect;E.value={right:`calc(100% - ${se+15+6}px)`}});const W=()=>{const{type:he,autosize:ve}=i;if(!(!Ot||he!=="textarea"||!g.value))if(ve){const se=nn(ve)?ve.minRows:void 0,we=nn(ve)?ve.maxRows:void 0,pe=Km(g.value,se,we);S.value={overflowY:"hidden",...pe},a.nextTick(()=>{g.value.offsetHeight,S.value=pe})}else S.value={minHeight:Km(g.value).minHeight}},ee=(he=>{let ve=!1;return()=>{var se;if(ve||!i.autosize)return;((se=g.value)==null?void 0:se.offsetParent)===null||(he(),ve=!0)}})(W),q=()=>{const he=w.value,ve=i.formatter?i.formatter(B.value):B.value;!he||he.value===ve||(he.value=ve)},ie=async he=>{j();let{value:ve}=he.target;if(i.formatter&&(ve=i.parser?i.parser(ve):ve),!te.value){if(ve===B.value){q();return}t(ft,ve),t("input",ve),await a.nextTick(),q(),G()}},Y=he=>{t("change",he.target.value)},{isComposing:te,handleCompositionStart:F,handleCompositionUpdate:$,handleCompositionEnd:Q}=Xm({emit:t,afterComposition:ie}),V=()=>{_.value=!_.value,z()},z=async()=>{var he;await a.nextTick(),(he=w.value)==null||he.focus()},oe=()=>{var he;return(he=w.value)==null?void 0:he.blur()},ae=he=>{M.value=!1,t("mouseleave",he)},le=he=>{M.value=!0,t("mouseenter",he)},fe=he=>{t("keydown",he)},be=()=>{var he;(he=w.value)==null||he.select()},ye=()=>{t(ft,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var he;a.nextTick(()=>W()),i.validateEvent&&((he=h==null?void 0:h.validate)==null||he.call(h,"change").catch(ve=>St(ve)))}),a.watch(B,()=>q()),a.watch(()=>i.type,async()=>{await a.nextTick(),q(),W()}),a.onMounted(()=>{!i.formatter&&i.parser&&St("ElInput","If you set the parser, you also need to set the formatter."),q(),a.nextTick(W)}),e({input:v,textarea:g,ref:w,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:te,focus:z,blur:oe,select:be,clear:ye,resizeTextarea:W}),(he,ve)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:he.$slots.append,[a.unref(d).bm("group","prepend")]:he.$slots.prepend}],style:a.unref(x),role:he.containerRole,onMouseenter:le,onMouseleave:ae}),[a.createCommentVNode(" input "),he.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),he.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(he.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:A,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),he.$slots.prefix||he.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(he.$slots,"prefix"),he.prefixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(he.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:v,class:a.unref(d).e("inner")},a.unref(c),{minlength:he.minlength,maxlength:he.maxlength,type:he.showPassword?_.value?"text":"password":he.type,disabled:a.unref(m),readonly:he.readonly,autocomplete:he.autocomplete,tabindex:he.tabindex,"aria-label":he.ariaLabel,placeholder:he.placeholder,style:he.inputStyle,form:he.form,autofocus:he.autofocus,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(Q),onInput:ie,onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(re)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(D)||!a.unref(k)||!a.unref(U)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(he.$slots,"suffix"),he.suffixIcon?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(he.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(Oo),["prevent"]),onClick:ye},{default:a.withCtx(()=>[a.createVNode(a.unref(Lu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(mt),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:V},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(N))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(U)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(H))+" / "+a.toDisplayString(he.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(R)&&a.unref(L)&&a.unref(C)?(a.openBlock(),a.createBlock(a.unref(mt),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(R)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),he.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(he.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(I))]},a.unref(c),{minlength:he.minlength,maxlength:he.maxlength,tabindex:he.tabindex,disabled:a.unref(m),readonly:he.readonly,autocomplete:he.autocomplete,style:a.unref(O),"aria-label":he.ariaLabel,placeholder:he.placeholder,form:he.form,autofocus:he.autofocus,rows:he.rows,onCompositionstart:a.unref(F),onCompositionupdate:a.unref($),onCompositionend:a.unref(Q),onInput:ie,onFocus:a.unref(T),onBlur:a.unref(P),onChange:Y,onKeydown:fe}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(U)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(E.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(H))+" / "+a.toDisplayString(he.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var YT=je(XT,[["__file","input.vue"]]);const JT=kt(YT),Es=4,KT={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},qT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Zu=Symbol("scrollbarContextKey"),QT=qe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),eC="Thumb";var qm=je(a.defineComponent({__name:"thumb",props:QT,setup(n){const e=n,t=a.inject(Zu),i=Ue("scrollbar");t||ms(eC,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Ot?document.onselectstart:null;const h=a.computed(()=>KT[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>qT({size:e.size,move:e.move,bar:h.value})),y=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=S=>{var w;if(S.stopPropagation(),S.ctrlKey||[1,2].includes(S.button))return;(w=window.getSelection())==null||w.removeAllRanges(),b(S);const A=S.currentTarget;A&&(o.value[h.value.axis]=A[h.value.offset]-(S[h.value.client]-A.getBoundingClientRect()[h.value.direction]))},d=S=>{if(!s.value||!r.value||!t.wrapElement)return;const w=Math.abs(S.target.getBoundingClientRect()[h.value.direction]-S[h.value.client]),A=s.value[h.value.offset]/2,I=(w-A)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=I*t.wrapElement[h.value.scrollSize]/100},b=S=>{S.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},v=S=>{if(!r.value||!s.value||u===!1)return;const w=o.value[h.value.axis];if(!w)return;const A=(r.value.getBoundingClientRect()[h.value.direction]-S[h.value.client])*-1,I=s.value[h.value.offset]-w,T=(A-I)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=T*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),E(),c&&(l.value=!1)},M=()=>{c=!1,l.value=!!e.size},_=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{E(),document.removeEventListener("mouseup",g)});const E=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Vt(a.toRef(t,"scrollbarElement"),"mousemove",M),Vt(a.toRef(t,"scrollbarElement"),"mouseleave",_),(S,w)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,S.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const tC=qe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var nC=je(a.defineComponent({__name:"bar",props:tC,setup(n,{expose:e}){const t=n,i=a.inject(Zu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const y=p.offsetHeight-Es,m=p.offsetWidth-Es;s.value=p.scrollTop*100/y*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const y=p.offsetHeight-Es,m=p.offsetWidth-Es,d=y**2/p.scrollHeight,b=m**2/p.scrollWidth,v=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(y-d)/(v/(y-v)),c.value=b/(m-b)/(g/(m-g)),l.value=v+Es<y?`${v}px`:"",o.value=g+Es<m?`${g}px`:""}}),(p,y)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(qm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(qm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const iC=qe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Pr(["ariaLabel","ariaOrientation"])}),rC={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(rt)},Xu="ElScrollbar",sC=a.defineComponent({name:Xu}),oC=a.defineComponent({...sC,props:iC,emits:rC,setup(n,{expose:e,emit:t}){const i=n,r=Ue("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),y=a.computed(()=>{const E={};return i.height&&(E.height=ll(i.height)),i.maxHeight&&(E.maxHeight=ll(i.maxHeight)),[i.wrapStyle,E]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var E;f.value&&((E=p.value)==null||E.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function v(E,S){nn(E)?f.value.scrollTo(E):rt(E)&&rt(S)&&f.value.scrollTo(E,S)}const g=E=>{if(!rt(E)){St(Xu,"value must be a number");return}f.value.scrollTop=E},M=E=>{if(!rt(E)){St(Xu,"value must be a number");return}f.value.scrollLeft=E},_=()=>{var E;(E=p.value)==null||E.update()};return a.watch(()=>i.noresize,E=>{E?(s==null||s(),o==null||o()):({stop:s}=Sn(h,_),o=Vt("resize",_))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var E;_(),f.value&&((E=p.value)==null||E.handleScroll(f.value))})}),a.provide(Zu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{_()})}),a.onUpdated(()=>_()),e({wrapRef:f,update:_,scrollTo:v,setScrollTop:g,setScrollLeft:M,handleScroll:b}),(E,S)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(y)),tabindex:E.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(E.tag),{id:E.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(E.viewStyle),role:E.role,"aria-label":E.ariaLabel,"aria-orientation":E.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(E.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),E.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(nC,{key:0,ref_key:"barRef",ref:p,always:E.always,"min-size":E.minSize},null,8,["always","min-size"]))],2))}});var aC=je(oC,[["__file","scrollbar.vue"]]);const lC=kt(aC),Yu=Symbol("popper"),Qm=Symbol("popperContent"),eg=qe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),cC=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),uC=a.defineComponent({...cC,props:eg,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Yu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var dC=je(uC,[["__file","popper.vue"]]);const tg=qe({arrowOffset:{type:Number,default:5}}),hC=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),fC=a.defineComponent({...hC,props:tg,setup(n,{expose:e}){const t=n,i=Ue("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Qm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var pC=je(fC,[["__file","arrow.vue"]]);const Ju="ElOnlyChild",mC=a.defineComponent({name:Ju,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(km),s=_T((i=r==null?void 0:r.setForwardRef)!=null?i:Oo);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return St(Ju,"requires exact only one valid child."),null;const u=ng(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(St(Ju,"no valid child node found"),null)}}});function ng(n){if(!n)return null;const e=n;for(const t of e){if(nn(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return ig(t);case a.Fragment:return ng(t.children);default:return t}return ig(t)}return null}function ig(n){const e=Ue("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const rg=qe({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),gC=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),yC=a.defineComponent({...gC,props:rg,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Yu,void 0);ST(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=di(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,Cr(h)&&(f.forEach(y=>{var m;const d=t[y];d&&(h.addEventListener(y.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,y.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{gi(y[d])?h.removeAttribute(m):h.setAttribute(m,y[d])})},{immediate:!0})),Cr(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>p.removeAttribute(y))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Cr(r.value)){const h=r.value;f.forEach(p=>{const y=t[p];y&&h.removeEventListener(p.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(mC),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var vC=je(yC,[["__file","trigger.vue"]]);const Ku="focus-trap.focus-after-trapped",qu="focus-trap.focus-after-released",bC="focus-trap.focusout-prevented",sg={cancelable:!0,bubbles:!1},xC={cancelable:!0,bubbles:!1},og="focusAfterTrapped",ag="focusAfterReleased",wC=Symbol("elFocusTrap"),Qu=a.ref(),Sl=a.ref(0),ed=a.ref(0);let _l=0;const lg=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},cg=(n,e)=>{for(const t of n)if(!MC(t,e))return t},MC=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},SC=n=>{const e=lg(n),t=cg(e,n),i=cg(e.reverse(),n);return[t,i]},_C=n=>n instanceof HTMLInputElement&&"select"in n,Xi=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ed.value=window.performance.now(),n!==t&&_C(n)&&e&&n.select()}};function ug(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const EC=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=ug(n,i),n.unshift(i)},remove:i=>{var r,s;n=ug(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},TC=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Xi(i,e),document.activeElement!==t)return},dg=EC(),CC=()=>Sl.value>ed.value,El=()=>{Qu.value="pointer",Sl.value=window.performance.now()},hg=()=>{Qu.value="keyboard",Sl.value=window.performance.now()},AC=()=>(a.onMounted(()=>{_l===0&&(document.addEventListener("mousedown",El),document.addEventListener("touchstart",El),document.addEventListener("keydown",hg)),_l++}),a.onBeforeUnmount(()=>{_l--,_l<=0&&(document.removeEventListener("mousedown",El),document.removeEventListener("touchstart",El),document.removeEventListener("keydown",hg))}),{focusReason:Qu,lastUserFocusTimestamp:Sl,lastAutomatedFocusTimestamp:ed}),Tl=n=>new CustomEvent(bC,{...xC,detail:n}),RC=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[og,ag,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=AC();vT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:v,metaKey:g,currentTarget:M,shiftKey:_}=m,{loop:E}=n,S=d===Yn.tab&&!b&&!v&&!g,w=document.activeElement;if(S&&w){const A=M,[I,T]=SC(A);if(I&&T){if(!_&&w===T){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||(m.preventDefault(),E&&Xi(I,!0))}else if(_&&[I,A].includes(w)){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||(m.preventDefault(),E&&Xi(T,!0))}}else if(w===A){const C=Tl({focusReason:s.value});e("focusout-prevented",C),C.defaultPrevented||m.preventDefault()}}};a.provide(wC,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(og,m)},c=m=>e(ag,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,v=m.relatedTarget,g=b&&d.contains(b);n.trapped||v&&d.contains(v)||(i=v),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:Xi(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!gi(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const v=Tl({focusReason:s.value});e("focusout-prevented",v),v.defaultPrevented||Xi(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){dg.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const v=new Event(Ku,sg);m.addEventListener(Ku,u),m.dispatchEvent(v),v.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;tn(g)||(Xi(g),document.activeElement!==g&&(g="first")),g==="first"&&TC(lg(m),!0),(document.activeElement===d||g==="container")&&Xi(m)})}}}function y(){const m=a.unref(t);if(m){m.removeEventListener(Ku,u);const d=new CustomEvent(qu,{...sg,detail:{focusReason:s.value}});m.addEventListener(qu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!CC()||m.contains(document.activeElement))&&Xi(i??document.body),m.removeEventListener(qu,c),dg.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():y()})}),a.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function LC(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var PC=je(RC,[["render",LC],["__file","focus-trap.vue"]]);const IC=["fixed","absolute"],OC=qe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ys,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:IC,default:"absolute"}}),fg=qe({...OC,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Pr(["ariaLabel"])}),NC={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},DC=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...FC(n),...e]};return VC(s,r==null?void 0:r.modifiers),s},BC=n=>{if(Ot)return di(n)};function FC(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function VC(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const kC=0,zC=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Yu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var v;const g=a.unref(s),M=(v=a.unref(o))!=null?v:kC;return{name:"arrow",enabled:!__(g),options:{element:g,padding:M}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...DC(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>BC(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:y,update:m,forceUpdate:d,instanceRef:b}=mT(f,t,c);return a.watch(b,v=>e.value=v),a.onMounted(()=>{a.watch(()=>{var v;return(v=a.unref(f))==null?void 0:v.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:y,role:r,forceUpdate:d,update:m}},UC=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=jm(),s=Ue("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(rt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=rt(n.zIndex)?n.zIndex:r()}}},GC=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},HC=a.defineComponent({name:"ElPopperContent"}),WC=a.defineComponent({...HC,props:fg,emits:NC,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=GC(i,t),{attributes:h,arrowRef:p,contentRef:y,styles:m,instanceRef:d,role:b,update:v}=zC(i),{ariaModal:g,arrowStyle:M,contentAttrs:_,contentClass:E,contentStyle:S,updateZIndex:w}=UC(i,{styles:m,attributes:h,role:b}),A=a.inject(wl,void 0),I=a.ref();a.provide(Qm,{arrowStyle:M,arrowRef:p,arrowOffset:I}),A&&a.provide(wl,{...A,addInputId:Oo,removeInputId:Oo});let T;const P=(R=!0)=>{v(),R&&w()},C=()=>{P(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(R,L)=>{T==null||T(),T=void 0;const N=a.unref(R||y.value),x=a.unref(L||y.value);Cr(N)&&(T=a.watch([b,()=>i.ariaLabel,g,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{gi(O[D])?N.removeAttribute(B):N.setAttribute(B,O[D])})},{immediate:!0})),x!==N&&Cr(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,C,{immediate:!0})}),a.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:y,popperInstanceRef:d,updatePopper:P,contentStyle:S}),(R,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:y},a.unref(_),{style:a.unref(S),class:a.unref(E),tabindex:"-1",onMouseenter:N=>R.$emit("mouseenter",N),onMouseleave:N=>R.$emit("mouseleave",N)}),[a.createVNode(a.unref(PC),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(y),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var jC=je(WC,[["__file","content.vue"]]);const $C=kt(dC),td=Symbol("elTooltip"),fn=qe({...wT,...fg,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Pr(["ariaLabel"])}),Xo=qe({...rg,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[Yn.enter,Yn.space]}}),{useModelToggleProps:ZC,useModelToggleEmits:XC,useModelToggle:YC}=hE("visible"),JC=qe({...eg,...ZC,...fn,...Xo,...tg,showArrow:{type:Boolean,default:!0}}),KC=[...XC,"before-show","before-hide","show","hide","open","close"],qC=(n,e)=>an(n)?n.includes(e):n===e,Ts=(n,e,t)=>i=>{qC(a.unref(n),e)&&t(i)},QC=a.defineComponent({name:"ElTooltipTrigger"}),eA=a.defineComponent({...QC,props:Xo,setup(n,{expose:e}){const t=n,i=Ue("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(td,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),y=ui(h,Ts(p,"hover",l)),m=ui(h,Ts(p,"hover",u)),d=ui(h,Ts(p,"click",_=>{_.button===0&&c(_)})),b=ui(h,Ts(p,"focus",l)),v=ui(h,Ts(p,"focus",u)),g=ui(h,Ts(p,"contextmenu",_=>{_.preventDefault(),c(_)})),M=ui(h,_=>{const{code:E}=_;t.triggerKeys.includes(E)&&(_.preventDefault(),c(_))});return e({triggerRef:f}),(_,E)=>(a.openBlock(),a.createBlock(a.unref(vC),{id:a.unref(s),"virtual-ref":_.virtualRef,open:a.unref(o),"virtual-triggering":_.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(v),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(y),onMouseleave:a.unref(m),onKeydown:a.unref(M)},{default:a.withCtx(()=>[a.renderSlot(_.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var tA=je(eA,[["__file","trigger.vue"]]);const nA=qe({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var iA=je(a.defineComponent({__name:"teleport",props:nA,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const rA=kt(iA),sA=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),oA=a.defineComponent({...sA,props:fn,setup(n,{expose:e}){const t=n,{selector:i}=Vm(),r=Ue("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:y,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(td,void 0),v=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const M=a.computed(()=>a.unref(g)?!0:a.unref(c)),_=a.computed(()=>t.disabled?!1:a.unref(c)),E=a.computed(()=>t.appendTo||i.value),S=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),w=a.ref(!0),A=()=>{m(),w.value=!0},I=()=>{if(a.unref(l))return!0},T=ui(I,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),P=ui(I,()=>{a.unref(f)==="hover"&&h()}),C=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),d==null||d()},R=()=>{b==null||b()},L=()=>{y(),o=mw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},N=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?w.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(rA),{disabled:!x.teleported,to:a.unref(E)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(v),onAfterLeave:A,onBeforeEnter:C,onAfterEnter:L,onBeforeLeave:R},{default:a.withCtx(()=>[a.unref(M)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(jC),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":w.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(S)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(_),"z-index":x.zIndex,onMouseenter:a.unref(T),onMouseleave:a.unref(P),onBlur:N,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(_)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var aA=je(oA,[["__file","content.vue"]]);const lA=a.defineComponent({name:"ElTooltip"}),cA=a.defineComponent({...lA,props:JC,emits:KC,setup(n,{expose:e,emit:t}){const i=n;xT();const r=bl(),s=a.ref(),o=a.ref(),l=()=>{var v;const g=a.unref(s);g&&((v=g.popperInstanceRef)==null||v.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=YC({indicator:u,toggleReason:c}),{onOpen:y,onClose:m}=MT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>Au(i.visible)&&!p.value);a.provide(td,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:v=>{y(v)},onClose:v=>{m(v)},onToggle:v=>{a.unref(u)?m(v):y(v)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,v=>{v&&u.value&&(u.value=!1)});const b=v=>{var g,M;const _=(M=(g=o.value)==null?void 0:g.contentRef)==null?void 0:M.popperContentRef,E=(v==null?void 0:v.relatedTarget)||document.activeElement;return _&&_.contains(E)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:y,onClose:m,hide:h}),(v,g)=>(a.openBlock(),a.createBlock(a.unref($C),{ref_key:"popperRef",ref:s,role:v.role},{default:a.withCtx(()=>[a.createVNode(tA,{disabled:v.disabled,trigger:v.trigger,"trigger-keys":v.triggerKeys,"virtual-ref":v.virtualRef,"virtual-triggering":v.virtualTriggering},{default:a.withCtx(()=>[v.$slots.default?a.renderSlot(v.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(aA,{ref_key:"contentRef",ref:o,"aria-label":v.ariaLabel,"boundaries-padding":v.boundariesPadding,content:v.content,disabled:v.disabled,effect:v.effect,enterable:v.enterable,"fallback-placements":v.fallbackPlacements,"hide-after":v.hideAfter,"gpu-acceleration":v.gpuAcceleration,offset:v.offset,persistent:v.persistent,"popper-class":v.popperClass,"popper-style":v.popperStyle,placement:v.placement,"popper-options":v.popperOptions,pure:v.pure,"raw-content":v.rawContent,"reference-el":v.referenceEl,"trigger-target-el":v.triggerTargetEl,"show-after":v.showAfter,strategy:v.strategy,teleported:v.teleported,transition:v.transition,"virtual-triggering":v.virtualTriggering,"z-index":v.zIndex,"append-to":v.appendTo},{default:a.withCtx(()=>[a.renderSlot(v.$slots,"content",{},()=>[v.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:v.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(v.content),1))]),v.showArrow?(a.openBlock(),a.createBlock(a.unref(pC),{key:0,"arrow-offset":v.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var uA=je(cA,[["__file","tooltip.vue"]]);const nd=kt(uA),pg=Symbol("buttonGroupContextKey"),dA=(n,e)=>{rE({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(pg,void 0),i=Wu("button"),{form:r}=Zo(),s=_s(a.computed(()=>t==null?void 0:t.size)),o=Ml(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const v=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(v.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},id=qe({size:Ss,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ji},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ji,default:()=>am},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),hA={click:n=>n instanceof MouseEvent};function Wt(n,e){fA(n)&&(n="100%");var t=pA(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 Cl(n){return Math.min(1,Math.max(0,n))}function fA(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function pA(n){return typeof n=="string"&&n.indexOf("%")!==-1}function mg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Al(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Ir(n){return n.length===1?"0"+n:String(n)}function mA(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function gg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function rd(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 gA(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=rd(l,o,n+1/3),r=rd(l,o,n),s=rd(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function yg(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(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:u,v:o}}function yA(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function vg(n,e,t,i){var r=[Ir(Math.round(n).toString(16)),Ir(Math.round(e).toString(16)),Ir(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 vA(n,e,t,i,r){var s=[Ir(Math.round(n).toString(16)),Ir(Math.round(e).toString(16)),Ir(Math.round(t).toString(16)),Ir(bA(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 bA(n){return Math.round(parseFloat(n)*255).toString(16)}function bg(n){return pn(n)/255}function pn(n){return parseInt(n,16)}function xA(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var sd={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 wA(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=_A(n)),typeof n=="object"&&(xi(n.r)&&xi(n.g)&&xi(n.b)?(e=mA(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):xi(n.h)&&xi(n.s)&&xi(n.v)?(i=Al(n.s),r=Al(n.v),e=yA(n.h,i,r),o=!0,l="hsv"):xi(n.h)&&xi(n.s)&&xi(n.l)&&(i=Al(n.s),s=Al(n.l),e=gA(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=mg(t),{ok:o,format:n.format||l,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 MA="[-\\+]?\\d+%?",SA="[-\\+]?\\d*\\.\\d+%?",Yi="(?:".concat(SA,")|(?:").concat(MA,")"),od="[\\s|\\(]+(".concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")\\s*\\)?"),ad="[\\s|\\(]+(".concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")[,|\\s]+(").concat(Yi,")\\s*\\)?"),Nn={CSS_UNIT:new RegExp(Yi),rgb:new RegExp("rgb"+od),rgba:new RegExp("rgba"+ad),hsl:new RegExp("hsl"+od),hsla:new RegExp("hsla"+ad),hsv:new RegExp("hsv"+od),hsva:new RegExp("hsva"+ad),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 _A(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(sd[n])n=sd[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Nn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Nn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Nn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Nn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Nn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Nn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Nn.hex8.exec(n),t?{r:pn(t[1]),g:pn(t[2]),b:pn(t[3]),a:bg(t[4]),format:e?"name":"hex8"}:(t=Nn.hex6.exec(n),t?{r:pn(t[1]),g:pn(t[2]),b:pn(t[3]),format:e?"name":"hex"}:(t=Nn.hex4.exec(n),t?{r:pn(t[1]+t[1]),g:pn(t[2]+t[2]),b:pn(t[3]+t[3]),a:bg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Nn.hex3.exec(n),t?{r:pn(t[1]+t[1]),g:pn(t[2]+t[2]),b:pn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function xi(n){return!!Nn.CSS_UNIT.exec(String(n))}var EA=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=xA(e)),this.originalInput=e;var r=wA(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,l=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),l<=.03928?r=l/12.92:r=Math.pow((l+.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=mg(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=yg(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=yg(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=gg(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=gg(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),vg(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),vA(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(Wt(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(Wt(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="#"+vg(this.r,this.g,this.b,!1),t=0,i=Object.entries(sd);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??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=Cl(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=Cl(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=Cl(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=Cl(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=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%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}();function Ji(n,e=20){return n.mix("#141414",e).toString()}function TA(n){const e=Ml(),t=Ue("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new EA(r),l=n.dark?o.tint(20).toString():Ji(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Ji(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Ji(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Ji(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Ji(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Ji(o,80):o.tint(80).toString());else{const u=n.dark?Ji(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Ji(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const CA=a.defineComponent({name:"ElButton"}),AA=a.defineComponent({...CA,props:id,emits:hA,setup(n,{expose:e,emit:t}){const i=n,r=TA(i),s=Ue("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=dA(i,t),y=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(y),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(mt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(mt),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var RA=je(AA,[["__file","button.vue"]]);const LA={size:id.size,type:id.type},PA=a.defineComponent({name:"ElButtonGroup"}),IA=a.defineComponent({...PA,props:LA,setup(n){const e=n;a.provide(pg,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ue("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var xg=je(IA,[["__file","button-group.vue"]]);const Cs=kt(RA,{ButtonGroup:xg});yi(xg);var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function OA(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Rl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const qi=new Map;if(Ot){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of qi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function wg(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:Cr(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),y=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||y||e.value(i,r)}}const NA={beforeMount(n,e){qi.has(n)||qi.set(n,[]),qi.get(n).push({documentHandler:wg(n,e),bindingFn:e.value})},updated(n,e){qi.has(n)||qi.set(n,[]);const t=qi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:wg(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){qi.delete(n)}},DA=100,BA=600,Mg={beforeMount(n,e){const t=e.value,{interval:i=DA,delay:r=BA}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},ld=qe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:dm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),FA={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},VA=a.defineComponent({name:"ElTag"}),kA=a.defineComponent({...VA,props:ld,emits:FA,setup(n,{emit:e}){const t=n,i=_s(),r=Ue("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:y}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",y)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(mt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(Pu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var zA=je(kA,[["__file","tag.vue"]]);const UA=kt(zA),Sg=Symbol("rowContextKey"),GA=qe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),HA=a.defineComponent({name:"ElRow"}),WA=a.defineComponent({...HA,props:GA,setup(n){const e=n,t=Ue("row"),i=a.computed(()=>e.gutter);a.provide(Sg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var jA=je(WA,[["__file","row.vue"]]);const qn=kt(jA),$A=qe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>vi({})},sm:{type:Ve([Number,Object]),default:()=>vi({})},md:{type:Ve([Number,Object]),default:()=>vi({})},lg:{type:Ve([Number,Object]),default:()=>vi({})},xl:{type:Ve([Number,Object]),default:()=>vi({})}}),ZA=a.defineComponent({name:"ElCol"}),XA=a.defineComponent({...ZA,props:$A,setup(n){const e=n,{gutter:t}=a.inject(Sg,{gutter:a.computed(()=>0)}),i=Ue("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];rt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{rt(e[c])?o.push(i.b(`${c}-${e[c]}`)):nn(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var YA=je(XA,[["__file","col.vue"]]);const Dn=kt(YA),_g=n=>rt(n)||tn(n)||an(n),JA=qe({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>vi([])}}),KA={[ft]:_g,[$i]:_g},Eg=Symbol("collapseContextKey"),qA=(n,e)=>{const t=a.ref(Xn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(ft,o),e($i,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Xn(n.modelValue),{deep:!0}),a.provide(Eg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},QA=()=>{const n=Ue("collapse");return{rootKls:a.computed(()=>n.b())}},e2=a.defineComponent({name:"ElCollapse"}),t2=a.defineComponent({...e2,props:JA,emits:KA,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=qA(i,t),{rootKls:o}=QA();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var n2=je(t2,[["__file","collapse.vue"]]);const i2=a.defineComponent({name:"ElCollapseTransition"}),r2=a.defineComponent({...i2,setup(n){const e=Ue("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var s2=je(r2,[["__file","collapse-transition.vue"]]);const o2=kt(s2),a2=qe({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:ji,default:Wi},disabled:Boolean}),l2=n=>{const e=a.inject(Eg),{namespace:t}=Ue("collapse"),i=a.ref(!1),r=a.ref(!1),s=Hu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},c2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ue("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},u2=a.defineComponent({name:"ElCollapseItem"}),d2=a.defineComponent({...u2,props:a2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=l2(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:y,scopedContentId:m,scopedHeadId:d}=c2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(mt),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(o2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(y))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var Tg=je(d2,[["__file","collapse-item.vue"]]);const Cg=kt(n2,{CollapseItem:Tg}),Ag=yi(Tg),h2=a.defineComponent({name:"ElContainer"}),f2=a.defineComponent({...h2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ue("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var p2=je(f2,[["__file","container.vue"]]);const m2=a.defineComponent({name:"ElAside"}),g2=a.defineComponent({...m2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ue("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Rg=je(g2,[["__file","aside.vue"]]);const y2=a.defineComponent({name:"ElFooter"}),v2=a.defineComponent({...y2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Lg=je(v2,[["__file","footer.vue"]]);const b2=a.defineComponent({name:"ElHeader"}),x2=a.defineComponent({...b2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ue("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var Pg=je(x2,[["__file","header.vue"]]);const w2=a.defineComponent({name:"ElMain"}),M2=a.defineComponent({...w2,setup(n){const e=Ue("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Ig=je(M2,[["__file","main.vue"]]);const Qn=kt(p2,{Aside:Rg,Footer:Lg,Header:Pg,Main:Ig});yi(Rg);const Og=yi(Lg),S2=yi(Pg),wi=yi(Ig),_2=a.defineComponent({inheritAttrs:!1});function E2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var T2=je(_2,[["render",E2],["__file","collection.vue"]]);const C2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function A2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var R2=je(C2,[["render",A2],["__file","collection-item.vue"]]);const L2="data-el-collection-item",P2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...T2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${L2}]`));return[...u.values()].sort((y,m)=>h.indexOf(y.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...R2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},cd=qe({trigger:Xo.trigger,effect:{...fn.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:fn.teleported});qe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ji}}),qe({onKeydown:{type:Ve(Function)}}),P2("Dropdown");const I2=qe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Ss,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||rt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Pr(["ariaLabel"])}),O2={[$i]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Ar]:n=>rt(n)||gi(n),[ft]:n=>rt(n)||gi(n)},N2=a.defineComponent({name:"ElInputNumber"}),D2=a.defineComponent({...N2,props:I2,emits:O2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=fl(),s=Ue("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=Zo(),c=a.computed(()=>rt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>rt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const N=v(i.step);return Pn(i.precision)?Math.max(v(i.modelValue),N):(N>i.precision&&St("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),y=_s(),m=Ml(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let N=l.currentValue;if(gi(N))return"";if(rt(N)){if(Number.isNaN(N))return"";Pn(i.precision)||(N=N.toFixed(i.precision))}return N}),b=(N,x)=>{if(Pn(x)&&(x=h.value),x===0)return Math.round(N);let O=String(N);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return N;const U=O.length;return O.charAt(U-1)==="5"&&(O=`${O.slice(0,Math.max(0,U-1))}6`),Number.parseFloat(Number(O).toFixed(x))},v=N=>{if(gi(N))return 0;const x=N.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},g=(N,x=1)=>rt(N)?b(N+i.step*x):l.currentValue,M=()=>{if(i.readonly||m.value||f.value)return;const N=Number(d.value)||0,x=g(N);S(x),t(Ar,l.currentValue),R()},_=()=>{if(i.readonly||m.value||c.value)return;const N=Number(d.value)||0,x=g(N,-1);S(x),t(Ar,l.currentValue),R()},E=(N,x)=>{const{max:O,min:B,step:D,precision:k,stepStrictly:U,valueOnClear:H}=i;O<B&&ms("InputNumber","min should not be greater than max.");let X=Number(N);if(gi(N)||Number.isNaN(X))return null;if(N===""){if(H===null)return null;X=tn(H)?{min:B,max:O}[H]:H}return U&&(X=b(Math.round(X/D)*D,k),X!==N&&x&&t(ft,X)),Pn(k)||(X=b(X,k)),(X>O||X<B)&&(X=X>O?O:B,x&&t(ft,X)),X},S=(N,x=!0)=>{var O;const B=l.currentValue,D=E(N);if(!x){t(ft,D);return}B===D&&N||(l.userInput=null,t(ft,D),B!==D&&t($i,D,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>St(k))),l.currentValue=D)},w=N=>{l.userInput=N;const x=N===""?null:Number(N);t(Ar,x),S(x,!1)},A=N=>{const x=N!==""?Number(N):"";(rt(x)&&!Number.isNaN(x)||N==="")&&S(x),R(),l.userInput=null},I=()=>{var N,x;(x=(N=o.value)==null?void 0:N.focus)==null||x.call(N)},T=()=>{var N,x;(x=(N=o.value)==null?void 0:N.blur)==null||x.call(N)},P=N=>{t("focus",N)},C=N=>{var x;l.userInput=null,t("blur",N),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>St(O)))},R=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=N=>{document.activeElement===N.target&&N.preventDefault()};return a.watch(()=>i.modelValue,(N,x)=>{const O=E(N,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var N;const{min:x,max:O,modelValue:B}=i,D=(N=o.value)==null?void 0:N.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(O)?D.setAttribute("aria-valuemax",String(O)):D.removeAttribute("aria-valuemax"),Number.isFinite(x)?D.setAttribute("aria-valuemin",String(x)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),D.setAttribute("aria-disabled",String(m.value)),!rt(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(ft,k)}D.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var N,x;const O=(N=o.value)==null?void 0:N.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:I,blur:T}),(N,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(y)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!N.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(_,["enter"])},[a.renderSlot(N.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(Ru),{key:0})):(a.openBlock(),a.createBlock(a.unref(Z_),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),_]]):a.createCommentVNode("v-if",!0),N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(M,["enter"])},[a.renderSlot(N.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(mt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(F_),{key:0})):(a.openBlock(),a.createBlock(a.unref(ul),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Mg),M]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(JT),{id:N.id,ref_key:"input",ref:o,type:"number",step:N.step,"model-value":a.unref(d),placeholder:N.placeholder,readonly:N.readonly,disabled:a.unref(m),size:a.unref(y),max:N.max,min:N.min,name:N.name,"aria-label":N.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(M,["prevent"]),["up"]),a.withKeys(a.withModifiers(_,["prevent"]),["down"])],onBlur:C,onFocus:P,onInput:w,onChange:A},a.createSlots({_:2},[N.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"prefix")])}:void 0,N.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var B2=je(D2,[["__file","input-number.vue"]]);const Mi=kt(B2),Ng=Symbol("ElSelectGroup"),Ll=Symbol("ElSelect");function F2(n,e){const t=a.inject(Ll),i=a.inject(Ng,{disabled:!1}),r=a.computed(()=>f(Xn(t.props.modelValue),n.value)),s=a.computed(()=>{var y;if(t.props.multiple){const m=Xn((y=t.props.modelValue)!=null?y:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(nn(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(y=[],m)=>{if(nn(n.value)){const d=t.props.valueKey;return y&&y.some(b=>a.toRaw(pi(b,d))===pi(m,d))}else return y&&y.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=y=>{const m=new RegExp(L_(y),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(y,m)=>{const{remote:d,valueKey:b}=t.props;if(y!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&nn(y)&&nn(m)&&y[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const V2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ue("select"),t=bl(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=F2(n,r),{visible:h,hover:p}=a.toRefs(r),y=a.getCurrentInstance().proxy;u.onOptionCreate(y),a.onBeforeUnmount(()=>{const d=y.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(M=>M.value===y.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===y&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,y)});function m(){l.value||u.handleOptionSelect(y)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function k2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var ud=je(V2,[["render",k2],["__file","option.vue"]]);const z2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(Ll),e=Ue("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),Sn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function U2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var G2=je(z2,[["render",U2],["__file","select-dropdown.vue"]]);const H2=11,W2=(n,e)=>{const{t}=fl(),i=bl(),r=Ue("select"),s=Ue("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),y=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),v=a.ref(null),g=a.ref(null),{isComposing:M,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S}=Xm({afterComposition:ue=>se(ue)}),{wrapperRef:w,isFocused:A}=Zm(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!I.value&&(I.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(ue){var xe,Te;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(ue))||((Te=f.value)==null?void 0:Te.isFocusInsideContent(ue))},afterBlur(){I.value=!1,o.menuVisibleOnFocus=!1}}),I=a.ref(!1),T=a.ref(),{form:P,formItem:C}=Zo(),{inputId:R}=$u(n,{formItemContext:C}),{valueOnClear:L,isEmptyValue:N}=OT(n),x=a.computed(()=>n.disabled||(P==null?void 0:P.disabled)),O=a.computed(()=>an(n.modelValue)?n.modelValue.length>0:!N(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",D.value&&I.value)),U=a.computed(()=>(C==null?void 0:C.validateState)||""),H=a.computed(()=>um[U.value]),X=a.computed(()=>n.remote?300:0),re=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&j.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),j=a.computed(()=>G.value.filter(ue=>ue.visible).length),G=a.computed(()=>{const ue=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(Te=>{const Pe=ue.findIndex(Ne=>Ne.value===Te);Pe>-1&&xe.push(ue[Pe])}),xe.length>=ue.length?xe:ue}),W=a.computed(()=>Array.from(o.cachedOptions.values())),K=a.computed(()=>{const ue=G.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!ue}),ee=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||G.value.forEach(ue=>{var xe;(xe=ue.updateOption)==null||xe.call(ue,o.inputValue)})},q=_s(),ie=a.computed(()=>["small"].includes(q.value)?"small":"default"),Y=a.computed({get(){return I.value&&re.value!==!1},set(ue){I.value=ue}}),te=a.computed(()=>{if(n.multiple&&!Pn(n.modelValue))return Xn(n.modelValue).length===0&&!o.inputValue;const ue=an(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||Pn(ue)?!o.inputValue:!0}),F=a.computed(()=>{var ue;const xe=(ue=n.placeholder)!=null?ue:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),$=a.computed(()=>au?null:"mouseenter");a.watch(()=>n.modelValue,(ue,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",Q("")),z(),!Cu(ue,xe)&&n.validateEvent&&(C==null||C.validate("change").catch(Te=>St(Te)))},{flush:"post",deep:!0}),a.watch(()=>I.value,ue=>{ue?Q(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",ue)}),a.watch(()=>o.options.entries(),()=>{var ue;if(!Ot)return;const xe=((ue=l.value)==null?void 0:ue.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!Pn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&z(),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value&&V()},{flush:"post"}),a.watch(()=>o.hoveringIndex,ue=>{rt(ue)&&ue>-1?T.value=G.value[ue]||{}:T.value={},G.value.forEach(xe=>{xe.hover=T.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||ee()});const Q=ue=>{o.previousQuery===ue||M.value||(o.previousQuery=ue,n.filterable&&Jt(n.filterMethod)?n.filterMethod(ue):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(ue),n.defaultFirstOption&&(n.filterable||n.remote)&&j.value?a.nextTick(V):a.nextTick(ae))},V=()=>{const ue=G.value.filter(Pe=>Pe.visible&&!Pe.disabled&&!Pe.states.groupDisabled),xe=ue.find(Pe=>Pe.created),Te=ue[0];o.hoveringIndex=ot(G.value,xe||Te)},z=()=>{if(n.multiple)o.selectedLabel="";else{const xe=an(n.modelValue)?n.modelValue[0]:n.modelValue,Te=oe(xe);o.selectedLabel=Te.currentLabel,o.selected=[Te];return}const ue=[];Pn(n.modelValue)||Xn(n.modelValue).forEach(xe=>{ue.push(oe(xe))}),o.selected=ue},oe=ue=>{let xe;const Te=lu(ue).toLowerCase()==="object",Pe=lu(ue).toLowerCase()==="null",Ne=lu(ue).toLowerCase()==="undefined";for(let Ke=o.cachedOptions.size-1;Ke>=0;Ke--){const It=W.value[Ke];if(Te?pi(It.value,n.valueKey)===pi(ue,n.valueKey):It.value===ue){xe={value:ue,currentLabel:It.currentLabel,get isDisabled(){return It.isDisabled}};break}}if(xe)return xe;const ze=Te?ue.label:!Pe&&!Ne?ue:"";return{value:ue,currentLabel:ze}},ae=()=>{o.hoveringIndex=G.value.findIndex(ue=>o.selected.some(xe=>Me(xe)===Me(ue)))},le=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},fe=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},be=()=>{o.collapseItemWidth=v.value.getBoundingClientRect().width},ye=()=>{var ue,xe;(xe=(ue=c.value)==null?void 0:ue.updatePopper)==null||xe.call(ue)},he=()=>{var ue,xe;(xe=(ue=f.value)==null?void 0:ue.updatePopper)==null||xe.call(ue)},ve=()=>{o.inputValue.length>0&&!I.value&&(I.value=!0),Q(o.inputValue)},se=ue=>{if(o.inputValue=ue.target.value,n.remote)we();else return ve()},we=Tu(()=>{ve()},X.value),pe=ue=>{Cu(n.modelValue,ue)||e($i,ue)},ge=ue=>S_(ue,xe=>!o.disabledOptions.has(xe)),Ee=ue=>{if(n.multiple&&ue.code!==Yn.delete&&ue.target.value.length<=0){const xe=Xn(n.modelValue).slice(),Te=ge(xe);if(Te<0)return;const Pe=xe[Te];xe.splice(Te,1),e(ft,xe),pe(xe),e("remove-tag",Pe)}},He=(ue,xe)=>{const Te=o.selected.indexOf(xe);if(Te>-1&&!x.value){const Pe=Xn(n.modelValue).slice();Pe.splice(Te,1),e(ft,Pe),pe(Pe),e("remove-tag",xe.value)}ue.stopPropagation(),Mt()},tt=ue=>{ue.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const Te of o.selected)Te.isDisabled&&xe.push(Te.value);e(ft,xe),pe(xe),o.hoveringIndex=-1,I.value=!1,e("clear"),Mt()},Ie=ue=>{var xe;if(n.multiple){const Te=Xn((xe=n.modelValue)!=null?xe:[]).slice(),Pe=ot(Te,ue.value);Pe>-1?Te.splice(Pe,1):(n.multipleLimit<=0||Te.length<n.multipleLimit)&&Te.push(ue.value),e(ft,Te),pe(Te),ue.created&&Q(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(ft,ue.value),pe(ue.value),I.value=!1;Mt(),!I.value&&a.nextTick(()=>{Le(ue)})},ot=(ue=[],xe)=>{if(!nn(xe))return ue.indexOf(xe);const Te=n.valueKey;let Pe=-1;return ue.some((Ne,ze)=>a.toRaw(pi(Ne,Te))===pi(xe,Te)?(Pe=ze,!0):!1),Pe},Le=ue=>{var xe,Te,Pe,Ne,ze;const Fe=an(ue)?ue[0]:ue;let Ke=null;if(Fe!=null&&Fe.value){const It=G.value.filter(Gt=>Gt.value===Fe.value);It.length>0&&(Ke=It[0].$el)}if(c.value&&Ke){const It=(Ne=(Pe=(Te=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:Te.contentRef)==null?void 0:Pe.querySelector)==null?void 0:Ne.call(Pe,`.${r.be("dropdown","wrap")}`);It&&I_(It,Ke)}(ze=g.value)==null||ze.handleScroll()},Ye=ue=>{o.options.set(ue.value,ue),o.cachedOptions.set(ue.value,ue),ue.disabled&&o.disabledOptions.set(ue.value,ue)},We=(ue,xe)=>{o.options.get(ue)===xe&&o.options.delete(ue)},it=a.computed(()=>{var ue,xe;return(xe=(ue=c.value)==null?void 0:ue.popperRef)==null?void 0:xe.contentRef}),et=()=>{o.isBeforeHide=!1,a.nextTick(()=>Le(o.selected))},Mt=()=>{var ue;(ue=h.value)==null||ue.focus()},pt=()=>{var ue;(ue=h.value)==null||ue.blur()},hn=ue=>{tt(ue)},Mn=()=>{I.value=!1,A.value&&pt()},jn=()=>{o.inputValue.length>0?o.inputValue="":I.value=!1},us=()=>{x.value||(au&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:I.value=!I.value)},ne=()=>{I.value?G.value[o.hoveringIndex]&&Ie(G.value[o.hoveringIndex]):us()},Me=ue=>nn(ue.value)?pi(ue.value,n.valueKey):ue.value,Ce=a.computed(()=>G.value.filter(ue=>ue.visible).every(ue=>ue.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),Je=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),Z=ue=>{if(!I.value){I.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||M.value)&&!Ce.value){ue==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):ue==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=G.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&Z(ue),a.nextTick(()=>Le(T.value))}},de=()=>{if(!u.value)return 0;const ue=window.getComputedStyle(u.value);return Number.parseFloat(ue.gap||"6px")},ce=a.computed(()=>{const ue=de();return{maxWidth:`${v.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-ue:o.selectionWidth}px`}}),me=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Se=a.computed(()=>({width:`${Math.max(o.calculatorWidth,H2)}px`}));return Sn(u,le),Sn(p,fe),Sn(d,ye),Sn(w,ye),Sn(b,he),Sn(v,be),a.onMounted(()=>{z()}),{inputId:R,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:A,expanded:I,optionsArray:G,hoverOption:T,selectSize:q,filteredOptionsCount:j,resetCalculatorWidth:fe,updateTooltip:ye,updateTagTooltip:he,debouncedOnInputChange:we,onInput:se,deletePrevTag:Ee,deleteTag:He,deleteSelected:tt,handleOptionSelect:Ie,scrollToOption:Le,hasModelValue:O,shouldShowPlaceholder:te,currentPlaceholder:F,mouseEnterEventName:$,showClose:B,iconComponent:D,iconReverse:k,validateState:U,validateIcon:H,showNewOption:K,updateOptions:ee,collapseTagSize:ie,setSelected:z,selectDisabled:x,emptyText:re,handleCompositionStart:_,handleCompositionUpdate:E,handleCompositionEnd:S,onOptionCreate:Ye,onOptionDestroy:We,handleMenuEnter:et,focus:Mt,blur:pt,handleClearClick:hn,handleClickOutside:Mn,handleEsc:jn,toggleMenu:us,selectOption:ne,getValueKey:Me,navigateOptions:Z,dropdownMenuVisible:Y,showTagList:Be,collapseTagList:Je,tagStyle:ce,collapseTagStyle:me,inputStyle:Se,popperRef:it,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:y,suffixRef:m,selectRef:l,wrapperRef:w,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:v}};var j2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(Ll);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){an(c)&&c.forEach(f=>{var h,p,y,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!tn(f.children)&&!an(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(y=f.children)==null?void 0:y.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):an(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),Cu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const $2=qe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ss,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:fn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ji,default:Lu},fitInputWidth:Boolean,suffixIcon:{type:ji,default:Ru},tagType:{...ld.type,default:"info"},tagEffect:{...ld.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:ys,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...IT,...Pr(["ariaLabel"])}),Dg="ElSelect",Z2=a.defineComponent({name:Dg,componentName:Dg,components:{ElSelectMenu:G2,ElOption:ud,ElOptions:j2,ElTag:UA,ElScrollbar:lC,ElTooltip:nd,ElIcon:mt},directives:{ClickOutside:NA},props:$2,emits:[ft,$i,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return an(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=W2(i,e);return a.provide(Ll,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function X2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),y=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[y,n.handleClickOutside,n.popperRef]])}var Y2=je(Z2,[["render",X2],["__file","select.vue"]]);const J2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ue("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Ng,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Xn(c),h=[];return f.forEach(p=>{var y,m;o(p)?h.push(p.component.proxy):(y=p.children)!=null&&y.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Sw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function K2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var Bg=je(J2,[["render",K2],["__file","option-group.vue"]]);const As=kt(Y2,{Option:ud,OptionGroup:Bg}),Rs=yi(ud);yi(Bg);const q2=qe({trigger:Xo.trigger,placement:cd.placement,disabled:Xo.disabled,visible:fn.visible,transition:fn.transition,popperOptions:cd.popperOptions,tabindex:cd.tabindex,content:fn.content,popperStyle:fn.popperStyle,popperClass:fn.popperClass,enterable:{...fn.enterable,default:!0},effect:{...fn.effect,default:"light"},teleported:fn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Q2={"update:visible":n=>Au(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},eR="onUpdate:visible",tR=a.defineComponent({name:"ElPopover"}),nR=a.defineComponent({...tR,props:q2,emits:Q2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[eR]),s=Ue("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:ll(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},y=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,v)=>(a.openBlock(),a.createBlock(a.unref(nd),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:y,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var iR=je(nR,[["__file","popover.vue"]]);const Fg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var rR={mounted(n,e){Fg(n,e)},updated(n,e){Fg(n,e)}};const sR=Q_(rR,"popover"),Pl=kt(iR,{directive:sR}),Vg=Symbol("sliderContextKey"),oR=qe({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Ss,inputSize:Ss,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ys,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},...Pr(["ariaLabel"])}),dd=n=>rt(n)||an(n)&&n.every(rt),aR={[ft]:dd,[Ar]:dd,[$i]:dd},lR=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Vt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},cR=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),uR=(n,e,t)=>{const{form:i,formItem:r}=Zo(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),y=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:y.value}:{width:p.value,left:y.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},v=C=>{const R=n.min+C*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-R)<Math.abs(h.value-R)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},g=C=>{const R=v(C);return R.value.setPosition(C),R},M=C=>{e.firstValue=C??n.min,E(n.range?[f.value,h.value]:C??n.min)},_=C=>{e.secondValue=C,n.range&&E([f.value,h.value])},E=C=>{t(ft,C),t(Ar,C)},S=async()=>{await a.nextTick(),t($i,n.range?[f.value,h.value]:n.modelValue)},w=C=>{var R,L,N,x,O,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const k=(N=(L=(R=C.touches)==null?void 0:R.item(0))==null?void 0:L.clientY)!=null?N:C.clientY;D=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=C.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:C.clientX,U=s.value.getBoundingClientRect().left;D=(k-U)/e.sliderSize*100}if(!(D<0||D>100))return g(D)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:S,onSliderWrapperPrevent:C=>{var R,L;((R=u.firstButton.value)!=null&&R.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&C.preventDefault()},onSliderClick:C=>{w(C)&&S()},onSliderDown:async C=>{const R=w(C);R&&(await a.nextTick(),R.value.onButtonDown(C))},onSliderMarkerDown:C=>{c.value||e.dragging||g(C)},setFirstValue:M,setSecondValue:_}},{left:dR,down:hR,right:fR,up:pR,home:mR,end:gR,pageUp:yR,pageDown:vR}=Yn,bR=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=Tu(()=>{t.value&&(r.value=!0)},50),u=Tu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},xR=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:y}=a.inject(Vg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:v,hideTooltip:g}=bR(n,f,l),M=a.ref(),_=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),E=a.computed(()=>n.vertical?{bottom:_.value}:{left:_.value}),S=()=>{e.hovering=!0,v()},w=()=>{e.hovering=!1,e.dragging||g()},A=H=>{i.value||(H.preventDefault(),B(H),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),M.value.focus())},I=H=>{i.value||(e.newPosition=Number.parseFloat(_.value)+H/(s.value-r.value)*100,U(e.newPosition),h())},T=()=>{I(-o.value)},P=()=>{I(o.value)},C=()=>{I(-o.value*4)},R=()=>{I(o.value*4)},L=()=>{i.value||(U(0),h())},N=()=>{i.value||(U(100),h())},x=H=>{let X=!0;[dR,hR].includes(H.key)?T():[fR,pR].includes(H.key)?P():H.key===mR?L():H.key===gR?N():H.key===vR?C():H.key===yR?R():X=!1,X&&H.preventDefault()},O=H=>{let X,re;return H.type.startsWith("touch")?(re=H.touches[0].clientY,X=H.touches[0].clientX):(re=H.clientY,X=H.clientX),{clientX:X,clientY:re}},B=H=>{e.dragging=!0,e.isClick=!0;const{clientX:X,clientY:re}=O(H);n.vertical?e.startY=re:e.startX=X,e.startPosition=Number.parseFloat(_.value),e.newPosition=e.startPosition},D=H=>{if(e.dragging){e.isClick=!1,v(),p();let X;const{clientX:re,clientY:j}=O(H);n.vertical?(e.currentY=j,X=(e.startY-e.currentY)/c.value*100):(e.currentX=re,X=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+X,U(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||U(e.newPosition),h()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},U=async H=>{if(H===null||Number.isNaN(+H))return;H<0?H=0:H>100&&(H=100);const X=100/((s.value-r.value)/o.value);let j=Math.round(H/X)*X*(s.value-r.value)*.01+r.value;j=Number.parseFloat(j.toFixed(u.value)),j!==n.modelValue&&t(ft,j),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&v(),m.value.updatePopper()};return a.watch(()=>e.dragging,H=>{y(H)}),Vt(M,"touchstart",A,{passive:!1}),{disabled:i,button:M,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:E,formatValue:b,handleMouseEnter:S,handleMouseLeave:w,onButtonDown:A,onKeyDown:x,setPosition:U}},wR=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return St("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),MR=(n,e,t,i,r,s)=>{const o=c=>{r(ft,c),r(Ar,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&ms("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>St(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>St(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},SR=qe({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ys,default:"top"}}),_R={[ft]:n=>rt(n)},ER=a.defineComponent({name:"ElSliderButton"}),TR=a.defineComponent({...ER,props:SR,emits:_R,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:y,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:v}=xR(i,s,t),{hovering:g,dragging:M}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:v,hovering:g,dragging:M}),(_,E)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(M)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(y),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(y),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(nd),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:_.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":_.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(M)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var kg=je(TR,[["__file","button.vue"]]);const CR=qe({mark:{type:Ve([String,Object]),default:void 0}});var AR=a.defineComponent({name:"ElSliderMarker",props:CR,setup(n){const e=Ue("slider"),t=a.computed(()=>tn(n.mark)?n.mark:n.mark.label),i=a.computed(()=>tn(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const RR=a.defineComponent({name:"ElSlider"}),LR=a.defineComponent({...RR,props:oR,emits:aR,setup(n,{expose:e,emit:t}){const i=n,r=Ue("slider"),{t:s}=fl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:y,runwayStyle:m,barStyle:d,resetSize:b,emitChange:v,onSliderWrapperPrevent:g,onSliderClick:M,onSliderDown:_,onSliderMarkerDown:E,setFirstValue:S,setSecondValue:w}=uR(i,o,t),{stops:A,getStopStyle:I}=wR(i,o,p,y),{inputId:T,isLabeledByFormItem:P}=$u(i,{formItemContext:l}),C=_s(),R=a.computed(()=>i.inputSize||C.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),N=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(X.value):`${X.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(re.value):`${re.value}`),D=a.computed(()=>[r.b(),r.m(C.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=cR(i);MR(i,o,p,y,t,l);const U=a.computed(()=>{const W=[i.min,i.max,i.step].map(K=>{const ee=`${K}`.split(".")[1];return ee?ee.length:0});return Math.max.apply(null,W)}),{sliderWrapper:H}=lR(i,o,b),{firstValue:X,secondValue:re,sliderSize:j}=a.toRefs(o),G=W=>{o.dragging=W};return Vt(H,"touchstart",g,{passive:!1}),Vt(H,"touchmove",g,{passive:!1}),a.provide(Vg,{...a.toRefs(i),sliderSize:j,disabled:h,precision:U,emitChange:v,resetSize:b,updateDragging:G}),e({onSliderClick:M}),(W,K)=>{var ee,q;return a.openBlock(),a.createElementBlock("div",{id:W.range?a.unref(T):void 0,ref_key:"sliderWrapper",ref:H,class:a.normalizeClass(a.unref(D)),role:W.range?"group":void 0,"aria-label":W.range&&!a.unref(P)?a.unref(L):void 0,"aria-labelledby":W.range&&a.unref(P)?(ee=a.unref(l))==null?void 0:ee.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":W.showInput&&!W.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(_),onTouchstartPassive:a.unref(_)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(kg,{id:W.range?void 0:a.unref(T),ref_key:"firstButton",ref:c,"model-value":a.unref(X),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":W.range||!a.unref(P)?a.unref(N):void 0,"aria-labelledby":!W.range&&a.unref(P)?(q=a.unref(l))==null?void 0:q.labelId:void 0,"aria-valuemin":W.min,"aria-valuemax":W.range?a.unref(re):W.max,"aria-valuenow":a.unref(X),"aria-valuetext":a.unref(x),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(S)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),W.range?(a.openBlock(),a.createBlock(kg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(re),vertical:W.vertical,"tooltip-class":W.tooltipClass,placement:W.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(X),"aria-valuemax":W.max,"aria-valuenow":a.unref(re),"aria-valuetext":a.unref(B),"aria-orientation":W.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(w)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),W.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(A),(ie,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(I)(ie))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(ie,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,style:a.normalizeStyle(a.unref(I)(ie.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(ie,Y)=>(a.openBlock(),a.createBlock(a.unref(AR),{key:Y,mark:ie.mark,style:a.normalizeStyle(a.unref(I)(ie.position)),onMousedown:a.withModifiers(te=>a.unref(E)(ie.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),W.showInput&&!W.range?(a.openBlock(),a.createBlock(a.unref(Mi),{key:0,ref:"input","model-value":a.unref(X),class:a.normalizeClass(a.unref(r).e("input")),step:W.step,disabled:a.unref(h),controls:W.showInputControls,min:W.min,max:W.max,precision:a.unref(U),debounce:W.debounce,size:a.unref(R),"onUpdate:modelValue":a.unref(S),onChange:a.unref(v)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var PR=je(LR,[["__file","slider.vue"]]);const Cn=kt(PR),Il=Symbol("tabsRootContextKey"),IR=qe({tabs:{type:Ve(Array),default:()=>vi([])}}),zg="ElTabBar",OR=a.defineComponent({name:zg}),NR=a.defineComponent({...OR,props:IR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Il);r||ms(zg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ue("tabs"),o=a.ref(),l=a.ref(),u=()=>{let y=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",v=b==="x"?"left":"top";return t.tabs.every(g=>{var M,_;const E=(_=(M=i.parent)==null?void 0:M.refs)==null?void 0:_[`tab-${g.uid}`];if(!E)return!1;if(!g.active)return!0;y=E[`offset${Gi(v)}`],m=E[`client${Gi(d)}`];const S=window.getComputedStyle(E);return d==="width"&&(m-=Number.parseFloat(S.paddingLeft)+Number.parseFloat(S.paddingRight),y+=Number.parseFloat(S.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Gi(b)}(${y}px)`}},c=()=>l.value=u(),f=[],h=()=>{var y;f.forEach(d=>d.stop()),f.length=0;const m=(y=i.parent)==null?void 0:y.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(Sn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=Sn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(y=>y.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(y,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var DR=je(NR,[["__file","tab-bar.vue"]]);const BR=qe({panes:{type:Ve(Array),default:()=>vi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),FR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Ug="ElTabNav",VR=a.defineComponent({name:Ug,props:BR,emits:FR,setup(n,{expose:e,emit:t}){const i=a.inject(Il);i||ms(Ug,"<el-tabs><tab-nav /></el-tabs>");const r=Ue("tabs"),s=gw(),o=Aw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),y=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),v=()=>{if(!l.value)return;const A=l.value[`offset${Gi(d.value)}`],I=p.value;if(!I)return;const T=I>A?I-A:0;p.value=T},g=()=>{if(!l.value||!u.value)return;const A=u.value[`offset${Gi(d.value)}`],I=l.value[`offset${Gi(d.value)}`],T=p.value;if(A-T<=I)return;const P=A-T>I*2?T+I:A-I;p.value=P},M=async()=>{const A=u.value;if(!h.value||!c.value||!l.value||!A)return;await a.nextTick();const I=c.value.querySelector(".is-active");if(!I)return;const T=l.value,P=["top","bottom"].includes(i.props.tabPosition),C=I.getBoundingClientRect(),R=T.getBoundingClientRect(),L=P?A.offsetWidth-R.width:A.offsetHeight-R.height,N=p.value;let x=N;P?(C.left<R.left&&(x=N-(R.left-C.left)),C.right>R.right&&(x=N+C.right-R.right)):(C.top<R.top&&(x=N-(R.top-C.top)),C.bottom>R.bottom&&(x=N+(C.bottom-R.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},_=()=>{var A;if(!u.value||!l.value)return;n.stretch&&((A=f.value)==null||A.update());const I=u.value[`offset${Gi(d.value)}`],T=l.value[`offset${Gi(d.value)}`],P=p.value;T<I?(h.value=h.value||{},h.value.prev=P,h.value.next=P+T<I,I-P<T&&(p.value=I-T)):(h.value=!1,P>0&&(p.value=0))},E=A=>{const I=A.code,{up:T,down:P,left:C,right:R}=Yn;if(![T,P,C,R].includes(I))return;const L=Array.from(A.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),N=L.indexOf(A.target);let x;I===C||I===T?N===0?x=L.length-1:x=N-1:N<L.length-1?x=N+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),S()},S=()=>{m.value&&(y.value=!0)},w=()=>y.value=!1;return a.watch(s,A=>{A==="hidden"?m.value=!1:A==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,A=>{A?setTimeout(()=>m.value=!0,50):m.value=!1}),Sn(c,_),a.onMounted(()=>setTimeout(()=>M(),0)),a.onUpdated(()=>_()),e({scrollToActiveTab:M,removeFocus:w}),()=>{const A=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:v},[a.createVNode(mt,null,{default:()=>[a.createVNode(Hi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(mt,null,{default:()=>[a.createVNode(Wi,null,null)]})])]:null,I=n.panes.map((T,P)=>{var C,R,L,N;const x=T.uid,O=T.props.disabled,B=(R=(C=T.props.name)!=null?C:T.index)!=null?R:`${P}`,D=!O&&(T.isClosable||n.editable);T.index=`${P}`;const k=D?a.createVNode(mt,{class:"is-icon-close",onClick:X=>t("tabRemove",T,X)},{default:()=>[a.createVNode(Pu,null,null)]}):null,U=((N=(L=T.slots).label)==null?void 0:N.call(L))||T.props.label,H=!O&&T.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",T.active),r.is("disabled",O),r.is("closable",D),r.is("focus",y.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":T.active,tabindex:H,onFocus:()=>S(),onBlur:()=>w(),onClick:X=>{w(),t("tabClick",T,B,X)},onKeydown:X=>{D&&(X.code===Yn.delete||X.code===Yn.backspace)&&t("tabRemove",T,X)}},[U,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[A,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:E},[n.type?null:a.createVNode(DR,{ref:f,tabs:[...n.panes]},null),I])])])}}}),kR=qe({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),hd=n=>tn(n)||rt(n),zR={[ft]:n=>hd(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>hd(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>hd(n),tabAdd:()=>!0},UR=a.defineComponent({name:"ElTabs",props:kR,emits:zR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ue("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=CT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(v,g=!1)=>{var M,_,E;if(!(h.value===v||Pn(v)))try{await((M=n.beforeLeave)==null?void 0:M.call(n,v,h.value))!==!1&&(h.value=v,g&&(e(ft,v),e("tabChange",v)),(E=(_=f.value)==null?void 0:_.removeFocus)==null||E.call(_))}catch{}},y=(v,g,M)=>{v.props.disabled||(p(g,!0),e("tabClick",v,M))},m=(v,g)=>{v.props.disabled||Pn(v.props.name)||(g.stopPropagation(),e("edit",v.props.name,"remove"),e("tabRemove",v.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,v=>p(v)),a.watch(h,async()=>{var v;await a.nextTick(),(v=f.value)==null||v.scrollToActiveTab()}),a.provide(Il,{props:n,currentName:h,registerPane:v=>{l.value.push(v)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:v})=>v();return()=>{const v=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:E=>{E.code===Yn.enter&&d()}},[v?a.renderSlot(t,"add-icon"):a.createVNode(mt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(ul,null,null)]})]):null,M=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const E=l.value.some(S=>S.slots.label);return a.createVNode(VR,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:y,onTabRemove:m},{$stable:!E})}},null),g]),_=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[_,M])}}}),GR=qe({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Gg="ElTabPane",HR=a.defineComponent({name:Gg}),WR=a.defineComponent({...HR,props:GR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Il);r||ms(Gg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ue("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=ip(()=>{var y;return r.currentName.value===((y=e.name)!=null?y:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var y;return(y=e.name)!=null?y:o.value}),h=ip(()=>!e.lazy||c.value||u.value);a.watch(u,y=>{y&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(y,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(y.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Hg=je(WR,[["__file","tab-pane.vue"]]);const Wg=kt(UR,{TabPane:Hg}),jg=yi(Hg);function jR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,y=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(al(p,y.bm("parent","relative")),p.removeAttribute("loading-number")),al(p,y.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,y;(y=(p=h.$el)==null?void 0:p.parentNode)==null||y.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:y}){const{ns:m,zIndex:d}=DT("loading");return y({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,v=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[v,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let Ol;const fd=function(n={}){if(!Ot)return;const e=$R(n);if(e.fullscreen&&Ol)return Ol;const t=jR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Ol=void 0)}});ZR(e,e.parent,t),$g(e,e.parent,t),e.parent.vLoadingAddClassList=()=>$g(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(Ol=t),t},$R=n=>{var e,t,i,r;let s;return tn(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},ZR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=ko(document.body,"position"),t.originalOverflow.value=ko(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=ko(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(ko(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=ko(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},$g=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?al(e,i.bm("parent","relative")):om(e,i.bm("parent","relative")),n.fullscreen&&n.lock?om(e,i.bm("parent","hidden")):al(e,i.bm("parent","hidden"))},Nl=Symbol("ElLoading"),Zg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>nn(e.value)?e.value[p]:void 0,u=p=>{const y=tn(p)&&(o==null?void 0:o[p])||p;return y&&a.ref(y)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Bw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[Nl]={options:h,instance:fd(h)}},XR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},pd={mounted(n,e){e.value&&Zg(n,e)},updated(n,e){const t=n[Nl];e.oldValue!==e.value&&(e.value&&!e.oldValue?Zg(n,e):e.value&&e.oldValue?nn(e.value)&&XR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[Nl])==null||e.instance.close(),n[Nl]=null}},YR={install(n){n.directive("loading",pd),n.config.globalProperties.$loading=fd},directive:pd,service:fd};var Xg={exports:{}},Yg={},Jg;function JR(){return Jg||(Jg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var y=this;h.forEach(function(v,g){y.append(g,v)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var y;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){y=this._entries[m];for(var d=0;d<y.length;d++)h.call(p,y[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,y){h.push(y)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,y){h.push([y,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,y){h.push(r(y)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,y){f.push([y,p]),c._entries||c.delete(y)}),f.sort(function(p,y){return p[0]<y[0]?-1:p[0]>y[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),y,h=0;h<p.length;h++)y=p[h].split("="),this.append(s(y[0]),y.length>1?s(y[1]):"")}})}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(M){throw new Error("URL unable to set base "+c+" due to "+M)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var y=f.createElement("input");if(y.type="url",y.value=u,p.protocol===":"||!/:/.test(p.href)||!y.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,v=this;["append","delete","set"].forEach(function(M){var _=m[M];m[M]=function(){_.apply(m,arguments),d&&(b=!1,v.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Ki<"u"?Ki:typeof window<"u"?window:typeof self<"u"?self:Ki)),Yg}/**
21
21
  * @license
22
22
  * Copyright 2010-2021 Three.js Authors
23
23
  * SPDX-License-Identifier: MIT
@@ -2864,7 +2864,7 @@ void main() {
2864
2864
  #include <logdepthbuf_vertex>
2865
2865
  #include <clipping_planes_vertex>
2866
2866
  #include <fog_vertex>
2867
- }`;const Xe={alphamap_fragment:rP,alphamap_pars_fragment:sP,alphatest_fragment:oP,aomap_fragment:aP,aomap_pars_fragment:lP,begin_vertex:cP,beginnormal_vertex:uP,bsdfs:dP,bumpmap_pars_fragment:hP,clipping_planes_fragment:fP,clipping_planes_pars_fragment:pP,clipping_planes_pars_vertex:mP,clipping_planes_vertex:gP,color_fragment:yP,color_pars_fragment:vP,color_pars_vertex:bP,color_vertex:xP,common:wP,cube_uv_reflection_fragment:MP,defaultnormal_vertex:SP,displacementmap_pars_vertex:_P,displacementmap_vertex:EP,emissivemap_fragment:TP,emissivemap_pars_fragment:CP,encodings_fragment:AP,encodings_pars_fragment:RP,envmap_fragment:LP,envmap_common_pars_fragment:PP,envmap_pars_fragment:IP,envmap_pars_vertex:OP,envmap_physical_pars_fragment:WP,envmap_vertex:NP,fog_vertex:DP,fog_pars_vertex:BP,fog_fragment:FP,fog_pars_fragment:VP,gradientmap_pars_fragment:kP,lightmap_fragment:zP,lightmap_pars_fragment:UP,lights_lambert_vertex:GP,lights_pars_begin:HP,lights_toon_fragment:jP,lights_toon_pars_fragment:$P,lights_phong_fragment:ZP,lights_phong_pars_fragment:XP,lights_physical_fragment:YP,lights_physical_pars_fragment:JP,lights_fragment_begin:KP,lights_fragment_maps:qP,lights_fragment_end:QP,logdepthbuf_fragment:eI,logdepthbuf_pars_fragment:tI,logdepthbuf_pars_vertex:nI,logdepthbuf_vertex:iI,map_fragment:rI,map_pars_fragment:sI,map_particle_fragment:oI,map_particle_pars_fragment:aI,metalnessmap_fragment:lI,metalnessmap_pars_fragment:cI,morphnormal_vertex:uI,morphtarget_pars_vertex:dI,morphtarget_vertex:hI,normal_fragment_begin:fI,normal_fragment_maps:pI,normalmap_pars_fragment:mI,clearcoat_normal_fragment_begin:gI,clearcoat_normal_fragment_maps:yI,clearcoat_pars_fragment:vI,packing:bI,premultiplied_alpha_fragment:xI,project_vertex:wI,dithering_fragment:MI,dithering_pars_fragment:SI,roughnessmap_fragment:_I,roughnessmap_pars_fragment:EI,shadowmap_pars_fragment:TI,shadowmap_pars_vertex:CI,shadowmap_vertex:AI,shadowmask_pars_fragment:RI,skinbase_vertex:LI,skinning_pars_vertex:PI,skinning_vertex:II,skinnormal_vertex:OI,specularmap_fragment:NI,specularmap_pars_fragment:DI,tonemapping_fragment:BI,tonemapping_pars_fragment:FI,transmission_fragment:VI,transmission_pars_fragment:kI,uv_pars_fragment:zI,uv_pars_vertex:UI,uv_vertex:GI,uv2_pars_fragment:HI,uv2_pars_vertex:WI,uv2_vertex:jI,worldpos_vertex:$I,background_frag:ZI,background_vert:XI,cube_frag:YI,cube_vert:JI,depth_frag:KI,depth_vert:qI,distanceRGBA_frag:QI,distanceRGBA_vert:eO,equirect_frag:tO,equirect_vert:nO,linedashed_frag:iO,linedashed_vert:rO,meshbasic_frag:sO,meshbasic_vert:oO,meshlambert_frag:aO,meshlambert_vert:lO,meshmatcap_frag:cO,meshmatcap_vert:uO,meshtoon_frag:dO,meshtoon_vert:hO,meshphong_frag:fO,meshphong_vert:pO,meshphysical_frag:mO,meshphysical_vert:gO,normal_frag:yO,normal_vert:vO,points_frag:bO,points_vert:xO,shadow_frag:wO,shadow_vert:MO,sprite_frag:SO,sprite_vert:_O},Re={common:{diffuse:{value:new Ae(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ae(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ae(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Ae(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},zn={basic:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.fog]),vertexShader:Xe.meshbasic_vert,fragmentShader:Xe.meshbasic_frag},lambert:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.fog,Re.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Xe.meshlambert_vert,fragmentShader:Xe.meshlambert_frag},phong:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)},specular:{value:new Ae(1118481)},shininess:{value:30}}]),vertexShader:Xe.meshphong_vert,fragmentShader:Xe.meshphong_frag},standard:{uniforms:Kt([Re.common,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.roughnessmap,Re.metalnessmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag},toon:{uniforms:Kt([Re.common,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.gradientmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Xe.meshtoon_vert,fragmentShader:Xe.meshtoon_frag},matcap:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,{matcap:{value:null}}]),vertexShader:Xe.meshmatcap_vert,fragmentShader:Xe.meshmatcap_frag},points:{uniforms:Kt([Re.points,Re.fog]),vertexShader:Xe.points_vert,fragmentShader:Xe.points_frag},dashed:{uniforms:Kt([Re.common,Re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xe.linedashed_vert,fragmentShader:Xe.linedashed_frag},depth:{uniforms:Kt([Re.common,Re.displacementmap]),vertexShader:Xe.depth_vert,fragmentShader:Xe.depth_frag},normal:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,{opacity:{value:1}}]),vertexShader:Xe.normal_vert,fragmentShader:Xe.normal_frag},sprite:{uniforms:Kt([Re.sprite,Re.fog]),vertexShader:Xe.sprite_vert,fragmentShader:Xe.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Xe.background_vert,fragmentShader:Xe.background_frag},cube:{uniforms:Kt([Re.envmap,{opacity:{value:1}}]),vertexShader:Xe.cube_vert,fragmentShader:Xe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xe.equirect_vert,fragmentShader:Xe.equirect_frag},distanceRGBA:{uniforms:Kt([Re.common,Re.displacementmap,{referencePosition:{value:new J},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xe.distanceRGBA_vert,fragmentShader:Xe.distanceRGBA_frag},shadow:{uniforms:Kt([Re.lights,Re.fog,{color:{value:new Ae(0)},opacity:{value:1}}]),vertexShader:Xe.shadow_vert,fragmentShader:Xe.shadow_frag}};zn.physical={uniforms:Kt([zn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new _e(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ae(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ae(0)}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag};function EO(n,e,t,i,r){const s=new Ae(0);let o=0,l,u,c=null,f=0,h=null;function p(m,d){let b=!1,v=d.isScene===!0?d.background:null;v&&v.isTexture&&(v=e.get(v));const g=n.xr,M=g.getSession&&g.getSession();M&&M.environmentBlendMode==="additive"&&(v=null),v===null?y(s,o):v&&v.isColor&&(y(v,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Is)?(u===void 0&&(u=new At(new Oi(1,1,1),new Ni({name:"BackgroundCubeMaterial",uniforms:Js(zn.cube.uniforms),vertexShader:zn.cube.vertexShader,fragmentShader:zn.cube.fragmentShader,side:_t,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(_,E,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,(c!==v||f!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(l===void 0&&(l=new At(new $r(2,2),new Ni({name:"BackgroundMaterial",uniforms:Js(zn.background.uniforms),vertexShader:zn.background.vertexShader,fragmentShader:zn.background.fragmentShader,side:Qi,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),(c!==v||f!==v.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function y(m,d){t.buffers.color.setClear(m.r,m.g,m.b,d,r)}return{getClearColor:function(){return s},setClearColor:function(m,d=1){s.set(m),o=d,y(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,y(s,o)},render:p}}function TO(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=d(null);let c=u;function f(R,L,N,x,O){let B=!1;if(o){const D=m(x,N,L);c!==D&&(c=D,p(c.object)),B=b(x,O),B&&v(x,O)}else{const D=L.wireframe===!0;(c.geometry!==x.id||c.program!==N.id||c.wireframe!==D)&&(c.geometry=x.id,c.program=N.id,c.wireframe=D,B=!0)}R.isInstancedMesh===!0&&(B=!0),O!==null&&t.update(O,34963),B&&(w(R,L,N,x),O!==null&&n.bindBuffer(34963,t.get(O).buffer))}function h(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(R){return i.isWebGL2?n.bindVertexArray(R):s.bindVertexArrayOES(R)}function y(R){return i.isWebGL2?n.deleteVertexArray(R):s.deleteVertexArrayOES(R)}function m(R,L,N){const x=N.wireframe===!0;let O=l[R.id];O===void 0&&(O={},l[R.id]=O);let B=O[L.id];B===void 0&&(B={},O[L.id]=B);let D=B[x];return D===void 0&&(D=d(h()),B[x]=D),D}function d(R){const L=[],N=[],x=[];for(let O=0;O<r;O++)L[O]=0,N[O]=0,x[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:N,attributeDivisors:x,object:R,attributes:{},index:null}}function b(R,L){const N=c.attributes,x=R.attributes;let O=0;for(const B in x){const D=N[B],k=x[B];if(D===void 0||D.attribute!==k||D.data!==k.data)return!0;O++}return c.attributesNum!==O||c.index!==L}function v(R,L){const N={},x=R.attributes;let O=0;for(const B in x){const D=x[B],k={};k.attribute=D,D.data&&(k.data=D.data),N[B]=k,O++}c.attributes=N,c.attributesNum=O,c.index=L}function g(){const R=c.newAttributes;for(let L=0,N=R.length;L<N;L++)R[L]=0}function M(R){_(R,0)}function _(R,L){const N=c.newAttributes,x=c.enabledAttributes,O=c.attributeDivisors;N[R]=1,x[R]===0&&(n.enableVertexAttribArray(R),x[R]=1),O[R]!==L&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](R,L),O[R]=L)}function E(){const R=c.newAttributes,L=c.enabledAttributes;for(let N=0,x=L.length;N<x;N++)L[N]!==R[N]&&(n.disableVertexAttribArray(N),L[N]=0)}function S(R,L,N,x,O,B){i.isWebGL2===!0&&(N===5124||N===5125)?n.vertexAttribIPointer(R,L,N,O,B):n.vertexAttribPointer(R,L,N,x,O,B)}function w(R,L,N,x){if(i.isWebGL2===!1&&(R.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;g();const O=x.attributes,B=N.getAttributes(),D=L.defaultAttributeValues;for(const k in B){const U=B[k];if(U>=0){const H=O[k];if(H!==void 0){const X=H.normalized,re=H.itemSize,j=t.get(H);if(j===void 0)continue;const G=j.buffer,W=j.type,q=j.bytesPerElement;if(H.isInterleavedBufferAttribute){const ee=H.data,K=ee.stride,ie=H.offset;ee&&ee.isInstancedInterleavedBuffer?(_(U,ee.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=ee.meshPerAttribute*ee.count)):M(U),n.bindBuffer(34962,G),S(U,re,W,X,K*q,ie*q)}else H.isInstancedBufferAttribute?(_(U,H.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=H.meshPerAttribute*H.count)):M(U),n.bindBuffer(34962,G),S(U,re,W,X,0,0)}else if(k==="instanceMatrix"){const X=t.get(R.instanceMatrix);if(X===void 0)continue;const re=X.buffer,j=X.type;_(U+0,1),_(U+1,1),_(U+2,1),_(U+3,1),n.bindBuffer(34962,re),n.vertexAttribPointer(U+0,4,j,!1,64,0),n.vertexAttribPointer(U+1,4,j,!1,64,16),n.vertexAttribPointer(U+2,4,j,!1,64,32),n.vertexAttribPointer(U+3,4,j,!1,64,48)}else if(k==="instanceColor"){const X=t.get(R.instanceColor);if(X===void 0)continue;const re=X.buffer,j=X.type;_(U,1),n.bindBuffer(34962,re),n.vertexAttribPointer(U,3,j,!1,12,0)}else if(D!==void 0){const X=D[k];if(X!==void 0)switch(X.length){case 2:n.vertexAttrib2fv(U,X);break;case 3:n.vertexAttrib3fv(U,X);break;case 4:n.vertexAttrib4fv(U,X);break;default:n.vertexAttrib1fv(U,X)}}}}E()}function A(){P();for(const R in l){const L=l[R];for(const N in L){const x=L[N];for(const O in x)y(x[O].object),delete x[O];delete L[N]}delete l[R]}}function I(R){if(l[R.id]===void 0)return;const L=l[R.id];for(const N in L){const x=L[N];for(const O in x)y(x[O].object),delete x[O];delete L[N]}delete l[R.id]}function T(R){for(const L in l){const N=l[L];if(N[R.id]===void 0)continue;const x=N[R.id];for(const O in x)y(x[O].object),delete x[O];delete N[R.id]}}function P(){C(),c!==u&&(c=u,p(c.object))}function C(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:P,resetDefaultState:C,dispose:A,releaseStatesOfGeometry:I,releaseStatesOfProgram:T,initAttributes:g,enableAttribute:M,disableUnusedAttributes:E}}function CO(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,h){if(h===0)return;let p,y;if(r)p=n,y="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[y](s,c,f,h),t.update(f,s,h)}this.setMode=o,this.render=l,this.renderInstances=u}function AO(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const w=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(w){if(w==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),y=n.getParameter(3379),m=n.getParameter(34076),d=n.getParameter(34921),b=n.getParameter(36347),v=n.getParameter(36348),g=n.getParameter(36349),M=p>0,_=o||e.has("OES_texture_float"),E=M&&_,S=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:y,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:b,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:M,floatFragmentTextures:_,floatVertexTextures:E,maxSamples:S}}function RO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new ei,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,y){const m=h.length!==0||p||i!==0||r;return r=p,t=f(h,y,0),i=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,p,y){const m=h.clippingPlanes,d=h.clipIntersection,b=h.clipShadows,v=n.get(h);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,M=g*4;let _=v.clippingState||null;u.value=_,_=f(m,p,M,y);for(let E=0;E!==M;++E)_[E]=t[E];v.clippingState=_,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=g}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(h,p,y,m){const d=h!==null?h.length:0;let b=null;if(d!==0){if(b=u.value,m!==!0||b===null){const v=y+d*4,g=p.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length<v)&&(b=new Float32Array(v));for(let M=0,_=y;M!==d;++M,_+=4)o.copy(h[M]).applyMatrix4(g,l),o.normal.toArray(b,_),b[_+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=d,e.numIntersection=0,b}}function LO(n){let e=new WeakMap;function t(o,l){return l===Fl?o.mapping=Jo:l===Vl&&(o.mapping=Ko),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===Fl||l===Vl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new dc(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function PO(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_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")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function IO(n,e,t,i){const r={},s=new WeakMap;function o(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const y=s.get(p);y&&(e.remove(y),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(h,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(h){const p=h.attributes;for(const m in p)e.update(p[m],34962);const y=h.morphAttributes;for(const m in y){const d=y[m];for(let b=0,v=d.length;b<v;b++)e.update(d[b],34962)}}function c(h){const p=[],y=h.index,m=h.attributes.position;let d=0;if(y!==null){const g=y.array;d=y.version;for(let M=0,_=g.length;M<_;M+=3){const E=g[M+0],S=g[M+1],w=g[M+2];p.push(E,S,S,w,w,E)}}else{const g=m.array;d=m.version;for(let M=0,_=g.length/3-1;M<_;M+=3){const E=M+0,S=M+1,w=M+2;p.push(E,S,S,w,w,E)}}const b=new(Yy(p)>65535?tc:ec)(p,1);b.version=d;const v=s.get(h);v&&e.remove(v),s.set(h,b)}function f(h){const p=s.get(h);if(p){const y=h.index;y!==null&&p.version<y.version&&c(h)}else c(h);return s.get(h)}return{get:l,update:u,getWireframeAttribute:f}}function OO(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,y){n.drawElements(s,y,l,p*u),t.update(y,s,1)}function h(p,y,m){if(m===0)return;let d,b;if(r)d=n,b="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",d===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[b](s,y,l,p*u,m),t.update(y,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=h}function NO(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,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 DO(n,e){return n[0]-e[0]}function BO(n,e){return Math.abs(e[1])-Math.abs(n[1])}function FO(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let h=e[o.id];if(h===void 0||h.length!==f){h=[];for(let b=0;b<f;b++)h[b]=[b,0];e[o.id]=h}for(let b=0;b<f;b++){const v=h[b];v[0]=b,v[1]=c[b]}h.sort(BO);for(let b=0;b<8;b++)b<f&&h[b][1]?(i[b][0]=h[b][0],i[b][1]=h[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(DO);const p=l.morphTargets&&o.morphAttributes.position,y=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const v=i[b],g=v[0],M=v[1];g!==Number.MAX_SAFE_INTEGER&&M?(p&&o.getAttribute("morphTarget"+b)!==p[g]&&o.setAttribute("morphTarget"+b,p[g]),y&&o.getAttribute("morphNormal"+b)!==y[g]&&o.setAttribute("morphNormal"+b,y[g]),t[b]=M,m+=M):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),y&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const d=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",d),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function VO(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,h=e.get(u,f);return r.get(h)!==c&&(e.update(h),r.set(h,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),h}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class gh extends Tt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Et,this.minFilter=Et,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}gh.prototype.isDataTexture2DArray=!0;class yh extends Tt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Et,this.minFilter=Et,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}yh.prototype.isDataTexture3D=!0;const Qy=new Tt,kO=new gh,zO=new yh,ev=new Qs,tv=[],nv=[],iv=new Float32Array(16),rv=new Float32Array(9),sv=new Float32Array(4);function to(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=tv[r];if(s===void 0&&(s=new Float32Array(r),tv[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function sn(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 qt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function ov(n,e){let t=nv[e];t===void 0&&(t=new Int32Array(e),nv[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function UO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function GO(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(sn(t,e))return;n.uniform2fv(this.addr,e),qt(t,e)}}function HO(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(sn(t,e))return;n.uniform3fv(this.addr,e),qt(t,e)}}function WO(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(sn(t,e))return;n.uniform4fv(this.addr,e),qt(t,e)}}function jO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;sv.set(i),n.uniformMatrix2fv(this.addr,!1,sv),qt(t,i)}}function $O(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;rv.set(i),n.uniformMatrix3fv(this.addr,!1,rv),qt(t,i)}}function ZO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;iv.set(i),n.uniformMatrix4fv(this.addr,!1,iv),qt(t,i)}}function XO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function YO(n,e){const t=this.cache;sn(t,e)||(n.uniform2iv(this.addr,e),qt(t,e))}function JO(n,e){const t=this.cache;sn(t,e)||(n.uniform3iv(this.addr,e),qt(t,e))}function KO(n,e){const t=this.cache;sn(t,e)||(n.uniform4iv(this.addr,e),qt(t,e))}function qO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function QO(n,e){const t=this.cache;sn(t,e)||(n.uniform2uiv(this.addr,e),qt(t,e))}function e3(n,e){const t=this.cache;sn(t,e)||(n.uniform3uiv(this.addr,e),qt(t,e))}function t3(n,e){const t=this.cache;sn(t,e)||(n.uniform4uiv(this.addr,e),qt(t,e))}function n3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||Qy,r)}function i3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||zO,r)}function r3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||ev,r)}function s3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||kO,r)}function o3(n){switch(n){case 5126:return UO;case 35664:return GO;case 35665:return HO;case 35666:return WO;case 35674:return jO;case 35675:return $O;case 35676:return ZO;case 5124:case 35670:return XO;case 35667:case 35671:return YO;case 35668:case 35672:return JO;case 35669:case 35673:return KO;case 5125:return qO;case 36294:return QO;case 36295:return e3;case 36296:return t3;case 35678:case 36198:case 36298:case 36306:case 35682:return n3;case 35679:case 36299:case 36307:return i3;case 35680:case 36300:case 36308:case 36293:return r3;case 36289:case 36303:case 36311:case 36292:return s3}}function a3(n,e){n.uniform1fv(this.addr,e)}function l3(n,e){const t=to(e,this.size,2);n.uniform2fv(this.addr,t)}function c3(n,e){const t=to(e,this.size,3);n.uniform3fv(this.addr,t)}function u3(n,e){const t=to(e,this.size,4);n.uniform4fv(this.addr,t)}function d3(n,e){const t=to(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function h3(n,e){const t=to(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function f3(n,e){const t=to(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function p3(n,e){n.uniform1iv(this.addr,e)}function m3(n,e){n.uniform2iv(this.addr,e)}function g3(n,e){n.uniform3iv(this.addr,e)}function y3(n,e){n.uniform4iv(this.addr,e)}function v3(n,e){n.uniform1uiv(this.addr,e)}function b3(n,e){n.uniform2uiv(this.addr,e)}function x3(n,e){n.uniform3uiv(this.addr,e)}function w3(n,e){n.uniform4uiv(this.addr,e)}function M3(n,e,t){const i=e.length,r=ov(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||Qy,r[s])}function S3(n,e,t){const i=e.length,r=ov(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||ev,r[s])}function _3(n){switch(n){case 5126:return a3;case 35664:return l3;case 35665:return c3;case 35666:return u3;case 35674:return d3;case 35675:return h3;case 35676:return f3;case 5124:case 35670:return p3;case 35667:case 35671:return m3;case 35668:case 35672:return g3;case 35669:case 35673:return y3;case 5125:return v3;case 36294:return b3;case 36295:return x3;case 36296:return w3;case 35678:case 36198:case 36298:case 36306:case 35682:return M3;case 35680:case 36300:case 36308:case 36293:return S3}}function E3(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=o3(e.type)}function av(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=_3(e.type)}av.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),qt(e,n)};function lv(n){this.id=n,this.seq=[],this.map={}}lv.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const vh=/(\w+)(\])?(\[|\.)?/g;function cv(n,e){n.seq.push(e),n.map[e.id]=e}function T3(n,e,t){const i=n.name,r=i.length;for(vh.lastIndex=0;;){const s=vh.exec(i),o=vh.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){cv(t,c===void 0?new E3(l,n,e):new av(l,n,e));break}else{let h=t.map[l];h===void 0&&(h=new lv(l),cv(t,h)),t=h}}}function fr(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);T3(r,s,this)}}fr.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},fr.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},fr.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},fr.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function uv(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let C3=0;function A3(n){const e=n.split(`
2867
+ }`;const Xe={alphamap_fragment:rP,alphamap_pars_fragment:sP,alphatest_fragment:oP,aomap_fragment:aP,aomap_pars_fragment:lP,begin_vertex:cP,beginnormal_vertex:uP,bsdfs:dP,bumpmap_pars_fragment:hP,clipping_planes_fragment:fP,clipping_planes_pars_fragment:pP,clipping_planes_pars_vertex:mP,clipping_planes_vertex:gP,color_fragment:yP,color_pars_fragment:vP,color_pars_vertex:bP,color_vertex:xP,common:wP,cube_uv_reflection_fragment:MP,defaultnormal_vertex:SP,displacementmap_pars_vertex:_P,displacementmap_vertex:EP,emissivemap_fragment:TP,emissivemap_pars_fragment:CP,encodings_fragment:AP,encodings_pars_fragment:RP,envmap_fragment:LP,envmap_common_pars_fragment:PP,envmap_pars_fragment:IP,envmap_pars_vertex:OP,envmap_physical_pars_fragment:WP,envmap_vertex:NP,fog_vertex:DP,fog_pars_vertex:BP,fog_fragment:FP,fog_pars_fragment:VP,gradientmap_pars_fragment:kP,lightmap_fragment:zP,lightmap_pars_fragment:UP,lights_lambert_vertex:GP,lights_pars_begin:HP,lights_toon_fragment:jP,lights_toon_pars_fragment:$P,lights_phong_fragment:ZP,lights_phong_pars_fragment:XP,lights_physical_fragment:YP,lights_physical_pars_fragment:JP,lights_fragment_begin:KP,lights_fragment_maps:qP,lights_fragment_end:QP,logdepthbuf_fragment:eI,logdepthbuf_pars_fragment:tI,logdepthbuf_pars_vertex:nI,logdepthbuf_vertex:iI,map_fragment:rI,map_pars_fragment:sI,map_particle_fragment:oI,map_particle_pars_fragment:aI,metalnessmap_fragment:lI,metalnessmap_pars_fragment:cI,morphnormal_vertex:uI,morphtarget_pars_vertex:dI,morphtarget_vertex:hI,normal_fragment_begin:fI,normal_fragment_maps:pI,normalmap_pars_fragment:mI,clearcoat_normal_fragment_begin:gI,clearcoat_normal_fragment_maps:yI,clearcoat_pars_fragment:vI,packing:bI,premultiplied_alpha_fragment:xI,project_vertex:wI,dithering_fragment:MI,dithering_pars_fragment:SI,roughnessmap_fragment:_I,roughnessmap_pars_fragment:EI,shadowmap_pars_fragment:TI,shadowmap_pars_vertex:CI,shadowmap_vertex:AI,shadowmask_pars_fragment:RI,skinbase_vertex:LI,skinning_pars_vertex:PI,skinning_vertex:II,skinnormal_vertex:OI,specularmap_fragment:NI,specularmap_pars_fragment:DI,tonemapping_fragment:BI,tonemapping_pars_fragment:FI,transmission_fragment:VI,transmission_pars_fragment:kI,uv_pars_fragment:zI,uv_pars_vertex:UI,uv_vertex:GI,uv2_pars_fragment:HI,uv2_pars_vertex:WI,uv2_vertex:jI,worldpos_vertex:$I,background_frag:ZI,background_vert:XI,cube_frag:YI,cube_vert:JI,depth_frag:KI,depth_vert:qI,distanceRGBA_frag:QI,distanceRGBA_vert:eO,equirect_frag:tO,equirect_vert:nO,linedashed_frag:iO,linedashed_vert:rO,meshbasic_frag:sO,meshbasic_vert:oO,meshlambert_frag:aO,meshlambert_vert:lO,meshmatcap_frag:cO,meshmatcap_vert:uO,meshtoon_frag:dO,meshtoon_vert:hO,meshphong_frag:fO,meshphong_vert:pO,meshphysical_frag:mO,meshphysical_vert:gO,normal_frag:yO,normal_vert:vO,points_frag:bO,points_vert:xO,shadow_frag:wO,shadow_vert:MO,sprite_frag:SO,sprite_vert:_O},Re={common:{diffuse:{value:new Ae(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ae(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ae(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Ae(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},zn={basic:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.fog]),vertexShader:Xe.meshbasic_vert,fragmentShader:Xe.meshbasic_frag},lambert:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.fog,Re.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Xe.meshlambert_vert,fragmentShader:Xe.meshlambert_frag},phong:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)},specular:{value:new Ae(1118481)},shininess:{value:30}}]),vertexShader:Xe.meshphong_vert,fragmentShader:Xe.meshphong_frag},standard:{uniforms:Kt([Re.common,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.roughnessmap,Re.metalnessmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag},toon:{uniforms:Kt([Re.common,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.gradientmap,Re.fog,Re.lights,{emissive:{value:new Ae(0)}}]),vertexShader:Xe.meshtoon_vert,fragmentShader:Xe.meshtoon_frag},matcap:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,{matcap:{value:null}}]),vertexShader:Xe.meshmatcap_vert,fragmentShader:Xe.meshmatcap_frag},points:{uniforms:Kt([Re.points,Re.fog]),vertexShader:Xe.points_vert,fragmentShader:Xe.points_frag},dashed:{uniforms:Kt([Re.common,Re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xe.linedashed_vert,fragmentShader:Xe.linedashed_frag},depth:{uniforms:Kt([Re.common,Re.displacementmap]),vertexShader:Xe.depth_vert,fragmentShader:Xe.depth_frag},normal:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,{opacity:{value:1}}]),vertexShader:Xe.normal_vert,fragmentShader:Xe.normal_frag},sprite:{uniforms:Kt([Re.sprite,Re.fog]),vertexShader:Xe.sprite_vert,fragmentShader:Xe.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Xe.background_vert,fragmentShader:Xe.background_frag},cube:{uniforms:Kt([Re.envmap,{opacity:{value:1}}]),vertexShader:Xe.cube_vert,fragmentShader:Xe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xe.equirect_vert,fragmentShader:Xe.equirect_frag},distanceRGBA:{uniforms:Kt([Re.common,Re.displacementmap,{referencePosition:{value:new J},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xe.distanceRGBA_vert,fragmentShader:Xe.distanceRGBA_frag},shadow:{uniforms:Kt([Re.lights,Re.fog,{color:{value:new Ae(0)},opacity:{value:1}}]),vertexShader:Xe.shadow_vert,fragmentShader:Xe.shadow_frag}};zn.physical={uniforms:Kt([zn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new _e(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ae(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ae(0)}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag};function EO(n,e,t,i,r){const s=new Ae(0);let o=0,l,u,c=null,f=0,h=null;function p(m,d){let b=!1,v=d.isScene===!0?d.background:null;v&&v.isTexture&&(v=e.get(v));const g=n.xr,M=g.getSession&&g.getSession();M&&M.environmentBlendMode==="additive"&&(v=null),v===null?y(s,o):v&&v.isColor&&(y(v,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Is)?(u===void 0&&(u=new At(new Oi(1,1,1),new Ni({name:"BackgroundCubeMaterial",uniforms:Js(zn.cube.uniforms),vertexShader:zn.cube.vertexShader,fragmentShader:zn.cube.fragmentShader,side:_t,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(_,E,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,(c!==v||f!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(l===void 0&&(l=new At(new $r(2,2),new Ni({name:"BackgroundMaterial",uniforms:Js(zn.background.uniforms),vertexShader:zn.background.vertexShader,fragmentShader:zn.background.fragmentShader,side:Qi,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),(c!==v||f!==v.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function y(m,d){t.buffers.color.setClear(m.r,m.g,m.b,d,r)}return{getClearColor:function(){return s},setClearColor:function(m,d=1){s.set(m),o=d,y(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,y(s,o)},render:p}}function TO(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=d(null);let c=u;function f(R,L,N,x,O){let B=!1;if(o){const D=m(x,N,L);c!==D&&(c=D,p(c.object)),B=b(x,O),B&&v(x,O)}else{const D=L.wireframe===!0;(c.geometry!==x.id||c.program!==N.id||c.wireframe!==D)&&(c.geometry=x.id,c.program=N.id,c.wireframe=D,B=!0)}R.isInstancedMesh===!0&&(B=!0),O!==null&&t.update(O,34963),B&&(w(R,L,N,x),O!==null&&n.bindBuffer(34963,t.get(O).buffer))}function h(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(R){return i.isWebGL2?n.bindVertexArray(R):s.bindVertexArrayOES(R)}function y(R){return i.isWebGL2?n.deleteVertexArray(R):s.deleteVertexArrayOES(R)}function m(R,L,N){const x=N.wireframe===!0;let O=l[R.id];O===void 0&&(O={},l[R.id]=O);let B=O[L.id];B===void 0&&(B={},O[L.id]=B);let D=B[x];return D===void 0&&(D=d(h()),B[x]=D),D}function d(R){const L=[],N=[],x=[];for(let O=0;O<r;O++)L[O]=0,N[O]=0,x[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:N,attributeDivisors:x,object:R,attributes:{},index:null}}function b(R,L){const N=c.attributes,x=R.attributes;let O=0;for(const B in x){const D=N[B],k=x[B];if(D===void 0||D.attribute!==k||D.data!==k.data)return!0;O++}return c.attributesNum!==O||c.index!==L}function v(R,L){const N={},x=R.attributes;let O=0;for(const B in x){const D=x[B],k={};k.attribute=D,D.data&&(k.data=D.data),N[B]=k,O++}c.attributes=N,c.attributesNum=O,c.index=L}function g(){const R=c.newAttributes;for(let L=0,N=R.length;L<N;L++)R[L]=0}function M(R){_(R,0)}function _(R,L){const N=c.newAttributes,x=c.enabledAttributes,O=c.attributeDivisors;N[R]=1,x[R]===0&&(n.enableVertexAttribArray(R),x[R]=1),O[R]!==L&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](R,L),O[R]=L)}function E(){const R=c.newAttributes,L=c.enabledAttributes;for(let N=0,x=L.length;N<x;N++)L[N]!==R[N]&&(n.disableVertexAttribArray(N),L[N]=0)}function S(R,L,N,x,O,B){i.isWebGL2===!0&&(N===5124||N===5125)?n.vertexAttribIPointer(R,L,N,O,B):n.vertexAttribPointer(R,L,N,x,O,B)}function w(R,L,N,x){if(i.isWebGL2===!1&&(R.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;g();const O=x.attributes,B=N.getAttributes(),D=L.defaultAttributeValues;for(const k in B){const U=B[k];if(U>=0){const H=O[k];if(H!==void 0){const X=H.normalized,re=H.itemSize,j=t.get(H);if(j===void 0)continue;const G=j.buffer,W=j.type,K=j.bytesPerElement;if(H.isInterleavedBufferAttribute){const ee=H.data,q=ee.stride,ie=H.offset;ee&&ee.isInstancedInterleavedBuffer?(_(U,ee.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=ee.meshPerAttribute*ee.count)):M(U),n.bindBuffer(34962,G),S(U,re,W,X,q*K,ie*K)}else H.isInstancedBufferAttribute?(_(U,H.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=H.meshPerAttribute*H.count)):M(U),n.bindBuffer(34962,G),S(U,re,W,X,0,0)}else if(k==="instanceMatrix"){const X=t.get(R.instanceMatrix);if(X===void 0)continue;const re=X.buffer,j=X.type;_(U+0,1),_(U+1,1),_(U+2,1),_(U+3,1),n.bindBuffer(34962,re),n.vertexAttribPointer(U+0,4,j,!1,64,0),n.vertexAttribPointer(U+1,4,j,!1,64,16),n.vertexAttribPointer(U+2,4,j,!1,64,32),n.vertexAttribPointer(U+3,4,j,!1,64,48)}else if(k==="instanceColor"){const X=t.get(R.instanceColor);if(X===void 0)continue;const re=X.buffer,j=X.type;_(U,1),n.bindBuffer(34962,re),n.vertexAttribPointer(U,3,j,!1,12,0)}else if(D!==void 0){const X=D[k];if(X!==void 0)switch(X.length){case 2:n.vertexAttrib2fv(U,X);break;case 3:n.vertexAttrib3fv(U,X);break;case 4:n.vertexAttrib4fv(U,X);break;default:n.vertexAttrib1fv(U,X)}}}}E()}function A(){P();for(const R in l){const L=l[R];for(const N in L){const x=L[N];for(const O in x)y(x[O].object),delete x[O];delete L[N]}delete l[R]}}function I(R){if(l[R.id]===void 0)return;const L=l[R.id];for(const N in L){const x=L[N];for(const O in x)y(x[O].object),delete x[O];delete L[N]}delete l[R.id]}function T(R){for(const L in l){const N=l[L];if(N[R.id]===void 0)continue;const x=N[R.id];for(const O in x)y(x[O].object),delete x[O];delete N[R.id]}}function P(){C(),c!==u&&(c=u,p(c.object))}function C(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:P,resetDefaultState:C,dispose:A,releaseStatesOfGeometry:I,releaseStatesOfProgram:T,initAttributes:g,enableAttribute:M,disableUnusedAttributes:E}}function CO(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,h){if(h===0)return;let p,y;if(r)p=n,y="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[y](s,c,f,h),t.update(f,s,h)}this.setMode=o,this.render=l,this.renderInstances=u}function AO(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const w=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(w){if(w==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),y=n.getParameter(3379),m=n.getParameter(34076),d=n.getParameter(34921),b=n.getParameter(36347),v=n.getParameter(36348),g=n.getParameter(36349),M=p>0,_=o||e.has("OES_texture_float"),E=M&&_,S=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:y,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:b,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:M,floatFragmentTextures:_,floatVertexTextures:E,maxSamples:S}}function RO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new ei,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,y){const m=h.length!==0||p||i!==0||r;return r=p,t=f(h,y,0),i=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,p,y){const m=h.clippingPlanes,d=h.clipIntersection,b=h.clipShadows,v=n.get(h);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,M=g*4;let _=v.clippingState||null;u.value=_,_=f(m,p,M,y);for(let E=0;E!==M;++E)_[E]=t[E];v.clippingState=_,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=g}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(h,p,y,m){const d=h!==null?h.length:0;let b=null;if(d!==0){if(b=u.value,m!==!0||b===null){const v=y+d*4,g=p.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length<v)&&(b=new Float32Array(v));for(let M=0,_=y;M!==d;++M,_+=4)o.copy(h[M]).applyMatrix4(g,l),o.normal.toArray(b,_),b[_+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=d,e.numIntersection=0,b}}function LO(n){let e=new WeakMap;function t(o,l){return l===Fl?o.mapping=Jo:l===Vl&&(o.mapping=Ko),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===Fl||l===Vl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new dc(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function PO(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_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")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function IO(n,e,t,i){const r={},s=new WeakMap;function o(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const y=s.get(p);y&&(e.remove(y),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(h,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(h){const p=h.attributes;for(const m in p)e.update(p[m],34962);const y=h.morphAttributes;for(const m in y){const d=y[m];for(let b=0,v=d.length;b<v;b++)e.update(d[b],34962)}}function c(h){const p=[],y=h.index,m=h.attributes.position;let d=0;if(y!==null){const g=y.array;d=y.version;for(let M=0,_=g.length;M<_;M+=3){const E=g[M+0],S=g[M+1],w=g[M+2];p.push(E,S,S,w,w,E)}}else{const g=m.array;d=m.version;for(let M=0,_=g.length/3-1;M<_;M+=3){const E=M+0,S=M+1,w=M+2;p.push(E,S,S,w,w,E)}}const b=new(Yy(p)>65535?tc:ec)(p,1);b.version=d;const v=s.get(h);v&&e.remove(v),s.set(h,b)}function f(h){const p=s.get(h);if(p){const y=h.index;y!==null&&p.version<y.version&&c(h)}else c(h);return s.get(h)}return{get:l,update:u,getWireframeAttribute:f}}function OO(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,y){n.drawElements(s,y,l,p*u),t.update(y,s,1)}function h(p,y,m){if(m===0)return;let d,b;if(r)d=n,b="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",d===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[b](s,y,l,p*u,m),t.update(y,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=h}function NO(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,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 DO(n,e){return n[0]-e[0]}function BO(n,e){return Math.abs(e[1])-Math.abs(n[1])}function FO(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let h=e[o.id];if(h===void 0||h.length!==f){h=[];for(let b=0;b<f;b++)h[b]=[b,0];e[o.id]=h}for(let b=0;b<f;b++){const v=h[b];v[0]=b,v[1]=c[b]}h.sort(BO);for(let b=0;b<8;b++)b<f&&h[b][1]?(i[b][0]=h[b][0],i[b][1]=h[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(DO);const p=l.morphTargets&&o.morphAttributes.position,y=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const v=i[b],g=v[0],M=v[1];g!==Number.MAX_SAFE_INTEGER&&M?(p&&o.getAttribute("morphTarget"+b)!==p[g]&&o.setAttribute("morphTarget"+b,p[g]),y&&o.getAttribute("morphNormal"+b)!==y[g]&&o.setAttribute("morphNormal"+b,y[g]),t[b]=M,m+=M):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),y&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const d=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",d),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function VO(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,h=e.get(u,f);return r.get(h)!==c&&(e.update(h),r.set(h,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),h}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class gh extends Tt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Et,this.minFilter=Et,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}gh.prototype.isDataTexture2DArray=!0;class yh extends Tt{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Et,this.minFilter=Et,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}yh.prototype.isDataTexture3D=!0;const Qy=new Tt,kO=new gh,zO=new yh,ev=new Qs,tv=[],nv=[],iv=new Float32Array(16),rv=new Float32Array(9),sv=new Float32Array(4);function to(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=tv[r];if(s===void 0&&(s=new Float32Array(r),tv[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function sn(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 qt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function ov(n,e){let t=nv[e];t===void 0&&(t=new Int32Array(e),nv[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function UO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function GO(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(sn(t,e))return;n.uniform2fv(this.addr,e),qt(t,e)}}function HO(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(sn(t,e))return;n.uniform3fv(this.addr,e),qt(t,e)}}function WO(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(sn(t,e))return;n.uniform4fv(this.addr,e),qt(t,e)}}function jO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;sv.set(i),n.uniformMatrix2fv(this.addr,!1,sv),qt(t,i)}}function $O(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;rv.set(i),n.uniformMatrix3fv(this.addr,!1,rv),qt(t,i)}}function ZO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(sn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),qt(t,e)}else{if(sn(t,i))return;iv.set(i),n.uniformMatrix4fv(this.addr,!1,iv),qt(t,i)}}function XO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function YO(n,e){const t=this.cache;sn(t,e)||(n.uniform2iv(this.addr,e),qt(t,e))}function JO(n,e){const t=this.cache;sn(t,e)||(n.uniform3iv(this.addr,e),qt(t,e))}function KO(n,e){const t=this.cache;sn(t,e)||(n.uniform4iv(this.addr,e),qt(t,e))}function qO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function QO(n,e){const t=this.cache;sn(t,e)||(n.uniform2uiv(this.addr,e),qt(t,e))}function e3(n,e){const t=this.cache;sn(t,e)||(n.uniform3uiv(this.addr,e),qt(t,e))}function t3(n,e){const t=this.cache;sn(t,e)||(n.uniform4uiv(this.addr,e),qt(t,e))}function n3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||Qy,r)}function i3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||zO,r)}function r3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||ev,r)}function s3(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||kO,r)}function o3(n){switch(n){case 5126:return UO;case 35664:return GO;case 35665:return HO;case 35666:return WO;case 35674:return jO;case 35675:return $O;case 35676:return ZO;case 5124:case 35670:return XO;case 35667:case 35671:return YO;case 35668:case 35672:return JO;case 35669:case 35673:return KO;case 5125:return qO;case 36294:return QO;case 36295:return e3;case 36296:return t3;case 35678:case 36198:case 36298:case 36306:case 35682:return n3;case 35679:case 36299:case 36307:return i3;case 35680:case 36300:case 36308:case 36293:return r3;case 36289:case 36303:case 36311:case 36292:return s3}}function a3(n,e){n.uniform1fv(this.addr,e)}function l3(n,e){const t=to(e,this.size,2);n.uniform2fv(this.addr,t)}function c3(n,e){const t=to(e,this.size,3);n.uniform3fv(this.addr,t)}function u3(n,e){const t=to(e,this.size,4);n.uniform4fv(this.addr,t)}function d3(n,e){const t=to(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function h3(n,e){const t=to(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function f3(n,e){const t=to(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function p3(n,e){n.uniform1iv(this.addr,e)}function m3(n,e){n.uniform2iv(this.addr,e)}function g3(n,e){n.uniform3iv(this.addr,e)}function y3(n,e){n.uniform4iv(this.addr,e)}function v3(n,e){n.uniform1uiv(this.addr,e)}function b3(n,e){n.uniform2uiv(this.addr,e)}function x3(n,e){n.uniform3uiv(this.addr,e)}function w3(n,e){n.uniform4uiv(this.addr,e)}function M3(n,e,t){const i=e.length,r=ov(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||Qy,r[s])}function S3(n,e,t){const i=e.length,r=ov(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||ev,r[s])}function _3(n){switch(n){case 5126:return a3;case 35664:return l3;case 35665:return c3;case 35666:return u3;case 35674:return d3;case 35675:return h3;case 35676:return f3;case 5124:case 35670:return p3;case 35667:case 35671:return m3;case 35668:case 35672:return g3;case 35669:case 35673:return y3;case 5125:return v3;case 36294:return b3;case 36295:return x3;case 36296:return w3;case 35678:case 36198:case 36298:case 36306:case 35682:return M3;case 35680:case 36300:case 36308:case 36293:return S3}}function E3(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=o3(e.type)}function av(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=_3(e.type)}av.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),qt(e,n)};function lv(n){this.id=n,this.seq=[],this.map={}}lv.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const vh=/(\w+)(\])?(\[|\.)?/g;function cv(n,e){n.seq.push(e),n.map[e.id]=e}function T3(n,e,t){const i=n.name,r=i.length;for(vh.lastIndex=0;;){const s=vh.exec(i),o=vh.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){cv(t,c===void 0?new E3(l,n,e):new av(l,n,e));break}else{let h=t.map[l];h===void 0&&(h=new lv(l),cv(t,h)),t=h}}}function fr(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);T3(r,s,this)}}fr.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},fr.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},fr.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},fr.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function uv(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let C3=0;function A3(n){const e=n.split(`
2868
2868
  `);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
2869
2869
  `)}function dv(n){switch(n){case rn:return["Linear","( value )"];case zr:return["sRGB","( value )"];case Hl:return["RGBE","( value )"];case Vd:return["RGBM","( value, 7.0 )"];case kd:return["RGBM","( value, 16.0 )"];case zd:return["RGBD","( value, 256.0 )"];case Gl:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Sy:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function hv(n,e,t){const i=n.getShaderParameter(e,35713),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=n.getShaderSource(e);return"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
2870
2870
  `+r+A3(s)}function ha(n,e){const t=dv(e);return"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function R3(n,e){const t=dv(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function L3(n,e){let t;switch(e){case w0:t="Linear";break;case M0:t="Reinhard";break;case S0:t="OptimizedCineon";break;case _0:t="ACESFilmic";break;case E0:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function P3(n){return[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission>0)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fa).join(`
@@ -2912,7 +2912,7 @@ void main() {
2912
2912
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
2913
2913
  }`,tN=`void main() {
2914
2914
  gl_Position = vec4( position, 1.0 );
2915
- }`;function wv(n,e,t){let i=new da;const r=new _e,s=new _e,o=new st,l=[],u=[],c={},f=t.maxTextureSize,h={0:_t,1:Qi,2:er},p=new Ni({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:tN,fragmentShader:eN}),y=p.clone();y.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ge(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new At(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=yd,this.render=function(S,w,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||S.length===0)return;const I=n.getRenderTarget(),T=n.getActiveCubeFace(),P=n.getActiveMipmapLevel(),C=n.state;C.setBlending(Si),C.buffers.color.setClear(1,1,1,1),C.buffers.depth.setTest(!0),C.setScissorTest(!1);for(let R=0,L=S.length;R<L;R++){const N=S[R],x=N.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ls){const D={minFilter:vt,magFilter:vt,format:mn};x.map=new Bn(r.x,r.y,D),x.map.texture.name=N.name+".shadowMap",x.mapPass=new Bn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:Et,magFilter:Et,format:mn};x.map=new Bn(r.x,r.y,D),x.map.texture.name=N.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D<B;D++){const k=x.getViewport(D);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),C.viewport(o),x.updateMatrices(N,D),i=x.getFrustum(),E(w,A,x.camera,N,this.type)}!x.isPointLightShadow&&this.type===Ls&&v(x,A),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(I,T,P)};function v(S,w){const A=e.update(d);p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(w,null,A,p,d,null),y.uniforms.shadow_pass.value=S.mapPass.texture,y.uniforms.resolution.value=S.mapSize,y.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(w,null,A,y,d,null)}function g(S){const w=S<<0;let A=l[w];return A===void 0&&(A=new fc({depthPacking:Ey,morphTargets:S}),l[w]=A),A}function M(S){const w=S<<0;let A=u[w];return A===void 0&&(A=new pc({morphTargets:S}),u[w]=A),A}function _(S,w,A,I,T,P,C){let R=null,L=g,N=S.customDepthMaterial;if(I.isPointLight===!0&&(L=M,N=S.customDistanceMaterial),N===void 0){let x=!1;A.morphTargets===!0&&(x=w.morphAttributes&&w.morphAttributes.position&&w.morphAttributes.position.length>0),R=L(x)}else R=N;if(n.localClippingEnabled&&A.clipShadows===!0&&A.clippingPlanes.length!==0){const x=R.uuid,O=A.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[O];D===void 0&&(D=R.clone(),B[O]=D),R=D}return R.visible=A.visible,R.wireframe=A.wireframe,C===Ls?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:h[A.side],R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,I.isPointLight===!0&&R.isMeshDistanceMaterial===!0&&(R.referencePosition.setFromMatrixPosition(I.matrixWorld),R.nearDistance=T,R.farDistance=P),R}function E(S,w,A,I,T){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&T===Ls)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,S.matrixWorld);const R=e.update(S),L=S.material;if(Array.isArray(L)){const N=R.groups;for(let x=0,O=N.length;x<O;x++){const B=N[x],D=L[B.materialIndex];if(D&&D.visible){const k=_(S,R,D,I,A.near,A.far,T);n.renderBufferDirect(A,null,R,k,S,B)}}}else if(L.visible){const N=_(S,R,L,I,A.near,A.far,T);n.renderBufferDirect(A,null,R,N,S,null)}}const C=S.children;for(let R=0,L=C.length;R<L;R++)E(C[R],w,A,I,T)}}function nN(n,e,t){const i=t.isWebGL2;function r(){let se=!1;const we=new st;let pe=null;const ge=new st(0,0,0,0);return{setMask:function(Ee){pe!==Ee&&!se&&(n.colorMask(Ee,Ee,Ee,Ee),pe=Ee)},setLocked:function(Ee){se=Ee},setClear:function(Ee,He,tt,Ie,ot){ot===!0&&(Ee*=Ie,He*=Ie,tt*=Ie),we.set(Ee,He,tt,Ie),ge.equals(we)===!1&&(n.clearColor(Ee,He,tt,Ie),ge.copy(we))},reset:function(){se=!1,pe=null,ge.set(-1,0,0,0)}}}function s(){let se=!1,we=null,pe=null,ge=null;return{setTest:function(Ee){Ee?re(2929):j(2929)},setMask:function(Ee){we!==Ee&&!se&&(n.depthMask(Ee),we=Ee)},setFunc:function(Ee){if(pe!==Ee){if(Ee)switch(Ee){case h0:n.depthFunc(512);break;case f0:n.depthFunc(519);break;case p0:n.depthFunc(513);break;case Dl:n.depthFunc(515);break;case m0:n.depthFunc(514);break;case g0:n.depthFunc(518);break;case y0:n.depthFunc(516);break;case v0:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);pe=Ee}},setLocked:function(Ee){se=Ee},setClear:function(Ee){ge!==Ee&&(n.clearDepth(Ee),ge=Ee)},reset:function(){se=!1,we=null,pe=null,ge=null}}}function o(){let se=!1,we=null,pe=null,ge=null,Ee=null,He=null,tt=null,Ie=null,ot=null;return{setTest:function(Le){se||(Le?re(2960):j(2960))},setMask:function(Le){we!==Le&&!se&&(n.stencilMask(Le),we=Le)},setFunc:function(Le,Ye,We){(pe!==Le||ge!==Ye||Ee!==We)&&(n.stencilFunc(Le,Ye,We),pe=Le,ge=Ye,Ee=We)},setOp:function(Le,Ye,We){(He!==Le||tt!==Ye||Ie!==We)&&(n.stencilOp(Le,Ye,We),He=Le,tt=Ye,Ie=We)},setLocked:function(Le){se=Le},setClear:function(Le){ot!==Le&&(n.clearStencil(Le),ot=Le)},reset:function(){se=!1,we=null,pe=null,ge=null,Ee=null,He=null,tt=null,Ie=null,ot=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,M=null,_=null,E=null,S=!1,w=null,A=null,I=null,T=null,P=null;const C=n.getParameter(35661);let R=!1,L=0;const N=n.getParameter(7938);N.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(N)[1]),R=L>=1):N.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),R=L>=2);let x=null,O={};const B=n.getParameter(3088),D=n.getParameter(2978),k=new st().fromArray(B),U=new st().fromArray(D);function H(se,we,pe){const ge=new Uint8Array(4),Ee=n.createTexture();n.bindTexture(se,Ee),n.texParameteri(se,10241,9728),n.texParameteri(se,10240,9728);for(let He=0;He<pe;He++)n.texImage2D(we+He,0,6408,1,1,0,6408,5121,ge);return Ee}const X={};X[3553]=H(3553,3553,1),X[34067]=H(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),re(2929),u.setFunc(Dl),te(!1),F(gd),re(2884),ie(Si);function re(se){f[se]!==!0&&(n.enable(se),f[se]=!0)}function j(se){f[se]!==!1&&(n.disable(se),f[se]=!1)}function G(se){se!==h&&(n.bindFramebuffer(36160,se),h=se)}function W(se,we){return we===null&&h!==null&&(we=h),p[se]!==we?(n.bindFramebuffer(se,we),p[se]=we,i&&(se===36009&&(p[36160]=we),se===36160&&(p[36009]=we)),!0):!1}function q(se){return y!==se?(n.useProgram(se),y=se,!0):!1}const ee={[Or]:32774,[t0]:32778,[n0]:32779};if(i)ee[Md]=32775,ee[Sd]=32776;else{const se=e.get("EXT_blend_minmax");se!==null&&(ee[Md]=se.MIN_EXT,ee[Sd]=se.MAX_EXT)}const K={[i0]:0,[r0]:1,[s0]:768,[_d]:770,[d0]:776,[c0]:774,[a0]:772,[o0]:769,[Ed]:771,[u0]:775,[l0]:773};function ie(se,we,pe,ge,Ee,He,tt,Ie){if(se===Si){m===!0&&(j(3042),m=!1);return}if(m===!1&&(re(3042),m=!0),se!==e0){if(se!==d||Ie!==S){if((b!==Or||M!==Or)&&(n.blendEquation(32774),b=Or,M=Or),Ie)switch(se){case Ps:n.blendFuncSeparate(1,771,1,771);break;case bd:n.blendFunc(1,1);break;case xd:n.blendFuncSeparate(0,0,769,771);break;case wd:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}else switch(se){case Ps:n.blendFuncSeparate(770,771,1,771);break;case bd:n.blendFunc(770,1);break;case xd:n.blendFunc(0,769);break;case wd:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}v=null,g=null,_=null,E=null,d=se,S=Ie}return}Ee=Ee||we,He=He||pe,tt=tt||ge,(we!==b||Ee!==M)&&(n.blendEquationSeparate(ee[we],ee[Ee]),b=we,M=Ee),(pe!==v||ge!==g||He!==_||tt!==E)&&(n.blendFuncSeparate(K[pe],K[ge],K[He],K[tt]),v=pe,g=ge,_=He,E=tt),d=se,S=null}function Y(se,we){se.side===er?j(2884):re(2884);let pe=se.side===_t;we&&(pe=!pe),te(pe),se.blending===Ps&&se.transparent===!1?ie(Si):ie(se.blending,se.blendEquation,se.blendSrc,se.blendDst,se.blendEquationAlpha,se.blendSrcAlpha,se.blendDstAlpha,se.premultipliedAlpha),u.setFunc(se.depthFunc),u.setTest(se.depthTest),u.setMask(se.depthWrite),l.setMask(se.colorWrite);const ge=se.stencilWrite;c.setTest(ge),ge&&(c.setMask(se.stencilWriteMask),c.setFunc(se.stencilFunc,se.stencilRef,se.stencilFuncMask),c.setOp(se.stencilFail,se.stencilZFail,se.stencilZPass)),Q(se.polygonOffset,se.polygonOffsetFactor,se.polygonOffsetUnits),se.alphaToCoverage===!0?re(32926):j(32926)}function te(se){w!==se&&(se?n.frontFace(2304):n.frontFace(2305),w=se)}function F(se){se!==Kg?(re(2884),se!==A&&(se===gd?n.cullFace(1029):se===qg?n.cullFace(1028):n.cullFace(1032))):j(2884),A=se}function $(se){se!==I&&(R&&n.lineWidth(se),I=se)}function Q(se,we,pe){se?(re(32823),(T!==we||P!==pe)&&(n.polygonOffset(we,pe),T=we,P=pe)):j(32823)}function V(se){se?re(3089):j(3089)}function z(se){se===void 0&&(se=33984+C-1),x!==se&&(n.activeTexture(se),x=se)}function oe(se,we){x===null&&z();let pe=O[x];pe===void 0&&(pe={type:void 0,texture:void 0},O[x]=pe),(pe.type!==se||pe.texture!==we)&&(n.bindTexture(se,we||X[se]),pe.type=se,pe.texture=we)}function ae(){const se=O[x];se!==void 0&&se.type!==void 0&&(n.bindTexture(se.type,null),se.type=void 0,se.texture=void 0)}function le(){try{n.compressedTexImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function fe(){try{n.texImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function be(){try{n.texImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function ye(se){k.equals(se)===!1&&(n.scissor(se.x,se.y,se.z,se.w),k.copy(se))}function he(se){U.equals(se)===!1&&(n.viewport(se.x,se.y,se.z,se.w),U.copy(se))}function ve(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,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),f={},x=null,O={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,M=null,_=null,E=null,S=!1,w=null,A=null,I=null,T=null,P=null,k.set(0,0,n.canvas.width,n.canvas.height),U.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:re,disable:j,bindFramebuffer:W,bindXRFramebuffer:G,useProgram:q,setBlending:ie,setMaterial:Y,setFlipSided:te,setCullFace:F,setLineWidth:$,setPolygonOffset:Q,setScissorTest:V,activeTexture:z,bindTexture:oe,unbindTexture:ae,compressedTexImage2D:le,texImage2D:fe,texImage3D:be,scissor:ye,viewport:he,reset:ve}}function iN(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let y,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(V,z){return m?new OffscreenCanvas(V,z):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(V,z,oe,ae){let le=1;if((V.width>ae||V.height>ae)&&(le=ae/Math.max(V.width,V.height)),le<1||z===!0)if(typeof HTMLImageElement<"u"&&V instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&V instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&V instanceof ImageBitmap){const fe=z?Ry:Math.floor,be=fe(le*V.width),ye=fe(le*V.height);y===void 0&&(y=d(be,ye));const he=oe?d(be,ye):y;return he.width=be,he.height=ye,he.getContext("2d").drawImage(V,0,0,be,ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+be+"x"+ye+")."),he}else return"data"in V&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.height+")."),V;return V}function v(V){return Hd(V.width)&&Hd(V.height)}function g(V){return l?!1:V.wrapS!==zt||V.wrapT!==zt||V.minFilter!==Et&&V.minFilter!==vt}function M(V,z){return V.generateMipmaps&&z&&V.minFilter!==Et&&V.minFilter!==vt}function _(V,z,oe,ae,le=1){n.generateMipmap(V);const fe=i.get(z);fe.__maxMipLevel=Math.log2(Math.max(oe,ae,le))}function E(V,z,oe){if(l===!1)return z;if(V!==null){if(n[V]!==void 0)return n[V];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+V+"'")}let ae=z;return z===6403&&(oe===5126&&(ae=33326),oe===5131&&(ae=33325),oe===5121&&(ae=33321)),z===6407&&(oe===5126&&(ae=34837),oe===5131&&(ae=34843),oe===5121&&(ae=32849)),z===6408&&(oe===5126&&(ae=34836),oe===5131&&(ae=34842),oe===5121&&(ae=32856)),(ae===33325||ae===33326||ae===34842||ae===34836)&&e.get("EXT_color_buffer_float"),ae}function S(V){return V===Et||V===Qo||V===ea?9728:9729}function w(V){const z=V.target;z.removeEventListener("dispose",w),I(z),z.isVideoTexture&&p.delete(z),o.memory.textures--}function A(V){const z=V.target;z.removeEventListener("dispose",A),T(z)}function I(V){const z=i.get(V);z.__webglInit!==void 0&&(n.deleteTexture(z.__webglTexture),i.remove(V))}function T(V){const z=V.texture,oe=i.get(V),ae=i.get(z);if(V){if(ae.__webglTexture!==void 0&&(n.deleteTexture(ae.__webglTexture),o.memory.textures--),V.depthTexture&&V.depthTexture.dispose(),V.isWebGLCubeRenderTarget)for(let le=0;le<6;le++)n.deleteFramebuffer(oe.__webglFramebuffer[le]),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer[le]);else n.deleteFramebuffer(oe.__webglFramebuffer),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer),oe.__webglMultisampledFramebuffer&&n.deleteFramebuffer(oe.__webglMultisampledFramebuffer),oe.__webglColorRenderbuffer&&n.deleteRenderbuffer(oe.__webglColorRenderbuffer),oe.__webglDepthRenderbuffer&&n.deleteRenderbuffer(oe.__webglDepthRenderbuffer);if(V.isWebGLMultipleRenderTargets)for(let le=0,fe=z.length;le<fe;le++){const be=i.get(z[le]);be.__webglTexture&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),i.remove(z[le])}i.remove(z),i.remove(V)}}let P=0;function C(){P=0}function R(){const V=P;return V>=u&&console.warn("THREE.WebGLTextures: Trying to use "+V+" texture units while this GPU supports only "+u),P+=1,V}function L(V,z){const oe=i.get(V);if(V.isVideoTexture&&Y(V),V.version>0&&oe.__version!==V.version){const ae=V.image;if(ae===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{H(oe,V,z);return}}t.activeTexture(33984+z),t.bindTexture(3553,oe.__webglTexture)}function N(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){H(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(35866,oe.__webglTexture)}function x(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){H(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(32879,oe.__webglTexture)}function O(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){X(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(34067,oe.__webglTexture)}const B={[nr]:10497,[zt]:33071,[Os]:33648},D={[Et]:9728,[Qo]:9984,[ea]:9986,[vt]:9729,[kl]:9985,[_i]:9987};function k(V,z,oe){if(oe?(n.texParameteri(V,10242,B[z.wrapS]),n.texParameteri(V,10243,B[z.wrapT]),(V===32879||V===35866)&&n.texParameteri(V,32882,B[z.wrapR]),n.texParameteri(V,10240,D[z.magFilter]),n.texParameteri(V,10241,D[z.minFilter])):(n.texParameteri(V,10242,33071),n.texParameteri(V,10243,33071),(V===32879||V===35866)&&n.texParameteri(V,32882,33071),(z.wrapS!==zt||z.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(V,10240,S(z.magFilter)),n.texParameteri(V,10241,S(z.minFilter)),z.minFilter!==Et&&z.minFilter!==vt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const ae=e.get("EXT_texture_filter_anisotropic");if(z.type===Ei&&e.has("OES_texture_float_linear")===!1||l===!1&&z.type===Dr&&e.has("OES_texture_half_float_linear")===!1)return;(z.anisotropy>1||i.get(z).__currentAnisotropy)&&(n.texParameterf(V,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(z.anisotropy,r.getMaxAnisotropy())),i.get(z).__currentAnisotropy=z.anisotropy)}}function U(V,z){V.__webglInit===void 0&&(V.__webglInit=!0,z.addEventListener("dispose",w),V.__webglTexture=n.createTexture(),o.memory.textures++)}function H(V,z,oe){let ae=3553;z.isDataTexture2DArray&&(ae=35866),z.isDataTexture3D&&(ae=32879),U(V,z),t.activeTexture(33984+oe),t.bindTexture(ae,V.__webglTexture),n.pixelStorei(37440,z.flipY),n.pixelStorei(37441,z.premultiplyAlpha),n.pixelStorei(3317,z.unpackAlignment),n.pixelStorei(37443,0);const le=g(z)&&v(z.image)===!1,fe=b(z.image,le,!1,f),be=v(fe)||l,ye=s.convert(z.format);let he=s.convert(z.type),ve=E(z.internalFormat,ye,he);k(ae,z,be);let se;const we=z.mipmaps;if(z.isDepthTexture)ve=6402,l?z.type===Ei?ve=36012:z.type===na?ve=33190:z.type===Ns?ve=35056:ve=33189:z.type===Ei&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),z.format===Br&&ve===6402&&z.type!==ta&&z.type!==na&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),z.type=ta,he=s.convert(z.type)),z.format===Ds&&ve===6402&&(ve=34041,z.type!==Ns&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),z.type=Ns,he=s.convert(z.type))),t.texImage2D(3553,0,ve,fe.width,fe.height,0,ye,he,null);else if(z.isDataTexture)if(we.length>0&&be){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],t.texImage2D(3553,pe,ve,se.width,se.height,0,ye,he,se.data);z.generateMipmaps=!1,V.__maxMipLevel=we.length-1}else t.texImage2D(3553,0,ve,fe.width,fe.height,0,ye,he,fe.data),V.__maxMipLevel=0;else if(z.isCompressedTexture){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],z.format!==mn&&z.format!==Ti?ye!==null?t.compressedTexImage2D(3553,pe,ve,se.width,se.height,0,se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,pe,ve,se.width,se.height,0,ye,he,se.data);V.__maxMipLevel=we.length-1}else if(z.isDataTexture2DArray)t.texImage3D(35866,0,ve,fe.width,fe.height,fe.depth,0,ye,he,fe.data),V.__maxMipLevel=0;else if(z.isDataTexture3D)t.texImage3D(32879,0,ve,fe.width,fe.height,fe.depth,0,ye,he,fe.data),V.__maxMipLevel=0;else if(we.length>0&&be){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],t.texImage2D(3553,pe,ve,ye,he,se);z.generateMipmaps=!1,V.__maxMipLevel=we.length-1}else t.texImage2D(3553,0,ve,ye,he,fe),V.__maxMipLevel=0;M(z,be)&&_(ae,z,fe.width,fe.height),V.__version=z.version,z.onUpdate&&z.onUpdate(z)}function X(V,z,oe){if(z.image.length!==6)return;U(V,z),t.activeTexture(33984+oe),t.bindTexture(34067,V.__webglTexture),n.pixelStorei(37440,z.flipY),n.pixelStorei(37441,z.premultiplyAlpha),n.pixelStorei(3317,z.unpackAlignment),n.pixelStorei(37443,0);const ae=z&&(z.isCompressedTexture||z.image[0].isCompressedTexture),le=z.image[0]&&z.image[0].isDataTexture,fe=[];for(let pe=0;pe<6;pe++)!ae&&!le?fe[pe]=b(z.image[pe],!1,!0,c):fe[pe]=le?z.image[pe].image:z.image[pe];const be=fe[0],ye=v(be)||l,he=s.convert(z.format),ve=s.convert(z.type),se=E(z.internalFormat,he,ve);k(34067,z,ye);let we;if(ae){for(let pe=0;pe<6;pe++){we=fe[pe].mipmaps;for(let ge=0;ge<we.length;ge++){const Ee=we[ge];z.format!==mn&&z.format!==Ti?he!==null?t.compressedTexImage2D(34069+pe,ge,se,Ee.width,Ee.height,0,Ee.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+pe,ge,se,Ee.width,Ee.height,0,he,ve,Ee.data)}}V.__maxMipLevel=we.length-1}else{we=z.mipmaps;for(let pe=0;pe<6;pe++)if(le){t.texImage2D(34069+pe,0,se,fe[pe].width,fe[pe].height,0,he,ve,fe[pe].data);for(let ge=0;ge<we.length;ge++){const He=we[ge].image[pe].image;t.texImage2D(34069+pe,ge+1,se,He.width,He.height,0,he,ve,He.data)}}else{t.texImage2D(34069+pe,0,se,he,ve,fe[pe]);for(let ge=0;ge<we.length;ge++){const Ee=we[ge];t.texImage2D(34069+pe,ge+1,se,he,ve,Ee.image[pe])}}V.__maxMipLevel=we.length}M(z,ye)&&_(34067,z,be.width,be.height),V.__version=z.version,z.onUpdate&&z.onUpdate(z)}function re(V,z,oe,ae,le){const fe=s.convert(oe.format),be=s.convert(oe.type),ye=E(oe.internalFormat,fe,be);le===32879||le===35866?t.texImage3D(le,0,ye,z.width,z.height,z.depth,0,fe,be,null):t.texImage2D(le,0,ye,z.width,z.height,0,fe,be,null),t.bindFramebuffer(36160,V),n.framebufferTexture2D(36160,ae,le,i.get(oe).__webglTexture,0),t.bindFramebuffer(36160,null)}function j(V,z,oe){if(n.bindRenderbuffer(36161,V),z.depthBuffer&&!z.stencilBuffer){let ae=33189;if(oe){const le=z.depthTexture;le&&le.isDepthTexture&&(le.type===Ei?ae=36012:le.type===na&&(ae=33190));const fe=ie(z);n.renderbufferStorageMultisample(36161,fe,ae,z.width,z.height)}else n.renderbufferStorage(36161,ae,z.width,z.height);n.framebufferRenderbuffer(36160,36096,36161,V)}else if(z.depthBuffer&&z.stencilBuffer){if(oe){const ae=ie(z);n.renderbufferStorageMultisample(36161,ae,35056,z.width,z.height)}else n.renderbufferStorage(36161,34041,z.width,z.height);n.framebufferRenderbuffer(36160,33306,36161,V)}else{const ae=z.isWebGLMultipleRenderTargets===!0?z.texture[0]:z.texture,le=s.convert(ae.format),fe=s.convert(ae.type),be=E(ae.internalFormat,le,fe);if(oe){const ye=ie(z);n.renderbufferStorageMultisample(36161,ye,be,z.width,z.height)}else n.renderbufferStorage(36161,be,z.width,z.height)}n.bindRenderbuffer(36161,null)}function G(V,z){if(z&&z.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,V),!(z.depthTexture&&z.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(z.depthTexture).__webglTexture||z.depthTexture.image.width!==z.width||z.depthTexture.image.height!==z.height)&&(z.depthTexture.image.width=z.width,z.depthTexture.image.height=z.height,z.depthTexture.needsUpdate=!0),L(z.depthTexture,0);const ae=i.get(z.depthTexture).__webglTexture;if(z.depthTexture.format===Br)n.framebufferTexture2D(36160,36096,3553,ae,0);else if(z.depthTexture.format===Ds)n.framebufferTexture2D(36160,33306,3553,ae,0);else throw new Error("Unknown depthTexture format")}function W(V){const z=i.get(V),oe=V.isWebGLCubeRenderTarget===!0;if(V.depthTexture){if(oe)throw new Error("target.depthTexture not supported in Cube render targets");G(z.__webglFramebuffer,V)}else if(oe){z.__webglDepthbuffer=[];for(let ae=0;ae<6;ae++)t.bindFramebuffer(36160,z.__webglFramebuffer[ae]),z.__webglDepthbuffer[ae]=n.createRenderbuffer(),j(z.__webglDepthbuffer[ae],V,!1)}else t.bindFramebuffer(36160,z.__webglFramebuffer),z.__webglDepthbuffer=n.createRenderbuffer(),j(z.__webglDepthbuffer,V,!1);t.bindFramebuffer(36160,null)}function q(V){const z=V.texture,oe=i.get(V),ae=i.get(z);V.addEventListener("dispose",A),V.isWebGLMultipleRenderTargets!==!0&&(ae.__webglTexture=n.createTexture(),ae.__version=z.version,o.memory.textures++);const le=V.isWebGLCubeRenderTarget===!0,fe=V.isWebGLMultipleRenderTargets===!0,be=V.isWebGLMultisampleRenderTarget===!0,ye=z.isDataTexture3D||z.isDataTexture2DArray,he=v(V)||l;if(l&&z.format===Ti&&(z.type===Ei||z.type===Dr)&&(z.format=mn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),le){oe.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)oe.__webglFramebuffer[ve]=n.createFramebuffer()}else if(oe.__webglFramebuffer=n.createFramebuffer(),fe)if(r.drawBuffers){const ve=V.texture;for(let se=0,we=ve.length;se<we;se++){const pe=i.get(ve[se]);pe.__webglTexture===void 0&&(pe.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(be)if(l){oe.__webglMultisampledFramebuffer=n.createFramebuffer(),oe.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,oe.__webglColorRenderbuffer);const ve=s.convert(z.format),se=s.convert(z.type),we=E(z.internalFormat,ve,se),pe=ie(V);n.renderbufferStorageMultisample(36161,pe,we,V.width,V.height),t.bindFramebuffer(36160,oe.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,oe.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),V.depthBuffer&&(oe.__webglDepthRenderbuffer=n.createRenderbuffer(),j(oe.__webglDepthRenderbuffer,V,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(le){t.bindTexture(34067,ae.__webglTexture),k(34067,z,he);for(let ve=0;ve<6;ve++)re(oe.__webglFramebuffer[ve],V,z,36064,34069+ve);M(z,he)&&_(34067,z,V.width,V.height),t.bindTexture(34067,null)}else if(fe){const ve=V.texture;for(let se=0,we=ve.length;se<we;se++){const pe=ve[se],ge=i.get(pe);t.bindTexture(3553,ge.__webglTexture),k(3553,pe,he),re(oe.__webglFramebuffer,V,pe,36064+se,3553),M(pe,he)&&_(3553,pe,V.width,V.height)}t.bindTexture(3553,null)}else{let ve=3553;ye&&(l?ve=z.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(ve,ae.__webglTexture),k(ve,z,he),re(oe.__webglFramebuffer,V,z,36064,ve),M(z,he)&&_(ve,z,V.width,V.height,V.depth),t.bindTexture(ve,null)}V.depthBuffer&&W(V)}function ee(V){const z=v(V)||l,oe=V.isWebGLMultipleRenderTargets===!0?V.texture:[V.texture];for(let ae=0,le=oe.length;ae<le;ae++){const fe=oe[ae];if(M(fe,z)){const be=V.isWebGLCubeRenderTarget?34067:3553,ye=i.get(fe).__webglTexture;t.bindTexture(be,ye),_(be,fe,V.width,V.height),t.bindTexture(be,null)}}}function K(V){if(V.isWebGLMultisampleRenderTarget)if(l){const z=V.width,oe=V.height;let ae=16384;V.depthBuffer&&(ae|=256),V.stencilBuffer&&(ae|=1024);const le=i.get(V);t.bindFramebuffer(36008,le.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,le.__webglFramebuffer),n.blitFramebuffer(0,0,z,oe,0,0,z,oe,ae,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,le.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function ie(V){return l&&V.isWebGLMultisampleRenderTarget?Math.min(h,V.samples):0}function Y(V){const z=o.render.frame;p.get(V)!==z&&(p.set(V,z),V.update())}let te=!1,F=!1;function $(V,z){V&&V.isWebGLRenderTarget&&(te===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),te=!0),V=V.texture),L(V,z)}function Q(V,z){V&&V.isWebGLCubeRenderTarget&&(F===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),V=V.texture),O(V,z)}this.allocateTextureUnit=R,this.resetTextureUnits=C,this.setTexture2D=L,this.setTexture2DArray=N,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=q,this.updateRenderTargetMipmap=ee,this.updateMultisampleRenderTarget=K,this.safeSetTexture2D=$,this.safeSetTextureCube=Q}function Mv(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Nr)return 5121;if(s===R0)return 32819;if(s===L0)return 32820;if(s===P0)return 33635;if(s===T0)return 5120;if(s===C0)return 5122;if(s===ta)return 5123;if(s===A0)return 5124;if(s===na)return 5125;if(s===Ei)return 5126;if(s===Dr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===I0)return 6406;if(s===Ti)return 6407;if(s===mn)return 6408;if(s===O0)return 6409;if(s===N0)return 6410;if(s===Br)return 6402;if(s===Ds)return 34041;if(s===B0)return 6403;if(s===F0)return 36244;if(s===V0)return 33319;if(s===k0)return 33320;if(s===z0)return 36248;if(s===U0)return 36249;if(s===Td||s===Cd||s===Ad||s===Rd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===Td)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Cd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ad)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Rd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ld||s===Pd||s===Id||s===Od)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===Ld)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Pd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Id)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Od)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===G0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===Nd||s===Dd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===Nd)return o.COMPRESSED_RGB8_ETC2;if(s===Dd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===H0||s===W0||s===j0||s===$0||s===Z0||s===X0||s===Y0||s===J0||s===K0||s===q0||s===Q0||s===ey||s===ty||s===ny||s===ry||s===sy||s===oy||s===ay||s===ly||s===cy||s===uy||s===dy||s===hy||s===fy||s===py||s===my||s===gy||s===yy)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===iy)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Ns)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class xh extends Bt{constructor(e=[]){super(),this.cameras=e}}xh.prototype.isArrayCamera=!0;class ti extends $e{constructor(){super(),this.type="Group"}}ti.prototype.isGroup=!0;const rN={type:"move"};class wh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ti,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 ti,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new J,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new J),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ti,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new J,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new J),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}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 l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(rN))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new ti;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const v=c.joints[d.jointName];b!==null&&(v.matrix.fromArray(b.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=b.radius),v.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),y=.02,m=.005;c.inputState.pinching&&p>y+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=y-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class sN extends rr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const y=[],m=new Map,d=new Bt;d.layers.enable(1),d.viewport=new st;const b=new Bt;b.layers.enable(2),b.viewport=new st;const v=[d,b],g=new xh;g.layers.enable(1),g.layers.enable(2);let M=null,_=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getTargetRaySpace()},this.getControllerGrip=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getGripSpace()},this.getHand=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getHandSpace()};function E(N){const x=m.get(N.inputSource);x&&x.dispatchEvent({type:N.type,data:N.inputSource})}function S(){m.forEach(function(N,x){N.disconnect(x)}),m.clear(),M=null,_=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(N){o=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(N){u=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(N){if(s=N,s!==null){s.addEventListener("select",E),s.addEventListener("selectstart",E),s.addEventListener("selectend",E),s.addEventListener("squeeze",E),s.addEventListener("squeezestart",E),s.addEventListener("squeezeend",E),s.addEventListener("end",S),s.addEventListener("inputsourceschange",w);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function w(N){const x=s.inputSources;for(let O=0;O<y.length;O++)m.set(x[O],y[O]);for(let O=0;O<N.removed.length;O++){const B=N.removed[O],D=m.get(B);D&&(D.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<N.added.length;O++){const B=N.added[O],D=m.get(B);D&&D.dispatchEvent({type:"connected",data:B})}}const A=new J,I=new J;function T(N,x,O){A.setFromMatrixPosition(x.matrixWorld),I.setFromMatrixPosition(O.matrixWorld);const B=A.distanceTo(I),D=x.projectionMatrix.elements,k=O.projectionMatrix.elements,U=D[14]/(D[10]-1),H=D[14]/(D[10]+1),X=(D[9]+1)/D[5],re=(D[9]-1)/D[5],j=(D[8]-1)/D[0],G=(k[8]+1)/k[0],W=U*j,q=U*G,ee=B/(-j+G),K=ee*-j;x.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(K),N.translateZ(ee),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const ie=U+ee,Y=H+ee,te=W-K,F=q+(B-K),$=X*H/Y*ie,Q=re*H/Y*ie;N.projectionMatrix.makePerspective(te,F,$,Q,ie,Y)}function P(N,x){x===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(x.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(s===null)return;g.near=b.near=d.near=N.near,g.far=b.far=d.far=N.far,(M!==g.near||_!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),M=g.near,_=g.far);const x=N.parent,O=g.cameras;P(g,x);for(let D=0;D<O.length;D++)P(O[D],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),N.position.copy(g.position),N.quaternion.copy(g.quaternion),N.scale.copy(g.scale),N.matrix.copy(g.matrix),N.matrixWorld.copy(g.matrixWorld);const B=N.children;for(let D=0,k=B.length;D<k;D++)B[D].updateMatrixWorld(!0);O.length===2?T(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let C=null;function R(N,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,D=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(D.framebuffer);let k=!1;B.length!==g.cameras.length&&(g.cameras.length=0,k=!0);for(let U=0;U<B.length;U++){const H=B[U];let X=null;if(s.renderState.layers===void 0)X=D.getViewport(H);else{const j=f.getViewSubImage(p,H);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,j.colorTexture,0),j.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,j.depthStencilTexture,0),X=j.viewport}const re=v[U];re.matrix.fromArray(H.transform.matrix),re.projectionMatrix.fromArray(H.projectionMatrix),re.viewport.set(X.x,X.y,X.width,X.height),U===0&&g.matrix.copy(re.matrix),k===!0&&g.cameras.push(re)}}const O=s.inputSources;for(let B=0;B<y.length;B++){const D=y[B],k=O[B];D.update(k,x,l)}C&&C(N,x)}const L=new qy;L.setAnimationLoop(R),this.setAnimationLoop=function(N){C=N},this.dispose=function(){}}}function oN(n){function e(v,g){v.fogColor.value.copy(g.color),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function t(v,g,M,_,E){g.isMeshBasicMaterial?i(v,g):g.isMeshLambertMaterial?(i(v,g),u(v,g)):g.isMeshToonMaterial?(i(v,g),f(v,g)):g.isMeshPhongMaterial?(i(v,g),c(v,g)):g.isMeshStandardMaterial?(i(v,g),g.isMeshPhysicalMaterial?p(v,g,E):h(v,g)):g.isMeshMatcapMaterial?(i(v,g),y(v,g)):g.isMeshDepthMaterial?(i(v,g),m(v,g)):g.isMeshDistanceMaterial?(i(v,g),d(v,g)):g.isMeshNormalMaterial?(i(v,g),b(v,g)):g.isLineBasicMaterial?(r(v,g),g.isLineDashedMaterial&&s(v,g)):g.isPointsMaterial?o(v,g,M,_):g.isSpriteMaterial?l(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap),g.specularMap&&(v.specularMap.value=g.specularMap);const M=n.get(g).envMap;if(M){v.envMap.value=M,v.flipEnvMap.value=M.isCubeTexture&&M._needsFlipEnvMap?-1:1,v.reflectivity.value=g.reflectivity,v.refractionRatio.value=g.refractionRatio;const S=n.get(M).__maxMipLevel;S!==void 0&&(v.maxMipLevel.value=S)}g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity);let _;g.map?_=g.map:g.specularMap?_=g.specularMap:g.displacementMap?_=g.displacementMap:g.normalMap?_=g.normalMap:g.bumpMap?_=g.bumpMap:g.roughnessMap?_=g.roughnessMap:g.metalnessMap?_=g.metalnessMap:g.alphaMap?_=g.alphaMap:g.emissiveMap?_=g.emissiveMap:g.clearcoatMap?_=g.clearcoatMap:g.clearcoatNormalMap?_=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(_=g.clearcoatRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),v.uvTransform.value.copy(_.matrix));let E;g.aoMap?E=g.aoMap:g.lightMap&&(E=g.lightMap),E!==void 0&&(E.isWebGLRenderTarget&&(E=E.texture),E.matrixAutoUpdate===!0&&E.updateMatrix(),v.uv2Transform.value.copy(E.matrix))}function r(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity}function s(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function o(v,g,M,_){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*M,v.scale.value=_*.5,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let E;g.map?E=g.map:g.alphaMap&&(E=g.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),v.uvTransform.value.copy(E.matrix))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let M;g.map?M=g.map:g.alphaMap&&(M=g.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),v.uvTransform.value.copy(M.matrix))}function u(v,g){g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap)}function c(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function h(v,g){v.roughness.value=g.roughness,v.metalness.value=g.metalness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),n.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function p(v,g,M){h(v,g),v.reflectivity.value=g.reflectivity,v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&v.sheen.value.copy(g.sheen),g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),v.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===_t&&v.clearcoatNormalScale.value.negate()),v.transmission.value=g.transmission,g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap),g.transmission>0&&(v.transmissionSamplerMap.value=M.texture,v.transmissionSamplerSize.value.set(M.width,M.height)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)}function y(v,g){g.matcap&&(v.matcap.value=g.matcap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function m(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function d(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),v.referencePosition.value.copy(g.referencePosition),v.nearDistance.value=g.nearDistance,v.farDistance.value=g.farDistance}function b(v,g){g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function aN(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function at(n={}){const e=n.canvas!==void 0?n.canvas:aN(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const y=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=rn,this.physicallyCorrectLights=!1,this.toneMapping=tr,this.toneMappingExposure=1;const d=this;let b=!1,v=0,g=0,M=null,_=-1,E=null;const S=new st,w=new st;let A=null,I=e.width,T=e.height,P=1,C=null,R=null;const L=new st(0,0,I,T),N=new st(0,0,I,T);let x=!1;const O=[],B=new da;let D=!1,k=!1,U=null;const H=new De,X=new J,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return M===null?P:1}let G=t;function W(Z,de){for(let ce=0;ce<Z.length;ce++){const me=Z[ce],Se=e.getContext(me,de);if(Se!==null)return Se}return null}try{const Z={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",He,!1),e.addEventListener("webglcontextrestored",tt,!1),G===null){const de=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&de.shift(),G=W(de,Z),G===null)throw W(de)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}G.getShaderPrecisionFormat===void 0&&(G.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let q,ee,K,ie,Y,te,F,$,Q,V,z,oe,ae,le,fe,be,ye,he,ve,se,we,pe;function ge(){q=new PO(G),ee=new AO(G,q,n),q.init(ee),we=new Mv(G,q,ee),K=new nN(G,q,ee),O[0]=1029,ie=new NO,Y=new j3,te=new iN(G,q,K,Y,ee,we,ie),F=new LO(d),$=new iP(G,ee),pe=new TO(G,q,$,ee),Q=new IO(G,$,ie,pe),V=new VO(G,Q,$,ie),he=new FO(G),fe=new RO(Y),z=new W3(d,F,q,ee,pe,fe),oe=new oN(Y),ae=new Z3(Y),le=new Q3(q,ee),ye=new EO(d,F,K,V,l),be=new wv(d,V,ee),ve=new CO(G,q,ie,ee),se=new OO(G,q,ie,ee),ie.programs=z.programs,d.capabilities=ee,d.extensions=q,d.properties=Y,d.renderLists=ae,d.shadowMap=be,d.state=K,d.info=ie}ge();const Ee=new sN(d,G);this.xr=Ee,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const Z=q.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){const Z=q.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(Z){Z!==void 0&&(P=Z,this.setSize(I,T,!1))},this.getSize=function(Z){return Z.set(I,T)},this.setSize=function(Z,de,ce){if(Ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}I=Z,T=de,e.width=Math.floor(Z*P),e.height=Math.floor(de*P),ce!==!1&&(e.style.width=Z+"px",e.style.height=de+"px"),this.setViewport(0,0,Z,de)},this.getDrawingBufferSize=function(Z){return Z.set(I*P,T*P).floor()},this.setDrawingBufferSize=function(Z,de,ce){I=Z,T=de,P=ce,e.width=Math.floor(Z*ce),e.height=Math.floor(de*ce),this.setViewport(0,0,Z,de)},this.getCurrentViewport=function(Z){return Z.copy(S)},this.getViewport=function(Z){return Z.copy(L)},this.setViewport=function(Z,de,ce,me){Z.isVector4?L.set(Z.x,Z.y,Z.z,Z.w):L.set(Z,de,ce,me),K.viewport(S.copy(L).multiplyScalar(P).floor())},this.getScissor=function(Z){return Z.copy(N)},this.setScissor=function(Z,de,ce,me){Z.isVector4?N.set(Z.x,Z.y,Z.z,Z.w):N.set(Z,de,ce,me),K.scissor(w.copy(N).multiplyScalar(P).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(Z){K.setScissorTest(x=Z)},this.setOpaqueSort=function(Z){C=Z},this.setTransparentSort=function(Z){R=Z},this.getClearColor=function(Z){return Z.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(Z,de,ce){let me=0;(Z===void 0||Z)&&(me|=16384),(de===void 0||de)&&(me|=256),(ce===void 0||ce)&&(me|=1024),G.clear(me)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",He,!1),e.removeEventListener("webglcontextrestored",tt,!1),ae.dispose(),le.dispose(),Y.dispose(),F.dispose(),V.dispose(),pe.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",et),Ee.removeEventListener("sessionend",Mt),U&&(U.dispose(),U=null),pt.stop()};function He(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function tt(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const Z=ie.autoReset,de=be.enabled,ce=be.autoUpdate,me=be.needsUpdate,Se=be.type;ge(),ie.autoReset=Z,be.enabled=de,be.autoUpdate=ce,be.needsUpdate=me,be.type=Se}function Ie(Z){const de=Z.target;de.removeEventListener("dispose",Ie),ot(de)}function ot(Z){Le(Z),Y.remove(Z)}function Le(Z){const de=Y.get(Z).programs;de!==void 0&&de.forEach(function(ce){z.releaseProgram(ce)})}function Ye(Z,de){Z.render(function(ce){d.renderBufferImmediate(ce,de)})}this.renderBufferImmediate=function(Z,de){pe.initAttributes();const ce=Y.get(Z);Z.hasPositions&&!ce.position&&(ce.position=G.createBuffer()),Z.hasNormals&&!ce.normal&&(ce.normal=G.createBuffer()),Z.hasUvs&&!ce.uv&&(ce.uv=G.createBuffer()),Z.hasColors&&!ce.color&&(ce.color=G.createBuffer());const me=de.getAttributes();Z.hasPositions&&(G.bindBuffer(34962,ce.position),G.bufferData(34962,Z.positionArray,35048),pe.enableAttribute(me.position),G.vertexAttribPointer(me.position,3,5126,!1,0,0)),Z.hasNormals&&(G.bindBuffer(34962,ce.normal),G.bufferData(34962,Z.normalArray,35048),pe.enableAttribute(me.normal),G.vertexAttribPointer(me.normal,3,5126,!1,0,0)),Z.hasUvs&&(G.bindBuffer(34962,ce.uv),G.bufferData(34962,Z.uvArray,35048),pe.enableAttribute(me.uv),G.vertexAttribPointer(me.uv,2,5126,!1,0,0)),Z.hasColors&&(G.bindBuffer(34962,ce.color),G.bufferData(34962,Z.colorArray,35048),pe.enableAttribute(me.color),G.vertexAttribPointer(me.color,3,5126,!1,0,0)),pe.disableUnusedAttributes(),G.drawArrays(4,0,Z.count),Z.count=0},this.renderBufferDirect=function(Z,de,ce,me,Se,ue){de===null&&(de=re);const xe=Se.isMesh&&Se.matrixWorld.determinant()<0,Te=Ce(Z,de,me,Se);K.setMaterial(me,xe);let Pe=ce.index;const Ne=ce.attributes.position;if(Pe===null){if(Ne===void 0||Ne.count===0)return}else if(Pe.count===0)return;let ze=1;me.wireframe===!0&&(Pe=Q.getWireframeAttribute(ce),ze=2),(me.morphTargets||me.morphNormals)&&he.update(Se,ce,me,Te),pe.setup(Se,me,Te,ce,Pe);let Fe,Ke=ve;Pe!==null&&(Fe=$.get(Pe),Ke=se,Ke.setIndex(Fe));const It=Pe!==null?Pe.count:Ne.count,Gt=ce.drawRange.start*ze,ds=ce.drawRange.count*ze,ht=ue!==null?ue.start*ze:0,hs=ue!==null?ue.count*ze:1/0,en=Math.max(Gt,ht),LV=Math.min(It,Gt+ds,ht+hs)-1,ou=Math.max(0,LV-en+1);if(ou!==0){if(Se.isMesh)me.wireframe===!0?(K.setLineWidth(me.wireframeLinewidth*j()),Ke.setMode(1)):Ke.setMode(4);else if(Se.isLine){let Ya=me.linewidth;Ya===void 0&&(Ya=1),K.setLineWidth(Ya*j()),Se.isLineSegments?Ke.setMode(1):Se.isLineLoop?Ke.setMode(2):Ke.setMode(3)}else Se.isPoints?Ke.setMode(0):Se.isSprite&&Ke.setMode(4);if(Se.isInstancedMesh)Ke.renderInstances(en,ou,Se.count);else if(ce.isInstancedBufferGeometry){const Ya=Math.min(ce.instanceCount,ce._maxInstanceCount);Ke.renderInstances(en,ou,Ya)}else Ke.render(en,ou)}},this.compile=function(Z,de){p=le.get(Z),p.init(),Z.traverseVisible(function(ce){ce.isLight&&ce.layers.test(de.layers)&&(p.pushLight(ce),ce.castShadow&&p.pushShadow(ce))}),p.setupLights(),Z.traverse(function(ce){const me=ce.material;if(me)if(Array.isArray(me))for(let Se=0;Se<me.length;Se++){const ue=me[Se];ne(ue,Z,ce)}else ne(me,Z,ce)})};let We=null;function it(Z){We&&We(Z)}function et(){pt.stop()}function Mt(){pt.start()}const pt=new qy;pt.setAnimationLoop(it),typeof window<"u"&&pt.setContext(window),this.setAnimationLoop=function(Z){We=Z,Ee.setAnimationLoop(Z),Z===null?pt.stop():pt.start()},Ee.addEventListener("sessionstart",et),Ee.addEventListener("sessionend",Mt),this.render=function(Z,de){if(de!==void 0&&de.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;Z.autoUpdate===!0&&Z.updateMatrixWorld(),de.parent===null&&de.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(de),de=Ee.getCamera()),Z.isScene===!0&&Z.onBeforeRender(d,Z,de,M),p=le.get(Z,m.length),p.init(),m.push(p),H.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),B.setFromProjectionMatrix(H),k=this.localClippingEnabled,D=fe.init(this.clippingPlanes,k,de),h=ae.get(Z,y.length),h.init(),y.push(h),hn(Z,de,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(C,R),D===!0&&fe.beginShadows();const ce=p.state.shadowsArray;be.render(ce,Z,de),p.setupLights(),p.setupLightsView(de),D===!0&&fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(h,Z);const me=h.opaque,Se=h.transmissive,ue=h.transparent;me.length>0&&jn(me,Z,de),Se.length>0&&Mn(me,Se,Z,de),ue.length>0&&jn(ue,Z,de),M!==null&&(te.updateMultisampleRenderTarget(M),te.updateRenderTargetMipmap(M)),Z.isScene===!0&&Z.onAfterRender(d,Z,de),K.buffers.depth.setTest(!0),K.buffers.depth.setMask(!0),K.buffers.color.setMask(!0),K.setPolygonOffset(!1),pe.resetDefaultState(),_=-1,E=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,y.pop(),y.length>0?h=y[y.length-1]:h=null};function hn(Z,de,ce,me){if(Z.visible===!1)return;if(Z.layers.test(de.layers)){if(Z.isGroup)ce=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(de);else if(Z.isLight)p.pushLight(Z),Z.castShadow&&p.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||B.intersectsSprite(Z)){me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H);const xe=V.update(Z),Te=Z.material;Te.visible&&h.push(Z,xe,Te,ce,X.z,null)}}else if(Z.isImmediateRenderObject)me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H),h.push(Z,null,Z.material,ce,X.z,null);else if((Z.isMesh||Z.isLine||Z.isPoints)&&(Z.isSkinnedMesh&&Z.skeleton.frame!==ie.render.frame&&(Z.skeleton.update(),Z.skeleton.frame=ie.render.frame),!Z.frustumCulled||B.intersectsObject(Z))){me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H);const xe=V.update(Z),Te=Z.material;if(Array.isArray(Te)){const Pe=xe.groups;for(let Ne=0,ze=Pe.length;Ne<ze;Ne++){const Fe=Pe[Ne],Ke=Te[Fe.materialIndex];Ke&&Ke.visible&&h.push(Z,xe,Ke,ce,X.z,Fe)}}else Te.visible&&h.push(Z,xe,Te,ce,X.z,null)}}const ue=Z.children;for(let xe=0,Te=ue.length;xe<Te;xe++)hn(ue[xe],de,ce,me)}function Mn(Z,de,ce,me){if(U===null){const Te=o===!0&&ee.isWebGL2===!0?$d:Bn;U=new Te(1024,1024,{generateMipmaps:!0,type:we.convert(Dr)!==null?Dr:Nr,minFilter:_i,magFilter:Et,wrapS:zt,wrapT:zt})}const Se=d.getRenderTarget();d.setRenderTarget(U),d.clear();const ue=d.toneMapping;d.toneMapping=tr,jn(Z,ce,me),d.toneMapping=ue,te.updateMultisampleRenderTarget(U),te.updateRenderTargetMipmap(U),d.setRenderTarget(Se),jn(de,ce,me)}function jn(Z,de,ce){const me=de.isScene===!0?de.overrideMaterial:null;for(let Se=0,ue=Z.length;Se<ue;Se++){const xe=Z[Se],Te=xe.object,Pe=xe.geometry,Ne=me===null?xe.material:me,ze=xe.group;if(ce.isArrayCamera){const Fe=ce.cameras;for(let Ke=0,It=Fe.length;Ke<It;Ke++){const Gt=Fe[Ke];Te.layers.test(Gt.layers)&&(K.viewport(S.copy(Gt.viewport)),p.setupLightsView(Gt),us(Te,de,Gt,Pe,Ne,ze))}}else us(Te,de,ce,Pe,Ne,ze)}}function us(Z,de,ce,me,Se,ue){if(Z.onBeforeRender(d,de,ce,me,Se,ue),Z.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),Z.isImmediateRenderObject){const xe=Ce(ce,de,Se,Z);K.setMaterial(Se),pe.reset(),Ye(Z,xe)}else Se.transparent===!0&&Se.side===er?(Se.side=_t,Se.needsUpdate=!0,d.renderBufferDirect(ce,de,me,Se,Z,ue),Se.side=Qi,Se.needsUpdate=!0,d.renderBufferDirect(ce,de,me,Se,Z,ue),Se.side=er):d.renderBufferDirect(ce,de,me,Se,Z,ue);Z.onAfterRender(d,de,ce,me,Se,ue)}function ne(Z,de,ce){de.isScene!==!0&&(de=re);const me=Y.get(Z),Se=p.state.lights,ue=p.state.shadowsArray,xe=Se.state.version,Te=z.getParameters(Z,Se.state,ue,de,ce),Pe=z.getProgramCacheKey(Te);let Ne=me.programs;me.environment=Z.isMeshStandardMaterial?de.environment:null,me.fog=de.fog,me.envMap=F.get(Z.envMap||me.environment),Ne===void 0&&(Z.addEventListener("dispose",Ie),Ne=new Map,me.programs=Ne);let ze=Ne.get(Pe);if(ze!==void 0){if(me.currentProgram===ze&&me.lightsStateVersion===xe)return Me(Z,Te),ze}else Te.uniforms=z.getUniforms(Z),Z.onBuild(Te,d),Z.onBeforeCompile(Te,d),ze=z.acquireProgram(Te,Pe),Ne.set(Pe,ze),me.uniforms=Te.uniforms;const Fe=me.uniforms;(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Fe.clippingPlanes=fe.uniform),Me(Z,Te),me.needsLights=Je(Z),me.lightsStateVersion=xe,me.needsLights&&(Fe.ambientLightColor.value=Se.state.ambient,Fe.lightProbe.value=Se.state.probe,Fe.directionalLights.value=Se.state.directional,Fe.directionalLightShadows.value=Se.state.directionalShadow,Fe.spotLights.value=Se.state.spot,Fe.spotLightShadows.value=Se.state.spotShadow,Fe.rectAreaLights.value=Se.state.rectArea,Fe.ltc_1.value=Se.state.rectAreaLTC1,Fe.ltc_2.value=Se.state.rectAreaLTC2,Fe.pointLights.value=Se.state.point,Fe.pointLightShadows.value=Se.state.pointShadow,Fe.hemisphereLights.value=Se.state.hemi,Fe.directionalShadowMap.value=Se.state.directionalShadowMap,Fe.directionalShadowMatrix.value=Se.state.directionalShadowMatrix,Fe.spotShadowMap.value=Se.state.spotShadowMap,Fe.spotShadowMatrix.value=Se.state.spotShadowMatrix,Fe.pointShadowMap.value=Se.state.pointShadowMap,Fe.pointShadowMatrix.value=Se.state.pointShadowMatrix);const Ke=ze.getUniforms(),It=fr.seqWithValue(Ke.seq,Fe);return me.currentProgram=ze,me.uniformsList=It,ze}function Me(Z,de){const ce=Y.get(Z);ce.outputEncoding=de.outputEncoding,ce.instancing=de.instancing,ce.skinning=de.skinning,ce.numClippingPlanes=de.numClippingPlanes,ce.numIntersection=de.numClipIntersection,ce.vertexAlphas=de.vertexAlphas}function Ce(Z,de,ce,me){de.isScene!==!0&&(de=re),te.resetTextureUnits();const Se=de.fog,ue=ce.isMeshStandardMaterial?de.environment:null,xe=M===null?d.outputEncoding:M.texture.encoding,Te=F.get(ce.envMap||ue),Pe=ce.vertexColors===!0&&me.geometry&&me.geometry.attributes.color&&me.geometry.attributes.color.itemSize===4,Ne=Y.get(ce),ze=p.state.lights;if(D===!0&&(k===!0||Z!==E)){const en=Z===E&&ce.id===_;fe.setState(ce,Z,en)}let Fe=!1;ce.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==ze.state.version||Ne.outputEncoding!==xe||me.isInstancedMesh&&Ne.instancing===!1||!me.isInstancedMesh&&Ne.instancing===!0||me.isSkinnedMesh&&Ne.skinning===!1||!me.isSkinnedMesh&&Ne.skinning===!0||Ne.envMap!==Te||ce.fog&&Ne.fog!==Se||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==fe.numPlanes||Ne.numIntersection!==fe.numIntersection)||Ne.vertexAlphas!==Pe)&&(Fe=!0):(Fe=!0,Ne.__version=ce.version);let Ke=Ne.currentProgram;Fe===!0&&(Ke=ne(ce,de,me));let It=!1,Gt=!1,ds=!1;const ht=Ke.getUniforms(),hs=Ne.uniforms;if(K.useProgram(Ke.program)&&(It=!0,Gt=!0,ds=!0),ce.id!==_&&(_=ce.id,Gt=!0),It||E!==Z){if(ht.setValue(G,"projectionMatrix",Z.projectionMatrix),ee.logarithmicDepthBuffer&&ht.setValue(G,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),E!==Z&&(E=Z,Gt=!0,ds=!0),ce.isShaderMaterial||ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshStandardMaterial||ce.envMap){const en=ht.map.cameraPosition;en!==void 0&&en.setValue(G,X.setFromMatrixPosition(Z.matrixWorld))}(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&ht.setValue(G,"isOrthographic",Z.isOrthographicCamera===!0),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial||ce.isShadowMaterial||me.isSkinnedMesh)&&ht.setValue(G,"viewMatrix",Z.matrixWorldInverse)}if(me.isSkinnedMesh){ht.setOptional(G,me,"bindMatrix"),ht.setOptional(G,me,"bindMatrixInverse");const en=me.skeleton;en&&(ee.floatVertexTextures?(en.boneTexture===null&&en.computeBoneTexture(),ht.setValue(G,"boneTexture",en.boneTexture,te),ht.setValue(G,"boneTextureSize",en.boneTextureSize)):ht.setOptional(G,en,"boneMatrices"))}return(Gt||Ne.receiveShadow!==me.receiveShadow)&&(Ne.receiveShadow=me.receiveShadow,ht.setValue(G,"receiveShadow",me.receiveShadow)),Gt&&(ht.setValue(G,"toneMappingExposure",d.toneMappingExposure),Ne.needsLights&&Be(hs,ds),Se&&ce.fog&&oe.refreshFogUniforms(hs,Se),oe.refreshMaterialUniforms(hs,ce,P,T,U),fr.upload(G,Ne.uniformsList,hs,te)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(fr.upload(G,Ne.uniformsList,hs,te),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&ht.setValue(G,"center",me.center),ht.setValue(G,"modelViewMatrix",me.modelViewMatrix),ht.setValue(G,"normalMatrix",me.normalMatrix),ht.setValue(G,"modelMatrix",me.matrixWorld),Ke}function Be(Z,de){Z.ambientLightColor.needsUpdate=de,Z.lightProbe.needsUpdate=de,Z.directionalLights.needsUpdate=de,Z.directionalLightShadows.needsUpdate=de,Z.pointLights.needsUpdate=de,Z.pointLightShadows.needsUpdate=de,Z.spotLights.needsUpdate=de,Z.spotLightShadows.needsUpdate=de,Z.rectAreaLights.needsUpdate=de,Z.hemisphereLights.needsUpdate=de}function Je(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return M},this.setRenderTarget=function(Z,de=0,ce=0){M=Z,v=de,g=ce,Z&&Y.get(Z).__webglFramebuffer===void 0&&te.setupRenderTarget(Z);let me=null,Se=!1,ue=!1;if(Z){const Te=Z.texture;(Te.isDataTexture3D||Te.isDataTexture2DArray)&&(ue=!0);const Pe=Y.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(me=Pe[de],Se=!0):Z.isWebGLMultisampleRenderTarget?me=Y.get(Z).__webglMultisampledFramebuffer:me=Pe,S.copy(Z.viewport),w.copy(Z.scissor),A=Z.scissorTest}else S.copy(L).multiplyScalar(P).floor(),w.copy(N).multiplyScalar(P).floor(),A=x;if(K.bindFramebuffer(36160,me)&&ee.drawBuffers){let Te=!1;if(Z)if(Z.isWebGLMultipleRenderTargets){const Pe=Z.texture;if(O.length!==Pe.length||O[0]!==36064){for(let Ne=0,ze=Pe.length;Ne<ze;Ne++)O[Ne]=36064+Ne;O.length=Pe.length,Te=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,Te=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,Te=!0);Te&&(ee.isWebGL2?G.drawBuffers(O):q.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if(K.viewport(S),K.scissor(w),K.setScissorTest(A),Se){const Te=Y.get(Z.texture);G.framebufferTexture2D(36160,36064,34069+de,Te.__webglTexture,ce)}else if(ue){const Te=Y.get(Z.texture),Pe=de||0;G.framebufferTextureLayer(36160,36064,Te.__webglTexture,ce||0,Pe)}},this.readRenderTargetPixels=function(Z,de,ce,me,Se,ue,xe){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Te=Y.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&xe!==void 0&&(Te=Te[xe]),Te){K.bindFramebuffer(36160,Te);try{const Pe=Z.texture,Ne=Pe.format,ze=Pe.type;if(Ne!==mn&&we.convert(Ne)!==G.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Fe=ze===Dr&&(q.has("EXT_color_buffer_half_float")||ee.isWebGL2&&q.has("EXT_color_buffer_float"));if(ze!==Nr&&we.convert(ze)!==G.getParameter(35738)&&!(ze===Ei&&(ee.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float")))&&!Fe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}G.checkFramebufferStatus(36160)===36053?de>=0&&de<=Z.width-me&&ce>=0&&ce<=Z.height-Se&&G.readPixels(de,ce,me,Se,we.convert(Ne),we.convert(ze),ue):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Pe=M!==null?Y.get(M).__webglFramebuffer:null;K.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(Z,de,ce=0){const me=Math.pow(2,-ce),Se=Math.floor(de.image.width*me),ue=Math.floor(de.image.height*me);let xe=we.convert(de.format);ee.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),te.setTexture2D(de,0),G.copyTexImage2D(3553,ce,xe,Z.x,Z.y,Se,ue,0),K.unbindTexture()},this.copyTextureToTexture=function(Z,de,ce,me=0){const Se=de.image.width,ue=de.image.height,xe=we.convert(ce.format),Te=we.convert(ce.type);te.setTexture2D(ce,0),G.pixelStorei(37440,ce.flipY),G.pixelStorei(37441,ce.premultiplyAlpha),G.pixelStorei(3317,ce.unpackAlignment),de.isDataTexture?G.texSubImage2D(3553,me,Z.x,Z.y,Se,ue,xe,Te,de.image.data):de.isCompressedTexture?G.compressedTexSubImage2D(3553,me,Z.x,Z.y,de.mipmaps[0].width,de.mipmaps[0].height,xe,de.mipmaps[0].data):G.texSubImage2D(3553,me,Z.x,Z.y,xe,Te,de.image),me===0&&ce.generateMipmaps&&G.generateMipmap(3553),K.unbindTexture()},this.copyTextureToTexture3D=function(Z,de,ce,me,Se=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ue=Z.max.x-Z.min.x+1,xe=Z.max.y-Z.min.y+1,Te=Z.max.z-Z.min.z+1,Pe=we.convert(me.format),Ne=we.convert(me.type);let ze;if(me.isDataTexture3D)te.setTexture3D(me,0),ze=32879;else if(me.isDataTexture2DArray)te.setTexture2DArray(me,0),ze=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}G.pixelStorei(37440,me.flipY),G.pixelStorei(37441,me.premultiplyAlpha),G.pixelStorei(3317,me.unpackAlignment);const Fe=G.getParameter(3314),Ke=G.getParameter(32878),It=G.getParameter(3316),Gt=G.getParameter(3315),ds=G.getParameter(32877),ht=ce.isCompressedTexture?ce.mipmaps[0]:ce.image;G.pixelStorei(3314,ht.width),G.pixelStorei(32878,ht.height),G.pixelStorei(3316,Z.min.x),G.pixelStorei(3315,Z.min.y),G.pixelStorei(32877,Z.min.z),ce.isDataTexture||ce.isDataTexture3D?G.texSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,Ne,ht.data):ce.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),G.compressedTexSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,ht.data)):G.texSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,Ne,ht),G.pixelStorei(3314,Fe),G.pixelStorei(32878,Ke),G.pixelStorei(3316,It),G.pixelStorei(3315,Gt),G.pixelStorei(32877,ds),Se===0&&me.generateMipmaps&&G.generateMipmap(ze),K.unbindTexture()},this.initTexture=function(Z){te.setTexture2D(Z,0),K.unbindTexture()},this.resetState=function(){v=0,g=0,M=null,K.reset(),pe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Sv extends at{}Sv.prototype.isWebGL1Renderer=!0;class pa{constructor(e,t=25e-5){this.name="",this.color=new Ae(e),this.density=t}clone(){return new pa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}pa.prototype.isFogExp2=!0;class ma{constructor(e,t=1,i=1e3){this.name="",this.color=new Ae(e),this.near=t,this.far=i}clone(){return new ma(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ma.prototype.isFog=!0;class mc extends $e{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}mc.prototype.isScene=!0;class pr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=gn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,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=gn()),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=gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}pr.prototype.isInterleavedBuffer=!0;const Rt=new J;class Di{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}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++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.applyMatrix4(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.applyNormalMatrix(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.transformDirection(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,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.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.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 interlaved buffer attribute will deinterleave 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 Ge(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 Di(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave 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}}}Di.prototype.isInterleavedBufferAttribute=!0;class ga extends Nt{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}ga.prototype.isSpriteMaterial=!0;let no;const ya=new J,io=new J,ro=new J,so=new _e,va=new _e,_v=new De,gc=new J,ba=new J,yc=new J,Ev=new _e,Mh=new _e,Tv=new _e;class xa extends $e{constructor(e){if(super(),this.type="Sprite",no===void 0){no=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new pr(t,5);no.setIndex([0,1,2,0,2,3]),no.setAttribute("position",new Di(i,3,0,!1)),no.setAttribute("uv",new Di(i,2,3,!1))}this.geometry=no,this.material=e!==void 0?e:new ga,this.center=new _e(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),io.setFromMatrixScale(this.matrixWorld),_v.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ro.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&io.multiplyScalar(-ro.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;vc(gc.set(-.5,-.5,0),ro,o,io,r,s),vc(ba.set(.5,-.5,0),ro,o,io,r,s),vc(yc.set(.5,.5,0),ro,o,io,r,s),Ev.set(0,0),Mh.set(1,0),Tv.set(1,1);let l=e.ray.intersectTriangle(gc,ba,yc,!1,ya);if(l===null&&(vc(ba.set(-.5,.5,0),ro,o,io,r,s),Mh.set(0,1),l=e.ray.intersectTriangle(gc,yc,ba,!1,ya),l===null))return;const u=e.ray.origin.distanceTo(ya);u<e.near||u>e.far||t.push({distance:u,point:ya.clone(),uv:Ct.getUV(ya,gc,ba,yc,Ev,Mh,Tv,new _e),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}xa.prototype.isSprite=!0;function vc(n,e,t,i,r,s){so.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(va.x=s*so.x-r*so.y,va.y=r*so.x+s*so.y):va.copy(so),n.copy(e),n.x+=va.x,n.y+=va.y,n.applyMatrix4(_v)}const bc=new J,Cv=new J;class Av extends $e{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){bc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(bc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){bc.setFromMatrixPosition(e.matrixWorld),Cv.setFromMatrixPosition(this.matrixWorld);const i=bc.distanceTo(Cv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Rv=new J,Lv=new st,Pv=new st,lN=new J,Iv=new De;class wa extends At{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new De,this.bindMatrixInverse=new De}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}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 st,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(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==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;Lv.fromBufferAttribute(r.attributes.skinIndex,e),Pv.fromBufferAttribute(r.attributes.skinWeight,e),Rv.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Pv.getComponent(s);if(o!==0){const l=Lv.getComponent(s);Iv.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(lN.copy(Rv).applyMatrix4(Iv),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}wa.prototype.isSkinnedMesh=!0;class Ma extends $e{constructor(){super(),this.type="Bone"}}Ma.prototype.isBone=!0;class Zr extends Tt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=Et,f=Et,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Zr.prototype.isDataTexture=!0;const Ov=new De,cN=new De;class Sa{constructor(e=[],t=[]){this.uuid=gn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,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 De)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new De;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 l=e[s]?e[s].matrixWorld:cN;Ov.multiplyMatrices(l,t[s]),Ov.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Sa(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Ay(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Zr(t,e,e,mn,Ei);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,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 Ma),this.bones.push(o),this.boneInverses.push(new De().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,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 l=i[r];e.boneInverses.push(l.toArray())}return e}}const Nv=new De,Dv=new De,xc=[],_a=new At;class Sh extends At{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ge(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(_a.geometry=this.geometry,_a.material=this.material,_a.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,Nv),Dv.multiplyMatrices(i,Nv),_a.matrixWorld=Dv,_a.raycast(e,xc);for(let o=0,l=xc.length;o<l;o++){const u=xc[o];u.instanceId=s,u.object=this,t.push(u)}xc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ge(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Sh.prototype.isInstancedMesh=!0;class Ft extends Nt{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ae(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Ft.prototype.isLineBasicMaterial=!0;const Bv=new J,Fv=new J,Vv=new De,_h=new lr,wc=new Ai;class ni extends $e{constructor(e=new ke,t=new Ft){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Bv.fromBufferAttribute(t,r-1),Fv.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Bv.distanceTo(Fv);e.setAttribute("lineDistance",new Oe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");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(),wc.copy(i.boundingSphere),wc.applyMatrix4(r),wc.radius+=s,e.ray.intersectsSphere(wc)===!1)return;Vv.copy(r).invert(),_h.copy(e.ray).applyMatrix4(Vv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new J,f=new J,h=new J,p=new J,y=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const v=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let M=v,_=g-1;M<_;M+=y){const E=m.getX(M),S=m.getX(M+1);if(c.fromBufferAttribute(b,E),f.fromBufferAttribute(b,S),_h.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(p);A<e.near||A>e.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let M=v,_=g-1;M<_;M+=y){if(c.fromBufferAttribute(b,M),f.fromBufferAttribute(b,M+1),_h.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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 l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ni.prototype.isLine=!0;const kv=new J,zv=new J;class on extends ni{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)kv.fromBufferAttribute(t,r),zv.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+kv.distanceTo(zv);e.setAttribute("lineDistance",new Oe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}on.prototype.isLineSegments=!0;class Mc extends ni{constructor(e,t){super(e,t),this.type="LineLoop"}}Mc.prototype.isLineLoop=!0;class mr extends Nt{constructor(e){super(),this.type="PointsMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,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.morphTargets=e.morphTargets,this}}mr.prototype.isPointsMaterial=!0;const Uv=new De,Eh=new lr,Sc=new Ai,_c=new J;class oo extends $e{constructor(e=new ke,t=new mr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=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(),Sc.copy(i.boundingSphere),Sc.applyMatrix4(r),Sc.radius+=s,e.ray.intersectsSphere(Sc)===!1)return;Uv.copy(r).invert(),Eh.copy(e.ray).applyMatrix4(Uv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),y=Math.min(c.count,o.start+o.count);for(let m=p,d=y;m<d;m++){const b=c.getX(m);_c.fromBufferAttribute(h,b),Gv(_c,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),y=Math.min(h.count,o.start+o.count);for(let m=p,d=y;m<d;m++)_c.fromBufferAttribute(h,m),Gv(_c,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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 l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}oo.prototype.isPoints=!0;function Gv(n,e,t,i,r,s,o){const l=Eh.distanceSqToPoint(n);if(l<t){const u=new J;Eh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Hv extends Tt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Ti,this.minFilter=o!==void 0?o:vt,this.magFilter=s!==void 0?s:vt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Hv.prototype.isVideoTexture=!0;class Th extends Tt{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Th.prototype.isCompressedTexture=!0;class Wv extends Tt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Wv.prototype.isCanvasTexture=!0;class jv extends Tt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Br,f!==Br&&f!==Ds)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Br&&(i=ta),i===void 0&&f===Ds&&(i=Ns),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:Et,this.minFilter=u!==void 0?u:Et,this.flipY=!1,this.generateMipmaps=!1}}jv.prototype.isDepthTexture=!0;class ao extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new J,f=new _e;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const y=i+h/t*r;c.x=e*Math.cos(y),c.y=e*Math.sin(y),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Oe(o,3)),this.setAttribute("normal",new Oe(l,3)),this.setAttribute("uv",new Oe(u,2))}static fromJSON(e){return new ao(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class gr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],y=[];let m=0;const d=[],b=i/2;let v=0;g(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new Oe(h,3)),this.setAttribute("normal",new Oe(p,3)),this.setAttribute("uv",new Oe(y,2));function g(){const _=new J,E=new J;let S=0;const w=(t-e)/i;for(let A=0;A<=s;A++){const I=[],T=A/s,P=T*(t-e)+e;for(let C=0;C<=r;C++){const R=C/r,L=R*u+l,N=Math.sin(L),x=Math.cos(L);E.x=P*N,E.y=-T*i+b,E.z=P*x,h.push(E.x,E.y,E.z),_.set(N,w,x).normalize(),p.push(_.x,_.y,_.z),y.push(R,1-T),I.push(m++)}d.push(I)}for(let A=0;A<r;A++)for(let I=0;I<s;I++){const T=d[I][A],P=d[I+1][A],C=d[I+1][A+1],R=d[I][A+1];f.push(T,P,R),f.push(P,C,R),S+=6}c.addGroup(v,S,0),v+=S}function M(_){const E=m,S=new _e,w=new J;let A=0;const I=_===!0?e:t,T=_===!0?1:-1;for(let C=1;C<=r;C++)h.push(0,b*T,0),p.push(0,T,0),y.push(.5,.5),m++;const P=m;for(let C=0;C<=r;C++){const L=C/r*u+l,N=Math.cos(L),x=Math.sin(L);w.x=I*x,w.y=b*T,w.z=I*N,h.push(w.x,w.y,w.z),p.push(0,T,0),S.x=N*.5+.5,S.y=x*.5*T+.5,y.push(S.x,S.y),m++}for(let C=0;C<r;C++){const R=E+C,L=P+C;_===!0?f.push(L,L+1,R):f.push(L+1,L,R),A+=3}c.addGroup(v,A,_===!0?1:2),v+=A}}static fromJSON(e){return new gr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class lo extends gr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new lo(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ii extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Oe(s,3)),this.setAttribute("normal",new Oe(s.slice(),3)),this.setAttribute("uv",new Oe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const M=new J,_=new J,E=new J;for(let S=0;S<t.length;S+=3)y(t[S+0],M),y(t[S+1],_),y(t[S+2],E),u(M,_,E,g)}function u(g,M,_,E){const S=E+1,w=[];for(let A=0;A<=S;A++){w[A]=[];const I=g.clone().lerp(_,A/S),T=M.clone().lerp(_,A/S),P=S-A;for(let C=0;C<=P;C++)C===0&&A===S?w[A][C]=I:w[A][C]=I.clone().lerp(T,C/P)}for(let A=0;A<S;A++)for(let I=0;I<2*(S-A)-1;I++){const T=Math.floor(I/2);I%2===0?(p(w[A][T+1]),p(w[A+1][T]),p(w[A][T])):(p(w[A][T+1]),p(w[A+1][T+1]),p(w[A+1][T]))}}function c(g){const M=new J;for(let _=0;_<s.length;_+=3)M.x=s[_+0],M.y=s[_+1],M.z=s[_+2],M.normalize().multiplyScalar(g),s[_+0]=M.x,s[_+1]=M.y,s[_+2]=M.z}function f(){const g=new J;for(let M=0;M<s.length;M+=3){g.x=s[M+0],g.y=s[M+1],g.z=s[M+2];const _=b(g)/2/Math.PI+.5,E=v(g)/Math.PI+.5;o.push(_,1-E)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const M=o[g+0],_=o[g+2],E=o[g+4],S=Math.max(M,_,E),w=Math.min(M,_,E);S>.9&&w<.1&&(M<.2&&(o[g+0]+=1),_<.2&&(o[g+2]+=1),E<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function y(g,M){const _=g*3;M.x=e[_+0],M.y=e[_+1],M.z=e[_+2]}function m(){const g=new J,M=new J,_=new J,E=new J,S=new _e,w=new _e,A=new _e;for(let I=0,T=0;I<s.length;I+=9,T+=6){g.set(s[I+0],s[I+1],s[I+2]),M.set(s[I+3],s[I+4],s[I+5]),_.set(s[I+6],s[I+7],s[I+8]),S.set(o[T+0],o[T+1]),w.set(o[T+2],o[T+3]),A.set(o[T+4],o[T+5]),E.copy(g).add(M).add(_).divideScalar(3);const P=b(E);d(S,T+0,g,P),d(w,T+2,M,P),d(A,T+4,_,P)}}function d(g,M,_,E){E<0&&g.x===1&&(o[M]=g.x-1),_.x===0&&_.z===0&&(o[M]=E/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function v(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new ii(e.vertices,e.indices,e.radius,e.details)}}class co extends ii{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new co(e.radius,e.detail)}}const Ec=new J,Tc=new J,Ch=new J,Cc=new Ct;class Ah extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Ur*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},y=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:v}=Cc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),v.fromBufferAttribute(l,c[2]),Cc.getNormal(Ch),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const M=(g+1)%3,_=h[g],E=h[M],S=Cc[f[g]],w=Cc[f[M]],A=`${_}_${E}`,I=`${E}_${_}`;I in p&&p[I]?(Ch.dot(p[I].normal)<=s&&(y.push(S.x,S.y,S.z),y.push(w.x,w.y,w.z)),p[I]=null):A in p||(p[A]={index0:c[g],index1:c[M],normal:Ch.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];Ec.fromBufferAttribute(l,d),Tc.fromBufferAttribute(l,b),y.push(Ec.x,Ec.y,Ec.z),y.push(Tc.x,Tc.y,Tc.z)}this.setAttribute("position",new Oe(y,3))}}class bn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,y=(o-f)/p;return(r+y)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new _e:new J);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new J,r=[],s=[],o=[],l=new J,u=new De;for(let y=0;y<=e;y++){const m=y/e;r[y]=this.getTangentAt(m,new J),r[y].normalize()}s[0]=new J,o[0]=new J;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(r[y-1],r[y]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[y-1].dot(r[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,m))}o[y].crossVectors(r[y],s[y])}if(t===!0){let y=Math.acos($t(s[0].dot(s[e]),-1,1));y/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],y*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ea extends bn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new _e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,y=c-this.aY;u=p*f-y*h+this.aX,c=p*h+y*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Ea.prototype.isEllipseCurve=!0;class Rh extends Ea{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}Rh.prototype.isArcCurve=!0;function Lh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,y=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,y*=f,r(o,l,p,y)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const Ac=new J,Ph=new Lh,Ih=new Lh,Oh=new Lh;class Nh extends bn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new J){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(Ac.subVectors(r[0],r[1]).add(r[0]),c=Ac);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(Ac.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=Ac),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),y),d=Math.pow(h.distanceToSquared(p),y),b=Math.pow(p.distanceToSquared(f),y);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),Ph.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),Ih.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),Oh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(Ph.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),Ih.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),Oh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(Ph.calc(u),Ih.calc(u),Oh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new J().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}Nh.prototype.isCatmullRomCurve3=!0;function $v(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function uN(n,e){const t=1-n;return t*t*e}function dN(n,e){return 2*(1-n)*n*e}function hN(n,e){return n*n*e}function Ta(n,e,t,i){return uN(n,e)+dN(n,t)+hN(n,i)}function fN(n,e){const t=1-n;return t*t*t*e}function pN(n,e){const t=1-n;return 3*t*t*n*e}function mN(n,e){return 3*(1-n)*n*n*e}function gN(n,e){return n*n*n*e}function Ca(n,e,t,i,r){return fN(n,e)+pN(n,t)+mN(n,i)+gN(n,r)}class Rc extends bn{constructor(e=new _e,t=new _e,i=new _e,r=new _e){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new _e){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ca(e,r.x,s.x,o.x,l.x),Ca(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Rc.prototype.isCubicBezierCurve=!0;class Dh extends bn{constructor(e=new J,t=new J,i=new J,r=new J){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new J){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ca(e,r.x,s.x,o.x,l.x),Ca(e,r.y,s.y,o.y,l.y),Ca(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Dh.prototype.isCubicBezierCurve3=!0;class Aa extends bn{constructor(e=new _e,t=new _e){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new _e){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new _e;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Aa.prototype.isLineCurve=!0;class Zv extends bn{constructor(e=new J,t=new J){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new J){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Lc extends bn{constructor(e=new _e,t=new _e,i=new _e){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new _e){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Ta(e,r.x,s.x,o.x),Ta(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Lc.prototype.isQuadraticBezierCurve=!0;class Bh extends bn{constructor(e=new J,t=new J,i=new J){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new J){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Ta(e,r.x,s.x,o.x),Ta(e,r.y,s.y,o.y),Ta(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Bh.prototype.isQuadraticBezierCurve3=!0;class Pc extends bn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new _e){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set($v(l,u.x,c.x,f.x,h.x),$v(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new _e().fromArray(r))}return this}}Pc.prototype.isSplineCurve=!0;var Fh=Object.freeze({__proto__:null,ArcCurve:Rh,CatmullRomCurve3:Nh,CubicBezierCurve:Rc,CubicBezierCurve3:Dh,EllipseCurve:Ea,LineCurve:Aa,LineCurve3:Zv,QuadraticBezierCurve:Lc,QuadraticBezierCurve3:Bh,SplineCurve:Pc});const yN={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Xv(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,y;if(i&&(s=MN(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);y=Math.max(c-l,f-u),y=y!==0?1/y:0}return Ra(s,o,t,l,u,y),o}};function Xv(n,e,t,i,r){let s,o;if(r===ON(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Kv(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Kv(s,n[s],n[s+1],o);return o&&Ic(o,o.next)&&(Pa(o),o=o.next),o}function yr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ic(t,t.next)||gt(t.prev,t,t.next)===0)){if(Pa(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ra(n,e,t,i,r,s,o){if(!n)return;!o&&s&&CN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?bN(n,i,r,s):vN(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Pa(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=xN(yr(n),e,t),Ra(n,e,t,i,r,s,2)):o===2&&wN(n,e,t,i,r,s):Ra(yr(n),e,t,i,r,s,1);break}}}function vN(n){const e=n.prev,t=n,i=n.next;if(gt(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(uo(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&gt(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function bN(n,e,t,i){const r=n.prev,s=n,o=n.next;if(gt(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Vh(l,u,e,t,i),p=Vh(c,f,e,t,i);let y=n.prevZ,m=n.nextZ;for(;y&&y.z>=h&&m&&m.z<=p;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&gt(y.prev,y,y.next)>=0||(y=y.prevZ,m!==n.prev&&m!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&gt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;y&&y.z>=h;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&gt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&gt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function xN(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ic(r,s)&&Yv(r,i,i.next,s)&&La(r,s)&&La(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Pa(i),Pa(i.next),i=n=s),i=i.next}while(i!==n);return yr(i)}function wN(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&LN(o,l)){let u=Jv(o,l);o=yr(o,o.next),u=yr(u,u.next),Ra(o,e,t,i,r,s),Ra(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function MN(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Xv(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(RN(c));for(r.sort(SN),s=0;s<r.length;s++)_N(r[s],t),t=yr(t,t.next);return t}function SN(n,e){return n.x-e.x}function _N(n,e){if(e=EN(n,e),e){const t=Jv(e,n);yr(e,e.next),yr(t,t.next)}}function EN(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&uo(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),La(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&TN(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function TN(n,e){return gt(n.prev,n,e.prev)<0&&gt(e.next,n,n.next)<0}function CN(n,e,t,i){let r=n;do r.z===null&&(r.z=Vh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,AN(r)}function AN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Vh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function RN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function uo(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function LN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!PN(n,e)&&(La(n,e)&&La(e,n)&&IN(n,e)&&(gt(n.prev,n,e.prev)||gt(n,e.prev,e))||Ic(n,e)&&gt(n.prev,n,n.next)>0&&gt(e.prev,e,e.next)>0)}function gt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ic(n,e){return n.x===e.x&&n.y===e.y}function Yv(n,e,t,i){const r=Nc(gt(n,e,t)),s=Nc(gt(n,e,i)),o=Nc(gt(t,i,n)),l=Nc(gt(t,i,e));return!!(r!==s&&o!==l||r===0&&Oc(n,t,e)||s===0&&Oc(n,i,e)||o===0&&Oc(t,n,i)||l===0&&Oc(t,e,i))}function Oc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Nc(n){return n>0?1:n<0?-1:0}function PN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Yv(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function La(n,e){return gt(n.prev,n,n.next)<0?gt(n,e,n.next)>=0&&gt(n,n.prev,e)>=0:gt(n,e,n.prev)<0||gt(n,n.next,e)<0}function IN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Jv(n,e){const t=new kh(n.i,n.x,n.y),i=new kh(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Kv(n,e,t,i){const r=new kh(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Pa(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function kh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ON(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ri{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ri.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];qv(e),Qv(i,e);let o=e.length;t.forEach(qv);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Qv(i,t[u]);const l=yN.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function qv(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Qv(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Un extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Oe(r,3)),this.setAttribute("uv",new Oe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,y=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:y-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:NN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let M,_=!1,E,S,w,A;v&&(M=v.getSpacedPoints(f),_=!0,p=!1,E=v.computeFrenetFrames(f,!1),S=new J,w=new J,A=new J),p||(b=0,y=0,m=0,d=0);const I=l.extractPoints(c);let T=I.shape;const P=I.holes;if(!ri.isClockWise(T)){T=T.reverse();for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];ri.isClockWise(F)&&(P[Y]=F.reverse())}}const R=ri.triangulateShape(T,P),L=T;for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];T=T.concat(F)}function N(Y,te,F){return te||console.error("THREE.ExtrudeGeometry: vec does not exist"),te.clone().multiplyScalar(F).add(Y)}const x=T.length,O=R.length;function B(Y,te,F){let $,Q,V;const z=Y.x-te.x,oe=Y.y-te.y,ae=F.x-Y.x,le=F.y-Y.y,fe=z*z+oe*oe,be=z*le-oe*ae;if(Math.abs(be)>Number.EPSILON){const ye=Math.sqrt(fe),he=Math.sqrt(ae*ae+le*le),ve=te.x-oe/ye,se=te.y+z/ye,we=F.x-le/he,pe=F.y+ae/he,ge=((we-ve)*le-(pe-se)*ae)/(z*le-oe*ae);$=ve+z*ge-Y.x,Q=se+oe*ge-Y.y;const Ee=$*$+Q*Q;if(Ee<=2)return new _e($,Q);V=Math.sqrt(Ee/2)}else{let ye=!1;z>Number.EPSILON?ae>Number.EPSILON&&(ye=!0):z<-Number.EPSILON?ae<-Number.EPSILON&&(ye=!0):Math.sign(oe)===Math.sign(le)&&(ye=!0),ye?($=-oe,Q=z,V=Math.sqrt(fe)):($=z,Q=oe,V=Math.sqrt(fe/2))}return new _e($/V,Q/V)}const D=[];for(let Y=0,te=L.length,F=te-1,$=Y+1;Y<te;Y++,F++,$++)F===te&&(F=0),$===te&&($=0),D[Y]=B(L[Y],L[F],L[$]);const k=[];let U,H=D.concat();for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];U=[];for(let $=0,Q=F.length,V=Q-1,z=$+1;$<Q;$++,V++,z++)V===Q&&(V=0),z===Q&&(z=0),U[$]=B(F[$],F[V],F[z]);k.push(U),H=H.concat(U)}for(let Y=0;Y<b;Y++){const te=Y/b,F=y*Math.cos(te*Math.PI/2),$=m*Math.sin(te*Math.PI/2)+d;for(let Q=0,V=L.length;Q<V;Q++){const z=N(L[Q],D[Q],$);W(z.x,z.y,-F)}for(let Q=0,V=P.length;Q<V;Q++){const z=P[Q];U=k[Q];for(let oe=0,ae=z.length;oe<ae;oe++){const le=N(z[oe],U[oe],$);W(le.x,le.y,-F)}}}const X=m+d;for(let Y=0;Y<x;Y++){const te=p?N(T[Y],H[Y],X):T[Y];_?(w.copy(E.normals[0]).multiplyScalar(te.x),S.copy(E.binormals[0]).multiplyScalar(te.y),A.copy(M[0]).add(w).add(S),W(A.x,A.y,A.z)):W(te.x,te.y,0)}for(let Y=1;Y<=f;Y++)for(let te=0;te<x;te++){const F=p?N(T[te],H[te],X):T[te];_?(w.copy(E.normals[Y]).multiplyScalar(F.x),S.copy(E.binormals[Y]).multiplyScalar(F.y),A.copy(M[Y]).add(w).add(S),W(A.x,A.y,A.z)):W(F.x,F.y,h/f*Y)}for(let Y=b-1;Y>=0;Y--){const te=Y/b,F=y*Math.cos(te*Math.PI/2),$=m*Math.sin(te*Math.PI/2)+d;for(let Q=0,V=L.length;Q<V;Q++){const z=N(L[Q],D[Q],$);W(z.x,z.y,h+F)}for(let Q=0,V=P.length;Q<V;Q++){const z=P[Q];U=k[Q];for(let oe=0,ae=z.length;oe<ae;oe++){const le=N(z[oe],U[oe],$);_?W(le.x,le.y+M[f-1].y,M[f-1].x+F):W(le.x,le.y,h+F)}}}re(),j();function re(){const Y=r.length/3;if(p){let te=0,F=x*te;for(let $=0;$<O;$++){const Q=R[$];q(Q[2]+F,Q[1]+F,Q[0]+F)}te=f+b*2,F=x*te;for(let $=0;$<O;$++){const Q=R[$];q(Q[0]+F,Q[1]+F,Q[2]+F)}}else{for(let te=0;te<O;te++){const F=R[te];q(F[2],F[1],F[0])}for(let te=0;te<O;te++){const F=R[te];q(F[0]+x*f,F[1]+x*f,F[2]+x*f)}}i.addGroup(Y,r.length/3-Y,0)}function j(){const Y=r.length/3;let te=0;G(L,te),te+=L.length;for(let F=0,$=P.length;F<$;F++){const Q=P[F];G(Q,te),te+=Q.length}i.addGroup(Y,r.length/3-Y,1)}function G(Y,te){let F=Y.length;for(;--F>=0;){const $=F;let Q=F-1;Q<0&&(Q=Y.length-1);for(let V=0,z=f+b*2;V<z;V++){const oe=x*V,ae=x*(V+1),le=te+$+oe,fe=te+Q+oe,be=te+Q+ae,ye=te+$+ae;ee(le,fe,be,ye)}}}function W(Y,te,F){u.push(Y),u.push(te),u.push(F)}function q(Y,te,F){K(Y),K(te),K(F);const $=r.length/3,Q=g.generateTopUV(i,r,$-3,$-2,$-1);ie(Q[0]),ie(Q[1]),ie(Q[2])}function ee(Y,te,F,$){K(Y),K(te),K($),K(te),K(F),K($);const Q=r.length/3,V=g.generateSideWallUV(i,r,Q-6,Q-3,Q-2,Q-1);ie(V[0]),ie(V[1]),ie(V[3]),ie(V[1]),ie(V[2]),ie(V[3])}function K(Y){r.push(u[Y*3+0]),r.push(u[Y*3+1]),r.push(u[Y*3+2])}function ie(Y){s.push(Y.x),s.push(Y.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return DN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Fh[r.type]().fromJSON(r)),new Un(i,e.options)}}const NN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new _e(s,o),new _e(l,u),new _e(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],y=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],v=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new _e(o,1-u),new _e(c,1-h),new _e(p,1-m),new _e(d,1-v)]:[new _e(l,1-u),new _e(f,1-h),new _e(y,1-m),new _e(b,1-v)]}};function DN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class ho extends ii{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ho(e.radius,e.detail)}}class fo extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new J,f=new _e;for(let h=0;h<=t;h++){const p=i+h*u*r,y=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*y,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const y=p+h*e.length,m=y,d=y+e.length,b=y+e.length+1,v=y+1;s.push(m,d,v),s.push(d,b,v)}if(this.setIndex(s),this.setAttribute("position",new Oe(o,3)),this.setAttribute("uv",new Oe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new J,y=new J,m=new J,d=t*e.length*3;for(let b=0,v=0;b<e.length;b++,v+=3)p.x=h[v+0],p.y=h[v+1],p.z=h[v+2],y.x=h[d+v+0],y.y=h[d+v+1],y.z=h[d+v+2],m.addVectors(p,y).normalize(),h[v+0]=h[d+v+0]=m.x,h[v+1]=h[d+v+1]=m.y,h[v+2]=h[d+v+2]=m.z}}static fromJSON(e){return new fo(e.points,e.segments,e.phiStart,e.phiLength)}}class Xr extends ii{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Xr(e.radius,e.detail)}}class Dc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new J,f=new J,h=new J,p=new J,y=new J;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let v=0;v<=t;v++){const g=v/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),y.subVectors(f,h)):(e(g,b+u,h),y.subVectors(h,f)),c.crossVectors(p,y).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const v=d*m+b,g=d*m+b+1,M=(d+1)*m+b+1,_=(d+1)*m+b;r.push(v,g,_),r.push(g,M,_)}this.setIndex(r),this.setAttribute("position",new Oe(s,3)),this.setAttribute("normal",new Oe(o,3)),this.setAttribute("uv",new Oe(l,2))}}class po extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,y=new J,m=new _e;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const v=s+b/i*o;y.x=h*Math.cos(v),y.y=h*Math.sin(v),u.push(y.x,y.y,y.z),c.push(0,0,1),m.x=(y.x/t+1)/2,m.y=(y.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let v=0;v<i;v++){const g=v+b,M=g,_=g+i+1,E=g+i+2,S=g+1;l.push(M,_,S),l.push(_,E,S)}}this.setIndex(l),this.setAttribute("position",new Oe(u,3)),this.setAttribute("normal",new Oe(c,3)),this.setAttribute("uv",new Oe(f,2))}static fromJSON(e){return new po(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Yr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Oe(r,3)),this.setAttribute("normal",new Oe(s,3)),this.setAttribute("uv",new Oe(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let y=p.shape;const m=p.holes;ri.isClockWise(y)===!1&&(y=y.reverse());for(let b=0,v=m.length;b<v;b++){const g=m[b];ri.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=ri.triangulateShape(y,m);for(let b=0,v=m.length;b<v;b++){const g=m[b];y=y.concat(g)}for(let b=0,v=y.length;b<v;b++){const g=y[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,v=d.length;b<v;b++){const g=d[b],M=g[0]+h,_=g[1]+h,E=g[2]+h;i.push(M,_,E),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return BN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Yr(i,e.curveSegments)}}function BN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Jr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new J,p=new J,y=[],m=[],d=[],b=[];for(let v=0;v<=i;v++){const g=[],M=v/i;let _=0;v==0&&o==0?_=.5/t:v==i&&u==Math.PI&&(_=-.5/t);for(let E=0;E<=t;E++){const S=E/t;h.x=-e*Math.cos(r+S*s)*Math.sin(o+M*l),h.y=e*Math.cos(o+M*l),h.z=e*Math.sin(r+S*s)*Math.sin(o+M*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(S+_,1-M),g.push(c++)}f.push(g)}for(let v=0;v<i;v++)for(let g=0;g<t;g++){const M=f[v][g+1],_=f[v][g],E=f[v+1][g],S=f[v+1][g+1];(v!==0||o>0)&&y.push(M,_,S),(v!==i-1||u<Math.PI)&&y.push(_,E,S)}this.setIndex(y),this.setAttribute("position",new Oe(m,3)),this.setAttribute("normal",new Oe(d,3)),this.setAttribute("uv",new Oe(b,2))}static fromJSON(e){return new Jr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class mo extends ii{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new mo(e.radius,e.detail)}}class Bc extends Un{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class go extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new J,h=new J,p=new J;for(let y=0;y<=i;y++)for(let m=0;m<=r;m++){const d=m/r*s,b=y/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(y/i)}for(let y=1;y<=i;y++)for(let m=1;m<=r;m++){const d=(r+1)*y+m-1,b=(r+1)*(y-1)+m-1,v=(r+1)*(y-1)+m,g=(r+1)*y+m;o.push(d,b,g),o.push(b,v,g)}this.setIndex(o),this.setAttribute("position",new Oe(l,3)),this.setAttribute("normal",new Oe(u,3)),this.setAttribute("uv",new Oe(c,2))}static fromJSON(e){return new go(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class yo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new J,p=new J,y=new J,m=new J,d=new J,b=new J,v=new J;for(let M=0;M<=i;++M){const _=M/i*s*Math.PI*2;g(_,s,o,e,y),g(_+.01,s,o,e,m),b.subVectors(m,y),v.addVectors(m,y),d.crossVectors(b,v),v.crossVectors(d,b),d.normalize(),v.normalize();for(let E=0;E<=r;++E){const S=E/r*Math.PI*2,w=-t*Math.cos(S),A=t*Math.sin(S);h.x=y.x+(w*v.x+A*d.x),h.y=y.y+(w*v.y+A*d.y),h.z=y.z+(w*v.z+A*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,y).normalize(),c.push(p.x,p.y,p.z),f.push(M/i),f.push(E/r)}}for(let M=1;M<=i;M++)for(let _=1;_<=r;_++){const E=(r+1)*(M-1)+(_-1),S=(r+1)*M+(_-1),w=(r+1)*M+_,A=(r+1)*(M-1)+_;l.push(E,S,A),l.push(S,w,A)}this.setIndex(l),this.setAttribute("position",new Oe(u,3)),this.setAttribute("normal",new Oe(c,3)),this.setAttribute("uv",new Oe(f,2));function g(M,_,E,S,w){const A=Math.cos(M),I=Math.sin(M),T=E/_*M,P=Math.cos(T);w.x=S*(2+P)*.5*A,w.y=S*(2+P)*I*.5,w.z=S*Math.sin(T)*.5}}static fromJSON(e){return new yo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class vo extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new J,u=new J,c=new _e;let f=new J;const h=[],p=[],y=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Oe(h,3)),this.setAttribute("normal",new Oe(p,3)),this.setAttribute("uv",new Oe(y,2));function d(){for(let M=0;M<t;M++)b(M);b(s===!1?t:0),g(),v()}function b(M){f=e.getPointAt(M/t,f);const _=o.normals[M],E=o.binormals[M];for(let S=0;S<=r;S++){const w=S/r*Math.PI*2,A=Math.sin(w),I=-Math.cos(w);u.x=I*_.x+A*E.x,u.y=I*_.y+A*E.y,u.z=I*_.z+A*E.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function v(){for(let M=1;M<=t;M++)for(let _=1;_<=r;_++){const E=(r+1)*(M-1)+(_-1),S=(r+1)*M+(_-1),w=(r+1)*M+_,A=(r+1)*(M-1)+_;m.push(E,S,A),m.push(S,w,A)}}function g(){for(let M=0;M<=t;M++)for(let _=0;_<=r;_++)c.x=M/t,c.y=_/r,y.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new vo(new Fh[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class zh extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new J;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,y=h.count;for(let m=p,d=p+y;m<d;m+=3)for(let b=0;b<3;b++){const v=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(v,g),i[1]=Math.max(v,g);const M=i[0]+","+i[1];r[M]===void 0&&(r[M]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Oe(t,3))}}var eb=Object.freeze({__proto__:null,BoxGeometry:Oi,BoxBufferGeometry:Oi,CircleGeometry:ao,CircleBufferGeometry:ao,ConeGeometry:lo,ConeBufferGeometry:lo,CylinderGeometry:gr,CylinderBufferGeometry:gr,DodecahedronGeometry:co,DodecahedronBufferGeometry:co,EdgesGeometry:Ah,ExtrudeGeometry:Un,ExtrudeBufferGeometry:Un,IcosahedronGeometry:ho,IcosahedronBufferGeometry:ho,LatheGeometry:fo,LatheBufferGeometry:fo,OctahedronGeometry:Xr,OctahedronBufferGeometry:Xr,ParametricGeometry:Dc,ParametricBufferGeometry:Dc,PlaneGeometry:$r,PlaneBufferGeometry:$r,PolyhedronGeometry:ii,PolyhedronBufferGeometry:ii,RingGeometry:po,RingBufferGeometry:po,ShapeGeometry:Yr,ShapeBufferGeometry:Yr,SphereGeometry:Jr,SphereBufferGeometry:Jr,TetrahedronGeometry:mo,TetrahedronBufferGeometry:mo,TextGeometry:Bc,TextBufferGeometry:Bc,TorusGeometry:go,TorusBufferGeometry:go,TorusKnotGeometry:yo,TorusKnotBufferGeometry:yo,TubeGeometry:vo,TubeBufferGeometry:vo,WireframeGeometry:zh});class Uh extends Nt{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ae(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Uh.prototype.isShadowMaterial=!0;class bo extends Ni{constructor(e){super(e),this.type="RawShaderMaterial"}}bo.prototype.isRawShaderMaterial=!0;class Kr extends Nt{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ae(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 Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Kr.prototype.isMeshStandardMaterial=!0;class Ia extends Kr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new _e(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ae(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ae).copy(e.sheen):this.sheen=null,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}}Ia.prototype.isMeshPhysicalMaterial=!0;class Gh extends Nt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ae(16777215),this.specular=new Ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Yo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Gh.prototype.isMeshPhongMaterial=!0;class Hh extends Nt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Hh.prototype.isMeshToonMaterial=!0;class Wh extends Nt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Wh.prototype.isMeshNormalMaterial=!0;class jh extends Nt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Yo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}jh.prototype.isMeshLambertMaterial=!0;class $h extends Nt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}$h.prototype.isMeshMatcapMaterial=!0;class Zh extends Ft{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Zh.prototype.isLineDashedMaterial=!0;var FN=Object.freeze({__proto__:null,ShadowMaterial:Uh,SpriteMaterial:ga,RawShaderMaterial:bo,ShaderMaterial:Ni,PointsMaterial:mr,MeshPhysicalMaterial:Ia,MeshStandardMaterial:Kr,MeshPhongMaterial:Gh,MeshToonMaterial:Hh,MeshNormalMaterial:Wh,MeshLambertMaterial:jh,MeshDepthMaterial:fc,MeshDistanceMaterial:pc,MeshBasicMaterial:dn,MeshMatcapMaterial:$h,LineDashedMaterial:Zh,LineBasicMaterial:Ft,Material:Nt});const dt={arraySlice:function(n,e,t){return dt.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(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},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(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)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let y=0;y<c.times.length;++y){const m=c.times[y]*r;if(!(m<t||m>=i)){h.push(c.times[y]);for(let d=0;d<f;++d)p.push(c.values[y*f+d])}}h.length!==0&&(c.times=dt.convertArray(h,c.times.constructor),c.values=dt.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(v){return v.name===l.name&&v.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const y=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=y/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const v=f,g=h-f;d=dt.arraySlice(l.values,v,g)}else if(s>=l.times[m]){const v=m*h+f,g=v+h-f;d=dt.arraySlice(l.values,v,g)}else{const v=l.createInterpolant(),g=f,M=h-f;v.evaluate(s),d=dt.arraySlice(v.resultBuffer,g,M)}u==="quaternion"&&new Zt().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let v=0;v<b;++v){const g=v*y+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const M=y-p*2;for(let _=0;_<M;++_)c.values[g+_]-=d[_]}}}return n.blendMode=Bd,n}};class si{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 l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}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_(){}}si.prototype.beforeStart_=si.prototype.copySampleValue_,si.prototype.afterEnd_=si.prototype.copySampleValue_;class tb extends si{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:Vr,endingEnd:Vr}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case kr:s=e,l=2*t-i;break;case ia:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case kr:o=e,u=2*i-t;break;case ia:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,y=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,v=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,M=(-1-y)*b+(1.5+y)*d+.5*m,_=y*b-y*d;for(let E=0;E!==l;++E)s[E]=v*o[f+E]+g*o[c+E]+M*o[u+E]+_*o[h+E];return s}}class Xh extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class nb extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Gn{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=dt.convertArray(t,this.TimeBufferType),this.values=dt.convertArray(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:dt.convertArray(e.times,Array),values:dt.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new nb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Xh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new tb(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Bs:t=this.InterpolantFactoryMethodDiscrete;break;case Fr:t=this.InterpolantFactoryMethodLinear;break;case zl: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 Bs;case this.InterpolantFactoryMethodLinear:return Fr;case this.InterpolantFactoryMethodSmooth:return zl}}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 l=this.getValueSize();this.times=dt.arraySlice(i,s,o),this.values=dt.arraySlice(this.values,s*l,o*l)}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 l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&dt.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=dt.arraySlice(this.times),t=dt.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===zl,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,y=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[y+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let y=0;y!==i;++y)t[p+y]=t[h+y]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=dt.arraySlice(e,0,o),this.values=dt.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=dt.arraySlice(this.times,0),t=dt.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Gn.prototype.TimeBufferType=Float32Array,Gn.prototype.ValueBufferType=Float32Array,Gn.prototype.DefaultInterpolation=Fr;class qr extends Gn{}qr.prototype.ValueTypeName="bool",qr.prototype.ValueBufferType=Array,qr.prototype.DefaultInterpolation=Bs,qr.prototype.InterpolantFactoryMethodLinear=void 0,qr.prototype.InterpolantFactoryMethodSmooth=void 0;class Yh extends Gn{}Yh.prototype.ValueTypeName="color";class xo extends Gn{}xo.prototype.ValueTypeName="number";class ib extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Qr extends Gn{InterpolantFactoryMethodLinear(e){return new ib(this.times,this.values,this.getValueSize(),e)}}Qr.prototype.ValueTypeName="quaternion",Qr.prototype.DefaultInterpolation=Fr,Qr.prototype.InterpolantFactoryMethodSmooth=void 0;class es extends Gn{}es.prototype.ValueTypeName="string",es.prototype.ValueBufferType=Array,es.prototype.DefaultInterpolation=Bs,es.prototype.InterpolantFactoryMethodLinear=void 0,es.prototype.InterpolantFactoryMethodSmooth=void 0;class wo extends Gn{}wo.prototype.ValueTypeName="vector";class Mo{constructor(e,t=-1,i,r=Ul){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=gn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(kN(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(Gn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=dt.getKeyframeOrder(u);u=dt.sortedArray(u,1,f),c=dt.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new xo(".morphTargetInfluences["+t[l].name+"]",u,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 l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,y,m,d){if(y.length!==0){const b=[],v=[];dt.flattenJSON(y,b,v,m),b.length!==0&&d.push(new h(p,b,v))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const y={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)y[p[m].morphTargets[d]]=-1;for(const d in y){const b=[],v=[];for(let g=0;g!==p[m].morphTargets.length;++g){const M=p[m];b.push(M.time),v.push(M.morphTarget===d?1:0)}r.push(new xo(".morphTargetInfluence["+d+"]",b,v))}u=y.length*(o||1)}else{const y=".bones["+t[h].name+"]";i(wo,y+".position",p,"pos",r),i(Qr,y+".quaternion",p,"rot",r),i(wo,y+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}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 VN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return xo;case"vector":case"vector2":case"vector3":case"vector4":return wo;case"color":return Yh;case"quaternion":return Qr;case"bool":case"boolean":return qr;case"string":return es}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function kN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=VN(n.type);if(n.times===void 0){const t=[],i=[];dt.flattenJSON(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 ts={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 Jh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const y=c[h],m=c[h+1];if(y.global&&(y.lastIndex=0),y.test(f))return m}return null}}}const rb=new Jh;class Xt{constructor(e){this.manager=e!==void 0?e:rb,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}}const Hn={};class xn extends Xt{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=this,o=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Hn[e]!==void 0){Hn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let y;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let v=0;v<p.length;v++)d[v]=p.charCodeAt(v);m==="blob"?y=new Blob([d.buffer],{type:f}):y=d.buffer;break;case"document":y=new DOMParser().parseFromString(p,f);break;case"json":y=JSON.parse(p);break;default:y=p;break}setTimeout(function(){t&&t(y),s.manager.itemEnd(e)},0)}catch(y){setTimeout(function(){r&&r(y),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Hn[e]=[],Hn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=Hn[e];if(delete Hn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ts.add(e,h);for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=Hn[e];delete Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=Hn[e];delete Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Mo.parse(e[i]);t.push(r)}return t}}class UN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new Th,u=new xn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const y=s.parse(p,!0);o[h]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},c+=1,c===6&&(y.mipmapCount===1&&(l.minFilter=vt),l.image=o,l.format=y.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const y=p.mipmaps.length/p.mipmapCount;for(let m=0;m<y;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=vt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Oa extends Xt{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=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),ts.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class sb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Qs,o=new Oa(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class ob extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Zr,l=new xn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:vt,o.minFilter=c.minFilter!==void 0?c.minFilter:vt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=_i),c.mipmapCount===1&&(o.minFilter=vt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Kh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Tt,o=new Oa(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Ti:mn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ab extends bn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Aa(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Fh[r.type]().fromJSON(r))}return this}}class Na extends ab{constructor(e){super(),this.type="Path",this.currentPoint=new _e,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Aa(this.currentPoint.clone(),new _e(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new Lc(this.currentPoint.clone(),new _e(e,t),new _e(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new Rc(this.currentPoint.clone(),new _e(e,t),new _e(i,r),new _e(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new Pc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new Ea(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class vr extends Na{constructor(e){super(e),this.uuid=gn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Na().fromJSON(r))}return this}}class Wn extends $e{constructor(e,t=1){super(),this.type="Light",this.color=new Ae(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}Wn.prototype.isLight=!0;class qh extends Wn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.groundColor=new Ae(t)}copy(e){return Wn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}qh.prototype.isHemisphereLight=!0;const lb=new De,cb=new J,ub=new J;class Qh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new De,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new da,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new st(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;cb.setFromMatrixPosition(e.matrixWorld),t.position.copy(cb),ub.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ub),t.updateMatrixWorld(),lb.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(lb),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class db extends Qh{constructor(){super(new Bt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=ra*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}}db.prototype.isSpotLightShadow=!0;class Fc extends Wn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.target=new $e,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new db}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),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}}Fc.prototype.isSpotLight=!0;const hb=new De,Da=new J,ef=new J;class fb extends Qh{constructor(){super(new Bt(90,1,.5,500)),this._frameExtents=new _e(4,2),this._viewportCount=6,this._viewports=[new st(2,1,1,1),new st(0,1,1,1),new st(3,1,1,1),new st(1,1,1,1),new st(3,0,1,1),new st(1,0,1,1)],this._cubeDirections=[new J(1,0,0),new J(-1,0,0),new J(0,0,1),new J(0,0,-1),new J(0,1,0),new J(0,-1,0)],this._cubeUps=[new J(0,1,0),new J(0,1,0),new J(0,1,0),new J(0,1,0),new J(0,0,1),new J(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Da.setFromMatrixPosition(e.matrixWorld),i.position.copy(Da),ef.copy(i.position),ef.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(ef),i.updateMatrixWorld(),r.makeTranslation(-Da.x,-Da.y,-Da.z),hb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hb)}}fb.prototype.isPointLightShadow=!0;class Vc extends Wn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new fb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Vc.prototype.isPointLight=!0;class So extends ua{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),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,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),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}}So.prototype.isOrthographicCamera=!0;class pb extends Qh{constructor(){super(new So(-5,5,5,-5,.5,500))}}pb.prototype.isDirectionalLightShadow=!0;class kc extends Wn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.target=new $e,this.shadow=new pb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}kc.prototype.isDirectionalLight=!0;class tf extends Wn{constructor(e,t){super(e,t),this.type="AmbientLight"}}tf.prototype.isAmbientLight=!0;class nf extends Wn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}nf.prototype.isRectAreaLight=!0;class rf{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new J)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}rf.prototype.isSphericalHarmonics3=!0;class Ba extends Wn{constructor(e=new rf,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Ba.prototype.isLightProbe=!0;class mb extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new xn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new FN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Ae().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Ae().setHex(o.value);break;case"v2":r.uniforms[s].value=new _e().fromArray(o.value);break;case"v3":r.uniforms[s].value=new J().fromArray(o.value);break;case"v4":r.uniforms[s].value=new st().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new De().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new _e().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new _e().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Bi{static decodeText(e){if(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{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class sf extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}sf.prototype.isInstancedBufferGeometry=!0;class of extends Ge{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),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}}of.prototype.isInstancedBufferAttribute=!0;class gb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(y,m){if(t[m]!==void 0)return t[m];const b=y.interleavedBuffers[m],v=s(y,b.buffer),g=Zs(b.type,v),M=new pr(g,b.stride);return M.uuid=b.uuid,t[m]=M,M}function s(y,m){if(i[m]!==void 0)return i[m];const b=y.arrayBuffers[m],v=new Uint32Array(b).buffer;return i[m]=v,v}const o=e.isInstancedBufferGeometry?new sf:new ke,l=e.data.index;if(l!==void 0){const y=Zs(l.type,l.array);o.setIndex(new Ge(y,1))}const u=e.data.attributes;for(const y in u){const m=u[y];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Di(b,m.itemSize,m.offset,m.normalized)}else{const b=Zs(m.type,m.array),v=m.isInstancedBufferAttribute?of:Ge;d=new v(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(y,d)}const c=e.data.morphAttributes;if(c)for(const y in c){const m=c[y],d=[];for(let b=0,v=m.length;b<v;b++){const g=m[b];let M;if(g.isInterleavedBufferAttribute){const _=r(e.data,g.data);M=new Di(_,g.itemSize,g.offset,g.normalized)}else{const _=Zs(g.type,g.array);M=new Ge(_,g.itemSize,g.normalized)}g.name!==void 0&&(M.name=g.name),d.push(M)}o.morphAttributes[y]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let y=0,m=h.length;y!==m;++y){const d=h[y];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const y=new J;p.center!==void 0&&y.fromArray(p.center),o.boundingSphere=new Ai(y,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class GN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new xn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new xn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new vr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new Sa().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new gb;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in eb?l=eb[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new mb;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=Mo.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Zs(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Jh(t);s=new Oa(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let y=0,m=p.length;y<m;y++){const d=p[y],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new Zr(b.data,b.width,b.height)))}}else{const y=l(h.url);y!==null&&(r[h.uuid]=y)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Zs(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Oa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],y=await s(p);y!==null&&(y instanceof HTMLImageElement?i[u.uuid].push(y):i[u.uuid].push(new Zr(y.data,y.width,y.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Qs(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new Zr(c.data,c.width,c.height):u=new Tt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,HN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],yb),u.wrapT=i(l.wrap[1],yb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,vb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,vb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const y=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),y.push(i[b])}return y}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new mc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ae(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ma(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new pa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Bt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new So(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new tf(e.color,e.intensity);break;case"DirectionalLight":o=new kc(e.color,e.intensity);break;case"PointLight":o=new Vc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new nf(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Fc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new qh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Ba().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new wa(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new At(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,y=e.instanceMatrix,m=e.instanceColor;o=new Sh(f,h,p),o.instanceMatrix=new Ge(new Float32Array(y.array),16),m!==void 0&&(o.instanceColor=new Ge(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new Av;break;case"Line":o=new ni(l(e.geometry),u(e.material));break;case"LineLoop":o=new Mc(l(e.geometry),u(e.material));break;case"LineSegments":o=new on(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new oo(l(e.geometry),u(e.material));break;case"Sprite":o=new xa(u(e.material));break;case"Group":o=new ti;break;case"Bone":o=new Ma;break;default:o=new $e}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let y=0;y<p.length;y++)o.add(this.parseObject(p[y],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let y=0;y<p.length;y++){const m=p[y];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let y=0;y<p.length;y++){const m=p[y],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const HN={UVMapping:Bl,CubeReflectionMapping:Jo,CubeRefractionMapping:Ko,EquirectangularReflectionMapping:Fl,EquirectangularRefractionMapping:Vl,CubeUVReflectionMapping:Is,CubeUVRefractionMapping:qo},yb={RepeatWrapping:nr,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Os},vb={NearestFilter:Et,NearestMipmapNearestFilter:Qo,NearestMipmapLinearFilter:ea,LinearFilter:vt,LinearMipmapNearestFilter:kl,LinearMipmapLinearFilter:_i};class af extends Xt{constructor(e){super(e),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=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){ts.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}af.prototype.isImageBitmapLoader=!0;class bb{constructor(){this.type="ShapePath",this.color=new Ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Na,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const M=[];for(let _=0,E=g.length;_<E;_++){const S=g[_],w=new vr;w.curves=S.curves,M.push(w)}return M}function r(g,M){const _=M.length;let E=!1;for(let S=_-1,w=0;w<_;S=w++){let A=M[S],I=M[w],T=I.x-A.x,P=I.y-A.y;if(Math.abs(P)>Number.EPSILON){if(P<0&&(A=M[w],T=-T,I=M[S],P=-P),g.y<A.y||g.y>I.y)continue;if(g.y===A.y){if(g.x===A.x)return!0}else{const C=P*(g.x-A.x)-T*(g.y-A.y);if(C===0)return!0;if(C<0)continue;E=!E}}else{if(g.y!==A.y)continue;if(I.x<=g.x&&g.x<=A.x||A.x<=g.x&&g.x<=I.x)return!0}}return E}const s=ri.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new vr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],y=[];let m=[],d=0,b;y[d]=void 0,m[d]=[];for(let g=0,M=o.length;g<M;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&y[d]&&d++,y[d]={s:new vr,p:b},y[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!y[0])return i(o);if(y.length>1){let g=!1;const M=[];for(let _=0,E=y.length;_<E;_++)p[_]=[];for(let _=0,E=y.length;_<E;_++){const S=m[_];for(let w=0;w<S.length;w++){const A=S[w];let I=!0;for(let T=0;T<y.length;T++)r(A.p,y[T].p)&&(_!==T&&M.push({froms:_,tos:T,hole:w}),I?(I=!1,p[T].push(A)):g=!0);I&&p[_].push(A)}}M.length>0&&(g||(m=p))}let v;for(let g=0,M=y.length;g<M;g++){c=y[g].s,f.push(c),v=m[g];for(let _=0,E=v.length;_<E;_++)c.holes.push(v[_].h)}return f}}class lf{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=WN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function WN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2915
+ }`;function wv(n,e,t){let i=new da;const r=new _e,s=new _e,o=new st,l=[],u=[],c={},f=t.maxTextureSize,h={0:_t,1:Qi,2:er},p=new Ni({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:tN,fragmentShader:eN}),y=p.clone();y.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ge(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new At(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=yd,this.render=function(S,w,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||S.length===0)return;const I=n.getRenderTarget(),T=n.getActiveCubeFace(),P=n.getActiveMipmapLevel(),C=n.state;C.setBlending(Si),C.buffers.color.setClear(1,1,1,1),C.buffers.depth.setTest(!0),C.setScissorTest(!1);for(let R=0,L=S.length;R<L;R++){const N=S[R],x=N.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ls){const D={minFilter:vt,magFilter:vt,format:mn};x.map=new Bn(r.x,r.y,D),x.map.texture.name=N.name+".shadowMap",x.mapPass=new Bn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:Et,magFilter:Et,format:mn};x.map=new Bn(r.x,r.y,D),x.map.texture.name=N.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D<B;D++){const k=x.getViewport(D);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),C.viewport(o),x.updateMatrices(N,D),i=x.getFrustum(),E(w,A,x.camera,N,this.type)}!x.isPointLightShadow&&this.type===Ls&&v(x,A),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(I,T,P)};function v(S,w){const A=e.update(d);p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(w,null,A,p,d,null),y.uniforms.shadow_pass.value=S.mapPass.texture,y.uniforms.resolution.value=S.mapSize,y.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(w,null,A,y,d,null)}function g(S){const w=S<<0;let A=l[w];return A===void 0&&(A=new fc({depthPacking:Ey,morphTargets:S}),l[w]=A),A}function M(S){const w=S<<0;let A=u[w];return A===void 0&&(A=new pc({morphTargets:S}),u[w]=A),A}function _(S,w,A,I,T,P,C){let R=null,L=g,N=S.customDepthMaterial;if(I.isPointLight===!0&&(L=M,N=S.customDistanceMaterial),N===void 0){let x=!1;A.morphTargets===!0&&(x=w.morphAttributes&&w.morphAttributes.position&&w.morphAttributes.position.length>0),R=L(x)}else R=N;if(n.localClippingEnabled&&A.clipShadows===!0&&A.clippingPlanes.length!==0){const x=R.uuid,O=A.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[O];D===void 0&&(D=R.clone(),B[O]=D),R=D}return R.visible=A.visible,R.wireframe=A.wireframe,C===Ls?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:h[A.side],R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,I.isPointLight===!0&&R.isMeshDistanceMaterial===!0&&(R.referencePosition.setFromMatrixPosition(I.matrixWorld),R.nearDistance=T,R.farDistance=P),R}function E(S,w,A,I,T){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&T===Ls)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,S.matrixWorld);const R=e.update(S),L=S.material;if(Array.isArray(L)){const N=R.groups;for(let x=0,O=N.length;x<O;x++){const B=N[x],D=L[B.materialIndex];if(D&&D.visible){const k=_(S,R,D,I,A.near,A.far,T);n.renderBufferDirect(A,null,R,k,S,B)}}}else if(L.visible){const N=_(S,R,L,I,A.near,A.far,T);n.renderBufferDirect(A,null,R,N,S,null)}}const C=S.children;for(let R=0,L=C.length;R<L;R++)E(C[R],w,A,I,T)}}function nN(n,e,t){const i=t.isWebGL2;function r(){let se=!1;const we=new st;let pe=null;const ge=new st(0,0,0,0);return{setMask:function(Ee){pe!==Ee&&!se&&(n.colorMask(Ee,Ee,Ee,Ee),pe=Ee)},setLocked:function(Ee){se=Ee},setClear:function(Ee,He,tt,Ie,ot){ot===!0&&(Ee*=Ie,He*=Ie,tt*=Ie),we.set(Ee,He,tt,Ie),ge.equals(we)===!1&&(n.clearColor(Ee,He,tt,Ie),ge.copy(we))},reset:function(){se=!1,pe=null,ge.set(-1,0,0,0)}}}function s(){let se=!1,we=null,pe=null,ge=null;return{setTest:function(Ee){Ee?re(2929):j(2929)},setMask:function(Ee){we!==Ee&&!se&&(n.depthMask(Ee),we=Ee)},setFunc:function(Ee){if(pe!==Ee){if(Ee)switch(Ee){case h0:n.depthFunc(512);break;case f0:n.depthFunc(519);break;case p0:n.depthFunc(513);break;case Dl:n.depthFunc(515);break;case m0:n.depthFunc(514);break;case g0:n.depthFunc(518);break;case y0:n.depthFunc(516);break;case v0:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);pe=Ee}},setLocked:function(Ee){se=Ee},setClear:function(Ee){ge!==Ee&&(n.clearDepth(Ee),ge=Ee)},reset:function(){se=!1,we=null,pe=null,ge=null}}}function o(){let se=!1,we=null,pe=null,ge=null,Ee=null,He=null,tt=null,Ie=null,ot=null;return{setTest:function(Le){se||(Le?re(2960):j(2960))},setMask:function(Le){we!==Le&&!se&&(n.stencilMask(Le),we=Le)},setFunc:function(Le,Ye,We){(pe!==Le||ge!==Ye||Ee!==We)&&(n.stencilFunc(Le,Ye,We),pe=Le,ge=Ye,Ee=We)},setOp:function(Le,Ye,We){(He!==Le||tt!==Ye||Ie!==We)&&(n.stencilOp(Le,Ye,We),He=Le,tt=Ye,Ie=We)},setLocked:function(Le){se=Le},setClear:function(Le){ot!==Le&&(n.clearStencil(Le),ot=Le)},reset:function(){se=!1,we=null,pe=null,ge=null,Ee=null,He=null,tt=null,Ie=null,ot=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,M=null,_=null,E=null,S=!1,w=null,A=null,I=null,T=null,P=null;const C=n.getParameter(35661);let R=!1,L=0;const N=n.getParameter(7938);N.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(N)[1]),R=L>=1):N.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),R=L>=2);let x=null,O={};const B=n.getParameter(3088),D=n.getParameter(2978),k=new st().fromArray(B),U=new st().fromArray(D);function H(se,we,pe){const ge=new Uint8Array(4),Ee=n.createTexture();n.bindTexture(se,Ee),n.texParameteri(se,10241,9728),n.texParameteri(se,10240,9728);for(let He=0;He<pe;He++)n.texImage2D(we+He,0,6408,1,1,0,6408,5121,ge);return Ee}const X={};X[3553]=H(3553,3553,1),X[34067]=H(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),re(2929),u.setFunc(Dl),te(!1),F(gd),re(2884),ie(Si);function re(se){f[se]!==!0&&(n.enable(se),f[se]=!0)}function j(se){f[se]!==!1&&(n.disable(se),f[se]=!1)}function G(se){se!==h&&(n.bindFramebuffer(36160,se),h=se)}function W(se,we){return we===null&&h!==null&&(we=h),p[se]!==we?(n.bindFramebuffer(se,we),p[se]=we,i&&(se===36009&&(p[36160]=we),se===36160&&(p[36009]=we)),!0):!1}function K(se){return y!==se?(n.useProgram(se),y=se,!0):!1}const ee={[Or]:32774,[t0]:32778,[n0]:32779};if(i)ee[Md]=32775,ee[Sd]=32776;else{const se=e.get("EXT_blend_minmax");se!==null&&(ee[Md]=se.MIN_EXT,ee[Sd]=se.MAX_EXT)}const q={[i0]:0,[r0]:1,[s0]:768,[_d]:770,[d0]:776,[c0]:774,[a0]:772,[o0]:769,[Ed]:771,[u0]:775,[l0]:773};function ie(se,we,pe,ge,Ee,He,tt,Ie){if(se===Si){m===!0&&(j(3042),m=!1);return}if(m===!1&&(re(3042),m=!0),se!==e0){if(se!==d||Ie!==S){if((b!==Or||M!==Or)&&(n.blendEquation(32774),b=Or,M=Or),Ie)switch(se){case Ps:n.blendFuncSeparate(1,771,1,771);break;case bd:n.blendFunc(1,1);break;case xd:n.blendFuncSeparate(0,0,769,771);break;case wd:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}else switch(se){case Ps:n.blendFuncSeparate(770,771,1,771);break;case bd:n.blendFunc(770,1);break;case xd:n.blendFunc(0,769);break;case wd:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}v=null,g=null,_=null,E=null,d=se,S=Ie}return}Ee=Ee||we,He=He||pe,tt=tt||ge,(we!==b||Ee!==M)&&(n.blendEquationSeparate(ee[we],ee[Ee]),b=we,M=Ee),(pe!==v||ge!==g||He!==_||tt!==E)&&(n.blendFuncSeparate(q[pe],q[ge],q[He],q[tt]),v=pe,g=ge,_=He,E=tt),d=se,S=null}function Y(se,we){se.side===er?j(2884):re(2884);let pe=se.side===_t;we&&(pe=!pe),te(pe),se.blending===Ps&&se.transparent===!1?ie(Si):ie(se.blending,se.blendEquation,se.blendSrc,se.blendDst,se.blendEquationAlpha,se.blendSrcAlpha,se.blendDstAlpha,se.premultipliedAlpha),u.setFunc(se.depthFunc),u.setTest(se.depthTest),u.setMask(se.depthWrite),l.setMask(se.colorWrite);const ge=se.stencilWrite;c.setTest(ge),ge&&(c.setMask(se.stencilWriteMask),c.setFunc(se.stencilFunc,se.stencilRef,se.stencilFuncMask),c.setOp(se.stencilFail,se.stencilZFail,se.stencilZPass)),Q(se.polygonOffset,se.polygonOffsetFactor,se.polygonOffsetUnits),se.alphaToCoverage===!0?re(32926):j(32926)}function te(se){w!==se&&(se?n.frontFace(2304):n.frontFace(2305),w=se)}function F(se){se!==Kg?(re(2884),se!==A&&(se===gd?n.cullFace(1029):se===qg?n.cullFace(1028):n.cullFace(1032))):j(2884),A=se}function $(se){se!==I&&(R&&n.lineWidth(se),I=se)}function Q(se,we,pe){se?(re(32823),(T!==we||P!==pe)&&(n.polygonOffset(we,pe),T=we,P=pe)):j(32823)}function V(se){se?re(3089):j(3089)}function z(se){se===void 0&&(se=33984+C-1),x!==se&&(n.activeTexture(se),x=se)}function oe(se,we){x===null&&z();let pe=O[x];pe===void 0&&(pe={type:void 0,texture:void 0},O[x]=pe),(pe.type!==se||pe.texture!==we)&&(n.bindTexture(se,we||X[se]),pe.type=se,pe.texture=we)}function ae(){const se=O[x];se!==void 0&&se.type!==void 0&&(n.bindTexture(se.type,null),se.type=void 0,se.texture=void 0)}function le(){try{n.compressedTexImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function fe(){try{n.texImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function be(){try{n.texImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function ye(se){k.equals(se)===!1&&(n.scissor(se.x,se.y,se.z,se.w),k.copy(se))}function he(se){U.equals(se)===!1&&(n.viewport(se.x,se.y,se.z,se.w),U.copy(se))}function ve(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,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),f={},x=null,O={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,M=null,_=null,E=null,S=!1,w=null,A=null,I=null,T=null,P=null,k.set(0,0,n.canvas.width,n.canvas.height),U.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:re,disable:j,bindFramebuffer:W,bindXRFramebuffer:G,useProgram:K,setBlending:ie,setMaterial:Y,setFlipSided:te,setCullFace:F,setLineWidth:$,setPolygonOffset:Q,setScissorTest:V,activeTexture:z,bindTexture:oe,unbindTexture:ae,compressedTexImage2D:le,texImage2D:fe,texImage3D:be,scissor:ye,viewport:he,reset:ve}}function iN(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let y,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(V,z){return m?new OffscreenCanvas(V,z):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(V,z,oe,ae){let le=1;if((V.width>ae||V.height>ae)&&(le=ae/Math.max(V.width,V.height)),le<1||z===!0)if(typeof HTMLImageElement<"u"&&V instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&V instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&V instanceof ImageBitmap){const fe=z?Ry:Math.floor,be=fe(le*V.width),ye=fe(le*V.height);y===void 0&&(y=d(be,ye));const he=oe?d(be,ye):y;return he.width=be,he.height=ye,he.getContext("2d").drawImage(V,0,0,be,ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+be+"x"+ye+")."),he}else return"data"in V&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.height+")."),V;return V}function v(V){return Hd(V.width)&&Hd(V.height)}function g(V){return l?!1:V.wrapS!==zt||V.wrapT!==zt||V.minFilter!==Et&&V.minFilter!==vt}function M(V,z){return V.generateMipmaps&&z&&V.minFilter!==Et&&V.minFilter!==vt}function _(V,z,oe,ae,le=1){n.generateMipmap(V);const fe=i.get(z);fe.__maxMipLevel=Math.log2(Math.max(oe,ae,le))}function E(V,z,oe){if(l===!1)return z;if(V!==null){if(n[V]!==void 0)return n[V];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+V+"'")}let ae=z;return z===6403&&(oe===5126&&(ae=33326),oe===5131&&(ae=33325),oe===5121&&(ae=33321)),z===6407&&(oe===5126&&(ae=34837),oe===5131&&(ae=34843),oe===5121&&(ae=32849)),z===6408&&(oe===5126&&(ae=34836),oe===5131&&(ae=34842),oe===5121&&(ae=32856)),(ae===33325||ae===33326||ae===34842||ae===34836)&&e.get("EXT_color_buffer_float"),ae}function S(V){return V===Et||V===Qo||V===ea?9728:9729}function w(V){const z=V.target;z.removeEventListener("dispose",w),I(z),z.isVideoTexture&&p.delete(z),o.memory.textures--}function A(V){const z=V.target;z.removeEventListener("dispose",A),T(z)}function I(V){const z=i.get(V);z.__webglInit!==void 0&&(n.deleteTexture(z.__webglTexture),i.remove(V))}function T(V){const z=V.texture,oe=i.get(V),ae=i.get(z);if(V){if(ae.__webglTexture!==void 0&&(n.deleteTexture(ae.__webglTexture),o.memory.textures--),V.depthTexture&&V.depthTexture.dispose(),V.isWebGLCubeRenderTarget)for(let le=0;le<6;le++)n.deleteFramebuffer(oe.__webglFramebuffer[le]),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer[le]);else n.deleteFramebuffer(oe.__webglFramebuffer),oe.__webglDepthbuffer&&n.deleteRenderbuffer(oe.__webglDepthbuffer),oe.__webglMultisampledFramebuffer&&n.deleteFramebuffer(oe.__webglMultisampledFramebuffer),oe.__webglColorRenderbuffer&&n.deleteRenderbuffer(oe.__webglColorRenderbuffer),oe.__webglDepthRenderbuffer&&n.deleteRenderbuffer(oe.__webglDepthRenderbuffer);if(V.isWebGLMultipleRenderTargets)for(let le=0,fe=z.length;le<fe;le++){const be=i.get(z[le]);be.__webglTexture&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),i.remove(z[le])}i.remove(z),i.remove(V)}}let P=0;function C(){P=0}function R(){const V=P;return V>=u&&console.warn("THREE.WebGLTextures: Trying to use "+V+" texture units while this GPU supports only "+u),P+=1,V}function L(V,z){const oe=i.get(V);if(V.isVideoTexture&&Y(V),V.version>0&&oe.__version!==V.version){const ae=V.image;if(ae===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{H(oe,V,z);return}}t.activeTexture(33984+z),t.bindTexture(3553,oe.__webglTexture)}function N(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){H(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(35866,oe.__webglTexture)}function x(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){H(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(32879,oe.__webglTexture)}function O(V,z){const oe=i.get(V);if(V.version>0&&oe.__version!==V.version){X(oe,V,z);return}t.activeTexture(33984+z),t.bindTexture(34067,oe.__webglTexture)}const B={[nr]:10497,[zt]:33071,[Os]:33648},D={[Et]:9728,[Qo]:9984,[ea]:9986,[vt]:9729,[kl]:9985,[_i]:9987};function k(V,z,oe){if(oe?(n.texParameteri(V,10242,B[z.wrapS]),n.texParameteri(V,10243,B[z.wrapT]),(V===32879||V===35866)&&n.texParameteri(V,32882,B[z.wrapR]),n.texParameteri(V,10240,D[z.magFilter]),n.texParameteri(V,10241,D[z.minFilter])):(n.texParameteri(V,10242,33071),n.texParameteri(V,10243,33071),(V===32879||V===35866)&&n.texParameteri(V,32882,33071),(z.wrapS!==zt||z.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(V,10240,S(z.magFilter)),n.texParameteri(V,10241,S(z.minFilter)),z.minFilter!==Et&&z.minFilter!==vt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const ae=e.get("EXT_texture_filter_anisotropic");if(z.type===Ei&&e.has("OES_texture_float_linear")===!1||l===!1&&z.type===Dr&&e.has("OES_texture_half_float_linear")===!1)return;(z.anisotropy>1||i.get(z).__currentAnisotropy)&&(n.texParameterf(V,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(z.anisotropy,r.getMaxAnisotropy())),i.get(z).__currentAnisotropy=z.anisotropy)}}function U(V,z){V.__webglInit===void 0&&(V.__webglInit=!0,z.addEventListener("dispose",w),V.__webglTexture=n.createTexture(),o.memory.textures++)}function H(V,z,oe){let ae=3553;z.isDataTexture2DArray&&(ae=35866),z.isDataTexture3D&&(ae=32879),U(V,z),t.activeTexture(33984+oe),t.bindTexture(ae,V.__webglTexture),n.pixelStorei(37440,z.flipY),n.pixelStorei(37441,z.premultiplyAlpha),n.pixelStorei(3317,z.unpackAlignment),n.pixelStorei(37443,0);const le=g(z)&&v(z.image)===!1,fe=b(z.image,le,!1,f),be=v(fe)||l,ye=s.convert(z.format);let he=s.convert(z.type),ve=E(z.internalFormat,ye,he);k(ae,z,be);let se;const we=z.mipmaps;if(z.isDepthTexture)ve=6402,l?z.type===Ei?ve=36012:z.type===na?ve=33190:z.type===Ns?ve=35056:ve=33189:z.type===Ei&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),z.format===Br&&ve===6402&&z.type!==ta&&z.type!==na&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),z.type=ta,he=s.convert(z.type)),z.format===Ds&&ve===6402&&(ve=34041,z.type!==Ns&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),z.type=Ns,he=s.convert(z.type))),t.texImage2D(3553,0,ve,fe.width,fe.height,0,ye,he,null);else if(z.isDataTexture)if(we.length>0&&be){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],t.texImage2D(3553,pe,ve,se.width,se.height,0,ye,he,se.data);z.generateMipmaps=!1,V.__maxMipLevel=we.length-1}else t.texImage2D(3553,0,ve,fe.width,fe.height,0,ye,he,fe.data),V.__maxMipLevel=0;else if(z.isCompressedTexture){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],z.format!==mn&&z.format!==Ti?ye!==null?t.compressedTexImage2D(3553,pe,ve,se.width,se.height,0,se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,pe,ve,se.width,se.height,0,ye,he,se.data);V.__maxMipLevel=we.length-1}else if(z.isDataTexture2DArray)t.texImage3D(35866,0,ve,fe.width,fe.height,fe.depth,0,ye,he,fe.data),V.__maxMipLevel=0;else if(z.isDataTexture3D)t.texImage3D(32879,0,ve,fe.width,fe.height,fe.depth,0,ye,he,fe.data),V.__maxMipLevel=0;else if(we.length>0&&be){for(let pe=0,ge=we.length;pe<ge;pe++)se=we[pe],t.texImage2D(3553,pe,ve,ye,he,se);z.generateMipmaps=!1,V.__maxMipLevel=we.length-1}else t.texImage2D(3553,0,ve,ye,he,fe),V.__maxMipLevel=0;M(z,be)&&_(ae,z,fe.width,fe.height),V.__version=z.version,z.onUpdate&&z.onUpdate(z)}function X(V,z,oe){if(z.image.length!==6)return;U(V,z),t.activeTexture(33984+oe),t.bindTexture(34067,V.__webglTexture),n.pixelStorei(37440,z.flipY),n.pixelStorei(37441,z.premultiplyAlpha),n.pixelStorei(3317,z.unpackAlignment),n.pixelStorei(37443,0);const ae=z&&(z.isCompressedTexture||z.image[0].isCompressedTexture),le=z.image[0]&&z.image[0].isDataTexture,fe=[];for(let pe=0;pe<6;pe++)!ae&&!le?fe[pe]=b(z.image[pe],!1,!0,c):fe[pe]=le?z.image[pe].image:z.image[pe];const be=fe[0],ye=v(be)||l,he=s.convert(z.format),ve=s.convert(z.type),se=E(z.internalFormat,he,ve);k(34067,z,ye);let we;if(ae){for(let pe=0;pe<6;pe++){we=fe[pe].mipmaps;for(let ge=0;ge<we.length;ge++){const Ee=we[ge];z.format!==mn&&z.format!==Ti?he!==null?t.compressedTexImage2D(34069+pe,ge,se,Ee.width,Ee.height,0,Ee.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+pe,ge,se,Ee.width,Ee.height,0,he,ve,Ee.data)}}V.__maxMipLevel=we.length-1}else{we=z.mipmaps;for(let pe=0;pe<6;pe++)if(le){t.texImage2D(34069+pe,0,se,fe[pe].width,fe[pe].height,0,he,ve,fe[pe].data);for(let ge=0;ge<we.length;ge++){const He=we[ge].image[pe].image;t.texImage2D(34069+pe,ge+1,se,He.width,He.height,0,he,ve,He.data)}}else{t.texImage2D(34069+pe,0,se,he,ve,fe[pe]);for(let ge=0;ge<we.length;ge++){const Ee=we[ge];t.texImage2D(34069+pe,ge+1,se,he,ve,Ee.image[pe])}}V.__maxMipLevel=we.length}M(z,ye)&&_(34067,z,be.width,be.height),V.__version=z.version,z.onUpdate&&z.onUpdate(z)}function re(V,z,oe,ae,le){const fe=s.convert(oe.format),be=s.convert(oe.type),ye=E(oe.internalFormat,fe,be);le===32879||le===35866?t.texImage3D(le,0,ye,z.width,z.height,z.depth,0,fe,be,null):t.texImage2D(le,0,ye,z.width,z.height,0,fe,be,null),t.bindFramebuffer(36160,V),n.framebufferTexture2D(36160,ae,le,i.get(oe).__webglTexture,0),t.bindFramebuffer(36160,null)}function j(V,z,oe){if(n.bindRenderbuffer(36161,V),z.depthBuffer&&!z.stencilBuffer){let ae=33189;if(oe){const le=z.depthTexture;le&&le.isDepthTexture&&(le.type===Ei?ae=36012:le.type===na&&(ae=33190));const fe=ie(z);n.renderbufferStorageMultisample(36161,fe,ae,z.width,z.height)}else n.renderbufferStorage(36161,ae,z.width,z.height);n.framebufferRenderbuffer(36160,36096,36161,V)}else if(z.depthBuffer&&z.stencilBuffer){if(oe){const ae=ie(z);n.renderbufferStorageMultisample(36161,ae,35056,z.width,z.height)}else n.renderbufferStorage(36161,34041,z.width,z.height);n.framebufferRenderbuffer(36160,33306,36161,V)}else{const ae=z.isWebGLMultipleRenderTargets===!0?z.texture[0]:z.texture,le=s.convert(ae.format),fe=s.convert(ae.type),be=E(ae.internalFormat,le,fe);if(oe){const ye=ie(z);n.renderbufferStorageMultisample(36161,ye,be,z.width,z.height)}else n.renderbufferStorage(36161,be,z.width,z.height)}n.bindRenderbuffer(36161,null)}function G(V,z){if(z&&z.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,V),!(z.depthTexture&&z.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(z.depthTexture).__webglTexture||z.depthTexture.image.width!==z.width||z.depthTexture.image.height!==z.height)&&(z.depthTexture.image.width=z.width,z.depthTexture.image.height=z.height,z.depthTexture.needsUpdate=!0),L(z.depthTexture,0);const ae=i.get(z.depthTexture).__webglTexture;if(z.depthTexture.format===Br)n.framebufferTexture2D(36160,36096,3553,ae,0);else if(z.depthTexture.format===Ds)n.framebufferTexture2D(36160,33306,3553,ae,0);else throw new Error("Unknown depthTexture format")}function W(V){const z=i.get(V),oe=V.isWebGLCubeRenderTarget===!0;if(V.depthTexture){if(oe)throw new Error("target.depthTexture not supported in Cube render targets");G(z.__webglFramebuffer,V)}else if(oe){z.__webglDepthbuffer=[];for(let ae=0;ae<6;ae++)t.bindFramebuffer(36160,z.__webglFramebuffer[ae]),z.__webglDepthbuffer[ae]=n.createRenderbuffer(),j(z.__webglDepthbuffer[ae],V,!1)}else t.bindFramebuffer(36160,z.__webglFramebuffer),z.__webglDepthbuffer=n.createRenderbuffer(),j(z.__webglDepthbuffer,V,!1);t.bindFramebuffer(36160,null)}function K(V){const z=V.texture,oe=i.get(V),ae=i.get(z);V.addEventListener("dispose",A),V.isWebGLMultipleRenderTargets!==!0&&(ae.__webglTexture=n.createTexture(),ae.__version=z.version,o.memory.textures++);const le=V.isWebGLCubeRenderTarget===!0,fe=V.isWebGLMultipleRenderTargets===!0,be=V.isWebGLMultisampleRenderTarget===!0,ye=z.isDataTexture3D||z.isDataTexture2DArray,he=v(V)||l;if(l&&z.format===Ti&&(z.type===Ei||z.type===Dr)&&(z.format=mn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),le){oe.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)oe.__webglFramebuffer[ve]=n.createFramebuffer()}else if(oe.__webglFramebuffer=n.createFramebuffer(),fe)if(r.drawBuffers){const ve=V.texture;for(let se=0,we=ve.length;se<we;se++){const pe=i.get(ve[se]);pe.__webglTexture===void 0&&(pe.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(be)if(l){oe.__webglMultisampledFramebuffer=n.createFramebuffer(),oe.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,oe.__webglColorRenderbuffer);const ve=s.convert(z.format),se=s.convert(z.type),we=E(z.internalFormat,ve,se),pe=ie(V);n.renderbufferStorageMultisample(36161,pe,we,V.width,V.height),t.bindFramebuffer(36160,oe.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,oe.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),V.depthBuffer&&(oe.__webglDepthRenderbuffer=n.createRenderbuffer(),j(oe.__webglDepthRenderbuffer,V,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(le){t.bindTexture(34067,ae.__webglTexture),k(34067,z,he);for(let ve=0;ve<6;ve++)re(oe.__webglFramebuffer[ve],V,z,36064,34069+ve);M(z,he)&&_(34067,z,V.width,V.height),t.bindTexture(34067,null)}else if(fe){const ve=V.texture;for(let se=0,we=ve.length;se<we;se++){const pe=ve[se],ge=i.get(pe);t.bindTexture(3553,ge.__webglTexture),k(3553,pe,he),re(oe.__webglFramebuffer,V,pe,36064+se,3553),M(pe,he)&&_(3553,pe,V.width,V.height)}t.bindTexture(3553,null)}else{let ve=3553;ye&&(l?ve=z.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(ve,ae.__webglTexture),k(ve,z,he),re(oe.__webglFramebuffer,V,z,36064,ve),M(z,he)&&_(ve,z,V.width,V.height,V.depth),t.bindTexture(ve,null)}V.depthBuffer&&W(V)}function ee(V){const z=v(V)||l,oe=V.isWebGLMultipleRenderTargets===!0?V.texture:[V.texture];for(let ae=0,le=oe.length;ae<le;ae++){const fe=oe[ae];if(M(fe,z)){const be=V.isWebGLCubeRenderTarget?34067:3553,ye=i.get(fe).__webglTexture;t.bindTexture(be,ye),_(be,fe,V.width,V.height),t.bindTexture(be,null)}}}function q(V){if(V.isWebGLMultisampleRenderTarget)if(l){const z=V.width,oe=V.height;let ae=16384;V.depthBuffer&&(ae|=256),V.stencilBuffer&&(ae|=1024);const le=i.get(V);t.bindFramebuffer(36008,le.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,le.__webglFramebuffer),n.blitFramebuffer(0,0,z,oe,0,0,z,oe,ae,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,le.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function ie(V){return l&&V.isWebGLMultisampleRenderTarget?Math.min(h,V.samples):0}function Y(V){const z=o.render.frame;p.get(V)!==z&&(p.set(V,z),V.update())}let te=!1,F=!1;function $(V,z){V&&V.isWebGLRenderTarget&&(te===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),te=!0),V=V.texture),L(V,z)}function Q(V,z){V&&V.isWebGLCubeRenderTarget&&(F===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),V=V.texture),O(V,z)}this.allocateTextureUnit=R,this.resetTextureUnits=C,this.setTexture2D=L,this.setTexture2DArray=N,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=K,this.updateRenderTargetMipmap=ee,this.updateMultisampleRenderTarget=q,this.safeSetTexture2D=$,this.safeSetTextureCube=Q}function Mv(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Nr)return 5121;if(s===R0)return 32819;if(s===L0)return 32820;if(s===P0)return 33635;if(s===T0)return 5120;if(s===C0)return 5122;if(s===ta)return 5123;if(s===A0)return 5124;if(s===na)return 5125;if(s===Ei)return 5126;if(s===Dr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===I0)return 6406;if(s===Ti)return 6407;if(s===mn)return 6408;if(s===O0)return 6409;if(s===N0)return 6410;if(s===Br)return 6402;if(s===Ds)return 34041;if(s===B0)return 6403;if(s===F0)return 36244;if(s===V0)return 33319;if(s===k0)return 33320;if(s===z0)return 36248;if(s===U0)return 36249;if(s===Td||s===Cd||s===Ad||s===Rd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===Td)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Cd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ad)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Rd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ld||s===Pd||s===Id||s===Od)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===Ld)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Pd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Id)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Od)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===G0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===Nd||s===Dd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===Nd)return o.COMPRESSED_RGB8_ETC2;if(s===Dd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===H0||s===W0||s===j0||s===$0||s===Z0||s===X0||s===Y0||s===J0||s===K0||s===q0||s===Q0||s===ey||s===ty||s===ny||s===ry||s===sy||s===oy||s===ay||s===ly||s===cy||s===uy||s===dy||s===hy||s===fy||s===py||s===my||s===gy||s===yy)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===iy)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Ns)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class xh extends Bt{constructor(e=[]){super(),this.cameras=e}}xh.prototype.isArrayCamera=!0;class ti extends $e{constructor(){super(),this.type="Group"}}ti.prototype.isGroup=!0;const rN={type:"move"};class wh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ti,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 ti,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new J,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new J),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ti,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new J,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new J),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}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 l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(rN))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new ti;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const v=c.joints[d.jointName];b!==null&&(v.matrix.fromArray(b.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=b.radius),v.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),y=.02,m=.005;c.inputState.pinching&&p>y+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=y-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class sN extends rr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const y=[],m=new Map,d=new Bt;d.layers.enable(1),d.viewport=new st;const b=new Bt;b.layers.enable(2),b.viewport=new st;const v=[d,b],g=new xh;g.layers.enable(1),g.layers.enable(2);let M=null,_=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getTargetRaySpace()},this.getControllerGrip=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getGripSpace()},this.getHand=function(N){let x=y[N];return x===void 0&&(x=new wh,y[N]=x),x.getHandSpace()};function E(N){const x=m.get(N.inputSource);x&&x.dispatchEvent({type:N.type,data:N.inputSource})}function S(){m.forEach(function(N,x){N.disconnect(x)}),m.clear(),M=null,_=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(N){o=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(N){u=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(N){if(s=N,s!==null){s.addEventListener("select",E),s.addEventListener("selectstart",E),s.addEventListener("selectend",E),s.addEventListener("squeeze",E),s.addEventListener("squeezestart",E),s.addEventListener("squeezeend",E),s.addEventListener("end",S),s.addEventListener("inputsourceschange",w);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function w(N){const x=s.inputSources;for(let O=0;O<y.length;O++)m.set(x[O],y[O]);for(let O=0;O<N.removed.length;O++){const B=N.removed[O],D=m.get(B);D&&(D.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<N.added.length;O++){const B=N.added[O],D=m.get(B);D&&D.dispatchEvent({type:"connected",data:B})}}const A=new J,I=new J;function T(N,x,O){A.setFromMatrixPosition(x.matrixWorld),I.setFromMatrixPosition(O.matrixWorld);const B=A.distanceTo(I),D=x.projectionMatrix.elements,k=O.projectionMatrix.elements,U=D[14]/(D[10]-1),H=D[14]/(D[10]+1),X=(D[9]+1)/D[5],re=(D[9]-1)/D[5],j=(D[8]-1)/D[0],G=(k[8]+1)/k[0],W=U*j,K=U*G,ee=B/(-j+G),q=ee*-j;x.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(q),N.translateZ(ee),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const ie=U+ee,Y=H+ee,te=W-q,F=K+(B-q),$=X*H/Y*ie,Q=re*H/Y*ie;N.projectionMatrix.makePerspective(te,F,$,Q,ie,Y)}function P(N,x){x===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(x.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(s===null)return;g.near=b.near=d.near=N.near,g.far=b.far=d.far=N.far,(M!==g.near||_!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),M=g.near,_=g.far);const x=N.parent,O=g.cameras;P(g,x);for(let D=0;D<O.length;D++)P(O[D],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),N.position.copy(g.position),N.quaternion.copy(g.quaternion),N.scale.copy(g.scale),N.matrix.copy(g.matrix),N.matrixWorld.copy(g.matrixWorld);const B=N.children;for(let D=0,k=B.length;D<k;D++)B[D].updateMatrixWorld(!0);O.length===2?T(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let C=null;function R(N,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,D=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(D.framebuffer);let k=!1;B.length!==g.cameras.length&&(g.cameras.length=0,k=!0);for(let U=0;U<B.length;U++){const H=B[U];let X=null;if(s.renderState.layers===void 0)X=D.getViewport(H);else{const j=f.getViewSubImage(p,H);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,j.colorTexture,0),j.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,j.depthStencilTexture,0),X=j.viewport}const re=v[U];re.matrix.fromArray(H.transform.matrix),re.projectionMatrix.fromArray(H.projectionMatrix),re.viewport.set(X.x,X.y,X.width,X.height),U===0&&g.matrix.copy(re.matrix),k===!0&&g.cameras.push(re)}}const O=s.inputSources;for(let B=0;B<y.length;B++){const D=y[B],k=O[B];D.update(k,x,l)}C&&C(N,x)}const L=new qy;L.setAnimationLoop(R),this.setAnimationLoop=function(N){C=N},this.dispose=function(){}}}function oN(n){function e(v,g){v.fogColor.value.copy(g.color),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function t(v,g,M,_,E){g.isMeshBasicMaterial?i(v,g):g.isMeshLambertMaterial?(i(v,g),u(v,g)):g.isMeshToonMaterial?(i(v,g),f(v,g)):g.isMeshPhongMaterial?(i(v,g),c(v,g)):g.isMeshStandardMaterial?(i(v,g),g.isMeshPhysicalMaterial?p(v,g,E):h(v,g)):g.isMeshMatcapMaterial?(i(v,g),y(v,g)):g.isMeshDepthMaterial?(i(v,g),m(v,g)):g.isMeshDistanceMaterial?(i(v,g),d(v,g)):g.isMeshNormalMaterial?(i(v,g),b(v,g)):g.isLineBasicMaterial?(r(v,g),g.isLineDashedMaterial&&s(v,g)):g.isPointsMaterial?o(v,g,M,_):g.isSpriteMaterial?l(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap),g.specularMap&&(v.specularMap.value=g.specularMap);const M=n.get(g).envMap;if(M){v.envMap.value=M,v.flipEnvMap.value=M.isCubeTexture&&M._needsFlipEnvMap?-1:1,v.reflectivity.value=g.reflectivity,v.refractionRatio.value=g.refractionRatio;const S=n.get(M).__maxMipLevel;S!==void 0&&(v.maxMipLevel.value=S)}g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity);let _;g.map?_=g.map:g.specularMap?_=g.specularMap:g.displacementMap?_=g.displacementMap:g.normalMap?_=g.normalMap:g.bumpMap?_=g.bumpMap:g.roughnessMap?_=g.roughnessMap:g.metalnessMap?_=g.metalnessMap:g.alphaMap?_=g.alphaMap:g.emissiveMap?_=g.emissiveMap:g.clearcoatMap?_=g.clearcoatMap:g.clearcoatNormalMap?_=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(_=g.clearcoatRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),v.uvTransform.value.copy(_.matrix));let E;g.aoMap?E=g.aoMap:g.lightMap&&(E=g.lightMap),E!==void 0&&(E.isWebGLRenderTarget&&(E=E.texture),E.matrixAutoUpdate===!0&&E.updateMatrix(),v.uv2Transform.value.copy(E.matrix))}function r(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity}function s(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function o(v,g,M,_){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*M,v.scale.value=_*.5,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let E;g.map?E=g.map:g.alphaMap&&(E=g.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),v.uvTransform.value.copy(E.matrix))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let M;g.map?M=g.map:g.alphaMap&&(M=g.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),v.uvTransform.value.copy(M.matrix))}function u(v,g){g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap)}function c(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function h(v,g){v.roughness.value=g.roughness,v.metalness.value=g.metalness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),n.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function p(v,g,M){h(v,g),v.reflectivity.value=g.reflectivity,v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&v.sheen.value.copy(g.sheen),g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),v.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===_t&&v.clearcoatNormalScale.value.negate()),v.transmission.value=g.transmission,g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap),g.transmission>0&&(v.transmissionSamplerMap.value=M.texture,v.transmissionSamplerSize.value.set(M.width,M.height)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)}function y(v,g){g.matcap&&(v.matcap.value=g.matcap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function m(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function d(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),v.referencePosition.value.copy(g.referencePosition),v.nearDistance.value=g.nearDistance,v.farDistance.value=g.farDistance}function b(v,g){g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===_t&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===_t&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function aN(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function at(n={}){const e=n.canvas!==void 0?n.canvas:aN(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const y=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=rn,this.physicallyCorrectLights=!1,this.toneMapping=tr,this.toneMappingExposure=1;const d=this;let b=!1,v=0,g=0,M=null,_=-1,E=null;const S=new st,w=new st;let A=null,I=e.width,T=e.height,P=1,C=null,R=null;const L=new st(0,0,I,T),N=new st(0,0,I,T);let x=!1;const O=[],B=new da;let D=!1,k=!1,U=null;const H=new De,X=new J,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return M===null?P:1}let G=t;function W(Z,de){for(let ce=0;ce<Z.length;ce++){const me=Z[ce],Se=e.getContext(me,de);if(Se!==null)return Se}return null}try{const Z={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",He,!1),e.addEventListener("webglcontextrestored",tt,!1),G===null){const de=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&de.shift(),G=W(de,Z),G===null)throw W(de)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}G.getShaderPrecisionFormat===void 0&&(G.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let K,ee,q,ie,Y,te,F,$,Q,V,z,oe,ae,le,fe,be,ye,he,ve,se,we,pe;function ge(){K=new PO(G),ee=new AO(G,K,n),K.init(ee),we=new Mv(G,K,ee),q=new nN(G,K,ee),O[0]=1029,ie=new NO,Y=new j3,te=new iN(G,K,q,Y,ee,we,ie),F=new LO(d),$=new iP(G,ee),pe=new TO(G,K,$,ee),Q=new IO(G,$,ie,pe),V=new VO(G,Q,$,ie),he=new FO(G),fe=new RO(Y),z=new W3(d,F,K,ee,pe,fe),oe=new oN(Y),ae=new Z3(Y),le=new Q3(K,ee),ye=new EO(d,F,q,V,l),be=new wv(d,V,ee),ve=new CO(G,K,ie,ee),se=new OO(G,K,ie,ee),ie.programs=z.programs,d.capabilities=ee,d.extensions=K,d.properties=Y,d.renderLists=ae,d.shadowMap=be,d.state=q,d.info=ie}ge();const Ee=new sN(d,G);this.xr=Ee,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const Z=K.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){const Z=K.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(Z){Z!==void 0&&(P=Z,this.setSize(I,T,!1))},this.getSize=function(Z){return Z.set(I,T)},this.setSize=function(Z,de,ce){if(Ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}I=Z,T=de,e.width=Math.floor(Z*P),e.height=Math.floor(de*P),ce!==!1&&(e.style.width=Z+"px",e.style.height=de+"px"),this.setViewport(0,0,Z,de)},this.getDrawingBufferSize=function(Z){return Z.set(I*P,T*P).floor()},this.setDrawingBufferSize=function(Z,de,ce){I=Z,T=de,P=ce,e.width=Math.floor(Z*ce),e.height=Math.floor(de*ce),this.setViewport(0,0,Z,de)},this.getCurrentViewport=function(Z){return Z.copy(S)},this.getViewport=function(Z){return Z.copy(L)},this.setViewport=function(Z,de,ce,me){Z.isVector4?L.set(Z.x,Z.y,Z.z,Z.w):L.set(Z,de,ce,me),q.viewport(S.copy(L).multiplyScalar(P).floor())},this.getScissor=function(Z){return Z.copy(N)},this.setScissor=function(Z,de,ce,me){Z.isVector4?N.set(Z.x,Z.y,Z.z,Z.w):N.set(Z,de,ce,me),q.scissor(w.copy(N).multiplyScalar(P).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(Z){q.setScissorTest(x=Z)},this.setOpaqueSort=function(Z){C=Z},this.setTransparentSort=function(Z){R=Z},this.getClearColor=function(Z){return Z.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(Z,de,ce){let me=0;(Z===void 0||Z)&&(me|=16384),(de===void 0||de)&&(me|=256),(ce===void 0||ce)&&(me|=1024),G.clear(me)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",He,!1),e.removeEventListener("webglcontextrestored",tt,!1),ae.dispose(),le.dispose(),Y.dispose(),F.dispose(),V.dispose(),pe.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",et),Ee.removeEventListener("sessionend",Mt),U&&(U.dispose(),U=null),pt.stop()};function He(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function tt(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const Z=ie.autoReset,de=be.enabled,ce=be.autoUpdate,me=be.needsUpdate,Se=be.type;ge(),ie.autoReset=Z,be.enabled=de,be.autoUpdate=ce,be.needsUpdate=me,be.type=Se}function Ie(Z){const de=Z.target;de.removeEventListener("dispose",Ie),ot(de)}function ot(Z){Le(Z),Y.remove(Z)}function Le(Z){const de=Y.get(Z).programs;de!==void 0&&de.forEach(function(ce){z.releaseProgram(ce)})}function Ye(Z,de){Z.render(function(ce){d.renderBufferImmediate(ce,de)})}this.renderBufferImmediate=function(Z,de){pe.initAttributes();const ce=Y.get(Z);Z.hasPositions&&!ce.position&&(ce.position=G.createBuffer()),Z.hasNormals&&!ce.normal&&(ce.normal=G.createBuffer()),Z.hasUvs&&!ce.uv&&(ce.uv=G.createBuffer()),Z.hasColors&&!ce.color&&(ce.color=G.createBuffer());const me=de.getAttributes();Z.hasPositions&&(G.bindBuffer(34962,ce.position),G.bufferData(34962,Z.positionArray,35048),pe.enableAttribute(me.position),G.vertexAttribPointer(me.position,3,5126,!1,0,0)),Z.hasNormals&&(G.bindBuffer(34962,ce.normal),G.bufferData(34962,Z.normalArray,35048),pe.enableAttribute(me.normal),G.vertexAttribPointer(me.normal,3,5126,!1,0,0)),Z.hasUvs&&(G.bindBuffer(34962,ce.uv),G.bufferData(34962,Z.uvArray,35048),pe.enableAttribute(me.uv),G.vertexAttribPointer(me.uv,2,5126,!1,0,0)),Z.hasColors&&(G.bindBuffer(34962,ce.color),G.bufferData(34962,Z.colorArray,35048),pe.enableAttribute(me.color),G.vertexAttribPointer(me.color,3,5126,!1,0,0)),pe.disableUnusedAttributes(),G.drawArrays(4,0,Z.count),Z.count=0},this.renderBufferDirect=function(Z,de,ce,me,Se,ue){de===null&&(de=re);const xe=Se.isMesh&&Se.matrixWorld.determinant()<0,Te=Ce(Z,de,me,Se);q.setMaterial(me,xe);let Pe=ce.index;const Ne=ce.attributes.position;if(Pe===null){if(Ne===void 0||Ne.count===0)return}else if(Pe.count===0)return;let ze=1;me.wireframe===!0&&(Pe=Q.getWireframeAttribute(ce),ze=2),(me.morphTargets||me.morphNormals)&&he.update(Se,ce,me,Te),pe.setup(Se,me,Te,ce,Pe);let Fe,Ke=ve;Pe!==null&&(Fe=$.get(Pe),Ke=se,Ke.setIndex(Fe));const It=Pe!==null?Pe.count:Ne.count,Gt=ce.drawRange.start*ze,ds=ce.drawRange.count*ze,ht=ue!==null?ue.start*ze:0,hs=ue!==null?ue.count*ze:1/0,en=Math.max(Gt,ht),LV=Math.min(It,Gt+ds,ht+hs)-1,ou=Math.max(0,LV-en+1);if(ou!==0){if(Se.isMesh)me.wireframe===!0?(q.setLineWidth(me.wireframeLinewidth*j()),Ke.setMode(1)):Ke.setMode(4);else if(Se.isLine){let Ya=me.linewidth;Ya===void 0&&(Ya=1),q.setLineWidth(Ya*j()),Se.isLineSegments?Ke.setMode(1):Se.isLineLoop?Ke.setMode(2):Ke.setMode(3)}else Se.isPoints?Ke.setMode(0):Se.isSprite&&Ke.setMode(4);if(Se.isInstancedMesh)Ke.renderInstances(en,ou,Se.count);else if(ce.isInstancedBufferGeometry){const Ya=Math.min(ce.instanceCount,ce._maxInstanceCount);Ke.renderInstances(en,ou,Ya)}else Ke.render(en,ou)}},this.compile=function(Z,de){p=le.get(Z),p.init(),Z.traverseVisible(function(ce){ce.isLight&&ce.layers.test(de.layers)&&(p.pushLight(ce),ce.castShadow&&p.pushShadow(ce))}),p.setupLights(),Z.traverse(function(ce){const me=ce.material;if(me)if(Array.isArray(me))for(let Se=0;Se<me.length;Se++){const ue=me[Se];ne(ue,Z,ce)}else ne(me,Z,ce)})};let We=null;function it(Z){We&&We(Z)}function et(){pt.stop()}function Mt(){pt.start()}const pt=new qy;pt.setAnimationLoop(it),typeof window<"u"&&pt.setContext(window),this.setAnimationLoop=function(Z){We=Z,Ee.setAnimationLoop(Z),Z===null?pt.stop():pt.start()},Ee.addEventListener("sessionstart",et),Ee.addEventListener("sessionend",Mt),this.render=function(Z,de){if(de!==void 0&&de.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;Z.autoUpdate===!0&&Z.updateMatrixWorld(),de.parent===null&&de.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(de),de=Ee.getCamera()),Z.isScene===!0&&Z.onBeforeRender(d,Z,de,M),p=le.get(Z,m.length),p.init(),m.push(p),H.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),B.setFromProjectionMatrix(H),k=this.localClippingEnabled,D=fe.init(this.clippingPlanes,k,de),h=ae.get(Z,y.length),h.init(),y.push(h),hn(Z,de,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(C,R),D===!0&&fe.beginShadows();const ce=p.state.shadowsArray;be.render(ce,Z,de),p.setupLights(),p.setupLightsView(de),D===!0&&fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(h,Z);const me=h.opaque,Se=h.transmissive,ue=h.transparent;me.length>0&&jn(me,Z,de),Se.length>0&&Mn(me,Se,Z,de),ue.length>0&&jn(ue,Z,de),M!==null&&(te.updateMultisampleRenderTarget(M),te.updateRenderTargetMipmap(M)),Z.isScene===!0&&Z.onAfterRender(d,Z,de),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1),pe.resetDefaultState(),_=-1,E=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,y.pop(),y.length>0?h=y[y.length-1]:h=null};function hn(Z,de,ce,me){if(Z.visible===!1)return;if(Z.layers.test(de.layers)){if(Z.isGroup)ce=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(de);else if(Z.isLight)p.pushLight(Z),Z.castShadow&&p.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||B.intersectsSprite(Z)){me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H);const xe=V.update(Z),Te=Z.material;Te.visible&&h.push(Z,xe,Te,ce,X.z,null)}}else if(Z.isImmediateRenderObject)me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H),h.push(Z,null,Z.material,ce,X.z,null);else if((Z.isMesh||Z.isLine||Z.isPoints)&&(Z.isSkinnedMesh&&Z.skeleton.frame!==ie.render.frame&&(Z.skeleton.update(),Z.skeleton.frame=ie.render.frame),!Z.frustumCulled||B.intersectsObject(Z))){me&&X.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(H);const xe=V.update(Z),Te=Z.material;if(Array.isArray(Te)){const Pe=xe.groups;for(let Ne=0,ze=Pe.length;Ne<ze;Ne++){const Fe=Pe[Ne],Ke=Te[Fe.materialIndex];Ke&&Ke.visible&&h.push(Z,xe,Ke,ce,X.z,Fe)}}else Te.visible&&h.push(Z,xe,Te,ce,X.z,null)}}const ue=Z.children;for(let xe=0,Te=ue.length;xe<Te;xe++)hn(ue[xe],de,ce,me)}function Mn(Z,de,ce,me){if(U===null){const Te=o===!0&&ee.isWebGL2===!0?$d:Bn;U=new Te(1024,1024,{generateMipmaps:!0,type:we.convert(Dr)!==null?Dr:Nr,minFilter:_i,magFilter:Et,wrapS:zt,wrapT:zt})}const Se=d.getRenderTarget();d.setRenderTarget(U),d.clear();const ue=d.toneMapping;d.toneMapping=tr,jn(Z,ce,me),d.toneMapping=ue,te.updateMultisampleRenderTarget(U),te.updateRenderTargetMipmap(U),d.setRenderTarget(Se),jn(de,ce,me)}function jn(Z,de,ce){const me=de.isScene===!0?de.overrideMaterial:null;for(let Se=0,ue=Z.length;Se<ue;Se++){const xe=Z[Se],Te=xe.object,Pe=xe.geometry,Ne=me===null?xe.material:me,ze=xe.group;if(ce.isArrayCamera){const Fe=ce.cameras;for(let Ke=0,It=Fe.length;Ke<It;Ke++){const Gt=Fe[Ke];Te.layers.test(Gt.layers)&&(q.viewport(S.copy(Gt.viewport)),p.setupLightsView(Gt),us(Te,de,Gt,Pe,Ne,ze))}}else us(Te,de,ce,Pe,Ne,ze)}}function us(Z,de,ce,me,Se,ue){if(Z.onBeforeRender(d,de,ce,me,Se,ue),Z.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),Z.isImmediateRenderObject){const xe=Ce(ce,de,Se,Z);q.setMaterial(Se),pe.reset(),Ye(Z,xe)}else Se.transparent===!0&&Se.side===er?(Se.side=_t,Se.needsUpdate=!0,d.renderBufferDirect(ce,de,me,Se,Z,ue),Se.side=Qi,Se.needsUpdate=!0,d.renderBufferDirect(ce,de,me,Se,Z,ue),Se.side=er):d.renderBufferDirect(ce,de,me,Se,Z,ue);Z.onAfterRender(d,de,ce,me,Se,ue)}function ne(Z,de,ce){de.isScene!==!0&&(de=re);const me=Y.get(Z),Se=p.state.lights,ue=p.state.shadowsArray,xe=Se.state.version,Te=z.getParameters(Z,Se.state,ue,de,ce),Pe=z.getProgramCacheKey(Te);let Ne=me.programs;me.environment=Z.isMeshStandardMaterial?de.environment:null,me.fog=de.fog,me.envMap=F.get(Z.envMap||me.environment),Ne===void 0&&(Z.addEventListener("dispose",Ie),Ne=new Map,me.programs=Ne);let ze=Ne.get(Pe);if(ze!==void 0){if(me.currentProgram===ze&&me.lightsStateVersion===xe)return Me(Z,Te),ze}else Te.uniforms=z.getUniforms(Z),Z.onBuild(Te,d),Z.onBeforeCompile(Te,d),ze=z.acquireProgram(Te,Pe),Ne.set(Pe,ze),me.uniforms=Te.uniforms;const Fe=me.uniforms;(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Fe.clippingPlanes=fe.uniform),Me(Z,Te),me.needsLights=Je(Z),me.lightsStateVersion=xe,me.needsLights&&(Fe.ambientLightColor.value=Se.state.ambient,Fe.lightProbe.value=Se.state.probe,Fe.directionalLights.value=Se.state.directional,Fe.directionalLightShadows.value=Se.state.directionalShadow,Fe.spotLights.value=Se.state.spot,Fe.spotLightShadows.value=Se.state.spotShadow,Fe.rectAreaLights.value=Se.state.rectArea,Fe.ltc_1.value=Se.state.rectAreaLTC1,Fe.ltc_2.value=Se.state.rectAreaLTC2,Fe.pointLights.value=Se.state.point,Fe.pointLightShadows.value=Se.state.pointShadow,Fe.hemisphereLights.value=Se.state.hemi,Fe.directionalShadowMap.value=Se.state.directionalShadowMap,Fe.directionalShadowMatrix.value=Se.state.directionalShadowMatrix,Fe.spotShadowMap.value=Se.state.spotShadowMap,Fe.spotShadowMatrix.value=Se.state.spotShadowMatrix,Fe.pointShadowMap.value=Se.state.pointShadowMap,Fe.pointShadowMatrix.value=Se.state.pointShadowMatrix);const Ke=ze.getUniforms(),It=fr.seqWithValue(Ke.seq,Fe);return me.currentProgram=ze,me.uniformsList=It,ze}function Me(Z,de){const ce=Y.get(Z);ce.outputEncoding=de.outputEncoding,ce.instancing=de.instancing,ce.skinning=de.skinning,ce.numClippingPlanes=de.numClippingPlanes,ce.numIntersection=de.numClipIntersection,ce.vertexAlphas=de.vertexAlphas}function Ce(Z,de,ce,me){de.isScene!==!0&&(de=re),te.resetTextureUnits();const Se=de.fog,ue=ce.isMeshStandardMaterial?de.environment:null,xe=M===null?d.outputEncoding:M.texture.encoding,Te=F.get(ce.envMap||ue),Pe=ce.vertexColors===!0&&me.geometry&&me.geometry.attributes.color&&me.geometry.attributes.color.itemSize===4,Ne=Y.get(ce),ze=p.state.lights;if(D===!0&&(k===!0||Z!==E)){const en=Z===E&&ce.id===_;fe.setState(ce,Z,en)}let Fe=!1;ce.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==ze.state.version||Ne.outputEncoding!==xe||me.isInstancedMesh&&Ne.instancing===!1||!me.isInstancedMesh&&Ne.instancing===!0||me.isSkinnedMesh&&Ne.skinning===!1||!me.isSkinnedMesh&&Ne.skinning===!0||Ne.envMap!==Te||ce.fog&&Ne.fog!==Se||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==fe.numPlanes||Ne.numIntersection!==fe.numIntersection)||Ne.vertexAlphas!==Pe)&&(Fe=!0):(Fe=!0,Ne.__version=ce.version);let Ke=Ne.currentProgram;Fe===!0&&(Ke=ne(ce,de,me));let It=!1,Gt=!1,ds=!1;const ht=Ke.getUniforms(),hs=Ne.uniforms;if(q.useProgram(Ke.program)&&(It=!0,Gt=!0,ds=!0),ce.id!==_&&(_=ce.id,Gt=!0),It||E!==Z){if(ht.setValue(G,"projectionMatrix",Z.projectionMatrix),ee.logarithmicDepthBuffer&&ht.setValue(G,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),E!==Z&&(E=Z,Gt=!0,ds=!0),ce.isShaderMaterial||ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshStandardMaterial||ce.envMap){const en=ht.map.cameraPosition;en!==void 0&&en.setValue(G,X.setFromMatrixPosition(Z.matrixWorld))}(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&ht.setValue(G,"isOrthographic",Z.isOrthographicCamera===!0),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial||ce.isShadowMaterial||me.isSkinnedMesh)&&ht.setValue(G,"viewMatrix",Z.matrixWorldInverse)}if(me.isSkinnedMesh){ht.setOptional(G,me,"bindMatrix"),ht.setOptional(G,me,"bindMatrixInverse");const en=me.skeleton;en&&(ee.floatVertexTextures?(en.boneTexture===null&&en.computeBoneTexture(),ht.setValue(G,"boneTexture",en.boneTexture,te),ht.setValue(G,"boneTextureSize",en.boneTextureSize)):ht.setOptional(G,en,"boneMatrices"))}return(Gt||Ne.receiveShadow!==me.receiveShadow)&&(Ne.receiveShadow=me.receiveShadow,ht.setValue(G,"receiveShadow",me.receiveShadow)),Gt&&(ht.setValue(G,"toneMappingExposure",d.toneMappingExposure),Ne.needsLights&&Be(hs,ds),Se&&ce.fog&&oe.refreshFogUniforms(hs,Se),oe.refreshMaterialUniforms(hs,ce,P,T,U),fr.upload(G,Ne.uniformsList,hs,te)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(fr.upload(G,Ne.uniformsList,hs,te),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&ht.setValue(G,"center",me.center),ht.setValue(G,"modelViewMatrix",me.modelViewMatrix),ht.setValue(G,"normalMatrix",me.normalMatrix),ht.setValue(G,"modelMatrix",me.matrixWorld),Ke}function Be(Z,de){Z.ambientLightColor.needsUpdate=de,Z.lightProbe.needsUpdate=de,Z.directionalLights.needsUpdate=de,Z.directionalLightShadows.needsUpdate=de,Z.pointLights.needsUpdate=de,Z.pointLightShadows.needsUpdate=de,Z.spotLights.needsUpdate=de,Z.spotLightShadows.needsUpdate=de,Z.rectAreaLights.needsUpdate=de,Z.hemisphereLights.needsUpdate=de}function Je(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return M},this.setRenderTarget=function(Z,de=0,ce=0){M=Z,v=de,g=ce,Z&&Y.get(Z).__webglFramebuffer===void 0&&te.setupRenderTarget(Z);let me=null,Se=!1,ue=!1;if(Z){const Te=Z.texture;(Te.isDataTexture3D||Te.isDataTexture2DArray)&&(ue=!0);const Pe=Y.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(me=Pe[de],Se=!0):Z.isWebGLMultisampleRenderTarget?me=Y.get(Z).__webglMultisampledFramebuffer:me=Pe,S.copy(Z.viewport),w.copy(Z.scissor),A=Z.scissorTest}else S.copy(L).multiplyScalar(P).floor(),w.copy(N).multiplyScalar(P).floor(),A=x;if(q.bindFramebuffer(36160,me)&&ee.drawBuffers){let Te=!1;if(Z)if(Z.isWebGLMultipleRenderTargets){const Pe=Z.texture;if(O.length!==Pe.length||O[0]!==36064){for(let Ne=0,ze=Pe.length;Ne<ze;Ne++)O[Ne]=36064+Ne;O.length=Pe.length,Te=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,Te=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,Te=!0);Te&&(ee.isWebGL2?G.drawBuffers(O):K.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if(q.viewport(S),q.scissor(w),q.setScissorTest(A),Se){const Te=Y.get(Z.texture);G.framebufferTexture2D(36160,36064,34069+de,Te.__webglTexture,ce)}else if(ue){const Te=Y.get(Z.texture),Pe=de||0;G.framebufferTextureLayer(36160,36064,Te.__webglTexture,ce||0,Pe)}},this.readRenderTargetPixels=function(Z,de,ce,me,Se,ue,xe){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Te=Y.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&xe!==void 0&&(Te=Te[xe]),Te){q.bindFramebuffer(36160,Te);try{const Pe=Z.texture,Ne=Pe.format,ze=Pe.type;if(Ne!==mn&&we.convert(Ne)!==G.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Fe=ze===Dr&&(K.has("EXT_color_buffer_half_float")||ee.isWebGL2&&K.has("EXT_color_buffer_float"));if(ze!==Nr&&we.convert(ze)!==G.getParameter(35738)&&!(ze===Ei&&(ee.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!Fe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}G.checkFramebufferStatus(36160)===36053?de>=0&&de<=Z.width-me&&ce>=0&&ce<=Z.height-Se&&G.readPixels(de,ce,me,Se,we.convert(Ne),we.convert(ze),ue):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Pe=M!==null?Y.get(M).__webglFramebuffer:null;q.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(Z,de,ce=0){const me=Math.pow(2,-ce),Se=Math.floor(de.image.width*me),ue=Math.floor(de.image.height*me);let xe=we.convert(de.format);ee.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),te.setTexture2D(de,0),G.copyTexImage2D(3553,ce,xe,Z.x,Z.y,Se,ue,0),q.unbindTexture()},this.copyTextureToTexture=function(Z,de,ce,me=0){const Se=de.image.width,ue=de.image.height,xe=we.convert(ce.format),Te=we.convert(ce.type);te.setTexture2D(ce,0),G.pixelStorei(37440,ce.flipY),G.pixelStorei(37441,ce.premultiplyAlpha),G.pixelStorei(3317,ce.unpackAlignment),de.isDataTexture?G.texSubImage2D(3553,me,Z.x,Z.y,Se,ue,xe,Te,de.image.data):de.isCompressedTexture?G.compressedTexSubImage2D(3553,me,Z.x,Z.y,de.mipmaps[0].width,de.mipmaps[0].height,xe,de.mipmaps[0].data):G.texSubImage2D(3553,me,Z.x,Z.y,xe,Te,de.image),me===0&&ce.generateMipmaps&&G.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(Z,de,ce,me,Se=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ue=Z.max.x-Z.min.x+1,xe=Z.max.y-Z.min.y+1,Te=Z.max.z-Z.min.z+1,Pe=we.convert(me.format),Ne=we.convert(me.type);let ze;if(me.isDataTexture3D)te.setTexture3D(me,0),ze=32879;else if(me.isDataTexture2DArray)te.setTexture2DArray(me,0),ze=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}G.pixelStorei(37440,me.flipY),G.pixelStorei(37441,me.premultiplyAlpha),G.pixelStorei(3317,me.unpackAlignment);const Fe=G.getParameter(3314),Ke=G.getParameter(32878),It=G.getParameter(3316),Gt=G.getParameter(3315),ds=G.getParameter(32877),ht=ce.isCompressedTexture?ce.mipmaps[0]:ce.image;G.pixelStorei(3314,ht.width),G.pixelStorei(32878,ht.height),G.pixelStorei(3316,Z.min.x),G.pixelStorei(3315,Z.min.y),G.pixelStorei(32877,Z.min.z),ce.isDataTexture||ce.isDataTexture3D?G.texSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,Ne,ht.data):ce.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),G.compressedTexSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,ht.data)):G.texSubImage3D(ze,Se,de.x,de.y,de.z,ue,xe,Te,Pe,Ne,ht),G.pixelStorei(3314,Fe),G.pixelStorei(32878,Ke),G.pixelStorei(3316,It),G.pixelStorei(3315,Gt),G.pixelStorei(32877,ds),Se===0&&me.generateMipmaps&&G.generateMipmap(ze),q.unbindTexture()},this.initTexture=function(Z){te.setTexture2D(Z,0),q.unbindTexture()},this.resetState=function(){v=0,g=0,M=null,q.reset(),pe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Sv extends at{}Sv.prototype.isWebGL1Renderer=!0;class pa{constructor(e,t=25e-5){this.name="",this.color=new Ae(e),this.density=t}clone(){return new pa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}pa.prototype.isFogExp2=!0;class ma{constructor(e,t=1,i=1e3){this.name="",this.color=new Ae(e),this.near=t,this.far=i}clone(){return new ma(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ma.prototype.isFog=!0;class mc extends $e{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}mc.prototype.isScene=!0;class pr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=gn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,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=gn()),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=gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}pr.prototype.isInterleavedBuffer=!0;const Rt=new J;class Di{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}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++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.applyMatrix4(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.applyNormalMatrix(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Rt.x=this.getX(t),Rt.y=this.getY(t),Rt.z=this.getZ(t),Rt.transformDirection(e),this.setXYZ(t,Rt.x,Rt.y,Rt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,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.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.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 interlaved buffer attribute will deinterleave 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 Ge(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 Di(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave 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}}}Di.prototype.isInterleavedBufferAttribute=!0;class ga extends Nt{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}ga.prototype.isSpriteMaterial=!0;let no;const ya=new J,io=new J,ro=new J,so=new _e,va=new _e,_v=new De,gc=new J,ba=new J,yc=new J,Ev=new _e,Mh=new _e,Tv=new _e;class xa extends $e{constructor(e){if(super(),this.type="Sprite",no===void 0){no=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new pr(t,5);no.setIndex([0,1,2,0,2,3]),no.setAttribute("position",new Di(i,3,0,!1)),no.setAttribute("uv",new Di(i,2,3,!1))}this.geometry=no,this.material=e!==void 0?e:new ga,this.center=new _e(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),io.setFromMatrixScale(this.matrixWorld),_v.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ro.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&io.multiplyScalar(-ro.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;vc(gc.set(-.5,-.5,0),ro,o,io,r,s),vc(ba.set(.5,-.5,0),ro,o,io,r,s),vc(yc.set(.5,.5,0),ro,o,io,r,s),Ev.set(0,0),Mh.set(1,0),Tv.set(1,1);let l=e.ray.intersectTriangle(gc,ba,yc,!1,ya);if(l===null&&(vc(ba.set(-.5,.5,0),ro,o,io,r,s),Mh.set(0,1),l=e.ray.intersectTriangle(gc,yc,ba,!1,ya),l===null))return;const u=e.ray.origin.distanceTo(ya);u<e.near||u>e.far||t.push({distance:u,point:ya.clone(),uv:Ct.getUV(ya,gc,ba,yc,Ev,Mh,Tv,new _e),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}xa.prototype.isSprite=!0;function vc(n,e,t,i,r,s){so.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(va.x=s*so.x-r*so.y,va.y=r*so.x+s*so.y):va.copy(so),n.copy(e),n.x+=va.x,n.y+=va.y,n.applyMatrix4(_v)}const bc=new J,Cv=new J;class Av extends $e{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){bc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(bc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){bc.setFromMatrixPosition(e.matrixWorld),Cv.setFromMatrixPosition(this.matrixWorld);const i=bc.distanceTo(Cv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Rv=new J,Lv=new st,Pv=new st,lN=new J,Iv=new De;class wa extends At{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new De,this.bindMatrixInverse=new De}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}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 st,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(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==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;Lv.fromBufferAttribute(r.attributes.skinIndex,e),Pv.fromBufferAttribute(r.attributes.skinWeight,e),Rv.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Pv.getComponent(s);if(o!==0){const l=Lv.getComponent(s);Iv.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(lN.copy(Rv).applyMatrix4(Iv),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}wa.prototype.isSkinnedMesh=!0;class Ma extends $e{constructor(){super(),this.type="Bone"}}Ma.prototype.isBone=!0;class Zr extends Tt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=Et,f=Et,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Zr.prototype.isDataTexture=!0;const Ov=new De,cN=new De;class Sa{constructor(e=[],t=[]){this.uuid=gn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,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 De)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new De;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 l=e[s]?e[s].matrixWorld:cN;Ov.multiplyMatrices(l,t[s]),Ov.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Sa(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Ay(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Zr(t,e,e,mn,Ei);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,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 Ma),this.bones.push(o),this.boneInverses.push(new De().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,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 l=i[r];e.boneInverses.push(l.toArray())}return e}}const Nv=new De,Dv=new De,xc=[],_a=new At;class Sh extends At{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ge(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(_a.geometry=this.geometry,_a.material=this.material,_a.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,Nv),Dv.multiplyMatrices(i,Nv),_a.matrixWorld=Dv,_a.raycast(e,xc);for(let o=0,l=xc.length;o<l;o++){const u=xc[o];u.instanceId=s,u.object=this,t.push(u)}xc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ge(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Sh.prototype.isInstancedMesh=!0;class Ft extends Nt{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ae(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Ft.prototype.isLineBasicMaterial=!0;const Bv=new J,Fv=new J,Vv=new De,_h=new lr,wc=new Ai;class ni extends $e{constructor(e=new ke,t=new Ft){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Bv.fromBufferAttribute(t,r-1),Fv.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Bv.distanceTo(Fv);e.setAttribute("lineDistance",new Oe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");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(),wc.copy(i.boundingSphere),wc.applyMatrix4(r),wc.radius+=s,e.ray.intersectsSphere(wc)===!1)return;Vv.copy(r).invert(),_h.copy(e.ray).applyMatrix4(Vv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new J,f=new J,h=new J,p=new J,y=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const v=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let M=v,_=g-1;M<_;M+=y){const E=m.getX(M),S=m.getX(M+1);if(c.fromBufferAttribute(b,E),f.fromBufferAttribute(b,S),_h.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(p);A<e.near||A>e.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let M=v,_=g-1;M<_;M+=y){if(c.fromBufferAttribute(b,M),f.fromBufferAttribute(b,M+1),_h.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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 l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ni.prototype.isLine=!0;const kv=new J,zv=new J;class on extends ni{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)kv.fromBufferAttribute(t,r),zv.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+kv.distanceTo(zv);e.setAttribute("lineDistance",new Oe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}on.prototype.isLineSegments=!0;class Mc extends ni{constructor(e,t){super(e,t),this.type="LineLoop"}}Mc.prototype.isLineLoop=!0;class mr extends Nt{constructor(e){super(),this.type="PointsMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,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.morphTargets=e.morphTargets,this}}mr.prototype.isPointsMaterial=!0;const Uv=new De,Eh=new lr,Sc=new Ai,_c=new J;class oo extends $e{constructor(e=new ke,t=new mr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=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(),Sc.copy(i.boundingSphere),Sc.applyMatrix4(r),Sc.radius+=s,e.ray.intersectsSphere(Sc)===!1)return;Uv.copy(r).invert(),Eh.copy(e.ray).applyMatrix4(Uv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),y=Math.min(c.count,o.start+o.count);for(let m=p,d=y;m<d;m++){const b=c.getX(m);_c.fromBufferAttribute(h,b),Gv(_c,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),y=Math.min(h.count,o.start+o.count);for(let m=p,d=y;m<d;m++)_c.fromBufferAttribute(h,m),Gv(_c,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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 l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}oo.prototype.isPoints=!0;function Gv(n,e,t,i,r,s,o){const l=Eh.distanceSqToPoint(n);if(l<t){const u=new J;Eh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Hv extends Tt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Ti,this.minFilter=o!==void 0?o:vt,this.magFilter=s!==void 0?s:vt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Hv.prototype.isVideoTexture=!0;class Th extends Tt{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Th.prototype.isCompressedTexture=!0;class Wv extends Tt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Wv.prototype.isCanvasTexture=!0;class jv extends Tt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Br,f!==Br&&f!==Ds)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Br&&(i=ta),i===void 0&&f===Ds&&(i=Ns),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:Et,this.minFilter=u!==void 0?u:Et,this.flipY=!1,this.generateMipmaps=!1}}jv.prototype.isDepthTexture=!0;class ao extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new J,f=new _e;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const y=i+h/t*r;c.x=e*Math.cos(y),c.y=e*Math.sin(y),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Oe(o,3)),this.setAttribute("normal",new Oe(l,3)),this.setAttribute("uv",new Oe(u,2))}static fromJSON(e){return new ao(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class gr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],y=[];let m=0;const d=[],b=i/2;let v=0;g(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new Oe(h,3)),this.setAttribute("normal",new Oe(p,3)),this.setAttribute("uv",new Oe(y,2));function g(){const _=new J,E=new J;let S=0;const w=(t-e)/i;for(let A=0;A<=s;A++){const I=[],T=A/s,P=T*(t-e)+e;for(let C=0;C<=r;C++){const R=C/r,L=R*u+l,N=Math.sin(L),x=Math.cos(L);E.x=P*N,E.y=-T*i+b,E.z=P*x,h.push(E.x,E.y,E.z),_.set(N,w,x).normalize(),p.push(_.x,_.y,_.z),y.push(R,1-T),I.push(m++)}d.push(I)}for(let A=0;A<r;A++)for(let I=0;I<s;I++){const T=d[I][A],P=d[I+1][A],C=d[I+1][A+1],R=d[I][A+1];f.push(T,P,R),f.push(P,C,R),S+=6}c.addGroup(v,S,0),v+=S}function M(_){const E=m,S=new _e,w=new J;let A=0;const I=_===!0?e:t,T=_===!0?1:-1;for(let C=1;C<=r;C++)h.push(0,b*T,0),p.push(0,T,0),y.push(.5,.5),m++;const P=m;for(let C=0;C<=r;C++){const L=C/r*u+l,N=Math.cos(L),x=Math.sin(L);w.x=I*x,w.y=b*T,w.z=I*N,h.push(w.x,w.y,w.z),p.push(0,T,0),S.x=N*.5+.5,S.y=x*.5*T+.5,y.push(S.x,S.y),m++}for(let C=0;C<r;C++){const R=E+C,L=P+C;_===!0?f.push(L,L+1,R):f.push(L+1,L,R),A+=3}c.addGroup(v,A,_===!0?1:2),v+=A}}static fromJSON(e){return new gr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class lo extends gr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new lo(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ii extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Oe(s,3)),this.setAttribute("normal",new Oe(s.slice(),3)),this.setAttribute("uv",new Oe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const M=new J,_=new J,E=new J;for(let S=0;S<t.length;S+=3)y(t[S+0],M),y(t[S+1],_),y(t[S+2],E),u(M,_,E,g)}function u(g,M,_,E){const S=E+1,w=[];for(let A=0;A<=S;A++){w[A]=[];const I=g.clone().lerp(_,A/S),T=M.clone().lerp(_,A/S),P=S-A;for(let C=0;C<=P;C++)C===0&&A===S?w[A][C]=I:w[A][C]=I.clone().lerp(T,C/P)}for(let A=0;A<S;A++)for(let I=0;I<2*(S-A)-1;I++){const T=Math.floor(I/2);I%2===0?(p(w[A][T+1]),p(w[A+1][T]),p(w[A][T])):(p(w[A][T+1]),p(w[A+1][T+1]),p(w[A+1][T]))}}function c(g){const M=new J;for(let _=0;_<s.length;_+=3)M.x=s[_+0],M.y=s[_+1],M.z=s[_+2],M.normalize().multiplyScalar(g),s[_+0]=M.x,s[_+1]=M.y,s[_+2]=M.z}function f(){const g=new J;for(let M=0;M<s.length;M+=3){g.x=s[M+0],g.y=s[M+1],g.z=s[M+2];const _=b(g)/2/Math.PI+.5,E=v(g)/Math.PI+.5;o.push(_,1-E)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const M=o[g+0],_=o[g+2],E=o[g+4],S=Math.max(M,_,E),w=Math.min(M,_,E);S>.9&&w<.1&&(M<.2&&(o[g+0]+=1),_<.2&&(o[g+2]+=1),E<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function y(g,M){const _=g*3;M.x=e[_+0],M.y=e[_+1],M.z=e[_+2]}function m(){const g=new J,M=new J,_=new J,E=new J,S=new _e,w=new _e,A=new _e;for(let I=0,T=0;I<s.length;I+=9,T+=6){g.set(s[I+0],s[I+1],s[I+2]),M.set(s[I+3],s[I+4],s[I+5]),_.set(s[I+6],s[I+7],s[I+8]),S.set(o[T+0],o[T+1]),w.set(o[T+2],o[T+3]),A.set(o[T+4],o[T+5]),E.copy(g).add(M).add(_).divideScalar(3);const P=b(E);d(S,T+0,g,P),d(w,T+2,M,P),d(A,T+4,_,P)}}function d(g,M,_,E){E<0&&g.x===1&&(o[M]=g.x-1),_.x===0&&_.z===0&&(o[M]=E/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function v(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new ii(e.vertices,e.indices,e.radius,e.details)}}class co extends ii{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new co(e.radius,e.detail)}}const Ec=new J,Tc=new J,Ch=new J,Cc=new Ct;class Ah extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Ur*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},y=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:v}=Cc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),v.fromBufferAttribute(l,c[2]),Cc.getNormal(Ch),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const M=(g+1)%3,_=h[g],E=h[M],S=Cc[f[g]],w=Cc[f[M]],A=`${_}_${E}`,I=`${E}_${_}`;I in p&&p[I]?(Ch.dot(p[I].normal)<=s&&(y.push(S.x,S.y,S.z),y.push(w.x,w.y,w.z)),p[I]=null):A in p||(p[A]={index0:c[g],index1:c[M],normal:Ch.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];Ec.fromBufferAttribute(l,d),Tc.fromBufferAttribute(l,b),y.push(Ec.x,Ec.y,Ec.z),y.push(Tc.x,Tc.y,Tc.z)}this.setAttribute("position",new Oe(y,3))}}class bn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,y=(o-f)/p;return(r+y)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new _e:new J);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new J,r=[],s=[],o=[],l=new J,u=new De;for(let y=0;y<=e;y++){const m=y/e;r[y]=this.getTangentAt(m,new J),r[y].normalize()}s[0]=new J,o[0]=new J;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(r[y-1],r[y]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[y-1].dot(r[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,m))}o[y].crossVectors(r[y],s[y])}if(t===!0){let y=Math.acos($t(s[0].dot(s[e]),-1,1));y/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],y*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ea extends bn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new _e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,y=c-this.aY;u=p*f-y*h+this.aX,c=p*h+y*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Ea.prototype.isEllipseCurve=!0;class Rh extends Ea{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}Rh.prototype.isArcCurve=!0;function Lh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,y=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,y*=f,r(o,l,p,y)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const Ac=new J,Ph=new Lh,Ih=new Lh,Oh=new Lh;class Nh extends bn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new J){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(Ac.subVectors(r[0],r[1]).add(r[0]),c=Ac);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(Ac.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=Ac),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),y),d=Math.pow(h.distanceToSquared(p),y),b=Math.pow(p.distanceToSquared(f),y);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),Ph.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),Ih.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),Oh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(Ph.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),Ih.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),Oh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(Ph.calc(u),Ih.calc(u),Oh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new J().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}Nh.prototype.isCatmullRomCurve3=!0;function $v(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function uN(n,e){const t=1-n;return t*t*e}function dN(n,e){return 2*(1-n)*n*e}function hN(n,e){return n*n*e}function Ta(n,e,t,i){return uN(n,e)+dN(n,t)+hN(n,i)}function fN(n,e){const t=1-n;return t*t*t*e}function pN(n,e){const t=1-n;return 3*t*t*n*e}function mN(n,e){return 3*(1-n)*n*n*e}function gN(n,e){return n*n*n*e}function Ca(n,e,t,i,r){return fN(n,e)+pN(n,t)+mN(n,i)+gN(n,r)}class Rc extends bn{constructor(e=new _e,t=new _e,i=new _e,r=new _e){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new _e){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ca(e,r.x,s.x,o.x,l.x),Ca(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Rc.prototype.isCubicBezierCurve=!0;class Dh extends bn{constructor(e=new J,t=new J,i=new J,r=new J){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new J){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ca(e,r.x,s.x,o.x,l.x),Ca(e,r.y,s.y,o.y,l.y),Ca(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Dh.prototype.isCubicBezierCurve3=!0;class Aa extends bn{constructor(e=new _e,t=new _e){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new _e){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new _e;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Aa.prototype.isLineCurve=!0;class Zv extends bn{constructor(e=new J,t=new J){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new J){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Lc extends bn{constructor(e=new _e,t=new _e,i=new _e){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new _e){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Ta(e,r.x,s.x,o.x),Ta(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Lc.prototype.isQuadraticBezierCurve=!0;class Bh extends bn{constructor(e=new J,t=new J,i=new J){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new J){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Ta(e,r.x,s.x,o.x),Ta(e,r.y,s.y,o.y),Ta(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Bh.prototype.isQuadraticBezierCurve3=!0;class Pc extends bn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new _e){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set($v(l,u.x,c.x,f.x,h.x),$v(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new _e().fromArray(r))}return this}}Pc.prototype.isSplineCurve=!0;var Fh=Object.freeze({__proto__:null,ArcCurve:Rh,CatmullRomCurve3:Nh,CubicBezierCurve:Rc,CubicBezierCurve3:Dh,EllipseCurve:Ea,LineCurve:Aa,LineCurve3:Zv,QuadraticBezierCurve:Lc,QuadraticBezierCurve3:Bh,SplineCurve:Pc});const yN={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Xv(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,y;if(i&&(s=MN(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);y=Math.max(c-l,f-u),y=y!==0?1/y:0}return Ra(s,o,t,l,u,y),o}};function Xv(n,e,t,i,r){let s,o;if(r===ON(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Kv(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Kv(s,n[s],n[s+1],o);return o&&Ic(o,o.next)&&(Pa(o),o=o.next),o}function yr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ic(t,t.next)||gt(t.prev,t,t.next)===0)){if(Pa(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Ra(n,e,t,i,r,s,o){if(!n)return;!o&&s&&CN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?bN(n,i,r,s):vN(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Pa(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=xN(yr(n),e,t),Ra(n,e,t,i,r,s,2)):o===2&&wN(n,e,t,i,r,s):Ra(yr(n),e,t,i,r,s,1);break}}}function vN(n){const e=n.prev,t=n,i=n.next;if(gt(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(uo(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&gt(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function bN(n,e,t,i){const r=n.prev,s=n,o=n.next;if(gt(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Vh(l,u,e,t,i),p=Vh(c,f,e,t,i);let y=n.prevZ,m=n.nextZ;for(;y&&y.z>=h&&m&&m.z<=p;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&gt(y.prev,y,y.next)>=0||(y=y.prevZ,m!==n.prev&&m!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&gt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;y&&y.z>=h;){if(y!==n.prev&&y!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&gt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&uo(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&gt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function xN(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ic(r,s)&&Yv(r,i,i.next,s)&&La(r,s)&&La(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Pa(i),Pa(i.next),i=n=s),i=i.next}while(i!==n);return yr(i)}function wN(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&LN(o,l)){let u=Jv(o,l);o=yr(o,o.next),u=yr(u,u.next),Ra(o,e,t,i,r,s),Ra(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function MN(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Xv(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(RN(c));for(r.sort(SN),s=0;s<r.length;s++)_N(r[s],t),t=yr(t,t.next);return t}function SN(n,e){return n.x-e.x}function _N(n,e){if(e=EN(n,e),e){const t=Jv(e,n);yr(e,e.next),yr(t,t.next)}}function EN(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&uo(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),La(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&TN(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function TN(n,e){return gt(n.prev,n,e.prev)<0&&gt(e.next,n,n.next)<0}function CN(n,e,t,i){let r=n;do r.z===null&&(r.z=Vh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,AN(r)}function AN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Vh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function RN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function uo(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function LN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!PN(n,e)&&(La(n,e)&&La(e,n)&&IN(n,e)&&(gt(n.prev,n,e.prev)||gt(n,e.prev,e))||Ic(n,e)&&gt(n.prev,n,n.next)>0&&gt(e.prev,e,e.next)>0)}function gt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ic(n,e){return n.x===e.x&&n.y===e.y}function Yv(n,e,t,i){const r=Nc(gt(n,e,t)),s=Nc(gt(n,e,i)),o=Nc(gt(t,i,n)),l=Nc(gt(t,i,e));return!!(r!==s&&o!==l||r===0&&Oc(n,t,e)||s===0&&Oc(n,i,e)||o===0&&Oc(t,n,i)||l===0&&Oc(t,e,i))}function Oc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Nc(n){return n>0?1:n<0?-1:0}function PN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Yv(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function La(n,e){return gt(n.prev,n,n.next)<0?gt(n,e,n.next)>=0&&gt(n,n.prev,e)>=0:gt(n,e,n.prev)<0||gt(n,n.next,e)<0}function IN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Jv(n,e){const t=new kh(n.i,n.x,n.y),i=new kh(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Kv(n,e,t,i){const r=new kh(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Pa(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function kh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ON(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ri{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ri.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];qv(e),Qv(i,e);let o=e.length;t.forEach(qv);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Qv(i,t[u]);const l=yN.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function qv(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Qv(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Un extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Oe(r,3)),this.setAttribute("uv",new Oe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,y=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:y-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:NN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let M,_=!1,E,S,w,A;v&&(M=v.getSpacedPoints(f),_=!0,p=!1,E=v.computeFrenetFrames(f,!1),S=new J,w=new J,A=new J),p||(b=0,y=0,m=0,d=0);const I=l.extractPoints(c);let T=I.shape;const P=I.holes;if(!ri.isClockWise(T)){T=T.reverse();for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];ri.isClockWise(F)&&(P[Y]=F.reverse())}}const R=ri.triangulateShape(T,P),L=T;for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];T=T.concat(F)}function N(Y,te,F){return te||console.error("THREE.ExtrudeGeometry: vec does not exist"),te.clone().multiplyScalar(F).add(Y)}const x=T.length,O=R.length;function B(Y,te,F){let $,Q,V;const z=Y.x-te.x,oe=Y.y-te.y,ae=F.x-Y.x,le=F.y-Y.y,fe=z*z+oe*oe,be=z*le-oe*ae;if(Math.abs(be)>Number.EPSILON){const ye=Math.sqrt(fe),he=Math.sqrt(ae*ae+le*le),ve=te.x-oe/ye,se=te.y+z/ye,we=F.x-le/he,pe=F.y+ae/he,ge=((we-ve)*le-(pe-se)*ae)/(z*le-oe*ae);$=ve+z*ge-Y.x,Q=se+oe*ge-Y.y;const Ee=$*$+Q*Q;if(Ee<=2)return new _e($,Q);V=Math.sqrt(Ee/2)}else{let ye=!1;z>Number.EPSILON?ae>Number.EPSILON&&(ye=!0):z<-Number.EPSILON?ae<-Number.EPSILON&&(ye=!0):Math.sign(oe)===Math.sign(le)&&(ye=!0),ye?($=-oe,Q=z,V=Math.sqrt(fe)):($=z,Q=oe,V=Math.sqrt(fe/2))}return new _e($/V,Q/V)}const D=[];for(let Y=0,te=L.length,F=te-1,$=Y+1;Y<te;Y++,F++,$++)F===te&&(F=0),$===te&&($=0),D[Y]=B(L[Y],L[F],L[$]);const k=[];let U,H=D.concat();for(let Y=0,te=P.length;Y<te;Y++){const F=P[Y];U=[];for(let $=0,Q=F.length,V=Q-1,z=$+1;$<Q;$++,V++,z++)V===Q&&(V=0),z===Q&&(z=0),U[$]=B(F[$],F[V],F[z]);k.push(U),H=H.concat(U)}for(let Y=0;Y<b;Y++){const te=Y/b,F=y*Math.cos(te*Math.PI/2),$=m*Math.sin(te*Math.PI/2)+d;for(let Q=0,V=L.length;Q<V;Q++){const z=N(L[Q],D[Q],$);W(z.x,z.y,-F)}for(let Q=0,V=P.length;Q<V;Q++){const z=P[Q];U=k[Q];for(let oe=0,ae=z.length;oe<ae;oe++){const le=N(z[oe],U[oe],$);W(le.x,le.y,-F)}}}const X=m+d;for(let Y=0;Y<x;Y++){const te=p?N(T[Y],H[Y],X):T[Y];_?(w.copy(E.normals[0]).multiplyScalar(te.x),S.copy(E.binormals[0]).multiplyScalar(te.y),A.copy(M[0]).add(w).add(S),W(A.x,A.y,A.z)):W(te.x,te.y,0)}for(let Y=1;Y<=f;Y++)for(let te=0;te<x;te++){const F=p?N(T[te],H[te],X):T[te];_?(w.copy(E.normals[Y]).multiplyScalar(F.x),S.copy(E.binormals[Y]).multiplyScalar(F.y),A.copy(M[Y]).add(w).add(S),W(A.x,A.y,A.z)):W(F.x,F.y,h/f*Y)}for(let Y=b-1;Y>=0;Y--){const te=Y/b,F=y*Math.cos(te*Math.PI/2),$=m*Math.sin(te*Math.PI/2)+d;for(let Q=0,V=L.length;Q<V;Q++){const z=N(L[Q],D[Q],$);W(z.x,z.y,h+F)}for(let Q=0,V=P.length;Q<V;Q++){const z=P[Q];U=k[Q];for(let oe=0,ae=z.length;oe<ae;oe++){const le=N(z[oe],U[oe],$);_?W(le.x,le.y+M[f-1].y,M[f-1].x+F):W(le.x,le.y,h+F)}}}re(),j();function re(){const Y=r.length/3;if(p){let te=0,F=x*te;for(let $=0;$<O;$++){const Q=R[$];K(Q[2]+F,Q[1]+F,Q[0]+F)}te=f+b*2,F=x*te;for(let $=0;$<O;$++){const Q=R[$];K(Q[0]+F,Q[1]+F,Q[2]+F)}}else{for(let te=0;te<O;te++){const F=R[te];K(F[2],F[1],F[0])}for(let te=0;te<O;te++){const F=R[te];K(F[0]+x*f,F[1]+x*f,F[2]+x*f)}}i.addGroup(Y,r.length/3-Y,0)}function j(){const Y=r.length/3;let te=0;G(L,te),te+=L.length;for(let F=0,$=P.length;F<$;F++){const Q=P[F];G(Q,te),te+=Q.length}i.addGroup(Y,r.length/3-Y,1)}function G(Y,te){let F=Y.length;for(;--F>=0;){const $=F;let Q=F-1;Q<0&&(Q=Y.length-1);for(let V=0,z=f+b*2;V<z;V++){const oe=x*V,ae=x*(V+1),le=te+$+oe,fe=te+Q+oe,be=te+Q+ae,ye=te+$+ae;ee(le,fe,be,ye)}}}function W(Y,te,F){u.push(Y),u.push(te),u.push(F)}function K(Y,te,F){q(Y),q(te),q(F);const $=r.length/3,Q=g.generateTopUV(i,r,$-3,$-2,$-1);ie(Q[0]),ie(Q[1]),ie(Q[2])}function ee(Y,te,F,$){q(Y),q(te),q($),q(te),q(F),q($);const Q=r.length/3,V=g.generateSideWallUV(i,r,Q-6,Q-3,Q-2,Q-1);ie(V[0]),ie(V[1]),ie(V[3]),ie(V[1]),ie(V[2]),ie(V[3])}function q(Y){r.push(u[Y*3+0]),r.push(u[Y*3+1]),r.push(u[Y*3+2])}function ie(Y){s.push(Y.x),s.push(Y.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return DN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Fh[r.type]().fromJSON(r)),new Un(i,e.options)}}const NN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new _e(s,o),new _e(l,u),new _e(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],y=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],v=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new _e(o,1-u),new _e(c,1-h),new _e(p,1-m),new _e(d,1-v)]:[new _e(l,1-u),new _e(f,1-h),new _e(y,1-m),new _e(b,1-v)]}};function DN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class ho extends ii{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ho(e.radius,e.detail)}}class fo extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new J,f=new _e;for(let h=0;h<=t;h++){const p=i+h*u*r,y=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*y,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const y=p+h*e.length,m=y,d=y+e.length,b=y+e.length+1,v=y+1;s.push(m,d,v),s.push(d,b,v)}if(this.setIndex(s),this.setAttribute("position",new Oe(o,3)),this.setAttribute("uv",new Oe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new J,y=new J,m=new J,d=t*e.length*3;for(let b=0,v=0;b<e.length;b++,v+=3)p.x=h[v+0],p.y=h[v+1],p.z=h[v+2],y.x=h[d+v+0],y.y=h[d+v+1],y.z=h[d+v+2],m.addVectors(p,y).normalize(),h[v+0]=h[d+v+0]=m.x,h[v+1]=h[d+v+1]=m.y,h[v+2]=h[d+v+2]=m.z}}static fromJSON(e){return new fo(e.points,e.segments,e.phiStart,e.phiLength)}}class Xr extends ii{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Xr(e.radius,e.detail)}}class Dc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new J,f=new J,h=new J,p=new J,y=new J;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let v=0;v<=t;v++){const g=v/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),y.subVectors(f,h)):(e(g,b+u,h),y.subVectors(h,f)),c.crossVectors(p,y).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const v=d*m+b,g=d*m+b+1,M=(d+1)*m+b+1,_=(d+1)*m+b;r.push(v,g,_),r.push(g,M,_)}this.setIndex(r),this.setAttribute("position",new Oe(s,3)),this.setAttribute("normal",new Oe(o,3)),this.setAttribute("uv",new Oe(l,2))}}class po extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,y=new J,m=new _e;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const v=s+b/i*o;y.x=h*Math.cos(v),y.y=h*Math.sin(v),u.push(y.x,y.y,y.z),c.push(0,0,1),m.x=(y.x/t+1)/2,m.y=(y.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let v=0;v<i;v++){const g=v+b,M=g,_=g+i+1,E=g+i+2,S=g+1;l.push(M,_,S),l.push(_,E,S)}}this.setIndex(l),this.setAttribute("position",new Oe(u,3)),this.setAttribute("normal",new Oe(c,3)),this.setAttribute("uv",new Oe(f,2))}static fromJSON(e){return new po(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Yr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Oe(r,3)),this.setAttribute("normal",new Oe(s,3)),this.setAttribute("uv",new Oe(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let y=p.shape;const m=p.holes;ri.isClockWise(y)===!1&&(y=y.reverse());for(let b=0,v=m.length;b<v;b++){const g=m[b];ri.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=ri.triangulateShape(y,m);for(let b=0,v=m.length;b<v;b++){const g=m[b];y=y.concat(g)}for(let b=0,v=y.length;b<v;b++){const g=y[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,v=d.length;b<v;b++){const g=d[b],M=g[0]+h,_=g[1]+h,E=g[2]+h;i.push(M,_,E),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return BN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Yr(i,e.curveSegments)}}function BN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Jr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new J,p=new J,y=[],m=[],d=[],b=[];for(let v=0;v<=i;v++){const g=[],M=v/i;let _=0;v==0&&o==0?_=.5/t:v==i&&u==Math.PI&&(_=-.5/t);for(let E=0;E<=t;E++){const S=E/t;h.x=-e*Math.cos(r+S*s)*Math.sin(o+M*l),h.y=e*Math.cos(o+M*l),h.z=e*Math.sin(r+S*s)*Math.sin(o+M*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(S+_,1-M),g.push(c++)}f.push(g)}for(let v=0;v<i;v++)for(let g=0;g<t;g++){const M=f[v][g+1],_=f[v][g],E=f[v+1][g],S=f[v+1][g+1];(v!==0||o>0)&&y.push(M,_,S),(v!==i-1||u<Math.PI)&&y.push(_,E,S)}this.setIndex(y),this.setAttribute("position",new Oe(m,3)),this.setAttribute("normal",new Oe(d,3)),this.setAttribute("uv",new Oe(b,2))}static fromJSON(e){return new Jr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class mo extends ii{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new mo(e.radius,e.detail)}}class Bc extends Un{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class go extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new J,h=new J,p=new J;for(let y=0;y<=i;y++)for(let m=0;m<=r;m++){const d=m/r*s,b=y/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(y/i)}for(let y=1;y<=i;y++)for(let m=1;m<=r;m++){const d=(r+1)*y+m-1,b=(r+1)*(y-1)+m-1,v=(r+1)*(y-1)+m,g=(r+1)*y+m;o.push(d,b,g),o.push(b,v,g)}this.setIndex(o),this.setAttribute("position",new Oe(l,3)),this.setAttribute("normal",new Oe(u,3)),this.setAttribute("uv",new Oe(c,2))}static fromJSON(e){return new go(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class yo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new J,p=new J,y=new J,m=new J,d=new J,b=new J,v=new J;for(let M=0;M<=i;++M){const _=M/i*s*Math.PI*2;g(_,s,o,e,y),g(_+.01,s,o,e,m),b.subVectors(m,y),v.addVectors(m,y),d.crossVectors(b,v),v.crossVectors(d,b),d.normalize(),v.normalize();for(let E=0;E<=r;++E){const S=E/r*Math.PI*2,w=-t*Math.cos(S),A=t*Math.sin(S);h.x=y.x+(w*v.x+A*d.x),h.y=y.y+(w*v.y+A*d.y),h.z=y.z+(w*v.z+A*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,y).normalize(),c.push(p.x,p.y,p.z),f.push(M/i),f.push(E/r)}}for(let M=1;M<=i;M++)for(let _=1;_<=r;_++){const E=(r+1)*(M-1)+(_-1),S=(r+1)*M+(_-1),w=(r+1)*M+_,A=(r+1)*(M-1)+_;l.push(E,S,A),l.push(S,w,A)}this.setIndex(l),this.setAttribute("position",new Oe(u,3)),this.setAttribute("normal",new Oe(c,3)),this.setAttribute("uv",new Oe(f,2));function g(M,_,E,S,w){const A=Math.cos(M),I=Math.sin(M),T=E/_*M,P=Math.cos(T);w.x=S*(2+P)*.5*A,w.y=S*(2+P)*I*.5,w.z=S*Math.sin(T)*.5}}static fromJSON(e){return new yo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class vo extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new J,u=new J,c=new _e;let f=new J;const h=[],p=[],y=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Oe(h,3)),this.setAttribute("normal",new Oe(p,3)),this.setAttribute("uv",new Oe(y,2));function d(){for(let M=0;M<t;M++)b(M);b(s===!1?t:0),g(),v()}function b(M){f=e.getPointAt(M/t,f);const _=o.normals[M],E=o.binormals[M];for(let S=0;S<=r;S++){const w=S/r*Math.PI*2,A=Math.sin(w),I=-Math.cos(w);u.x=I*_.x+A*E.x,u.y=I*_.y+A*E.y,u.z=I*_.z+A*E.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function v(){for(let M=1;M<=t;M++)for(let _=1;_<=r;_++){const E=(r+1)*(M-1)+(_-1),S=(r+1)*M+(_-1),w=(r+1)*M+_,A=(r+1)*(M-1)+_;m.push(E,S,A),m.push(S,w,A)}}function g(){for(let M=0;M<=t;M++)for(let _=0;_<=r;_++)c.x=M/t,c.y=_/r,y.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new vo(new Fh[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class zh extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new J;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,y=h.count;for(let m=p,d=p+y;m<d;m+=3)for(let b=0;b<3;b++){const v=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(v,g),i[1]=Math.max(v,g);const M=i[0]+","+i[1];r[M]===void 0&&(r[M]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Oe(t,3))}}var eb=Object.freeze({__proto__:null,BoxGeometry:Oi,BoxBufferGeometry:Oi,CircleGeometry:ao,CircleBufferGeometry:ao,ConeGeometry:lo,ConeBufferGeometry:lo,CylinderGeometry:gr,CylinderBufferGeometry:gr,DodecahedronGeometry:co,DodecahedronBufferGeometry:co,EdgesGeometry:Ah,ExtrudeGeometry:Un,ExtrudeBufferGeometry:Un,IcosahedronGeometry:ho,IcosahedronBufferGeometry:ho,LatheGeometry:fo,LatheBufferGeometry:fo,OctahedronGeometry:Xr,OctahedronBufferGeometry:Xr,ParametricGeometry:Dc,ParametricBufferGeometry:Dc,PlaneGeometry:$r,PlaneBufferGeometry:$r,PolyhedronGeometry:ii,PolyhedronBufferGeometry:ii,RingGeometry:po,RingBufferGeometry:po,ShapeGeometry:Yr,ShapeBufferGeometry:Yr,SphereGeometry:Jr,SphereBufferGeometry:Jr,TetrahedronGeometry:mo,TetrahedronBufferGeometry:mo,TextGeometry:Bc,TextBufferGeometry:Bc,TorusGeometry:go,TorusBufferGeometry:go,TorusKnotGeometry:yo,TorusKnotBufferGeometry:yo,TubeGeometry:vo,TubeBufferGeometry:vo,WireframeGeometry:zh});class Uh extends Nt{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ae(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Uh.prototype.isShadowMaterial=!0;class bo extends Ni{constructor(e){super(e),this.type="RawShaderMaterial"}}bo.prototype.isRawShaderMaterial=!0;class Kr extends Nt{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ae(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 Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Kr.prototype.isMeshStandardMaterial=!0;class Ia extends Kr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new _e(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ae(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ae).copy(e.sheen):this.sheen=null,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}}Ia.prototype.isMeshPhysicalMaterial=!0;class Gh extends Nt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ae(16777215),this.specular=new Ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Yo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Gh.prototype.isMeshPhongMaterial=!0;class Hh extends Nt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Hh.prototype.isMeshToonMaterial=!0;class Wh extends Nt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Wh.prototype.isMeshNormalMaterial=!0;class jh extends Nt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Yo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}jh.prototype.isMeshLambertMaterial=!0;class $h extends Nt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ir,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}$h.prototype.isMeshMatcapMaterial=!0;class Zh extends Ft{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Zh.prototype.isLineDashedMaterial=!0;var FN=Object.freeze({__proto__:null,ShadowMaterial:Uh,SpriteMaterial:ga,RawShaderMaterial:bo,ShaderMaterial:Ni,PointsMaterial:mr,MeshPhysicalMaterial:Ia,MeshStandardMaterial:Kr,MeshPhongMaterial:Gh,MeshToonMaterial:Hh,MeshNormalMaterial:Wh,MeshLambertMaterial:jh,MeshDepthMaterial:fc,MeshDistanceMaterial:pc,MeshBasicMaterial:dn,MeshMatcapMaterial:$h,LineDashedMaterial:Zh,LineBasicMaterial:Ft,Material:Nt});const dt={arraySlice:function(n,e,t){return dt.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(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},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(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)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let y=0;y<c.times.length;++y){const m=c.times[y]*r;if(!(m<t||m>=i)){h.push(c.times[y]);for(let d=0;d<f;++d)p.push(c.values[y*f+d])}}h.length!==0&&(c.times=dt.convertArray(h,c.times.constructor),c.values=dt.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(v){return v.name===l.name&&v.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const y=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=y/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const v=f,g=h-f;d=dt.arraySlice(l.values,v,g)}else if(s>=l.times[m]){const v=m*h+f,g=v+h-f;d=dt.arraySlice(l.values,v,g)}else{const v=l.createInterpolant(),g=f,M=h-f;v.evaluate(s),d=dt.arraySlice(v.resultBuffer,g,M)}u==="quaternion"&&new Zt().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let v=0;v<b;++v){const g=v*y+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const M=y-p*2;for(let _=0;_<M;++_)c.values[g+_]-=d[_]}}}return n.blendMode=Bd,n}};class si{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 l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}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_(){}}si.prototype.beforeStart_=si.prototype.copySampleValue_,si.prototype.afterEnd_=si.prototype.copySampleValue_;class tb extends si{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:Vr,endingEnd:Vr}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case kr:s=e,l=2*t-i;break;case ia:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case kr:o=e,u=2*i-t;break;case ia:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,y=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,v=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,M=(-1-y)*b+(1.5+y)*d+.5*m,_=y*b-y*d;for(let E=0;E!==l;++E)s[E]=v*o[f+E]+g*o[c+E]+M*o[u+E]+_*o[h+E];return s}}class Xh extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class nb extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Gn{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=dt.convertArray(t,this.TimeBufferType),this.values=dt.convertArray(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:dt.convertArray(e.times,Array),values:dt.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new nb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Xh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new tb(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Bs:t=this.InterpolantFactoryMethodDiscrete;break;case Fr:t=this.InterpolantFactoryMethodLinear;break;case zl: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 Bs;case this.InterpolantFactoryMethodLinear:return Fr;case this.InterpolantFactoryMethodSmooth:return zl}}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 l=this.getValueSize();this.times=dt.arraySlice(i,s,o),this.values=dt.arraySlice(this.values,s*l,o*l)}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 l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&dt.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=dt.arraySlice(this.times),t=dt.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===zl,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,y=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[y+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let y=0;y!==i;++y)t[p+y]=t[h+y]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=dt.arraySlice(e,0,o),this.values=dt.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=dt.arraySlice(this.times,0),t=dt.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Gn.prototype.TimeBufferType=Float32Array,Gn.prototype.ValueBufferType=Float32Array,Gn.prototype.DefaultInterpolation=Fr;class qr extends Gn{}qr.prototype.ValueTypeName="bool",qr.prototype.ValueBufferType=Array,qr.prototype.DefaultInterpolation=Bs,qr.prototype.InterpolantFactoryMethodLinear=void 0,qr.prototype.InterpolantFactoryMethodSmooth=void 0;class Yh extends Gn{}Yh.prototype.ValueTypeName="color";class xo extends Gn{}xo.prototype.ValueTypeName="number";class ib extends si{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Qr extends Gn{InterpolantFactoryMethodLinear(e){return new ib(this.times,this.values,this.getValueSize(),e)}}Qr.prototype.ValueTypeName="quaternion",Qr.prototype.DefaultInterpolation=Fr,Qr.prototype.InterpolantFactoryMethodSmooth=void 0;class es extends Gn{}es.prototype.ValueTypeName="string",es.prototype.ValueBufferType=Array,es.prototype.DefaultInterpolation=Bs,es.prototype.InterpolantFactoryMethodLinear=void 0,es.prototype.InterpolantFactoryMethodSmooth=void 0;class wo extends Gn{}wo.prototype.ValueTypeName="vector";class Mo{constructor(e,t=-1,i,r=Ul){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=gn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(kN(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(Gn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=dt.getKeyframeOrder(u);u=dt.sortedArray(u,1,f),c=dt.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new xo(".morphTargetInfluences["+t[l].name+"]",u,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 l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,y,m,d){if(y.length!==0){const b=[],v=[];dt.flattenJSON(y,b,v,m),b.length!==0&&d.push(new h(p,b,v))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const y={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)y[p[m].morphTargets[d]]=-1;for(const d in y){const b=[],v=[];for(let g=0;g!==p[m].morphTargets.length;++g){const M=p[m];b.push(M.time),v.push(M.morphTarget===d?1:0)}r.push(new xo(".morphTargetInfluence["+d+"]",b,v))}u=y.length*(o||1)}else{const y=".bones["+t[h].name+"]";i(wo,y+".position",p,"pos",r),i(Qr,y+".quaternion",p,"rot",r),i(wo,y+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}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 VN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return xo;case"vector":case"vector2":case"vector3":case"vector4":return wo;case"color":return Yh;case"quaternion":return Qr;case"bool":case"boolean":return qr;case"string":return es}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function kN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=VN(n.type);if(n.times===void 0){const t=[],i=[];dt.flattenJSON(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 ts={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 Jh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const y=c[h],m=c[h+1];if(y.global&&(y.lastIndex=0),y.test(f))return m}return null}}}const rb=new Jh;class Xt{constructor(e){this.manager=e!==void 0?e:rb,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}}const Hn={};class xn extends Xt{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=this,o=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Hn[e]!==void 0){Hn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let y;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let v=0;v<p.length;v++)d[v]=p.charCodeAt(v);m==="blob"?y=new Blob([d.buffer],{type:f}):y=d.buffer;break;case"document":y=new DOMParser().parseFromString(p,f);break;case"json":y=JSON.parse(p);break;default:y=p;break}setTimeout(function(){t&&t(y),s.manager.itemEnd(e)},0)}catch(y){setTimeout(function(){r&&r(y),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Hn[e]=[],Hn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=Hn[e];if(delete Hn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ts.add(e,h);for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=Hn[e];delete Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=Hn[e];delete Hn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Mo.parse(e[i]);t.push(r)}return t}}class UN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new Th,u=new xn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const y=s.parse(p,!0);o[h]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},c+=1,c===6&&(y.mipmapCount===1&&(l.minFilter=vt),l.image=o,l.format=y.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const y=p.mipmaps.length/p.mipmapCount;for(let m=0;m<y;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=vt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Oa extends Xt{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=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),ts.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class sb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Qs,o=new Oa(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class ob extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Zr,l=new xn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:vt,o.minFilter=c.minFilter!==void 0?c.minFilter:vt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=_i),c.mipmapCount===1&&(o.minFilter=vt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Kh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Tt,o=new Oa(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Ti:mn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ab extends bn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Aa(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Fh[r.type]().fromJSON(r))}return this}}class Na extends ab{constructor(e){super(),this.type="Path",this.currentPoint=new _e,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Aa(this.currentPoint.clone(),new _e(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new Lc(this.currentPoint.clone(),new _e(e,t),new _e(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new Rc(this.currentPoint.clone(),new _e(e,t),new _e(i,r),new _e(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new Pc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new Ea(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class vr extends Na{constructor(e){super(e),this.uuid=gn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Na().fromJSON(r))}return this}}class Wn extends $e{constructor(e,t=1){super(),this.type="Light",this.color=new Ae(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}Wn.prototype.isLight=!0;class qh extends Wn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.groundColor=new Ae(t)}copy(e){return Wn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}qh.prototype.isHemisphereLight=!0;const lb=new De,cb=new J,ub=new J;class Qh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new De,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new da,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new st(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;cb.setFromMatrixPosition(e.matrixWorld),t.position.copy(cb),ub.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ub),t.updateMatrixWorld(),lb.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(lb),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class db extends Qh{constructor(){super(new Bt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=ra*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}}db.prototype.isSpotLightShadow=!0;class Fc extends Wn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.target=new $e,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new db}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),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}}Fc.prototype.isSpotLight=!0;const hb=new De,Da=new J,ef=new J;class fb extends Qh{constructor(){super(new Bt(90,1,.5,500)),this._frameExtents=new _e(4,2),this._viewportCount=6,this._viewports=[new st(2,1,1,1),new st(0,1,1,1),new st(3,1,1,1),new st(1,1,1,1),new st(3,0,1,1),new st(1,0,1,1)],this._cubeDirections=[new J(1,0,0),new J(-1,0,0),new J(0,0,1),new J(0,0,-1),new J(0,1,0),new J(0,-1,0)],this._cubeUps=[new J(0,1,0),new J(0,1,0),new J(0,1,0),new J(0,1,0),new J(0,0,1),new J(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Da.setFromMatrixPosition(e.matrixWorld),i.position.copy(Da),ef.copy(i.position),ef.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(ef),i.updateMatrixWorld(),r.makeTranslation(-Da.x,-Da.y,-Da.z),hb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hb)}}fb.prototype.isPointLightShadow=!0;class Vc extends Wn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new fb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Vc.prototype.isPointLight=!0;class So extends ua{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),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,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),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}}So.prototype.isOrthographicCamera=!0;class pb extends Qh{constructor(){super(new So(-5,5,5,-5,.5,500))}}pb.prototype.isDirectionalLightShadow=!0;class kc extends Wn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy($e.DefaultUp),this.updateMatrix(),this.target=new $e,this.shadow=new pb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}kc.prototype.isDirectionalLight=!0;class tf extends Wn{constructor(e,t){super(e,t),this.type="AmbientLight"}}tf.prototype.isAmbientLight=!0;class nf extends Wn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}nf.prototype.isRectAreaLight=!0;class rf{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new J)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}rf.prototype.isSphericalHarmonics3=!0;class Ba extends Wn{constructor(e=new rf,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Ba.prototype.isLightProbe=!0;class mb extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new xn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new FN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Ae().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Ae().setHex(o.value);break;case"v2":r.uniforms[s].value=new _e().fromArray(o.value);break;case"v3":r.uniforms[s].value=new J().fromArray(o.value);break;case"v4":r.uniforms[s].value=new st().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new De().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new _e().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new _e().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Bi{static decodeText(e){if(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{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class sf extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}sf.prototype.isInstancedBufferGeometry=!0;class of extends Ge{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),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}}of.prototype.isInstancedBufferAttribute=!0;class gb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(y,m){if(t[m]!==void 0)return t[m];const b=y.interleavedBuffers[m],v=s(y,b.buffer),g=Zs(b.type,v),M=new pr(g,b.stride);return M.uuid=b.uuid,t[m]=M,M}function s(y,m){if(i[m]!==void 0)return i[m];const b=y.arrayBuffers[m],v=new Uint32Array(b).buffer;return i[m]=v,v}const o=e.isInstancedBufferGeometry?new sf:new ke,l=e.data.index;if(l!==void 0){const y=Zs(l.type,l.array);o.setIndex(new Ge(y,1))}const u=e.data.attributes;for(const y in u){const m=u[y];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Di(b,m.itemSize,m.offset,m.normalized)}else{const b=Zs(m.type,m.array),v=m.isInstancedBufferAttribute?of:Ge;d=new v(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(y,d)}const c=e.data.morphAttributes;if(c)for(const y in c){const m=c[y],d=[];for(let b=0,v=m.length;b<v;b++){const g=m[b];let M;if(g.isInterleavedBufferAttribute){const _=r(e.data,g.data);M=new Di(_,g.itemSize,g.offset,g.normalized)}else{const _=Zs(g.type,g.array);M=new Ge(_,g.itemSize,g.normalized)}g.name!==void 0&&(M.name=g.name),d.push(M)}o.morphAttributes[y]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let y=0,m=h.length;y!==m;++y){const d=h[y];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const y=new J;p.center!==void 0&&y.fromArray(p.center),o.boundingSphere=new Ai(y,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class GN extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new xn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Bi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new xn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new vr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new Sa().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new gb;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in eb?l=eb[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new mb;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=Mo.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Zs(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Jh(t);s=new Oa(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let y=0,m=p.length;y<m;y++){const d=p[y],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new Zr(b.data,b.width,b.height)))}}else{const y=l(h.url);y!==null&&(r[h.uuid]=y)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Zs(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Oa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],y=await s(p);y!==null&&(y instanceof HTMLImageElement?i[u.uuid].push(y):i[u.uuid].push(new Zr(y.data,y.width,y.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Qs(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new Zr(c.data,c.width,c.height):u=new Tt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,HN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],yb),u.wrapT=i(l.wrap[1],yb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,vb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,vb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const y=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),y.push(i[b])}return y}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new mc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ae(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ma(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new pa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Bt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new So(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new tf(e.color,e.intensity);break;case"DirectionalLight":o=new kc(e.color,e.intensity);break;case"PointLight":o=new Vc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new nf(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Fc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new qh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Ba().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new wa(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new At(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,y=e.instanceMatrix,m=e.instanceColor;o=new Sh(f,h,p),o.instanceMatrix=new Ge(new Float32Array(y.array),16),m!==void 0&&(o.instanceColor=new Ge(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new Av;break;case"Line":o=new ni(l(e.geometry),u(e.material));break;case"LineLoop":o=new Mc(l(e.geometry),u(e.material));break;case"LineSegments":o=new on(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new oo(l(e.geometry),u(e.material));break;case"Sprite":o=new xa(u(e.material));break;case"Group":o=new ti;break;case"Bone":o=new Ma;break;default:o=new $e}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let y=0;y<p.length;y++)o.add(this.parseObject(p[y],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let y=0;y<p.length;y++){const m=p[y];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let y=0;y<p.length;y++){const m=p[y],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const HN={UVMapping:Bl,CubeReflectionMapping:Jo,CubeRefractionMapping:Ko,EquirectangularReflectionMapping:Fl,EquirectangularRefractionMapping:Vl,CubeUVReflectionMapping:Is,CubeUVRefractionMapping:qo},yb={RepeatWrapping:nr,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Os},vb={NearestFilter:Et,NearestMipmapNearestFilter:Qo,NearestMipmapLinearFilter:ea,LinearFilter:vt,LinearMipmapNearestFilter:kl,LinearMipmapLinearFilter:_i};class af extends Xt{constructor(e){super(e),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=ts.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){ts.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}af.prototype.isImageBitmapLoader=!0;class bb{constructor(){this.type="ShapePath",this.color=new Ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Na,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const M=[];for(let _=0,E=g.length;_<E;_++){const S=g[_],w=new vr;w.curves=S.curves,M.push(w)}return M}function r(g,M){const _=M.length;let E=!1;for(let S=_-1,w=0;w<_;S=w++){let A=M[S],I=M[w],T=I.x-A.x,P=I.y-A.y;if(Math.abs(P)>Number.EPSILON){if(P<0&&(A=M[w],T=-T,I=M[S],P=-P),g.y<A.y||g.y>I.y)continue;if(g.y===A.y){if(g.x===A.x)return!0}else{const C=P*(g.x-A.x)-T*(g.y-A.y);if(C===0)return!0;if(C<0)continue;E=!E}}else{if(g.y!==A.y)continue;if(I.x<=g.x&&g.x<=A.x||A.x<=g.x&&g.x<=I.x)return!0}}return E}const s=ri.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new vr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],y=[];let m=[],d=0,b;y[d]=void 0,m[d]=[];for(let g=0,M=o.length;g<M;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&y[d]&&d++,y[d]={s:new vr,p:b},y[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!y[0])return i(o);if(y.length>1){let g=!1;const M=[];for(let _=0,E=y.length;_<E;_++)p[_]=[];for(let _=0,E=y.length;_<E;_++){const S=m[_];for(let w=0;w<S.length;w++){const A=S[w];let I=!0;for(let T=0;T<y.length;T++)r(A.p,y[T].p)&&(_!==T&&M.push({froms:_,tos:T,hole:w}),I?(I=!1,p[T].push(A)):g=!0);I&&p[_].push(A)}}M.length>0&&(g||(m=p))}let v;for(let g=0,M=y.length;g<M;g++){c=y[g].s,f.push(c),v=m[g];for(let _=0,E=v.length;_<E;_++)c.holes.push(v[_].h)}return f}}class lf{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=WN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function WN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2916
2916
  `)l=0,u-=s;else{const h=jN(f,r,l,u,t);l+=h.offsetX,o.push(h.path)}}return o}function jN(n,e,t,i,r){const s=r.glyphs[n]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");return}const o=new bb;let l,u,c,f,h,p,y,m;if(s.o){const d=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let b=0,v=d.length;b<v;)switch(d[b++]){case"m":l=d[b++]*e+t,u=d[b++]*e+i,o.moveTo(l,u);break;case"l":l=d[b++]*e+t,u=d[b++]*e+i,o.lineTo(l,u);break;case"q":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,o.quadraticCurveTo(h,p,c,f);break;case"b":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,y=d[b++]*e+t,m=d[b++]*e+i,o.bezierCurveTo(h,p,y,m,c,f);break}}return{offsetX:s.ha*e,path:o}}lf.prototype.isFont=!0;class $N extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let u;try{u=JSON.parse(l)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),u=JSON.parse(l.substring(65,l.length-2))}const c=s.parse(u);t&&t(c)},i,r)}parse(e){return new lf(e)}}let zc;const cf={getContext:function(){return zc===void 0&&(zc=new(window.AudioContext||window.webkitAudioContext)),zc},setContext:function(n){zc=n}};class xb extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new xn(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);cf.getContext().decodeAudioData(u,function(f){t(f)})}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}}class wb extends Ba{constructor(e,t,i=1){super(void 0,i);const r=new Ae().set(e),s=new Ae().set(t),o=new J(r.r,r.g,r.b),l=new J(s.r,s.g,s.b),u=Math.sqrt(Math.PI),c=u*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(l).multiplyScalar(u),this.sh.coefficients[1].copy(o).sub(l).multiplyScalar(c)}}wb.prototype.isHemisphereLightProbe=!0;class Mb extends Ba{constructor(e,t=1){super(void 0,t);const i=new Ae().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Mb.prototype.isAmbientLightProbe=!0;const Sb=new De,_b=new De;class ZN{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Bt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Bt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const r=e.projectionMatrix.clone(),s=t.eyeSep/2,o=s*t.near/t.focus,l=t.near*Math.tan(Ur*t.fov*.5)/t.zoom;let u,c;_b.elements[12]=-s,Sb.elements[12]=s,u=-l*t.aspect+o,c=l*t.aspect+o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(r),u=-l*t.aspect-o,c=l*t.aspect-o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(_b),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Sb)}}class Eb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Tb(),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=Tb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Tb(){return(typeof performance>"u"?Date:performance).now()}const ns=new J,Cb=new Zt,XN=new J,is=new J;class YN extends $e{constructor(){super(),this.type="AudioListener",this.context=cf.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Eb}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ns,Cb,XN),is.set(0,0,-1).applyQuaternion(Cb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ns.x,r),t.positionY.linearRampToValueAtTime(ns.y,r),t.positionZ.linearRampToValueAtTime(ns.z,r),t.forwardX.linearRampToValueAtTime(is.x,r),t.forwardY.linearRampToValueAtTime(is.y,r),t.forwardZ.linearRampToValueAtTime(is.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ns.x,ns.y,ns.z),t.setOrientation(is.x,is.y,is.z,i.x,i.y,i.z)}}class uf extends $e{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const rs=new J,Ab=new Zt,JN=new J,ss=new J;class KN extends uf{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(rs,Ab,JN),ss.set(0,0,1).applyQuaternion(Ab);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(rs.x,i),t.positionY.linearRampToValueAtTime(rs.y,i),t.positionZ.linearRampToValueAtTime(rs.z,i),t.orientationX.linearRampToValueAtTime(ss.x,i),t.orientationY.linearRampToValueAtTime(ss.y,i),t.orientationZ.linearRampToValueAtTime(ss.z,i)}else t.setPosition(rs.x,rs.y,rs.z),t.setOrientation(ss.x,ss.y,ss.z)}}class Rb{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class Lb{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 l=0;l!==r;++l)i[s+l]=i[l];o=t}else{o+=t;const l=t/o;this._mixBufferRegion(i,s,0,l,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,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,c=t+t;u!==c;++u)if(i[u]!==i[u+t]){l.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){Zt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Zt.multiplyQuaternionsFlat(e,o,e,t,e,i),Zt.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const df="\\[\\]\\.:\\/",qN=new RegExp("["+df+"]","g"),hf="[^"+df+"]",QN="[^"+df.replace("\\.","")+"]",eD=/((?:WC+[\/:])*)/.source.replace("WC",hf),tD=/(WCOD+)?/.source.replace("WCOD",QN),nD=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hf),iD=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hf),rD=new RegExp("^"+eD+tD+nD+iD+"$"),sD=["material","materials","bones"];class oD{constructor(e,t,i){const r=i||Qe.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 Qe{constructor(e,t,i){this.path=t,this.parsedPath=i||Qe.parseTrackName(t),this.node=Qe.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Qe.Composite(e,t,i):new Qe(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(qN,"")}static parseTrackName(e){const t=rD.exec(e);if(!t)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);sD.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||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 l=s[o];if(l.name===t||l.uuid===t)return l;const u=i(l.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[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=Qe.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");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 f=0;f<e.length;f++)if(e[f].name===c){c=f;break}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 l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=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.isBufferGeometry){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])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Qe.Composite=oD,Qe.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Qe.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Qe.prototype.GetterByBindingType=[Qe.prototype._getValue_direct,Qe.prototype._getValue_array,Qe.prototype._getValue_arrayElement,Qe.prototype._getValue_toArray],Qe.prototype.SetterByBindingTypeAndVersioning=[[Qe.prototype._setValue_direct,Qe.prototype._setValue_direct_setNeedsUpdate,Qe.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_array,Qe.prototype._setValue_array_setNeedsUpdate,Qe.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_arrayElement,Qe.prototype._setValue_arrayElement_setNeedsUpdate,Qe.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Qe.prototype._setValue_fromArray,Qe.prototype._setValue_fromArray_setNeedsUpdate,Qe.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Pb{constructor(){this.uuid=gn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let l,u=e.length,c=this.nCachedObjects_;for(let f=0,h=arguments.length;f!==h;++f){const p=arguments[f],y=p.uuid;let m=t[y];if(m===void 0){m=u++,t[y]=m,e.push(p);for(let d=0,b=o;d!==b;++d)s[d].push(new Qe(p,i[d],r[d]))}else if(m<c){l=e[m];const d=--c,b=e[d];t[b.uuid]=m,e[m]=b,t[y]=d,e[d]=p;for(let v=0,g=o;v!==g;++v){const M=s[v],_=M[d];let E=M[m];M[m]=_,E===void 0&&(E=new Qe(p,i[v],r[v])),M[d]=E}}else e[m]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,f=t[c];if(f!==void 0&&f>=s){const h=s++,p=e[h];t[p.uuid]=f,e[f]=p,t[c]=h,e[h]=u;for(let y=0,m=r;y!==m;++y){const d=i[y],b=d[h],v=d[f];d[f]=b,d[h]=v}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,u=arguments.length;l!==u;++l){const c=arguments[l],f=c.uuid,h=t[f];if(h!==void 0)if(delete t[f],h<s){const p=--s,y=e[p],m=--o,d=e[m];t[y.uuid]=h,e[h]=y,t[d.uuid]=p,e[p]=d,e.pop();for(let b=0,v=r;b!==v;++b){const g=i[b],M=g[p],_=g[m];g[h]=M,g[p]=_,g.pop()}}else{const p=--o,y=e[p];p>0&&(t[y.uuid]=h),e[h]=y,e.pop();for(let m=0,d=r;m!==d;++m){const b=i[m];b[h]=b[p],b.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,l=this._parsedPaths,u=this._objects,c=u.length,f=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(h);for(let p=f,y=u.length;p!==y;++p){const m=u[p];h[p]=new Qe(m,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],c=e[l];t[c]=i,o[i]=u,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}Pb.prototype.isAnimationObjectGroup=!0;class aD{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,l=new Array(o),u={endingStart:Vr,endingEnd:Vr};for(let c=0;c!==o;++c){const f=s[c].createInterpolant(null);l[c]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=by,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,l=r/s;e.warp(1,o,t),this.warp(l,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 l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,c=l.sampleValues;return u[0]=s,u[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 u=(e-s)*i;if(u<0||i===0)return;this._startTime=null,t=i*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Bd:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Ul:default:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulate(r,l)}}}_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===xy;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===vy){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 l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=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(u===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:l})}}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=kr,r.endingEnd=kr):(e?r.endingStart=this.zeroSlopeAtStart?kr:Vr:r.endingStart=ia,t?r.endingEnd=this.zeroSlopeAtEnd?kr:Vr:r.endingEnd=ia)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=i,this}}class Ib extends rr{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,l=e._interpolants,u=i.uuid,c=this._bindingsByRootAndName;let f=c[u];f===void 0&&(f={},c[u]=f);for(let h=0;h!==s;++h){const p=r[h],y=p.name;let m=f[y];if(m!==void 0)o[h]=m;else{if(m=o[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,u,y));continue}const d=t&&t._propertyBindings[h].binding.parsedPath;m=new Lb(Qe.create(i,y,d),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,u,y),o[h]=m}l[h].resultBuffer=m.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 l=o.knownActions;e._byClipCacheIndex=l.length,l.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,l=o[s],u=l.knownActions,c=u[u.length-1],f=e._byClipCacheIndex;c._byClipCacheIndex=f,u[f]=c,u.pop(),e._byClipCacheIndex=null;const h=l.actionByRoot,p=(e._localRoot||this._root).uuid;delete h[p],u.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,l=o[r],u=t[t.length-1],c=e._cacheIndex;u._cacheIndex=c,t[c]=u,t.pop(),delete l[s],Object.keys(l).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 Xh(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),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"?Mo.findByName(r,e):e;const l=o!==null?o.uuid:e,u=this._actionsByClip[l];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Ul),u!==void 0){const h=u.actionByRoot[s];if(h!==void 0&&h.blendMode===i)return h;c=u.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const f=new aD(this,o,t,i);return this._bindAction(f,c),this._addInactiveAction(f,l,s),f}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?Mo.findByName(i,e):e,o=s?s.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.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 l=this._bindings,u=this._nActiveBindings;for(let c=0;c!==u;++c)l[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 l=0,u=o.length;l!==u;++l){const c=o[l];this._deactivateAction(c);const f=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=f,t[f]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const l=i[o].actionByRoot,u=l[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const l=s[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}Ib.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Uc{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Uc(this.value.clone===void 0?this.value:this.value.clone())}}class Ob extends pr{constructor(e,t,i=1){super(e,t),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}}Ob.prototype.isInstancedInterleavedBuffer=!0;class Nb{constructor(e,t,i,r,s){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}Nb.prototype.isGLBufferAttribute=!0;class lD{constructor(e,t,i=0,r=1/0){this.ray=new lr(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new th,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,i=[]){return ff(e,this,i,t),i.sort(Db),i}intersectObjects(e,t=!1,i=[]){for(let r=0,s=e.length;r<s;r++)ff(e[r],this,i,t);return i.sort(Db),i}}function Db(n,e){return n.distance-e.distance}function ff(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)ff(r[s],e,t,!0)}}class cD{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=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,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($t(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class uD{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Bb=new _e;class _o{constructor(e=new _e(1/0,1/0),t=new _e(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),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=Bb.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(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}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}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}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))}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)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bb.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),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)}}_o.prototype.isBox2=!0;const Fb=new J,Gc=new J;class Vb{constructor(e=new J,t=new J){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Fb.subVectors(e,this.start),Gc.subVectors(this.end,this.start);const i=Gc.dot(Gc);let s=Gc.dot(Fb)/i;return t&&(s=$t(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class kb extends $e{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}kb.prototype.isImmediateRenderObject=!0;const zb=new J;class dD extends $e{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new ke,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,l=1,u=32;o<u;o++,l++){const c=o/u*Math.PI*2,f=l/u*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(f),Math.sin(f),1)}i.setAttribute("position",new Oe(r,3));const s=new Ft({fog:!1,toneMapped:!1});this.cone=new on(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),zb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(zb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const br=new J,Hc=new De,pf=new De;class Ub extends on{constructor(e){const t=Gb(e),i=new ke,r=[],s=[],o=new Ae(0,0,1),l=new Ae(0,1,0);for(let c=0;c<t.length;c++){const f=t[c];f.parent&&f.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(l.r,l.g,l.b))}i.setAttribute("position",new Oe(r,3)),i.setAttribute("color",new Oe(s,3));const u=new Ft({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,u),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");pf.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const l=t[s];l.parent&&l.parent.isBone&&(Hc.multiplyMatrices(pf,l.matrixWorld),br.setFromMatrixPosition(Hc),r.setXYZ(o,br.x,br.y,br.z),Hc.multiplyMatrices(pf,l.parent.matrixWorld),br.setFromMatrixPosition(Hc),r.setXYZ(o+1,br.x,br.y,br.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Gb(n){const e=[];n&&n.isBone&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,Gb(n.children[t]));return e}class hD extends At{constructor(e,t,i){const r=new Jr(t,4,2),s=new dn({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const fD=new J,Hb=new Ae,Wb=new Ae;class pD extends $e{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const r=new Xr(t);r.rotateY(Math.PI*.5),this.material=new dn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Ge(o,3)),this.add(new At(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Hb.copy(this.light.color),Wb.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?Hb:Wb;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(fD.setFromMatrixPosition(this.light.matrixWorld).negate())}}class jb extends on{constructor(e=10,t=10,i=4473924,r=8947848){i=new Ae(i),r=new Ae(r);const s=t/2,o=e/t,l=e/2,u=[],c=[];for(let p=0,y=0,m=-l;p<=t;p++,m+=o){u.push(-l,0,m,l,0,m),u.push(m,0,-l,m,0,l);const d=p===s?i:r;d.toArray(c,y),y+=3,d.toArray(c,y),y+=3,d.toArray(c,y),y+=3,d.toArray(c,y),y+=3}const f=new ke;f.setAttribute("position",new Oe(u,3)),f.setAttribute("color",new Oe(c,3));const h=new Ft({vertexColors:!0,toneMapped:!1});super(f,h),this.type="GridHelper"}}class mD extends on{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Ae(s),o=new Ae(o);const l=[],u=[];for(let h=0;h<=t;h++){const p=h/t*(Math.PI*2),y=Math.sin(p)*e,m=Math.cos(p)*e;l.push(0,0,0),l.push(y,0,m);const d=h&1?s:o;u.push(d.r,d.g,d.b),u.push(d.r,d.g,d.b)}for(let h=0;h<=i;h++){const p=h&1?s:o,y=e-e/i*h;for(let m=0;m<r;m++){let d=m/r*(Math.PI*2),b=Math.sin(d)*y,v=Math.cos(d)*y;l.push(b,0,v),u.push(p.r,p.g,p.b),d=(m+1)/r*(Math.PI*2),b=Math.sin(d)*y,v=Math.cos(d)*y,l.push(b,0,v),u.push(p.r,p.g,p.b)}}const c=new ke;c.setAttribute("position",new Oe(l,3)),c.setAttribute("color",new Oe(u,3));const f=new Ft({vertexColors:!0,toneMapped:!1});super(c,f),this.type="PolarGridHelper"}}const $b=new J,Wc=new J,Zb=new J;class gD extends $e{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,t===void 0&&(t=1);let r=new ke;r.setAttribute("position",new Oe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Ft({fog:!1,toneMapped:!1});this.lightPlane=new ni(r,s),this.add(this.lightPlane),r=new ke,r.setAttribute("position",new Oe([0,0,0,0,0,1],3)),this.targetLine=new ni(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){$b.setFromMatrixPosition(this.light.matrixWorld),Wc.setFromMatrixPosition(this.light.target.matrixWorld),Zb.subVectors(Wc,$b),this.lightPlane.lookAt(Wc),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Wc),this.targetLine.scale.z=Zb.length()}}const jc=new J,bt=new ua;class yD extends on{constructor(e){const t=new ke,i=new Ft({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={},l=new Ae(16755200),u=new Ae(16711680),c=new Ae(43775),f=new Ae(16777215),h=new Ae(3355443);p("n1","n2",l),p("n2","n4",l),p("n4","n3",l),p("n3","n1",l),p("f1","f2",l),p("f2","f4",l),p("f4","f3",l),p("f3","f1",l),p("n1","f1",l),p("n2","f2",l),p("n3","f3",l),p("n4","f4",l),p("p","n1",u),p("p","n2",u),p("p","n3",u),p("p","n4",u),p("u1","u2",c),p("u2","u3",c),p("u3","u1",c),p("c","t",f),p("p","c",h),p("cn1","cn2",h),p("cn3","cn4",h),p("cf1","cf2",h),p("cf3","cf4",h);function p(m,d,b){y(m,b),y(d,b)}function y(m,d){r.push(0,0,0),s.push(d.r,d.g,d.b),o[m]===void 0&&(o[m]=[]),o[m].push(r.length/3-1)}t.setAttribute("position",new Oe(r,3)),t.setAttribute("color",new Oe(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;bt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Lt("c",t,e,bt,0,0,-1),Lt("t",t,e,bt,0,0,1),Lt("n1",t,e,bt,-i,-r,-1),Lt("n2",t,e,bt,i,-r,-1),Lt("n3",t,e,bt,-i,r,-1),Lt("n4",t,e,bt,i,r,-1),Lt("f1",t,e,bt,-i,-r,1),Lt("f2",t,e,bt,i,-r,1),Lt("f3",t,e,bt,-i,r,1),Lt("f4",t,e,bt,i,r,1),Lt("u1",t,e,bt,i*.7,r*1.1,-1),Lt("u2",t,e,bt,-i*.7,r*1.1,-1),Lt("u3",t,e,bt,0,r*2,-1),Lt("cf1",t,e,bt,-i,0,1),Lt("cf2",t,e,bt,i,0,1),Lt("cf3",t,e,bt,0,-r,1),Lt("cf4",t,e,bt,0,r,1),Lt("cn1",t,e,bt,-i,0,-1),Lt("cn2",t,e,bt,i,0,-1),Lt("cn3",t,e,bt,0,-r,-1),Lt("cn4",t,e,bt,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Lt(n,e,t,i,r,s,o){jc.set(r,s,o).unproject(i);const l=e[n];if(l!==void 0){const u=t.getAttribute("position");for(let c=0,f=l.length;c<f;c++)u.setXYZ(l[c],jc.x,jc.y,jc.z)}}const $c=new un;class Xb extends on{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new ke;s.setIndex(new Ge(i,1)),s.setAttribute("position",new Ge(r,3)),super(s,new Ft({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&$c.setFromObject(this.object),$c.isEmpty())return;const t=$c.min,i=$c.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return on.prototype.copy.call(this,e),this.object=e.object,this}}class vD extends on{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ke;s.setIndex(new Ge(i,1)),s.setAttribute("position",new Oe(r,3)),super(s,new Ft({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class bD extends ni{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ke;o.setAttribute("position",new Oe(s,3)),o.computeBoundingSphere(),super(o,new Ft({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const l=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],u=new ke;u.setAttribute("position",new Oe(l,3)),u.computeBoundingSphere(),this.add(new At(u,new dn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?_t:Qi,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const Yb=new J;let Zc,mf;class xD extends $e{constructor(e=new J(0,0,1),t=new J(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Zc===void 0&&(Zc=new ke,Zc.setAttribute("position",new Oe([0,0,0,0,1,0],3)),mf=new gr(0,.5,1,5,1),mf.translate(0,-.5,0)),this.position.copy(t),this.line=new ni(Zc,new Ft({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new At(mf,new dn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}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{Yb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Yb,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}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}}class Jb extends on{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ke;r.setAttribute("position",new Oe(t,3)),r.setAttribute("color",new Oe(i,3));const s=new Ft({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Ae,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const Kb=new Float32Array(1),wD=new Int32Array(Kb.buffer);class MD{static toHalfFloat(e){Kb[0]=e;const t=wD[0];let i=t>>16&32768,r=t>>12&2047;const s=t>>23&255;return s<103?i:s>142?(i|=31744,i|=(s==255?0:1)&&t&8388607,i):s<113?(r|=2048,i|=(r>>114-s)+(r>>113-s&1),i):(i|=s-112<<10|r>>1,i+=r&1,i)}}const Eo=4,xr=8,oi=Math.pow(2,xr),qb=[.125,.215,.35,.446,.526,.582],Qb=xr-Eo+1+qb.length,To=20,ai={[rn]:0,[zr]:1,[Hl]:2,[Vd]:3,[kd]:4,[zd]:5,[Gl]:6},os=new dn({side:_t,depthWrite:!1,depthTest:!1}),SD=new At(new Oi,os),gf=new So,{_lodPlanes:Fa,_sizeLods:ex,_sigmas:Xc}=TD(),tx=new Ae;let yf=null;const as=(1+Math.sqrt(5))/2,Co=1/as,nx=[new J(1,1,1),new J(-1,1,1),new J(1,1,-1),new J(-1,1,-1),new J(0,as,Co),new J(0,as,-Co),new J(Co,0,as),new J(-Co,0,as),new J(as,Co,0),new J(-as,Co,0)];function ix(n){const e=Math.max(n.r,n.g,n.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return n.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class _D{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=CD(To),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){yf=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=ox(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=sx(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Fa.length;e++)Fa[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(yf),e.scissorTest=!1,Yc(e,0,0,e.width,e.height)}_fromTexture(e){yf=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Et,minFilter:Et,generateMipmaps:!1,type:Nr,format:D0,encoding:ED(e)?e.encoding:Hl,depthBuffer:!1},i=rx(t);return i.depthBuffer=!e,this._pingPongRenderTarget=rx(t),i}_compileMaterial(e){const t=new At(Fa[0],e);this._renderer.compile(t,gf)}_sceneToCubeUV(e,t,i,r){const l=new Bt(90,1,t,i),u=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],f=this._renderer,h=f.autoClear,p=f.outputEncoding,y=f.toneMapping;f.getClearColor(tx),f.toneMapping=tr,f.outputEncoding=rn,f.autoClear=!1;let m=!1;const d=e.background;if(d){if(d.isColor){os.color.copy(d).convertSRGBToLinear(),e.background=null;const b=ix(os.color);os.opacity=b,m=!0}}else{os.color.copy(tx).convertSRGBToLinear();const b=ix(os.color);os.opacity=b,m=!0}for(let b=0;b<6;b++){const v=b%3;v==0?(l.up.set(0,u[b],0),l.lookAt(c[b],0,0)):v==1?(l.up.set(0,0,u[b]),l.lookAt(0,c[b],0)):(l.up.set(0,u[b],0),l.lookAt(0,0,c[b])),Yc(r,v*oi,b>2?oi:0,oi,oi),f.setRenderTarget(r),m&&f.render(SD,l),f.render(e,l)}f.toneMapping=y,f.outputEncoding=p,f.autoClear=h}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=ox()):this._equirectShader==null&&(this._equirectShader=sx());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new At(Fa[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=ai[e.encoding],o.outputEncoding.value=ai[t.texture.encoding],Yc(t,0,0,3*oi,2*oi),i.setRenderTarget(t),i.render(s,gf)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<Qb;r++){const s=Math.sqrt(Xc[r]*Xc[r]-Xc[r-1]*Xc[r-1]),o=nx[(r-1)%nx.length];this._blur(e,r-1,r,s,o)}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,l){const u=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,h=new At(Fa[r],c),p=c.uniforms,y=ex[i]-1,m=isFinite(s)?Math.PI/(2*y):2*Math.PI/(2*To-1),d=s/m,b=isFinite(s)?1+Math.floor(f*d):To;b>To&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${To}`);const v=[];let g=0;for(let S=0;S<To;++S){const w=S/d,A=Math.exp(-w*w/2);v.push(A),S==0?g+=A:S<b&&(g+=2*A)}for(let S=0;S<v.length;S++)v[S]=v[S]/g;p.envMap.value=e.texture,p.samples.value=b,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l),p.dTheta.value=m,p.mipInt.value=xr-i,p.inputEncoding.value=ai[e.texture.encoding],p.outputEncoding.value=ai[e.texture.encoding];const M=ex[r],_=3*Math.max(0,oi-2*M),E=(r===0?0:2*oi)+2*M*(r>xr-Eo?r-xr+Eo:0);Yc(t,_,E,3*M,2*M),u.setRenderTarget(t),u.render(h,gf)}}function ED(n){return n===void 0||n.type!==Nr?!1:n.encoding===rn||n.encoding===zr||n.encoding===Gl}function TD(){const n=[],e=[],t=[];let i=xr;for(let r=0;r<Qb;r++){const s=Math.pow(2,i);e.push(s);let o=1/s;r>xr-Eo?o=qb[r-xr+Eo-1]:r==0&&(o=0),t.push(o);const l=1/(s-1),u=-l/2,c=1+l/2,f=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,p=6,y=3,m=2,d=1,b=new Float32Array(y*p*h),v=new Float32Array(m*p*h),g=new Float32Array(d*p*h);for(let _=0;_<h;_++){const E=_%3*2/3-1,S=_>2?0:-1,w=[E,S,0,E+2/3,S,0,E+2/3,S+1,0,E,S,0,E+2/3,S+1,0,E,S+1,0];b.set(w,y*p*_),v.set(f,m*p*_);const A=[_,_,_,_,_,_];g.set(A,d*p*_)}const M=new ke;M.setAttribute("position",new Ge(b,y)),M.setAttribute("uv",new Ge(v,m)),M.setAttribute("faceIndex",new Ge(g,d)),n.push(M),i>Eo&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function rx(n){const e=new Bn(3*oi,3*oi,n);return e.texture.mapping=Is,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Yc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function CD(n){const e=new Float32Array(n),t=new J(0,1,0);return new bo({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:ai[rn]},outputEncoding:{value:ai[rn]}},vertexShader:vf(),fragmentShader:`
2917
2917
 
2918
2918
  precision mediump float;
@@ -3179,9 +3179,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Ae().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class kB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return Sf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ae(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ae(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ae(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new Sf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=ir,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class zB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Ao extends si{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}}Ao.prototype.beforeStart_=Ao.prototype.copySampleValue_,Ao.prototype.afterEnd_=Ao.prototype.copySampleValue_,Ao.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,p=h*f,y=n*u,m=y-u,d=-2*p+3*h,b=p-h,v=1-d,g=b-h+f;for(let M=0;M!==o;M++){const _=s[m+M+o],E=s[m+M+l]*c,S=s[y+M+o],w=s[y+M]*c;r[M]=v*_+g*E+d*S+b*w}return r};const Fi={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},za={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:Et,9729:vt,9984:Qo,9985:kl,9986:ea,9987:_i},fx={33071:zt,33648:Os,10497:nr},px={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_f={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},UB={CUBICSPLINE:void 0,LINEAR:Fr,STEP:Bs},Ef={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function mx(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function GB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Qi})),n.DefaultMaterial}function Ua(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 ls(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 HB(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function WB(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 jB(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+gx(e.attributes):t=n.indices+":"+gx(n.attributes)+":"+n.mode,t}function gx(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 Tf(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.")}}class $B{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new AB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new af(this.options.manager):this.textureLoader=new Kh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new xn(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._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 l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};Ua(s,l,r),ls(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).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 l=0,u=o.length;l<u;l++)e[o[l]].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();return 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.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.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}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[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(mx(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)return Promise.resolve(null);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 l=o[0],u=px[r.type],c=za[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,p=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let d,b;if(y&&y!==h){const v=Math.floor(p/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let M=t.cache.get(g);M||(d=new c(l,v*y,r.count*y/f),M=new pr(d,y/f),t.cache.add(g,M)),b=new Di(M,u,p%y/f,m)}else l===null?d=new c(r.count*u):d=new c(l,p,r.count*u),b=new Ge(d,u,m);if(r.sparse!==void 0){const v=px.SCALAR,g=za[r.sparse.indices.componentType],M=r.sparse.indices.byteOffset||0,_=r.sparse.values.byteOffset||0,E=new g(o[1],M,r.sparse.count*v),S=new c(o[2],_,r.sparse.count*u);l!==null&&(b=new Ge(b.array.slice(),b.itemSize,b.normalized));for(let w=0,A=E.length;w<A;w++){const I=E[w];if(b.setX(I,S[w*u]),u>=2&&b.setY(I,S[w*u+1]),u>=3&&b.setZ(I,S[w*u+2]),u>=4&&b.setW(I,S[w*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,p=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const v=new DataView(d,25,1).getUint8(0,!1);p=v===6||v===4||v===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(M){const _=new Tt(M);_.needsUpdate=!0,b(_)}),i.load(mx(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),p||(d.format=Ti);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=hx[v.magFilter]||vt,d.minFilter=hx[v.minFilter]||_i,d.wrapS=fx[v.wrapS]||nr,d.wrapT=fx[v.wrapT]||nr,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}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,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new mr,Nt.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Ft,Nt.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Kr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Ae(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=er);const f=s.alphaMode||Ef.OPAQUE;return f===Ef.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Ef.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new _e(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(l.emissive=new Ae().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===Sf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=zr),h.emissiveMap&&(h.emissiveMap.encoding=zr),ls(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ua(r,h,s),h})}createUniqueName(e){const t=Qe.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return vx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=jB(c),h=r[f];if(h)o.push(h.promise);else{let p;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=vx(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?GB(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let y=0,m=f.length;y<m;y++){const d=f[y],b=o[y];let v;const g=c[y];if(b.mode===Fi.TRIANGLES||b.mode===Fi.TRIANGLE_STRIP||b.mode===Fi.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new wa(d,g):new At(d,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Fi.TRIANGLE_STRIP?v.geometry=bx(v.geometry,My):b.mode===Fi.TRIANGLE_FAN&&(v.geometry=bx(v.geometry,Fd));else if(b.mode===Fi.LINES)v=new on(d,g);else if(b.mode===Fi.LINE_STRIP)v=new ni(d,g);else if(b.mode===Fi.LINE_LOOP)v=new Mc(d,g);else if(b.mode===Fi.POINTS)v=new oo(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&WB(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ls(v,s),b.extensions&&Ua(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const p=new ti;for(let y=0,m=h.length;y<m;y++)p.add(h[y]);return p})}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 Bt(Wd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new So(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),ls(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],p=i.samplers[h.sampler],y=h.target,m=y.node!==void 0?y.node:y.id,d=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(y)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],p=c[2],y=c[3],m=c[4],d=[];for(let v=0,g=f.length;v<g;v++){const M=f[v],_=h[v],E=p[v],S=y[v],w=m[v];if(M===void 0)continue;M.updateMatrix(),M.matrixAutoUpdate=!0;let A;switch(wr[w.path]){case wr.weights:A=xo;break;case wr.rotation:A=Qr;break;case wr.position:case wr.scale:default:A=wo;break}const I=M.name?M.name:M.uuid,T=S.interpolation!==void 0?UB[S.interpolation]:Fr,P=[];wr[w.path]===wr.weights?M.traverse(function(R){R.isMesh===!0&&R.morphTargetInfluences&&P.push(R.name?R.name:R.uuid)}):P.push(I);let C=E.array;if(E.normalized){const R=Tf(C.constructor),L=new Float32Array(C.length);for(let N=0,x=C.length;N<x;N++)L[N]=C[N]*R;C=L}for(let R=0,L=P.length;R<L;R++){const N=new A(P[R]+"."+wr[w.path],_.array,C,T);S.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(O){return new Ao(this.times,this.values,this.getValueSize()/3,O)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(N)}}const b=i.name?i.name:"animation_"+e;return new Mo(b,void 0,d)})}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(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.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){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new Ma:l.length>1?u=new ti:l.length===1?u=l[0]:u=new $e,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),ls(u,s),s.extensions&&Ua(i,u,s),s.matrix!==void 0){const c=new De;c.fromArray(s.matrix),u.applyMatrix4(c)}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.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new ti;r.name&&(o.name=s.createUniqueName(r.name)),ls(o,r),r.extensions&&Ua(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(yx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function yx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,p=l.length;h<p;h++){const y=l[h];if(y){c.push(y);const m=new De;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new Sa(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(yx(f,s,t,i))}}return Promise.all(o)})}function ZB(n,e,t){const i=e.attributes,r=new un;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new J(u[0],u[1],u[2]),new J(c[0],c[1],c[2])),l.normalized){const f=Tf(za[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new J,u=new J;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const p=t.json.accessors[h.POSITION],y=p.min,m=p.max;if(y!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(m[2]))),p.normalized){const d=Tf(za[p.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Ai;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function vx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=_f[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return ls(n,e),ZB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?HB(n,e.targets,t):n})}function bx(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Fd)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.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const XB=Rl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:CB},Symbol.toStringTag,{value:"Module"})));var Cf={exports:{}},xx;function YB(){return xx||(xx=1,function(n){function e(c){var f={};function h(y){if(f[y])return f[y].exports;var m=f[y]={i:y,l:!1,exports:{}};return c[y].call(m.exports,m,m.exports,h),m.l=!0,m.exports}h.m=c,h.c=f,h.i=function(y){return y},h.d=function(y,m,d){h.o(y,m)||Object.defineProperty(y,m,{configurable:!1,enumerable:!0,get:d})},h.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},h.n=function(y){var m=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(m,"a",m),m},h.o=function(y,m){return Object.prototype.hasOwnProperty.call(y,m)},h.p="/",h.oe=function(y){throw console.error(y),y};var p=h(h.s=ENTRY_MODULE);return p.default||p}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var p={};p[h]=[];var y=f.toString(),m=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var d=m[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&p[h].push(v[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(p[h].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),p[v[2]]=p[v[2]]||[],p[v[2]].push(v[4]);for(var g=Object.keys(p),M=0;M<g.length;M++)for(var _=0;_<p[g[M]].length;_++)s(p[g[M]][_])&&(p[g[M]][_]=1*p[g[M]][_]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(h,p){return h||c[p].length>0},!1)}function u(c,f){for(var h={main:[f]},p={main:[]},y={main:{}};l(h);)for(var m=Object.keys(h),d=0;d<m.length;d++){var b=m[d],v=h[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var M=o(c,c[b][g],b),_=Object.keys(M),E=0;E<_.length;E++)h[_[E]]=h[_[E]]||[],h[_[E]]=h[_[E]].concat(M[_[E]])}}return p}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},p=f.all?{main:Object.keys(h.main)}:u(h,c),y="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var M=0;p[g][M];)M++;p[g].push(M),h[g][M]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(M))+")({"+p[g].map(function(_){return""+JSON.stringify(_)+": "+h[g][_].toString()}).join(",")+`});
3182
- `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function KB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function wx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}wx.prototype=Error.prototype;function qB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new wx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function Mx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(n,e){return function(){n.apply(e,arguments)}}function yt(n){if(!(this instanceof yt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],_x(n,this)}function Sx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,yt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof yt){n._state=3,n._value=e,Rf(n);return}else if(typeof t=="function"){_x(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(n){n._state===2&&n._deferreds.length===0&&yt._immediateFn(function(){n._handled||yt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Sx(n,n._deferreds[e]);n._deferreds=null}function nF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function _x(n,e){var t=!1;try{n(function(i){t||(t=!0,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}yt.prototype.catch=function(n){return this.then(null,n)},yt.prototype.then=function(n,e){var t=new this.constructor(eF);return Sx(this,new nF(n,e,t)),t},yt.prototype.finally=JB,yt.all=function(n){return new yt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},yt.any=qB,yt.allSettled=KB,yt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===yt?n:new yt(function(e){e(n)})},yt.reject=function(n){return new yt(function(e,t){t(n)})},yt.race=function(n){return new yt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)yt.resolve(n[i]).then(e,t)})},yt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){QB(n,0)},yt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.11.5","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var M=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=M,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var _=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:_,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],M=this.geometry.vertices[this.geometry.faces[v].b],_=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((M.x+d.x)/b.x,(M.y+d.y)/b.y),new c.Vector2((_.x+d.x)/b.x,(_.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(w){throw new TypeError('"'+w+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(w){var A=w,I=u(0).modelPrefix;return I&&(I[I.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(w)||(A=I+w)),A}function m(w,A){var I=(P,C)=>{try{var R=new URL(P,C).href;if(P&&2>P.split("?").length){var L=C.split("?");L.length===2&&(R=R+"?"+L[1])}return R}catch{console.error("There is an issue creting the url link with: ".concat(P,"."))}};if(!Array.isArray(w))return I(w,A);var T=[];return w.forEach(P=>{T.push(I(P,A))}),T}function d(w,A,I,T,P){var C=w.morphTargetInfluences,R=void 0;w.geometry&&(R=w.geometry.morphAttributes);var L=!1;if(C&&R&&R.position){T.set(0,0,0),P.set(0,0,0);for(var N=0;N<C.length;N++)0<C[N]&&(L=!0,I.setFromArray(R.position[N].array),T.add(I.min.multiplyScalar(C[N])),P.add(I.max.multiplyScalar(C[N])));L&&A.set(T,P)}L||A.setFromBufferAttribute(w.geometry.attributes.position),w.updateWorldMatrix(!0,!0),A.applyMatrix4(w.matrixWorld)}function b(w,A,I,T){var P=new XMLHttpRequest;P.open("GET",y(w),!0),P.onreadystatechange=()=>{P.readyState==4&&(P.status==200?I(P.responseText,A):T(w))},P.send(null)}function v(w,A,I){function T(N,x){R[x]=N,C++,C==P&&A(R)}for(var P=w.length,C=0,R=[],L=0;L<P;L++)b(w[L],L,T,I)}l.getColorsRGB=(w,A)=>{var I=Math.floor(A/3),T=A%3,P=0;T==0?P=w[I].r:T==1?P=w[I].g:T==2&&(P=w[I].b);var C=new f.Color(P);return[C.r,C.g,C.b]},l.updateMorphColorAttribute=function(w,A){if(A&&w&&w.morphAttributes&&w.morphAttributes.color){var I=w.morphAttributes.color,T=A.morphTargetInfluences,P=T.length;w.deleteAttribute("morphColor0"),w.deleteAttribute("morphColor1");for(var C=0,R=[],L=0;1>C||L<P;L++)0<T[L]&&(C++,R.push([L,T[L]]));R.length==2?(w.setAttribute("morphColor0",I[R[0][0]]),w.setAttribute("morphColor1",I[R[1][0]])):R.length==1&&(w.setAttribute("morphColor0",I[R[0][0]]),w.setAttribute("morphColor1",I[R[0][0]]))}},l.toBufferGeometry=(w,A)=>{var I;return w instanceof h?(A.localTimeEnabled&&!w.morphNormalsReady&&(w.morphNormals==null||w.morphNormals.length==0)&&w.computeMorphNormals(),I=w.toIndexedBufferGeometry(),A.localMorphColour&&g(w,I)):w instanceof f.BufferGeometry&&(I=w.clone()),I.colorsNeedUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),w._video&&(I._video=w._video),I},l.copyMorphColorsToBufferGeometry=(w,A)=>{if(w&&w.morphColors&&0<w.morphColors.length){for(var I=[],T=w.morphColors,P=u(5).getColorsRGB,C=0,R=T.length;C<R;C++){for(var L=T[C],N=[],x=0;x<w.faces.length;x++){var O=w.faces[x],B=P(L.colors,O.a);N.push(B[0],B[1],B[2]),B=P(L.colors,O.b),N.push(B[0],B[1],B[2]),B=P(L.colors,O.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*w.faces.length),3);D.name=L.name,I.push(D.copyArray(N))}A.morphAttributes.color=I}};var g=(w,A)=>{if(w&&w.morphColors&&0<w.morphColors.length){for(var I=[],T=w.morphColors,P=u(5).getColorsRGB,C=0,R=T.length;C<R;C++){for(var L,N=T[C],x=[],O=0;O<3*N.colors.length;O++)L=P(N.colors,O),x.push(L[0],L[1],L[2]);var B=new f.Float32BufferAttribute(x,3);B.name=N.name,I.push(B)}A.morphAttributes.color=I}};l.mergeVertices=function(w){var A=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;A=Math.max(A,Number.EPSILON);for(var I,T={},P=w.getIndex(),C=w.getAttribute("position"),R=P?P.count:C.count,L=0,N=Object.keys(w.attributes),x={},O={},le=[],B=["getX","getY","getZ","getW"],D=0,k=N.length;D<k;D++){I=N[D],x[I]=[];var U=w.morphAttributes[I];U&&(O[I]=Array(U.length).fill().map(()=>[]))}for(var H=Math.log10(1/A),X=Math.pow(10,H),D=0;D<R;D++){for(var re=P?P.getX(D):D,j="",G=0,k=N.length;G<k;G++)for(var I=N[G],W=w.getAttribute(I),q=W.itemSize,ee=0;ee<q;ee++)j+="".concat(~~(W[B[ee]](re)*X),",");if(j in T)le.push(T[j]);else{for(var G=0,k=N.length;G<k;G++)for(var K,I=N[G],W=w.getAttribute(I),U=w.morphAttributes[I],q=W.itemSize,ie=x[I],Y=O[I],ee=0;ee<q;ee++)if(K=B[ee],ie.push(W[K](re)),U)for(var te=0,F=U.length;te<F;te++)Y[te].push(U[te][K](re));T[j]=L,le.push(L),L++}}for(var $=w.clone(),D=0,k=N.length;D<k;D++){var W,I=N[D],Q=w.getAttribute(I),V=new Q.array.constructor(x[I]);if(Q.isInterleavedBufferAttribute?W=new f.BufferAttribute(V,Q.itemSize,Q.itemSize):(W=w.getAttribute(I).clone(),W.setArray(V)),$.setAttribute(I,W),I in O)for(var z,G=0;G<O[I].length;G++)z=w.morphAttributes[I][G].clone(),z.setArray(new z.array.constructor(O[I][G])),$.morphAttributes[I][G]=z}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return P===null?le=new f.BufferAttribute(ae,1):(le=w.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function M(w){if(w.isMeshPhongMaterial){var A=new f.MeshToonMaterial({color:w.color.clone(),morphTargets:w.morphTargets,morphNormals:w.morphNormals,vertexColors:w.vertexColors,transparent:w.transparent,opacity:w.opacity,side:w.side});return w.map&&(A.map=w.map),A}return w}function _(w,A){if(A&&w>=A.length){var I=new f.BufferGeometry,T=new Float32Array(3*w),P=0;return A.forEach(C=>{T[P++]=C[0],T[P++]=C[1],T[P++]=C[2]}),I.setAttribute("position",new f.BufferAttribute(T,3)),I.setDrawRange(0,A.length),I}}function E(){var w=new Image;w.src=u(8);var A=new f.Texture;return A.image=w,A.needsUpdate=!0,A}function S(w,A,I,T,P,C){var R=new p(w,A,I,T,P,C);return R.fontFace=T,R.fontSize=P,R.fontWeight=C,R.material.map.generateMipmaps=!1,R.material.map.anisotropy=4,R.material.sizeAttenuation=!1,R.material.alphaTest=.5,R.material.transparent=!0,R.material.depthWrite=!1,R.material.depthTest=!1,R.center.set(.5,-1.2),R.renderOrder=1e4,R}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=_,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=M,l.createNewSpriteText=S},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var M,_=new c.Matrix3().getNormalMatrix(g),E=0,S=this.vertices.length;E<S;E++)M=this.vertices[E],M.applyMatrix4(g);for(var w,A=0,I=this.faces.length;A<I;A++){w=this.faces[A],w.normal.applyMatrix3(_).normalize();for(var T=0,P=w.vertexNormals.length;T<P;T++)w.vertexNormals[T].applyMatrix3(_).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,M,_){return f.makeTranslation(g,M,_),this.applyMatrix4(f),this},scale:function(g,M,_){return f.makeScale(g,M,_),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function M(H,X,re,j){var G=I===void 0?[]:[_.colors[H].clone(),_.colors[X].clone(),_.colors[re].clone()],W=A===void 0?[]:[new c.Vector3().fromBufferAttribute(A,H),new c.Vector3().fromBufferAttribute(A,X),new c.Vector3().fromBufferAttribute(A,re)],q=new b(H,X,re,W,G,j);_.faces.push(q),T!==void 0&&_.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(T,H),new c.Vector2().fromBufferAttribute(T,X),new c.Vector2().fromBufferAttribute(T,re)]),P!==void 0&&_.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,H),new c.Vector2().fromBufferAttribute(P,X),new c.Vector2().fromBufferAttribute(P,re)])}var _=this,E=g.index===null?void 0:g.index,S=g.attributes;if(S.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var w=S.position,A=S.normal,I=S.color,T=S.uv,P=S.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var C=0;C<w.count;C++)_.vertices.push(new c.Vector3().fromBufferAttribute(w,C)),I!==void 0&&_.colors.push(new c.Color().fromBufferAttribute(I,C));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,D=x+O;B<D;B+=3)E===void 0?M(B,B+1,B+2,N.materialIndex):M(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var k=0;k<E.count;k+=3)M(E.getX(k),E.getX(k+1),E.getX(k+2));else for(var U=0;U<w.count;U+=3)M(U,U+1,U+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,M=this.boundingSphere.radius,_=M===0?1:1/M,E=new c.Matrix4;return E.set(_,0,0,-_*g.x,0,_,0,-_*g.y,0,0,_,-_*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,M=new c.Vector3,_=0,E=this.faces.length;_<E;_++){var S=this.faces[_],w=this.vertices[S.a],A=this.vertices[S.b],I=this.vertices[S.c];g.subVectors(I,A),M.subVectors(w,A),g.cross(M),g.normalize(),S.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],M=Array(this.vertices.length),_=0,E=this.vertices.length;_<E;_++)M[_]=new c.Vector3;if(g)for(var S=new c.Vector3,w=new c.Vector3,A=0,I=this.faces.length;A<I;A++){var T=this.faces[A],P=this.vertices[T.a],C=this.vertices[T.b],R=this.vertices[T.c];S.subVectors(R,C),w.subVectors(P,C),S.cross(w),M[T.a].add(S),M[T.b].add(S),M[T.c].add(S)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],M[L.a].add(L.normal),M[L.b].add(L.normal),M[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)M[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var U=this.faces[D],H=U.vertexNormals;H.length===3?(H[0].copy(M[U.a]),H[1].copy(M[U.b]),H[2].copy(M[U.c])):(H[0]=M[U.a].clone(),H[1]=M[U.b].clone(),H[2]=M[U.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),M},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,M=this.faces.length;g<M;g++){var _=this.faces[g],E=_.vertexNormals;E.length===3?(E[0].copy(_.normal),E[1].copy(_.normal),E[2].copy(_.normal)):(E[0]=_.normal.clone(),E[1]=_.normal.clone(),E[2]=_.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,M=0,_=this.faces.length;M<_;M++){g=this.faces[M],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,S=g.vertexNormals.length;E<S;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var w=new m;w.faces=this.faces;for(var A=0,I=this.morphTargets.length;A<I;A++){if(!this.morphNormals[A]){this.morphNormals[A]={},this.morphNormals[A].faceNormals=[],this.morphNormals[A].vertexNormals=[];for(var T=this.morphNormals[A].faceNormals,P=this.morphNormals[A].vertexNormals,C=0,R=this.faces.length;C<R;C++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};T.push(L),P.push(N)}}var x=this.morphNormals[A];w.vertices=this.morphTargets[A].vertices,w.computeFaceNormals();var O=w.computeVertexNormals();if(O&&0<O.length){this.morphTargets[A].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[A].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var U=this.faces[D],H=x.faceNormals[D],X=x.vertexNormals[D];H.copy(U.normal),X.a.copy(U.vertexNormals[0]),X.b.copy(U.vertexNormals[1]),X.c.copy(U.vertexNormals[2])}}for(var re,j=0,G=this.faces.length;j<G;j++)re=this.faces[j],re.normal=re.__originalFaceNormal,re.vertexNormals=re.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,M){var _=this.morphTargets.length,E=this.morphTargets,S=g.morphTargets,w=this.morphColors.length,A=this.morphColors,I=g.morphColors;if(0<_&&_==S.length)for(var T=0,P=E.length;T<P;T++){for(var C=E[T],R=S[T],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),C.vertices.push(O)}if(C.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),M!==void 0&&y.applyMatrix4(M),C.normals.push(y.x,y.y,y.z)}if(0<w&&w==I.length)for(var D=0,k=A.length;D<k;D++)for(var U=A[D],H=I[D],X=0,re=H.colors;X<re;X++)U.colors.push(H.colors[X].clone())},merge:function(g,M){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,S=this.vertices.length,w=this.vertices,A=g.vertices,I=g.normals,T=this.faces,P=g.faces,C=this.colors,R=g.colors;M!==void 0&&(E=new c.Matrix3().getNormalMatrix(M));for(var L=0,N=A.length;L<N;L++){var x=A[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),w.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),M!==void 0&&y.applyMatrix4(M),this.normals.push(y.x,y.y,y.z);for(var D=0,k=R.length;D<k;D++)typeof R[D]=="number"?C.push(R[D]):C.push(R[D].clone());for(var U=0,H=P.length;U<H;U++){var X=P[U],re=void 0,j=void 0,G=X.vertexNormals,W=X.vertexColors,q=new b(X.a+S,X.b+S,X.c+S);q.normal.copy(X.normal),E!==void 0&&q.normal.applyMatrix3(E).normalize();for(var ee=0,K=G.length;ee<K;ee++)re=G[ee].clone(),E!==void 0&&re.applyMatrix3(E).normalize(),q.vertexNormals.push(re);q.color.copy(X.color);for(var ie=0,Y=W.length;ie<Y;ie++)j=W[ie],q.vertexColors.push(j.clone());q.materialIndex=X.materialIndex+_,T.push(q)}for(var te,F=0,$=g.faceVertexUvs.length;F<$;F++){te=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var Q=0,V=te.length;Q<V;Q++){for(var z=te[Q],oe=[],ae=0,le=z.length;ae<le;ae++)oe.push(z[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,M)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,M={},_=[],E=[],S=Math.pow(10,g),w=0,A=this.vertices.length;w<A;w++){var I=this.vertices[w],T=Math.round(I.x*S)+"_"+Math.round(I.y*S)+"_"+Math.round(I.z*S);M[T]===void 0?(M[T]=w,_.push(this.vertices[w]),E[w]=_.length-1):E[w]=E[M[T]]}for(var P,C=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=E[P.a],P.b=E[P.b],P.c=E[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){C.push(R);break}}for(var O,B=C.length-1;0<=B;B--){O=C[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var U=this.vertices.length-_.length;return this.vertices=_,U},setFromPoints:function(g){this.vertices=[];for(var M,_=0,E=g.length;_<E;_++)M=g[_],this.vertices.push(new c.Vector3(M.x,M.y,M.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,M=g.length,_=0;_<M;_++)g[_]._id=_;g.sort(function(P,C){return P.materialIndex-C.materialIndex});var E,S,w=this.faceVertexUvs[0],A=this.faceVertexUvs[1];w&&w.length===M&&(E=[]),A&&A.length===M&&(S=[]);for(var I,T=0;T<M;T++)I=g[T]._id,E&&E.push(w[I]),S&&S.push(A[I]);E&&(this.faceVertexUvs[0]=E),S&&(this.faceVertexUvs[1]=S)},toJSON:function(){function g(Y,te,F){return F?Y|1<<te:Y&~(1<<te)}function M(Y){var te=Y.x.toString()+Y.y.toString()+Y.z.toString();return L[te]===void 0&&(L[te]=R.length/3,R.push(Y.x,Y.y,Y.z)),L[te]}function _(Y){var te=Y.r.toString()+Y.g.toString()+Y.b.toString();return x[te]===void 0&&(x[te]=N.length,N.push(Y.getHex())),x[te]}function E(Y){var te=Y.x.toString()+Y.y.toString();return B[te]===void 0&&(B[te]=O.length/2,O.push(Y.x,Y.y)),B[te]}var S={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(S.uuid=this.uuid,S.type=this.type,this.name!==""&&(S.name=this.name),this.parameters!==void 0){var w=this.parameters;for(var A in w)w[A]!==void 0&&(S[A]=w[A]);return S}for(var I,T=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],T.push(I.x,I.y,I.z);for(var C=[],R=[],L={},N=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],U=!0,H=!1,X=this.faceVertexUvs[0][D]!==void 0,re=0<k.normal.length(),j=0<k.vertexNormals.length,G=k.color.r!==1||k.color.g!==1||k.color.b!==1,W=0<k.vertexColors.length,q=0;if(q=g(q,0,0),q=g(q,1,U),q=g(q,2,H),q=g(q,3,X),q=g(q,4,re),q=g(q,5,j),q=g(q,6,G),q=g(q,7,W),C.push(q),C.push(k.a,k.b,k.c),C.push(k.materialIndex),X){var ee=this.faceVertexUvs[0][D];C.push(E(ee[0]),E(ee[1]),E(ee[2]))}if(re&&C.push(M(k.normal)),j){var K=k.vertexNormals;C.push(M(K[0]),M(K[1]),M(K[2]))}if(G&&C.push(_(k.color)),W){var ie=k.vertexColors;C.push(_(ie[0]),_(ie[1]),_(ie[2]))}}return S.data={},S.data.vertices=T,S.data.normals=R,0<N.length&&(S.data.colors=N),0<O.length&&(S.data.uvs=[O]),S.data.faces=C,S},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var M=g.vertices,_=0,E=M.length;_<E;_++)this.vertices.push(M[_].clone());for(var S=g.colors,w=0,A=S.length;w<A;w++)this.colors.push(S[w].clone());for(var I=g.faces,T=0,P=I.length;T<P;T++)this.faces.push(I[T].clone());for(var C,R=0,L=g.faceVertexUvs.length;R<L;R++){C=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=C.length;N<x;N++){for(var O,B=C[N],D=[],k=0,U=B.length;k<U;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[R].push(D)}}for(var H,X=g.morphTargets,re=0,j=X.length;re<j;re++){if(H={},H.name=X[re].name,X[re].vertices!==void 0){H.vertices=[];for(var G=0,W=X[re].vertices.length;G<W;G++)H.vertices.push(X[re].vertices[G].clone())}if(X[re].normals!==void 0){H.normals=[];for(var q=0,ee=X[re].normals.length;q<ee;q++)H.normals.push(X[re].normals[q].clone())}this.morphTargets.push(H)}for(var K,ie=g.morphNormals,Y=0,te=ie.length;Y<te;Y++){if(K={},ie[Y].vertexNormals!==void 0){K.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var Q=ie[Y].vertexNormals[F],V={};V.a=Q.a.clone(),V.b=Q.b.clone(),V.c=Q.c.clone(),K.vertexNormals.push(V)}}if(ie[Y].faceNormals!==void 0){K.faceNormals=[];for(var z=0,oe=ie[Y].faceNormals.length;z<oe;z++)K.faceNormals.push(ie[Y].faceNormals[z].clone())}this.morphNormals.push(K)}for(var ae=g.skinWeights,le=0,fe=ae.length;le<fe;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,ye=0,he=be.length;ye<he;ye++)this.skinIndices.push(be[ye].clone());for(var ve=g.lineDistances,se=0,we=ve.length;se<we;se++)this.lineDistances.push(ve[se]);var pe=g.boundingBox;pe!==null&&(this.boundingBox=pe.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,M=[],_=void 0,E=this.faces;for(g=0;g<E.length;g++){var S=E[g];S.materialIndex!==_&&(_=S.materialIndex,v!==void 0&&(v.count=3*g-v.start,M.push(v)),v={start:3*g,materialIndex:_})}return v!==void 0&&(v.count=3*g-v.start,M.push(v)),M},toBufferGeometry:function(){var g=new d().fromGeometry(this),M=new c.BufferGeometry,_=new Float32Array(3*g.vertices.length);if(M.setAttribute("position",new c.BufferAttribute(_,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);M.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var S=new Float32Array(3*g.colors.length);M.setAttribute("color",new c.BufferAttribute(S,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var w=new Float32Array(2*g.uvs.length);M.setAttribute("uv",new c.BufferAttribute(w,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var A=new Float32Array(2*g.uvs2.length);M.setAttribute("uv2",new c.BufferAttribute(A,2).copyVector2sArray(g.uvs2))}for(var I in M.groups=g.groups,g.morphTargets){for(var T=[],P=g.morphTargets[I],C=0,R=P.length;C<R;C++){var L=P[C],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,T.push(N.copyVector3sArray(L.data))}M.morphAttributes[I]=T}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);M.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);M.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(M.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(M.boundingBox=g.boundingBox.clone()),M},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,M=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(M,3).copyVector3sArray(this.vertices)),0<this.normals.length){var _=new Float32Array(this.normals.length),E=new c.BufferAttribute(_,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var S=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(S,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var w=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(w,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var A=[],I=0;I<this.colors.length;I++)A.push(new c.Color(this.colors[I]));var T=new Float32Array(3*A.length);g.setAttribute("color",new c.BufferAttribute(T,3).copyColorsArray(A))}else{for(var P=new Float32Array(3*this.vertices.length),C=0;C<3*this.vertices.length;C++)P[C]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,U=this.morphTargets.length;k<U;k++){var H=this.morphTargets[k],X=new c.Float32BufferAttribute(3*H.vertices.length,3);if(X.name=H.name,B.push(X.copyVector3sArray(H.vertices)),H.normals){var re=new c.Float32BufferAttribute(3*H.normals.length,3);re.name=H.name,D.push(re.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var j=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",j.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var G=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",G.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,M=v.geometry;if(v.isPoints||v.isLine){var _=new c.Float32BufferAttribute(3*M.vertices.length,3),E=new c.Float32BufferAttribute(3*M.colors.length,3);if(g.setAttribute("position",_.copyVector3sArray(M.vertices)),g.setAttribute("color",E.copyColorsArray(M.colors)),M.lineDistances&&M.lineDistances.length===M.vertices.length){var S=new c.Float32BufferAttribute(M.lineDistances.length,1);g.setAttribute("lineDistance",S.copyArray(M.lineDistances))}M.boundingSphere!==null&&(g.boundingSphere=M.boundingSphere.clone()),M.boundingBox!==null&&(g.boundingBox=M.boundingBox.clone())}else v.isMesh&&(g=M.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var M,_,E=[],S=void 0,w=g.faces;for(_=0;_<w.length;_++){var A=w[_];A.materialIndex!==S&&(S=A.materialIndex,M!==void 0&&(M.count=3*_-M.start,E.push(M)),M={start:3*_,materialIndex:S})}M!==void 0&&(M.count=3*_-M.start,E.push(M)),this.groups=E}fromGeometry(g){var M,_=g.faces,E=g.vertices,S=g.faceVertexUvs,w=S[0]&&0<S[0].length,A=S[1]&&0<S[1].length,I=g.morphTargets,T=I.length;if(0<T){M=[];for(var P=0;P<T;P++)M[P]={name:I[P].name,data:[]};this.morphTargets.position=M}var C,R=g.morphNormals,L=R.length;if(0<L){C=[];for(var N=0;N<L;N++)C[N]={name:R[N].name,data:[]};this.morphTargets.normal=C}var x=g.skinIndices,O=g.skinWeights,B=x.length===E.length,D=O.length===E.length;0<E.length&&_.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,U=0;U<_.length;U++){k=_[U],this.vertices.push(E[k.a],E[k.b],E[k.c]);var H=k.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var X=k.normal;this.normals.push(X,X,X)}var re=k.vertexColors;if(re.length===3)this.colors.push(re[0],re[1],re[2]);else{var j=k.color;this.colors.push(j,j,j)}if(w===!0){var G=S[0][U];G===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",U),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(G[0],G[1],G[2])}if(A===!0){var W=S[1][U];W===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",U),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(W[0],W[1],W[2])}for(var q,ee=0;ee<T;ee++)q=I[ee].vertices,M[ee].data.push(q[k.a],q[k.b],q[k.c]);for(var K,ie=0;ie<L;ie++)K=R[ie].vertexNormals[U],C[ie].data.push(K.a,K.b,K.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,M,_,E,S){var w=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=M,this.c=_,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=S&&S.isColor?S:new c.Color,this.vertexColors=Array.isArray(S)?S:[],this.materialIndex=w}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var M=0,_=g.vertexNormals.length;M<_;M++)this.vertexNormals[M]=g.vertexNormals[M].clone();for(var E=0,S=g.vertexColors.length;E<S;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=EB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function KB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function wx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}wx.prototype=Error.prototype;function qB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new wx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function Mx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(n,e){return function(){n.apply(e,arguments)}}function yt(n){if(!(this instanceof yt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],_x(n,this)}function Sx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,yt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof yt){n._state=3,n._value=e,Rf(n);return}else if(typeof t=="function"){_x(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(n){n._state===2&&n._deferreds.length===0&&yt._immediateFn(function(){n._handled||yt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Sx(n,n._deferreds[e]);n._deferreds=null}function nF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function _x(n,e){var t=!1;try{n(function(i){t||(t=!0,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}yt.prototype.catch=function(n){return this.then(null,n)},yt.prototype.then=function(n,e){var t=new this.constructor(eF);return Sx(this,new nF(n,e,t)),t},yt.prototype.finally=JB,yt.all=function(n){return new yt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},yt.any=qB,yt.allSettled=KB,yt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===yt?n:new yt(function(e){e(n)})},yt.reject=function(n){return new yt(function(e,t){t(n)})},yt.race=function(n){return new yt(function(e,t){if(!Mx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)yt.resolve(n[i]).then(e,t)})},yt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){QB(n,0)},yt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.11.7","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var M=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=M,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:M,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var _=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:_,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],M=this.geometry.vertices[this.geometry.faces[v].b],_=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((M.x+d.x)/b.x,(M.y+d.y)/b.y),new c.Vector2((_.x+d.x)/b.x,(_.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(w){throw new TypeError('"'+w+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(w){var A=w,I=u(0).modelPrefix;return I&&(I[I.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(w)||(A=I+w)),A}function m(w,A){var I=(P,C)=>{try{var R=new URL(P,C).href;if(P&&2>P.split("?").length){var L=C.split("?");L.length===2&&(R=R+"?"+L[1])}return R}catch{console.error("There is an issue creating the url link with: ".concat(P,"."))}};if(!Array.isArray(w))return I(w,A);var T=[];return w.forEach(P=>{T.push(I(P,A))}),T}function d(w,A,I,T,P){var C=w.morphTargetInfluences,R=void 0;w.geometry&&(R=w.geometry.morphAttributes);var L=!1;if(C&&R&&R.position){T.set(0,0,0),P.set(0,0,0);for(var N=0;N<C.length;N++)0<C[N]&&(L=!0,I.setFromArray(R.position[N].array),T.add(I.min.multiplyScalar(C[N])),P.add(I.max.multiplyScalar(C[N])));L&&A.set(T,P)}L||A.setFromBufferAttribute(w.geometry.attributes.position),w.updateWorldMatrix(!0,!0),A.applyMatrix4(w.matrixWorld)}function b(w,A,I,T){var P=new XMLHttpRequest;P.open("GET",y(w),!0),P.onreadystatechange=()=>{P.readyState==4&&(P.status==200?I(P.responseText,A):T(w))},P.send(null)}function v(w,A,I){function T(N,x){R[x]=N,C++,C==P&&A(R)}for(var P=w.length,C=0,R=[],L=0;L<P;L++)b(w[L],L,T,I)}l.getColorsRGB=(w,A)=>{var I=Math.floor(A/3),T=A%3,P=0;T==0?P=w[I].r:T==1?P=w[I].g:T==2&&(P=w[I].b);var C=new f.Color(P);return[C.r,C.g,C.b]},l.updateMorphColorAttribute=function(w,A){if(A&&w&&w.morphAttributes&&w.morphAttributes.color){var I=w.morphAttributes.color,T=A.morphTargetInfluences,P=T.length;w.deleteAttribute("morphColor0"),w.deleteAttribute("morphColor1");for(var C=0,R=[],L=0;1>C||L<P;L++)0<T[L]&&(C++,R.push([L,T[L]]));R.length==2?(w.setAttribute("morphColor0",I[R[0][0]]),w.setAttribute("morphColor1",I[R[1][0]])):R.length==1&&(w.setAttribute("morphColor0",I[R[0][0]]),w.setAttribute("morphColor1",I[R[0][0]]))}},l.toBufferGeometry=(w,A)=>{var I;return w instanceof h?(A.localTimeEnabled&&!w.morphNormalsReady&&(w.morphNormals==null||w.morphNormals.length==0)&&w.computeMorphNormals(),I=w.toIndexedBufferGeometry(),A.localMorphColour&&g(w,I)):w instanceof f.BufferGeometry&&(I=w.clone()),I.colorsNeedUpdate=!0,I.computeBoundingBox(),I.computeBoundingSphere(),w._video&&(I._video=w._video),I},l.copyMorphColorsToBufferGeometry=(w,A)=>{if(w&&w.morphColors&&0<w.morphColors.length){for(var I=[],T=w.morphColors,P=u(5).getColorsRGB,C=0,R=T.length;C<R;C++){for(var L=T[C],N=[],x=0;x<w.faces.length;x++){var O=w.faces[x],B=P(L.colors,O.a);N.push(B[0],B[1],B[2]),B=P(L.colors,O.b),N.push(B[0],B[1],B[2]),B=P(L.colors,O.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*w.faces.length),3);D.name=L.name,I.push(D.copyArray(N))}A.morphAttributes.color=I}};var g=(w,A)=>{if(w&&w.morphColors&&0<w.morphColors.length){for(var I=[],T=w.morphColors,P=u(5).getColorsRGB,C=0,R=T.length;C<R;C++){for(var L,N=T[C],x=[],O=0;O<3*N.colors.length;O++)L=P(N.colors,O),x.push(L[0],L[1],L[2]);var B=new f.Float32BufferAttribute(x,3);B.name=N.name,I.push(B)}A.morphAttributes.color=I}};l.mergeVertices=function(w){var A=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;A=Math.max(A,Number.EPSILON);for(var I,T={},P=w.getIndex(),C=w.getAttribute("position"),R=P?P.count:C.count,L=0,N=Object.keys(w.attributes),x={},O={},le=[],B=["getX","getY","getZ","getW"],D=0,k=N.length;D<k;D++){I=N[D],x[I]=[];var U=w.morphAttributes[I];U&&(O[I]=Array(U.length).fill().map(()=>[]))}for(var H=Math.log10(1/A),X=Math.pow(10,H),D=0;D<R;D++){for(var re=P?P.getX(D):D,j="",G=0,k=N.length;G<k;G++)for(var I=N[G],W=w.getAttribute(I),K=W.itemSize,ee=0;ee<K;ee++)j+="".concat(~~(W[B[ee]](re)*X),",");if(j in T)le.push(T[j]);else{for(var G=0,k=N.length;G<k;G++)for(var q,I=N[G],W=w.getAttribute(I),U=w.morphAttributes[I],K=W.itemSize,ie=x[I],Y=O[I],ee=0;ee<K;ee++)if(q=B[ee],ie.push(W[q](re)),U)for(var te=0,F=U.length;te<F;te++)Y[te].push(U[te][q](re));T[j]=L,le.push(L),L++}}for(var $=w.clone(),D=0,k=N.length;D<k;D++){var W,I=N[D],Q=w.getAttribute(I),V=new Q.array.constructor(x[I]);if(Q.isInterleavedBufferAttribute?W=new f.BufferAttribute(V,Q.itemSize,Q.itemSize):(W=w.getAttribute(I).clone(),W.setArray(V)),$.setAttribute(I,W),I in O)for(var z,G=0;G<O[I].length;G++)z=w.morphAttributes[I][G].clone(),z.setArray(new z.array.constructor(O[I][G])),$.morphAttributes[I][G]=z}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return P===null?le=new f.BufferAttribute(ae,1):(le=w.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function M(w){if(w.isMeshPhongMaterial){var A=new f.MeshToonMaterial({color:w.color.clone(),morphTargets:w.morphTargets,morphNormals:w.morphNormals,vertexColors:w.vertexColors,transparent:w.transparent,opacity:w.opacity,side:w.side});return w.map&&(A.map=w.map),A}return w}function _(w,A){if(A&&w>=A.length){var I=new f.BufferGeometry,T=new Float32Array(3*w),P=0;return A.forEach(C=>{T[P++]=C[0],T[P++]=C[1],T[P++]=C[2]}),I.setAttribute("position",new f.BufferAttribute(T,3)),I.setDrawRange(0,A.length),I}}function E(){var w=new Image;w.src=u(8);var A=new f.Texture;return A.image=w,A.needsUpdate=!0,A}function S(w,A,I,T,P,C){var R=new p(w,A,I,T,P,C);return R.fontFace=T,R.fontSize=P,R.fontWeight=C,R.material.map.generateMipmaps=!1,R.material.map.anisotropy=4,R.material.sizeAttenuation=!1,R.material.alphaTest=.5,R.material.transparent=!0,R.material.depthWrite=!1,R.material.depthTest=!1,R.center.set(.5,-1.2),R.renderOrder=1e4,R}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=_,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=M,l.createNewSpriteText=S},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var M,_=new c.Matrix3().getNormalMatrix(g),E=0,S=this.vertices.length;E<S;E++)M=this.vertices[E],M.applyMatrix4(g);for(var w,A=0,I=this.faces.length;A<I;A++){w=this.faces[A],w.normal.applyMatrix3(_).normalize();for(var T=0,P=w.vertexNormals.length;T<P;T++)w.vertexNormals[T].applyMatrix3(_).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,M,_){return f.makeTranslation(g,M,_),this.applyMatrix4(f),this},scale:function(g,M,_){return f.makeScale(g,M,_),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function M(H,X,re,j){var G=I===void 0?[]:[_.colors[H].clone(),_.colors[X].clone(),_.colors[re].clone()],W=A===void 0?[]:[new c.Vector3().fromBufferAttribute(A,H),new c.Vector3().fromBufferAttribute(A,X),new c.Vector3().fromBufferAttribute(A,re)],K=new b(H,X,re,W,G,j);_.faces.push(K),T!==void 0&&_.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(T,H),new c.Vector2().fromBufferAttribute(T,X),new c.Vector2().fromBufferAttribute(T,re)]),P!==void 0&&_.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,H),new c.Vector2().fromBufferAttribute(P,X),new c.Vector2().fromBufferAttribute(P,re)])}var _=this,E=g.index===null?void 0:g.index,S=g.attributes;if(S.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var w=S.position,A=S.normal,I=S.color,T=S.uv,P=S.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var C=0;C<w.count;C++)_.vertices.push(new c.Vector3().fromBufferAttribute(w,C)),I!==void 0&&_.colors.push(new c.Color().fromBufferAttribute(I,C));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,D=x+O;B<D;B+=3)E===void 0?M(B,B+1,B+2,N.materialIndex):M(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var k=0;k<E.count;k+=3)M(E.getX(k),E.getX(k+1),E.getX(k+2));else for(var U=0;U<w.count;U+=3)M(U,U+1,U+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,M=this.boundingSphere.radius,_=M===0?1:1/M,E=new c.Matrix4;return E.set(_,0,0,-_*g.x,0,_,0,-_*g.y,0,0,_,-_*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,M=new c.Vector3,_=0,E=this.faces.length;_<E;_++){var S=this.faces[_],w=this.vertices[S.a],A=this.vertices[S.b],I=this.vertices[S.c];g.subVectors(I,A),M.subVectors(w,A),g.cross(M),g.normalize(),S.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],M=Array(this.vertices.length),_=0,E=this.vertices.length;_<E;_++)M[_]=new c.Vector3;if(g)for(var S=new c.Vector3,w=new c.Vector3,A=0,I=this.faces.length;A<I;A++){var T=this.faces[A],P=this.vertices[T.a],C=this.vertices[T.b],R=this.vertices[T.c];S.subVectors(R,C),w.subVectors(P,C),S.cross(w),M[T.a].add(S),M[T.b].add(S),M[T.c].add(S)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],M[L.a].add(L.normal),M[L.b].add(L.normal),M[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)M[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var U=this.faces[D],H=U.vertexNormals;H.length===3?(H[0].copy(M[U.a]),H[1].copy(M[U.b]),H[2].copy(M[U.c])):(H[0]=M[U.a].clone(),H[1]=M[U.b].clone(),H[2]=M[U.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),M},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,M=this.faces.length;g<M;g++){var _=this.faces[g],E=_.vertexNormals;E.length===3?(E[0].copy(_.normal),E[1].copy(_.normal),E[2].copy(_.normal)):(E[0]=_.normal.clone(),E[1]=_.normal.clone(),E[2]=_.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,M=0,_=this.faces.length;M<_;M++){g=this.faces[M],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,S=g.vertexNormals.length;E<S;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var w=new m;w.faces=this.faces;for(var A=0,I=this.morphTargets.length;A<I;A++){if(!this.morphNormals[A]){this.morphNormals[A]={},this.morphNormals[A].faceNormals=[],this.morphNormals[A].vertexNormals=[];for(var T=this.morphNormals[A].faceNormals,P=this.morphNormals[A].vertexNormals,C=0,R=this.faces.length;C<R;C++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};T.push(L),P.push(N)}}var x=this.morphNormals[A];w.vertices=this.morphTargets[A].vertices,w.computeFaceNormals();var O=w.computeVertexNormals();if(O&&0<O.length){this.morphTargets[A].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[A].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var U=this.faces[D],H=x.faceNormals[D],X=x.vertexNormals[D];H.copy(U.normal),X.a.copy(U.vertexNormals[0]),X.b.copy(U.vertexNormals[1]),X.c.copy(U.vertexNormals[2])}}for(var re,j=0,G=this.faces.length;j<G;j++)re=this.faces[j],re.normal=re.__originalFaceNormal,re.vertexNormals=re.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,M){var _=this.morphTargets.length,E=this.morphTargets,S=g.morphTargets,w=this.morphColors.length,A=this.morphColors,I=g.morphColors;if(0<_&&_==S.length)for(var T=0,P=E.length;T<P;T++){for(var C=E[T],R=S[T],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),C.vertices.push(O)}if(C.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),M!==void 0&&y.applyMatrix4(M),C.normals.push(y.x,y.y,y.z)}if(0<w&&w==I.length)for(var D=0,k=A.length;D<k;D++)for(var U=A[D],H=I[D],X=0,re=H.colors;X<re;X++)U.colors.push(H.colors[X].clone())},merge:function(g,M){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,S=this.vertices.length,w=this.vertices,A=g.vertices,I=g.normals,T=this.faces,P=g.faces,C=this.colors,R=g.colors;M!==void 0&&(E=new c.Matrix3().getNormalMatrix(M));for(var L=0,N=A.length;L<N;L++){var x=A[L],O=x.clone();M!==void 0&&O.applyMatrix4(M),w.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),M!==void 0&&y.applyMatrix4(M),this.normals.push(y.x,y.y,y.z);for(var D=0,k=R.length;D<k;D++)typeof R[D]=="number"?C.push(R[D]):C.push(R[D].clone());for(var U=0,H=P.length;U<H;U++){var X=P[U],re=void 0,j=void 0,G=X.vertexNormals,W=X.vertexColors,K=new b(X.a+S,X.b+S,X.c+S);K.normal.copy(X.normal),E!==void 0&&K.normal.applyMatrix3(E).normalize();for(var ee=0,q=G.length;ee<q;ee++)re=G[ee].clone(),E!==void 0&&re.applyMatrix3(E).normalize(),K.vertexNormals.push(re);K.color.copy(X.color);for(var ie=0,Y=W.length;ie<Y;ie++)j=W[ie],K.vertexColors.push(j.clone());K.materialIndex=X.materialIndex+_,T.push(K)}for(var te,F=0,$=g.faceVertexUvs.length;F<$;F++){te=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var Q=0,V=te.length;Q<V;Q++){for(var z=te[Q],oe=[],ae=0,le=z.length;ae<le;ae++)oe.push(z[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,M)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,M={},_=[],E=[],S=Math.pow(10,g),w=0,A=this.vertices.length;w<A;w++){var I=this.vertices[w],T=Math.round(I.x*S)+"_"+Math.round(I.y*S)+"_"+Math.round(I.z*S);M[T]===void 0?(M[T]=w,_.push(this.vertices[w]),E[w]=_.length-1):E[w]=E[M[T]]}for(var P,C=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=E[P.a],P.b=E[P.b],P.c=E[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){C.push(R);break}}for(var O,B=C.length-1;0<=B;B--){O=C[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var U=this.vertices.length-_.length;return this.vertices=_,U},setFromPoints:function(g){this.vertices=[];for(var M,_=0,E=g.length;_<E;_++)M=g[_],this.vertices.push(new c.Vector3(M.x,M.y,M.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,M=g.length,_=0;_<M;_++)g[_]._id=_;g.sort(function(P,C){return P.materialIndex-C.materialIndex});var E,S,w=this.faceVertexUvs[0],A=this.faceVertexUvs[1];w&&w.length===M&&(E=[]),A&&A.length===M&&(S=[]);for(var I,T=0;T<M;T++)I=g[T]._id,E&&E.push(w[I]),S&&S.push(A[I]);E&&(this.faceVertexUvs[0]=E),S&&(this.faceVertexUvs[1]=S)},toJSON:function(){function g(Y,te,F){return F?Y|1<<te:Y&~(1<<te)}function M(Y){var te=Y.x.toString()+Y.y.toString()+Y.z.toString();return L[te]===void 0&&(L[te]=R.length/3,R.push(Y.x,Y.y,Y.z)),L[te]}function _(Y){var te=Y.r.toString()+Y.g.toString()+Y.b.toString();return x[te]===void 0&&(x[te]=N.length,N.push(Y.getHex())),x[te]}function E(Y){var te=Y.x.toString()+Y.y.toString();return B[te]===void 0&&(B[te]=O.length/2,O.push(Y.x,Y.y)),B[te]}var S={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(S.uuid=this.uuid,S.type=this.type,this.name!==""&&(S.name=this.name),this.parameters!==void 0){var w=this.parameters;for(var A in w)w[A]!==void 0&&(S[A]=w[A]);return S}for(var I,T=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],T.push(I.x,I.y,I.z);for(var C=[],R=[],L={},N=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],U=!0,H=!1,X=this.faceVertexUvs[0][D]!==void 0,re=0<k.normal.length(),j=0<k.vertexNormals.length,G=k.color.r!==1||k.color.g!==1||k.color.b!==1,W=0<k.vertexColors.length,K=0;if(K=g(K,0,0),K=g(K,1,U),K=g(K,2,H),K=g(K,3,X),K=g(K,4,re),K=g(K,5,j),K=g(K,6,G),K=g(K,7,W),C.push(K),C.push(k.a,k.b,k.c),C.push(k.materialIndex),X){var ee=this.faceVertexUvs[0][D];C.push(E(ee[0]),E(ee[1]),E(ee[2]))}if(re&&C.push(M(k.normal)),j){var q=k.vertexNormals;C.push(M(q[0]),M(q[1]),M(q[2]))}if(G&&C.push(_(k.color)),W){var ie=k.vertexColors;C.push(_(ie[0]),_(ie[1]),_(ie[2]))}}return S.data={},S.data.vertices=T,S.data.normals=R,0<N.length&&(S.data.colors=N),0<O.length&&(S.data.uvs=[O]),S.data.faces=C,S},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var M=g.vertices,_=0,E=M.length;_<E;_++)this.vertices.push(M[_].clone());for(var S=g.colors,w=0,A=S.length;w<A;w++)this.colors.push(S[w].clone());for(var I=g.faces,T=0,P=I.length;T<P;T++)this.faces.push(I[T].clone());for(var C,R=0,L=g.faceVertexUvs.length;R<L;R++){C=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=C.length;N<x;N++){for(var O,B=C[N],D=[],k=0,U=B.length;k<U;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[R].push(D)}}for(var H,X=g.morphTargets,re=0,j=X.length;re<j;re++){if(H={},H.name=X[re].name,X[re].vertices!==void 0){H.vertices=[];for(var G=0,W=X[re].vertices.length;G<W;G++)H.vertices.push(X[re].vertices[G].clone())}if(X[re].normals!==void 0){H.normals=[];for(var K=0,ee=X[re].normals.length;K<ee;K++)H.normals.push(X[re].normals[K].clone())}this.morphTargets.push(H)}for(var q,ie=g.morphNormals,Y=0,te=ie.length;Y<te;Y++){if(q={},ie[Y].vertexNormals!==void 0){q.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var Q=ie[Y].vertexNormals[F],V={};V.a=Q.a.clone(),V.b=Q.b.clone(),V.c=Q.c.clone(),q.vertexNormals.push(V)}}if(ie[Y].faceNormals!==void 0){q.faceNormals=[];for(var z=0,oe=ie[Y].faceNormals.length;z<oe;z++)q.faceNormals.push(ie[Y].faceNormals[z].clone())}this.morphNormals.push(q)}for(var ae=g.skinWeights,le=0,fe=ae.length;le<fe;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,ye=0,he=be.length;ye<he;ye++)this.skinIndices.push(be[ye].clone());for(var ve=g.lineDistances,se=0,we=ve.length;se<we;se++)this.lineDistances.push(ve[se]);var pe=g.boundingBox;pe!==null&&(this.boundingBox=pe.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,M=[],_=void 0,E=this.faces;for(g=0;g<E.length;g++){var S=E[g];S.materialIndex!==_&&(_=S.materialIndex,v!==void 0&&(v.count=3*g-v.start,M.push(v)),v={start:3*g,materialIndex:_})}return v!==void 0&&(v.count=3*g-v.start,M.push(v)),M},toBufferGeometry:function(){var g=new d().fromGeometry(this),M=new c.BufferGeometry,_=new Float32Array(3*g.vertices.length);if(M.setAttribute("position",new c.BufferAttribute(_,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);M.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var S=new Float32Array(3*g.colors.length);M.setAttribute("color",new c.BufferAttribute(S,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var w=new Float32Array(2*g.uvs.length);M.setAttribute("uv",new c.BufferAttribute(w,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var A=new Float32Array(2*g.uvs2.length);M.setAttribute("uv2",new c.BufferAttribute(A,2).copyVector2sArray(g.uvs2))}for(var I in M.groups=g.groups,g.morphTargets){for(var T=[],P=g.morphTargets[I],C=0,R=P.length;C<R;C++){var L=P[C],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,T.push(N.copyVector3sArray(L.data))}M.morphAttributes[I]=T}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);M.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);M.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(M.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(M.boundingBox=g.boundingBox.clone()),M},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,M=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(M,3).copyVector3sArray(this.vertices)),0<this.normals.length){var _=new Float32Array(this.normals.length),E=new c.BufferAttribute(_,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var S=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(S,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var w=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(w,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var A=[],I=0;I<this.colors.length;I++)A.push(new c.Color(this.colors[I]));var T=new Float32Array(3*A.length);g.setAttribute("color",new c.BufferAttribute(T,3).copyColorsArray(A))}else{for(var P=new Float32Array(3*this.vertices.length),C=0;C<3*this.vertices.length;C++)P[C]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,U=this.morphTargets.length;k<U;k++){var H=this.morphTargets[k],X=new c.Float32BufferAttribute(3*H.vertices.length,3);if(X.name=H.name,B.push(X.copyVector3sArray(H.vertices)),H.normals){var re=new c.Float32BufferAttribute(3*H.normals.length,3);re.name=H.name,D.push(re.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var j=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",j.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var G=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",G.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,M=v.geometry;if(v.isPoints||v.isLine){var _=new c.Float32BufferAttribute(3*M.vertices.length,3),E=new c.Float32BufferAttribute(3*M.colors.length,3);if(g.setAttribute("position",_.copyVector3sArray(M.vertices)),g.setAttribute("color",E.copyColorsArray(M.colors)),M.lineDistances&&M.lineDistances.length===M.vertices.length){var S=new c.Float32BufferAttribute(M.lineDistances.length,1);g.setAttribute("lineDistance",S.copyArray(M.lineDistances))}M.boundingSphere!==null&&(g.boundingSphere=M.boundingSphere.clone()),M.boundingBox!==null&&(g.boundingBox=M.boundingBox.clone())}else v.isMesh&&(g=M.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var M,_,E=[],S=void 0,w=g.faces;for(_=0;_<w.length;_++){var A=w[_];A.materialIndex!==S&&(S=A.materialIndex,M!==void 0&&(M.count=3*_-M.start,E.push(M)),M={start:3*_,materialIndex:S})}M!==void 0&&(M.count=3*_-M.start,E.push(M)),this.groups=E}fromGeometry(g){var M,_=g.faces,E=g.vertices,S=g.faceVertexUvs,w=S[0]&&0<S[0].length,A=S[1]&&0<S[1].length,I=g.morphTargets,T=I.length;if(0<T){M=[];for(var P=0;P<T;P++)M[P]={name:I[P].name,data:[]};this.morphTargets.position=M}var C,R=g.morphNormals,L=R.length;if(0<L){C=[];for(var N=0;N<L;N++)C[N]={name:R[N].name,data:[]};this.morphTargets.normal=C}var x=g.skinIndices,O=g.skinWeights,B=x.length===E.length,D=O.length===E.length;0<E.length&&_.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,U=0;U<_.length;U++){k=_[U],this.vertices.push(E[k.a],E[k.b],E[k.c]);var H=k.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var X=k.normal;this.normals.push(X,X,X)}var re=k.vertexColors;if(re.length===3)this.colors.push(re[0],re[1],re[2]);else{var j=k.color;this.colors.push(j,j,j)}if(w===!0){var G=S[0][U];G===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",U),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(G[0],G[1],G[2])}if(A===!0){var W=S[1][U];W===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",U),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(W[0],W[1],W[2])}for(var K,ee=0;ee<T;ee++)K=I[ee].vertices,M[ee].data.push(K[k.a],K[k.b],K[k.c]);for(var q,ie=0;ie<L;ie++)q=R[ie].vertexNormals[U],C[ie].data.push(q.a,q.b,q.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,M,_,E,S){var w=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=M,this.c=_,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=S&&S.isColor?S:new c.Color,this.vertexColors=Array.isArray(S)?S:[],this.materialIndex=w}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var M=0,_=g.vertexNormals.length;M<_;M++)this.vertexNormals[M]=g.vertexNormals[M].clone();for(var E=0,S=g.vertexColors.length;E<S;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=EB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
- `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var M=g.morphAttributes.position;M||(M=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),M&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(M,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,M=v*g;M!=this.clipAction.time&&(this.clipAction.time=M,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var _=d;_=d>this.duration?this.duration:0>d?0:d,_!=this.inbuildTime&&(this.inbuildTime=_,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,M=0,_=0;_<v.count;_++)this._v2.fromArray(v.array,3*_),M=this._v2.distanceTo(this._v1),g==-1?g=M:g>M&&(g=M,d=_)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,M=v.geometry.morphAttributes;if(g&&M&&M.position){for(var _=!1,E=0;E<g.length;E++)0<g[E]&&(_=!0,this._v1.fromArray(M.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(_)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var M=this.inbuildTime+d;M>this.duration&&(M-=this.duration),this.inbuildTime=M}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,M){this._lod.addLevelFromURL(d,b,v,g,M)},m.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(M=>{g.setXYZ(this.drawRange,M[0],M[1],M[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,M)=>{this._loader=d;var _,E=this.calculateDistance(b);for(_=0;_<this.levels.length&&!(E<this.levels[_].distance);_++);this.levels.splice(_,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),M&&this.loadLevel(_)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},M=h(b,g),_=void 0;this._parent.isGeometry?_=new c.Mesh(M,v):this._parent.isLines&&(_=new(u(12)).LineSegments(M,v)),_.userData=this._parent,_.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(_,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,M,_=d.cameraObject.position.distanceTo(b),E=-1,S=-1;for(g=0,M=v.length;g<M&&_>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,S=-1):S=g;for(-1<S&&this.loadLevel(S);g<M;g++)v[g].morph&&(-1<E?v[g].morph.visible=!1:(v[g].morph.visible=!0,E=g));this._currentLevel!=E&&(this._currentLevel=E,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,M=b.count;g<M;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>M});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class M extends c.Object3D{constructor(){var S=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=S,this.material=w,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}computeLineDistances(){var S=this.geometry;if(!S.isBufferGeometry)S.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(S.index===null){for(var w=S.attributes.position,A=[0],I=1,T=w.count;I<T;I++)f.fromBufferAttribute(w,I-1),h.fromBufferAttribute(w,I),A[I]=A[I-1],A[I]+=f.distanceTo(h);S.setAttribute("lineDistance",new c.Float32BufferAttribute(A,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(S,w){var A=this.geometry,I=this.matrixWorld,T=S.params.Line.threshold,P=A.drawRange,C=A.morphAttributes.position;if(A.boundingSphere===null&&A.computeBoundingSphere(),m.copy(A.boundingSphere),m.applyMatrix4(I),m.radius+=T,S.ray.intersectsSphere(m)!==!1){p.copy(I).invert(),y.copy(S.ray).applyMatrix4(p);var R=T/((this.scale.x+this.scale.y+this.scale.z)/3),L=R*R,N=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(A.isBufferGeometry){var k=A.index,U=A.attributes,H=U.position;if(k!==null)for(var X=Math.max(0,P.start),re=Math.min(k.count,P.start+P.count),j=X;j<re-1;j+=D){var G=k.getX(j),W=k.getX(j+1);_(N,x,this,H,C,G,W);var q=y.distanceSqToSegment(N,x,B,O);if(!(q>L)){B.applyMatrix4(this.matrixWorld);var ee=S.ray.origin.distanceTo(B);ee<S.near||ee>S.far||w.push({distance:ee,point:O.clone().applyMatrix4(this.matrixWorld),index:j,face:null,faceIndex:null,object:this})}}else for(var K=Math.max(0,P.start),ie=Math.min(H.count,P.start+P.count),Y=K;Y<ie-1;Y+=D){_(N,x,this,H,C,Y,Y+1);var te=y.distanceSqToSegment(N,x,B,O);if(!(te>L)){B.applyMatrix4(this.matrixWorld);var F=S.ray.origin.distanceTo(B);F<S.near||F>S.far||w.push({distance:F,point:O.clone().applyMatrix4(this.matrixWorld),index:Y,face:null,faceIndex:null,object:this})}}}else A.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var w=S.morphAttributes,A=Object.keys(w);if(0<A.length){var I=w[A[0]];if(I!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var T,P=0,C=I.length;P<C;P++)T=I[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[T]=P}}}else{var R=S.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function _(E,S,w,A,I,T,P){E.fromBufferAttribute(A,T),S.fromBufferAttribute(A,P);var C=w.morphTargetInfluences;if(w.material.morphTargets&&I&&C){d.set(0,0,0),b.set(0,0,0);for(var R=0,L=I.length;R<L;R++){var N=C[R],x=I[R];N!==0&&(v.fromBufferAttribute(x,T),g.fromBufferAttribute(x,P),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(S),N))}E.add(d),S.add(b)}}M.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,M=void 0,_=void 0,E=void 0,S=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var w=!1;this.ndc=new c.Vector3;var A=void 0,I=void 0,T=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(P,C)=>{var R=1,L=0;P!==C&&(L=1-(this.ndc.z-P)/(C-P),R=.6+.4*L),this.setSpriteSize(R)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,C,R)=>{this.morph.position.set(P,C,R)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{_&&(this.morph.add(_),S&&(this.morph.remove(v),I&&this.morph.remove(I),S=!1))},this.setImageForUserSprite=(P,C)=>{_&&(this.morph.remove(_),_=void 0),g&&g.dispose(),M&&M.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,M=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),C||(C=[.05,.05,1]),_=new c.Sprite(M),_.center.set(.5,0),_.scale.set(C[0],C[1],C[2]),_.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{S||(S=!0,this.morph.add(v),_&&this.morph.remove(_),I&&this.morph.add(I))},this.loadUserSprite=(P,C)=>{if(P)if(P!==E){E=P;var R=new Image(128,128);R.crossOrigin="anonymous",R.onload=()=>{this.setImageForUserSprite(R,C)},R.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),I&&(I.material.map.dispose(),I.material.dispose(),I=void 0)},this.isEnabled=()=>w,this.setNumber=P=>{(!P||A!=P)&&I&&(this.morph.remove(I),I.material.map.dispose(),I.material.dispose(),I=void 0),!I&&P&&(I=m(P,.012,"black","Asap",120,700),this.morph.add(I)),A=P},this.getNumber=()=>A||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{w=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{w=!1,this.morph.visible=!1,this.visible=!1},T()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0,this.fromMesh=g=>!!(g&&g.isMesh)&&(this.morph=g.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=g=>{g&&(typeof g=="string"||g instanceof String)&&(v=g,this.morph&&(this.morph.name=g)),b&&this.showLabel()},this.showLabel=g=>{if(b&&(position=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)){var M=[0,0,0];b=new(u(17)).Label(v,g),b.setPosition(M[0],M[1],M[2]),this.group.add(b.getSprite())}},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(g,M,_,E)=>{this.morph&&(this.morph.matrix.elements[0]=M[0],this.morph.matrix.elements[1]=M[1],this.morph.matrix.elements[2]=M[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=_[0],this.morph.matrix.elements[5]=_[1],this.morph.matrix.elements[6]=_[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=E[0],this.morph.matrix.elements[9]=E[1],this.morph.matrix.elements[10]=E[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=g[0],this.morph.matrix.elements[13]=g[1],this.morph.matrix.elements[14]=g[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),b&&b.setPosition(g[0],g[1],g[2])},this.setColour=g=>{b&&b.setColour(g),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{y.dispose()},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{function c(y){throw new TypeError('"'+y+'" is read-only')}var f=u(4),h=u(19).JSONLoader,p=function(){u(10).ZincObject.call(this);var y=[],m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,_=void 0,E=0,S=0,w=[0,0,0],A=[0,0,0],I=[0,0,0],T="NONE";this.ready=!1;var P=!1,C=!1;this.isGlyphset=!0;for(var R=new f.Matrix4,L=new f.Color,N=new f.Color,x=new f.Box3,O=new f.Box3,B=new f.Box3,D=[],k=[],U=[],H=[],X=[],re=[],j=[],G=[],W=0;8>W;W++)D[W]=new f.Vector3;this.load=(F,$,Q,V,z)=>{m=F.axis1,d=F.axis2,b=F.axis3,v=F.positions,g=F.scale,M=F.colors,_=F.label,P=F.metadata.MorphColours,C=F.metadata.MorphVertices,E=F.metadata.number_of_time_steps,T=F.metadata.repeat_mode,S=F.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),w=F.metadata.base_size,A=F.metadata.offset,I=F.metadata.scale_factors;var oe=new h;this.geometry=new f.BufferGeometry;var ae=new f.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(ae),V){var le=oe.parse($);te(Q,z)(le.geometry,le.materials),le.geometry.dispose()}else oe.crossOrigin="Anonymous",oe.load($,te(Q,z))};var q=(F,$,Q,V,z,oe)=>{if(T=="NONE"||T=="MIRROR"){for(var ae,le=[0,0,0],fe=[0,0,0],be=[0,0,0],ye=[0,0,0],he=[0,0,0],ve=[0,0,0],se=[0,0,0],we=[0,0,0],pe=[0,0,0],ge=0;3>ge;ge++)ae=0>z[ge]?-1:1,le[ge]=ae*w[ge]+z[ge]*I[ge];for(var ge=0;3>ge;ge++)fe[ge]=$[ge]*le[0],be[ge]=Q[ge]*le[1],ye[ge]=V[ge]*le[2],he[ge]=F[ge]+A[0]*fe[ge]+A[1]*be[ge]+A[2]*ye[ge],T=="MIRROR"&&(ve[ge]=-fe[ge],se[ge]=-be[ge],we[ge]=-ye[ge],pe[ge]=he[ge],0>z[0]&&(he[ge]-=fe[ge],pe[ge]-=ve[ge]));0>ye[0]*(fe[1]*be[2]-fe[2]*be[1])+ye[1]*(fe[2]*be[0]-fe[0]*be[2])+ye[2]*(fe[0]*be[1]-fe[1]*be[0])&&(ye[0]=-ye[0],ye[1]=-ye[1],ye[2]=-ye[2]),oe[0]=[he,fe,be,ye],T=="MIRROR"&&(0>we[0]*(ve[1]*se[2]-ve[2]*se[1])+we[1]*(ve[2]*se[0]-ve[0]*se[2])+we[2]*(ve[0]*se[1]-ve[1]*se[0])&&(we[0]=-we[0],we[1]=-we[1],we[2]=-we[2]),oe[1]=[pe,ve,se,we])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var ae,Ee=[0,0,0],He=[0,0,0],ge=0;3>ge;ge++)ae=0>z[ge]?-1:1,Ee[ge]=ae*w[0]+z[ge]*I[0];for(var ge=0;3>ge;ge++)He[ge]=F[ge]+A[0]*Ee[0]*$[ge]+A[1]*Ee[1]*Q[ge]+A[2]*Ee[2]*V[ge];for(var tt=glyph_repeat_mode=="AXES_2D"?2:3,Ie=0;Ie<tt;Ie++){var ot=void 0,Le=void 0,Ye=z[Ie],We=[0,0,0],it=[0,0,0],et=[0,0,0];Ie==0?(ot=$,Le=Q):Ie==1?(ot=Q,Le=glyph_repeat_mode=="AXES_2D"?$:V):(ot=V,Le=$);var Mt=w[0]+Ye*I[0];We[0]=ot[0]*Mt,We[1]=ot[1]*Mt,We[2]=ot[2]*Mt,et[0]=We[1]*Le[2]-Le[1]*We[2],et[1]=We[2]*Le[0]-Le[2]*We[0],et[2]=We[0]*Le[1]-We[1]*Le[0];var pt=Math.sqrt(et[0]*et[0]+et[1]*et[1]+et[2]*et[2]);if(0<pt){var hn=(w[2]+Ye*I[2])/pt;T=="AXES_2D"&&0<Ie&&(hn*=-1),et[0]*=hn,et[1]*=hn,et[2]*=hn}if(it[0]=et[1]*We[2]-We[1]*et[2],it[1]=et[2]*We[0]-We[2]*et[0],it[2]=et[0]*We[1]-et[1]*We[0],pt=Math.sqrt(it[0]*it[0]+it[1]*it[1]+it[2]*it[2]),0<pt){var Mn=(w[1]+Ye*I[1])/pt;it[0]*=Mn,it[1]*=Mn,it[2]*=Mn}oe[Ie]=[He,We,it,et]}}return oe},ee=(F,$,Q,V,z)=>{var oe=1;T=="AXES_2D"||T=="MIRROR"?oe=2:T=="AXES_3D"&&(oe=3);var ae=F.length/3,le=0;G.length=oe;for(var fe=0;fe<ae;fe++){var be=3*fe,ye=[F[be],F[be+1],F[be+2]],he=[$[be],$[be+1],$[be+2]],ve=[Q[be],Q[be+1],Q[be+2]],se=[V[be],V[be+1],V[be+2]],we=[z[be],z[be+1],z[be+2]],pe=q(ye,he,ve,se,we,G);if(pe.length==oe)for(var ge=0;ge<oe;ge++){R.elements[0]=pe[ge][1][0],R.elements[1]=pe[ge][1][1],R.elements[2]=pe[ge][1][2],R.elements[3]=0,R.elements[4]=pe[ge][2][0],R.elements[5]=pe[ge][2][1],R.elements[6]=pe[ge][2][2],R.elements[7]=0,R.elements[8]=pe[ge][3][0],R.elements[9]=pe[ge][3][1],R.elements[10]=pe[ge][3][2],R.elements[11]=0,R.elements[12]=pe[ge][0][0],R.elements[13]=pe[ge][0][1],R.elements[14]=pe[ge][0][2],R.elements[15]=1,this.morph.setMatrixAt(le,R);var Ee=y[le];Ee&&Ee.setTransformation(pe[ge][0],pe[ge][1],pe[ge][2],pe[ge][3]),le++}}this.morph.instanceMatrix.needsUpdate=!0},K=F=>{var $=1;T=="AXES_2D"||T=="MIRROR"?$=2:T=="AXES_3D"&&($=3);for(var Q,V=F.length,z=0,oe=0;oe<V;oe++){Q=F[oe];for(var ae=0;ae<$;ae++){L.setHex(Q),this.morph.setColorAt(z,L);var le=y[z];le&&le.setColour(L),z++}}this.morph.instanceColor.needsUpdate=!0},ie=()=>{var F=k,$=U,Q=H,V=X,z=re,oe=j,ae=this.inbuildTime/this.duration*(E-1),le=Math.floor(ae),fe=1-(ae-le),be=Math.ceil(ae);if(C){var ye=v[le.toString()],he=v[be.toString()],ve=m[le.toString()],se=m[be.toString()],we=d[le.toString()],pe=d[be.toString()],ge=b[le.toString()],Ee=b[be.toString()],He=g[le.toString()],tt=g[be.toString()];k.length=ye.length,U.length=ye.length,H.length=ye.length,X.length=ye.length,re.length=ye.length;for(var Ie=0;Ie<ye.length;Ie++)F[Ie]=fe*ye[Ie]+(1-fe)*he[Ie],$[Ie]=fe*ve[Ie]+(1-fe)*se[Ie],Q[Ie]=fe*we[Ie]+(1-fe)*pe[Ie],V[Ie]=fe*ge[Ie]+(1-fe)*Ee[Ie],z[Ie]=fe*He[Ie]+(1-fe)*tt[Ie]}else v[0],c("current_positions"),m[0],c("current_axis1s"),d[0],c("current_axis2s"),b[0],c("current_axis3s"),g[0],c("current_scales");if(ee(F,$,Q,V,z),this.boundingBoxUpdateRequired=!0,M!=null){if(P){var ot=M[le.toString()],Le=M[be.toString()];oe.length=ot.length;for(var Ye=0;Ye<ot.length;Ye++)L.setHex(ot[Ye]),N.setHex(Le[Ye]),L.setRGB(L.r*fe+N.r*(1-fe),L.g*fe+N.g*(1-fe),L.b*fe+N.b*(1-fe)),oe[Ye]=L.getHex()}else M[0],c("current_colors");K(oe)}};this.showLabel=()=>{for(var F=0;F<y.length;F++)y[F].showLabel(this.morph.material?this.morph.material.color:void 0)};var Y=F=>{if(_!=null&&F)for(var $,Q=0;Q<S;Q++)$=new(u(16)).Glyph(void 0,void 0,Q,this),_!=null&&_[Q]!=null&&$.setLabel(_[Q]),0<E&&$.setFrustumCulled(!1),y[Q]=$,this.morph.add($.getGroup());_!=null&&F&&this.showLabel(this.morph.material?this.morph.material.color:void 0),ee(v[0],m[0],d[0],b[0],g[0]),M!=null&&K(M[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=F=>{F.isGlyph&&y.push(F),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(F,$)=>{if(F.isMesh){var Q=new(u(16)).Glyph(void 0,void 0,$,this);return Q.fromMesh(F),y.push(Q),this.morph.add(Q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,Q}},this.forEachGlyph=F=>{for(var $=0;$<y.length;$++)F(y[$])};var te=(F,$)=>(Q,V)=>{var z=Q.toBufferGeometry();this.geometry.copy(z),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),z.dispose(),V&&V[0]&&(this.morph.material=V[0]),Y($),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),Q.dispose(),F!=null&&typeof F=="function"&&F(this)};this.getClosestVertexIndex=function(){var F=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var $,Q=v[0],V=Q.length/3,z=-1,oe=0,ae=0;ae<V;ae++)$=3*ae,this._v2.set(Q[$],Q[$+1],Q[$+2]),oe=this._v1.distanceTo(this._v2),(z==-1||z>oe)&&(z=oe,F=ae)}return F},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var F=new f.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,R),F.setFromMatrixPosition(R),F}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){x.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var F=0;F<S;F++)this.morph.getMatrixAt(F,R),O.copy(x).applyMatrix4(R),F==0?B.copy(O):B.union(O);if(B)this.cachedBoundingBox.copy(B),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=F=>{this.inbuildTime=F>this.duration?this.duration:0>F?0:F,(P||C)&&(ie(),C&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<E)&&(P||C)),this.getCurrentTime=()=>this.inbuildTime,this.dispose=()=>{for(var F=y.length-1;0<=F;F--)y[F].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,this.ready=!1,this.groupName=void 0},this.render=(F,$,Q)=>{if($==!0){var V=this.inbuildTime+F;V>this.duration&&(V-=this.duration),this.inbuildTime=V,(P||C)&&ie()}this.updateMarker($,Q)}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=p},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>S});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,M=c.FileLoader,_=c.DefaultLoadingManager,E=u(21).VideoHandler;function S(w){typeof w=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),w=void 0),this.manager=w===void 0?_:w,this.withCredentials=!1,this.paramsString=""}Object.assign(S.prototype,{load:function(A,I,T,P){var C=this,R=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(A),L=new M(this.manager);A.split("?"),this.paramsString=A.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(A,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),P)return void P({responseURL:A})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+A+" should be loaded with THREE.ObjectLoader instead.")}if(C&&C.parse){var D=C.parse(x,R);I(D.geometry,D.materials)}},T,P)},setTexturePath:function(A){this.texturePath=A},parse:function(){function w(P,C){function R(we,pe){return we&1<<pe}var L,N,x,O,B,D,k,U,H,X,re,j,G,W,q,ee,K,ie,Y,te,F,$,Q,V,z,oe,ae,le=P.faces,fe=P.vertices,be=P.normals,ye=P.colors,he=P.scale,ve=0;if(P.uvs!==void 0){for(L=0;L<P.uvs.length;L++)P.uvs[L].length&&ve++;for(L=0;L<ve;L++)C.faceVertexUvs[L]=[]}for(O=0,B=fe.length;O<B;)ie=new y,ie.x=fe[O++]*he,ie.y=fe[O++]*he,ie.z=fe[O++]*he,C.vertices.push(ie);if(O=0,B=le.length,P.uvs)for(L=0;L<P.uvs.length;L++){C.uvs[L]=[];for(var se=0;se<P.uvs[L].length;se++)C.uvs[L][se]=P.uvs[L][se]}if(be)for(L=0;L<be.length;L++)C.normals[L]=be[L];if(ye)for(L=0;L<ye.length;L++)C.colors[L]=ye[L];for(;O<B;)if(X=le[O++],re=R(X,0),j=R(X,1),G=R(X,3),W=R(X,4),q=R(X,5),ee=R(X,6),K=R(X,7),re){if(te=new v,te.a=le[O],te.b=le[O+1],te.c=le[O+3],F=new v,F.a=le[O+1],F.b=le[O+2],F.c=le[O+3],O+=4,j&&(H=le[O++],te.materialIndex=H,F.materialIndex=H),x=C.faces.length,G)for(L=0;L<ve;L++)for(V=P.uvs[L],C.faceVertexUvs[L][x]=[],C.faceVertexUvs[L][x+1]=[],N=0;4>N;N++)U=le[O++],oe=V[2*U],ae=V[2*U+1],z=new b(oe,ae),N!==2&&C.faceVertexUvs[L][x].push(z),N!==0&&C.faceVertexUvs[L][x+1].push(z);if(W&&(k=3*le[O++],te.normal.set(be[k++],be[k++],be[k]),F.normal.copy(te.normal)),q)for(L=0;4>L;L++)k=3*le[O++],Q=new y(be[k++],be[k++],be[k]),L!==2&&te.vertexNormals.push(Q),L!==0&&F.vertexNormals.push(Q);if(ee&&(D=le[O++],$=ye[D],te.color.setHex($),F.color.setHex($)),K)for(L=0;4>L;L++)D=le[O++],$=ye[D],L!==2&&te.vertexColors.push(new d($)),L!==0&&F.vertexColors.push(new d($));C.faces.push(te),C.faces.push(F)}else{if(Y=new v,Y.a=le[O++],Y.b=le[O++],Y.c=le[O++],j&&(H=le[O++],Y.materialIndex=H),x=C.faces.length,G)for(L=0;L<ve;L++)for(V=P.uvs[L],C.faceVertexUvs[L][x]=[],N=0;3>N;N++)U=le[O++],oe=V[2*U],ae=V[2*U+1],z=new b(oe,ae),C.faceVertexUvs[L][x].push(z);if(W&&(k=3*le[O++],Y.normal.set(be[k++],be[k++],be[k])),q)for(L=0;3>L;L++)k=3*le[O++],Q=new y(be[k++],be[k++],be[k]),Y.vertexNormals.push(Q);if(ee&&(D=le[O++],Y.color.setHex(ye[D])),K)for(L=0;3>L;L++)D=le[O++],Y.vertexColors.push(new d(ye[D]));C.faces.push(Y)}}function A(P,C){var R=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var L=0,N=P.skinWeights.length;L<N;L+=R){var x=P.skinWeights[L],O=1<R?P.skinWeights[L+1]:0,B=2<R?P.skinWeights[L+2]:0,D=3<R?P.skinWeights[L+3]:0;C.skinWeights.push(new m(x,O,B,D))}if(P.skinIndices)for(var L=0,N=P.skinIndices.length;L<N;L+=R){var k=P.skinIndices[L],U=1<R?P.skinIndices[L+1]:0,H=2<R?P.skinIndices[L+2]:0,X=3<R?P.skinIndices[L+3]:0;C.skinIndices.push(new m(k,U,H,X))}C.bones=P.bones,C.bones&&0<C.bones.length&&(C.skinWeights.length!==C.skinIndices.length||C.skinIndices.length!==C.vertices.length)&&console.warn("When skinning, number of vertices ("+C.vertices.length+"), skinIndices ("+C.skinIndices.length+"), and skinWeights ("+C.skinWeights.length+") should match.")}function I(P,C){var R=P.scale;if(P.morphTargets!==void 0)for(var L=0,N=P.morphTargets.length;L<N;L++){C.morphTargets[L]={},C.morphTargets[L].name=P.morphTargets[L].name,C.morphTargets[L].vertices=[];for(var x,O=C.morphTargets[L].vertices,B=P.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new y,x.x=B[D]*R,x.y=B[D+1]*R,x.z=B[D+2]*R,O.push(x)}if(P.morphNormals!==void 0){for(var L=0,N=P.morphNormals.length;L<N;L++)if(C.morphTargets[L]){C.morphTargets[L].normals=[];for(var U,H=C.morphTargets[L].normals,X=P.morphNormals[L].normals,D=0,k=X.length;D<k;D+=3)U=new y,U.x=X[D],U.y=X[D+1],U.z=X[D+2],H.push(U);C.morphNormalsReady=!0}}if(P.morphColors!==void 0){var L,N,re,j,G,W,q;for(L=0,N=P.morphColors.length;L<N;L++)for(C.morphColors[L]={},C.morphColors[L].name=P.morphColors[L].name,C.morphColors[L].colors=[],G=C.morphColors[L].colors,W=P.morphColors[L].colors,re=0,j=W.length;re<j;re+=3)q=new c.Color(16755200),q.setRGB(W[re],W[re+1],W[re+2]),G.push(q)}}function T(P,C){var R=[],L=[];P.animation!==void 0&&L.push(P.animation),P.animations!==void 0&&(P.animations.length?L=L.concat(P.animations):L.push(P.animations));for(var N,x=0;x<L.length;x++)N=p.parseAnimation(L[x],C.bones),N&&R.push(N);if(C.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(C.morphTargets,10);R=R.concat(O)}0<R.length&&(C.animations=R)}return function(P,C){P.data!==void 0&&(P=P.data),P.scale=P.scale===void 0?1:1/P.scale;var R=new g;if(R.morphColors=[],w(P,R),A(P,R),I(P,R),T(P,R),R.computeFaceNormals(),R.computeBoundingSphere(),P.materials===void 0||P.materials.length===0)return{geometry:R};var L=f.prototype.initMaterials(P.materials,C,"Anonymous");if(P.materials[0].video){var N=C+P.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new E(N);R._video=x}return L&&0<L.length&&(L[0].side=P.materials[0].singleSided?c.FrontSide:P.materials[0].flipSided?c.BackSide:c.DoubleSide,P.materials[0].specularCoef&&(L[0].shininess=Math.floor(P.materials[0].specularCoef/3))),{geometry:R,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(w,A,I,T,P){var C,R=b+w,L=f.Handlers.get(R);L===null?(y.setCrossOrigin(v),C=y.load(R)):C=L.load(R),A!==void 0&&(C.repeat.fromArray(A),A[0]!==1&&(C.wrapS=c.RepeatWrapping),A[1]!==1&&(C.wrapT=c.RepeatWrapping)),I!==void 0&&C.offset.fromArray(I),T!==void 0&&(T[0]==="repeat"&&(C.wrapS=c.RepeatWrapping),T[0]==="mirror"&&(C.wrapS=c.MirroredRepeatWrapping),T[1]==="repeat"&&(C.wrapT=c.RepeatWrapping),T[1]==="mirror"&&(C.wrapT=c.MirroredRepeatWrapping)),P!==void 0&&(C.anisotropy=P);var N=c.MathUtils.generateUUID();return M[N]=C,N}var M={},_={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var S=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":_.name=S;break;case"blending":_.blending=h[S];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":_.color=p.fromArray(S).getHex();break;case"colorSpecular":_.specular=p.fromArray(S).getHex();break;case"colorEmissive":_.emissive=p.fromArray(S).getHex();break;case"specularCoef":_.shininess=S;break;case"shading":S.toLowerCase()==="basic"&&(_.type="MeshBasicMaterial"),S.toLowerCase()==="phong"&&(_.type="MeshPhongMaterial"),S.toLowerCase()==="standard"&&(_.type="MeshStandardMaterial");break;case"mapDiffuse":_.map=g(S,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":_.emissiveMap=g(S,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":_.lightMap=g(S,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":_.aoMap=g(S,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":_.bumpMap=g(S,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":_.bumpScale=S;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":_.normalMap=g(S,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":_.normalScale=S;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":_.specularMap=g(S,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":_.metalnessMap=g(S,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":_.roughnessMap=g(S,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":_.alphaMap=g(S,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":_.side=c.BackSide;break;case"doubleSided":_.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),_.opacity=S;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":_[E]=S;break;case"vertexColors":S===!0&&(_.vertexColors=c.VertexColors),S==="face"&&(_.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,S)}}return _.type==="MeshBasicMaterial"&&delete _.emissive,_.type!=="MeshPhongMaterial"&&delete _.specular,1>_.opacity&&(_.transparent=!0),m.setTextures(M),m.parse(_)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,M)=>{if(v&&g){var _=h(v,M),E=p();g.map=E;var S=new f(_,g);this.setMesh(S,M.localTimeEnabled,M.localMorphColour)}};var b=(v,g,M,_)=>{if(M){var E=new c.Color(_),S=new y(M,E);S.setPosition(g[0],g[1],g[2]);var w=S.getSprite();w.material.sizeAttenuation=!1,w.material.alphaTest=.5,w.material.transparent=!0,w.material.depthWrite=!1,w.material.depthTest=!1,this.group.add(w),d[v]=S}};this.addPoints=(v,g,M)=>{if(v&&0<v.length){var _=this.drawRange-1,E=this.addVertices(v),S=this.getMorph();if(!S){var w=new c.PointsMaterial({alphaTest:.5,size:10,color:M,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,w,{localTimeEnabled:!1,localMorphColour:!1})}var A=_+v.length,I=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(_;_+I<A;){var T=typeof g=="string"?g:g[I];b(I,v[I],T,M),I++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var M=this.getMorph(),_=g+v.length-1;if(!M||0>g||_>=this.drawRange)return;var E=M.geometry.getAttribute("position"),S=g;v.forEach(w=>{var A=d[S];A&&A.setPosition(w[0],w[1],w[2]),E.setXYZ(S++,w[0],w[1],w[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,M,_)=>{this.morph&&M&&(this.morph.sizePerPixel=M.pixelHeight),m.prototype.render.call(this,v,g,M,_)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var _=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,E=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=_,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(_){return super.copy(_),this.material=_.material,this.geometry=_.geometry,this}raycast(_,E){var S=this.geometry,w=this.matrixWorld,A=_.params.Points.threshold,I=S.drawRange;if(S.boundingSphere===null&&S.computeBoundingSphere(),p.copy(S.boundingSphere),p.applyMatrix4(w),p.radius+=A,_.ray.intersectsSphere(p)!==!1){f.copy(w).invert(),h.copy(_.ray).applyMatrix4(f);var T=A/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,P=T*T;if(S.isBufferGeometry){var C=S.index,R=S.attributes,L=R.position,N=S.morphAttributes.position;if(C!==null)for(var x,O=Math.max(0,I.start),B=Math.min(C.count,I.start+I.count),D=O;D<B;D++)x=C.getX(D),g(this,L,N,x),v(y,x,P,w,_,E,this);else for(var k=Math.max(0,I.start),U=Math.min(L.count,I.start+I.count),H=k;H<U;H++)g(this,L,N,H),v(y,H,P,w,_,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var _=this.geometry;if(_.isBufferGeometry){var E=_.morphAttributes,S=Object.keys(E);if(0<S.length){var w=E[S[0]];if(w!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var A,I=0,T=w.length;I<T;I++)A=w[I].name||I+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[A]=I}}}else{var P=_.morphTargets;P!==void 0&&0<P.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(M,_,E,S,w,A,I){var T=h.distanceSqToPoint(M);if(T<E){var P=new c.Vector3;h.closestPointToPoint(M,P),P.applyMatrix4(S);var C=w.ray.origin.distanceTo(P);if(C<w.near||C>w.far)return;A.push({distance:C,distanceToRay:Math.sqrt(T),point:P,index:_,face:null,object:I})}}function g(M,_,E,S){y.fromBufferAttribute(_,S);var w=M.morphTargetInfluences;if(M.material.morphTargets&&E&&w){m.set(0,0,0);for(var A=0,I=E.length;A<I;A++){var T=w[A],P=E[A];T!==0&&(d.fromBufferAttribute(P,S),m.addScaledVector(d.sub(y),T))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,m,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var M=new Image;M.crossOrigin="Anonymous";for(var _,E=document.createElement("canvas"),S=0,w=Array(d.length),A=0;A<d.length;A++)_=yield y.imageToUint8Array(y,M,d[A],E),_&&_.array&&(b=_.width,v=_.height,w[g]=_.array,S+=w[g].length,g++);var I=new Uint8Array(S);S=0,w.forEach(T=>{I.set(T,S),S+=T.length}),y.impl=new h.DataTexture2DArray(I,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;m.transparent&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(v,g){var M=Object.keys(v);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(v);g&&(_=_.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),M.push.apply(M,_)}return M}function f(v){for(var g,M=1;M<arguments.length;M++)g=arguments[M]==null?{}:arguments[M],M%2?c(Object(g),!0).forEach(function(_){h(v,_,g[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(_){Object.defineProperty(v,_,Object.getOwnPropertyDescriptor(g,_))});return v}function h(v,g,M){return g=p(g),g in v?Object.defineProperty(v,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):v[g]=M,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var M=v[Symbol.toPrimitive];if(M!==void 0){var _=M.call(v,g||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],M={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var _=!0;this.createSlides=w=>{w.forEach(A=>this.createSlide(A))};var E=(w,A)=>{var I=w.material,T=I.uniforms;switch(w.rotation.x=0,w.rotation.y=0,w.rotation.z=0,w.position.x=0,w.position.y=0,w.position.z=0,A.direction){case"x":var P=_?-Math.PI/2:Math.PI/2;w.rotation.y=P,T.direction.value=1,T.slide.value.set(A.value,0,0),w.position.x=A.value;break;case"y":w.rotation.x=Math.PI/2,T.direction.value=2,T.slide.value.set(0,A.value,0),w.position.y=A.value;break;case"z":T.direction.value=3,T.slide.value.set(0,0,A.value),w.position.z=A.value;break}I.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=w=>{w&&w.id&&w.id in M&&M[w.id]&&E(M[w.id],w)},this.createSlide=w=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&w&&w.direction&&w.value!==void 0){var A=new m.PlaneGeometry(1,1);A.translate(.5,.5,0);var I=d.getUniforms();I.diffuse.value=this.texture.impl,I.depth.value=this.texture.size.depth,I.flipY.value=_;var T={fs:d.fs,vs:d.vs,uniforms:I,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},P=this.texture.getMaterial(T);P.needsUpdate=!0;var C=new m.Mesh(A,P);C.name=this.groupName,C.userData=this;var R={value:w.value,direction:w.direction,id:C.id};return g.push(R),E(C,R),M[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=w=>{for(var A=0;A<g.length;A++)if(w===g[A].id)return f({},g[A])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=w=>{w&&this.removeSlideWithId(w.id)},this.removeSlideWithId=w=>{if(this.morph&&w in M&&M[w]){if(this.morph.getObjectById(w)){var A=M[w];this.morph.remove(A),A.clear(),A.geometry&&A.geometry.dispose(),A.material&&A.material.dispose(),this.boundingBoxUpdateRequired=!0}var I=g.findIndex(T=>T.id===w);-1<I&&g.splice(I,1)}},this.dispose=()=>{this.morph.children.forEach(w=>{w.geometry&&w.geometry.dispose(),w.material&&w.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var S=(w,A,I)=>{switch(A.direction.value){case 1:I.copy(A.slide.value),w.expandByPoint(I),I.setY(1),I.setZ(1),w.expandByPoint(I);break;case 2:I.copy(A.slide.value),w.expandByPoint(I),I.setX(1),I.setZ(1),w.expandByPoint(I);break;case 3:I.copy(A.slide.value),w.expandByPoint(I),I.setX(1),I.setY(1),w.expandByPoint(I);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var w=new m.Vector3(0,0,0);this.morph.children.forEach(A=>{S(this.cachedBoundingBox,A.material.uniforms,w)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(w,A,I)=>{var T=new m.Matrix4;T.set(w[0],w[1],w[2],0,w[3],w[4],w[5],0,w[6],w[7],w[8],0,0,0,0,0);var P=new m.Quaternion().setFromRotationMatrix(T);this.morph.position.set(...A),this.morph.quaternion.copy(P),this.morph.scale.set(...I),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(w,A)=>{if(w){var I=w.locations;I&&0<I.length&&(this.applyTransformation(I[0].orientation,I[0].position,I[0].scale),"flipY"in I[0]&&(_=I[0].flipY)),this.createSlides(w.settings.slides),A!=null&&typeof A=="function"&&A(this)}}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3184
+ `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var M=g.morphAttributes.position;M||(M=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),M&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(M,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,M=v*g;M!=this.clipAction.time&&(this.clipAction.time=M,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var _=d;_=d>this.duration?this.duration:0>d?0:d,_!=this.inbuildTime&&(this.inbuildTime=_,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,M=0,_=0;_<v.count;_++)this._v2.fromArray(v.array,3*_),M=this._v2.distanceTo(this._v1),g==-1?g=M:g>M&&(g=M,d=_)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,M=v.geometry.morphAttributes;if(g&&M&&M.position){for(var _=!1,E=0;E<g.length;E++)0<g[E]&&(_=!0,this._v1.fromArray(M.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(_)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var M=this.inbuildTime+d;M>this.duration&&(M-=this.duration),this.inbuildTime=M}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,M){this._lod.addLevelFromURL(d,b,v,g,M)},m.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(M=>{g.setXYZ(this.drawRange,M[0],M[1],M[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,M)=>{this._loader=d;var _,E=this.calculateDistance(b);for(_=0;_<this.levels.length&&!(E<this.levels[_].distance);_++);this.levels.splice(_,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),M&&this.loadLevel(_)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},M=h(b,g),_=void 0;this._parent.isGeometry?_=new c.Mesh(M,v):this._parent.isLines&&(_=new(u(12)).LineSegments(M,v)),_.userData=this._parent,_.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(_,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,M,_=d.cameraObject.position.distanceTo(b),E=-1,S=-1;for(g=0,M=v.length;g<M&&_>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,S=-1):S=g;for(-1<S&&this.loadLevel(S);g<M;g++)v[g].morph&&(-1<E?v[g].morph.visible=!1:(v[g].morph.visible=!0,E=g));this._currentLevel!=E&&(this._currentLevel=E,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,M=b.count;g<M;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>M});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class M extends c.Object3D{constructor(){var S=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=S,this.material=w,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}computeLineDistances(){var S=this.geometry;if(!S.isBufferGeometry)S.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(S.index===null){for(var w=S.attributes.position,A=[0],I=1,T=w.count;I<T;I++)f.fromBufferAttribute(w,I-1),h.fromBufferAttribute(w,I),A[I]=A[I-1],A[I]+=f.distanceTo(h);S.setAttribute("lineDistance",new c.Float32BufferAttribute(A,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(S,w){var A=this.geometry,I=this.matrixWorld,T=S.params.Line.threshold,P=A.drawRange,C=A.morphAttributes.position;if(A.boundingSphere===null&&A.computeBoundingSphere(),m.copy(A.boundingSphere),m.applyMatrix4(I),m.radius+=T,S.ray.intersectsSphere(m)!==!1){p.copy(I).invert(),y.copy(S.ray).applyMatrix4(p);var R=T/((this.scale.x+this.scale.y+this.scale.z)/3),L=R*R,N=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(A.isBufferGeometry){var k=A.index,U=A.attributes,H=U.position;if(k!==null)for(var X=Math.max(0,P.start),re=Math.min(k.count,P.start+P.count),j=X;j<re-1;j+=D){var G=k.getX(j),W=k.getX(j+1);_(N,x,this,H,C,G,W);var K=y.distanceSqToSegment(N,x,B,O);if(!(K>L)){B.applyMatrix4(this.matrixWorld);var ee=S.ray.origin.distanceTo(B);ee<S.near||ee>S.far||w.push({distance:ee,point:O.clone().applyMatrix4(this.matrixWorld),index:j,face:null,faceIndex:null,object:this})}}else for(var q=Math.max(0,P.start),ie=Math.min(H.count,P.start+P.count),Y=q;Y<ie-1;Y+=D){_(N,x,this,H,C,Y,Y+1);var te=y.distanceSqToSegment(N,x,B,O);if(!(te>L)){B.applyMatrix4(this.matrixWorld);var F=S.ray.origin.distanceTo(B);F<S.near||F>S.far||w.push({distance:F,point:O.clone().applyMatrix4(this.matrixWorld),index:Y,face:null,faceIndex:null,object:this})}}}else A.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var w=S.morphAttributes,A=Object.keys(w);if(0<A.length){var I=w[A[0]];if(I!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var T,P=0,C=I.length;P<C;P++)T=I[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[T]=P}}}else{var R=S.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function _(E,S,w,A,I,T,P){E.fromBufferAttribute(A,T),S.fromBufferAttribute(A,P);var C=w.morphTargetInfluences;if(w.material.morphTargets&&I&&C){d.set(0,0,0),b.set(0,0,0);for(var R=0,L=I.length;R<L;R++){var N=C[R],x=I[R];N!==0&&(v.fromBufferAttribute(x,T),g.fromBufferAttribute(x,P),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(S),N))}E.add(d),S.add(b)}}M.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,M=void 0,_=void 0,E=void 0,S=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var w=!1;this.ndc=new c.Vector3;var A=void 0,I=void 0,T=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(P,C)=>{var R=1,L=0;P!==C&&(L=1-(this.ndc.z-P)/(C-P),R=.6+.4*L),this.setSpriteSize(R)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,C,R)=>{this.morph.position.set(P,C,R)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{_&&(this.morph.add(_),S&&(this.morph.remove(v),I&&this.morph.remove(I),S=!1))},this.setImageForUserSprite=(P,C)=>{_&&(this.morph.remove(_),_=void 0),g&&g.dispose(),M&&M.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,M=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),C||(C=[.05,.05,1]),_=new c.Sprite(M),_.center.set(.5,0),_.scale.set(C[0],C[1],C[2]),_.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{S||(S=!0,this.morph.add(v),_&&this.morph.remove(_),I&&this.morph.add(I))},this.loadUserSprite=(P,C)=>{if(P)if(P!==E){E=P;var R=new Image(128,128);R.crossOrigin="anonymous",R.onload=()=>{this.setImageForUserSprite(R,C)},R.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),I&&(I.material.map.dispose(),I.material.dispose(),I=void 0)},this.isEnabled=()=>w,this.setNumber=P=>{(!P||A!=P)&&I&&(this.morph.remove(I),I.material.map.dispose(),I.material.dispose(),I=void 0),!I&&P&&(I=m(P,.012,"black","Asap",120,700),this.morph.add(I)),A=P},this.getNumber=()=>A||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{w=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{w=!1,this.morph.visible=!1,this.visible=!1},T()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0,this.fromMesh=g=>!!(g&&g.isMesh)&&(this.morph=g.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=g=>{g&&(typeof g=="string"||g instanceof String)&&(v=g,this.morph&&(this.morph.name=g)),b&&this.showLabel()},this.showLabel=g=>{if(b&&(position=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)){var M=[0,0,0];b=new(u(17)).Label(v,g),b.setPosition(M[0],M[1],M[2]),this.group.add(b.getSprite())}},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(g,M,_,E)=>{this.morph&&(this.morph.matrix.elements[0]=M[0],this.morph.matrix.elements[1]=M[1],this.morph.matrix.elements[2]=M[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=_[0],this.morph.matrix.elements[5]=_[1],this.morph.matrix.elements[6]=_[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=E[0],this.morph.matrix.elements[9]=E[1],this.morph.matrix.elements[10]=E[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=g[0],this.morph.matrix.elements[13]=g[1],this.morph.matrix.elements[14]=g[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),b&&b.setPosition(g[0],g[1],g[2])},this.setColour=g=>{b&&b.setColour(g),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{y.dispose()},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{function c(y){throw new TypeError('"'+y+'" is read-only')}var f=u(4),h=u(19).JSONLoader,p=function(){u(10).ZincObject.call(this);var y=[],m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,_=void 0,E=0,S=0,w=[0,0,0],A=[0,0,0],I=[0,0,0],T="NONE";this.ready=!1;var P=!1,C=!1;this.isGlyphset=!0;for(var R=new f.Matrix4,L=new f.Color,N=new f.Color,x=new f.Box3,O=new f.Box3,B=new f.Box3,D=[],k=[],U=[],H=[],X=[],re=[],j=[],G=[],W=0;8>W;W++)D[W]=new f.Vector3;this.load=(F,$,Q,V,z)=>{m=F.axis1,d=F.axis2,b=F.axis3,v=F.positions,g=F.scale,M=F.colors,_=F.label,P=F.metadata.MorphColours,C=F.metadata.MorphVertices,E=F.metadata.number_of_time_steps,T=F.metadata.repeat_mode,S=F.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),w=F.metadata.base_size,A=F.metadata.offset,I=F.metadata.scale_factors;var oe=new h;this.geometry=new f.BufferGeometry;var ae=new f.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(ae),V){var le=oe.parse($);te(Q,z)(le.geometry,le.materials),le.geometry.dispose()}else oe.crossOrigin="Anonymous",oe.load($,te(Q,z))};var K=(F,$,Q,V,z,oe)=>{if(T=="NONE"||T=="MIRROR"){for(var ae,le=[0,0,0],fe=[0,0,0],be=[0,0,0],ye=[0,0,0],he=[0,0,0],ve=[0,0,0],se=[0,0,0],we=[0,0,0],pe=[0,0,0],ge=0;3>ge;ge++)ae=0>z[ge]?-1:1,le[ge]=ae*w[ge]+z[ge]*I[ge];for(var ge=0;3>ge;ge++)fe[ge]=$[ge]*le[0],be[ge]=Q[ge]*le[1],ye[ge]=V[ge]*le[2],he[ge]=F[ge]+A[0]*fe[ge]+A[1]*be[ge]+A[2]*ye[ge],T=="MIRROR"&&(ve[ge]=-fe[ge],se[ge]=-be[ge],we[ge]=-ye[ge],pe[ge]=he[ge],0>z[0]&&(he[ge]-=fe[ge],pe[ge]-=ve[ge]));0>ye[0]*(fe[1]*be[2]-fe[2]*be[1])+ye[1]*(fe[2]*be[0]-fe[0]*be[2])+ye[2]*(fe[0]*be[1]-fe[1]*be[0])&&(ye[0]=-ye[0],ye[1]=-ye[1],ye[2]=-ye[2]),oe[0]=[he,fe,be,ye],T=="MIRROR"&&(0>we[0]*(ve[1]*se[2]-ve[2]*se[1])+we[1]*(ve[2]*se[0]-ve[0]*se[2])+we[2]*(ve[0]*se[1]-ve[1]*se[0])&&(we[0]=-we[0],we[1]=-we[1],we[2]=-we[2]),oe[1]=[pe,ve,se,we])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var ae,Ee=[0,0,0],He=[0,0,0],ge=0;3>ge;ge++)ae=0>z[ge]?-1:1,Ee[ge]=ae*w[0]+z[ge]*I[0];for(var ge=0;3>ge;ge++)He[ge]=F[ge]+A[0]*Ee[0]*$[ge]+A[1]*Ee[1]*Q[ge]+A[2]*Ee[2]*V[ge];for(var tt=glyph_repeat_mode=="AXES_2D"?2:3,Ie=0;Ie<tt;Ie++){var ot=void 0,Le=void 0,Ye=z[Ie],We=[0,0,0],it=[0,0,0],et=[0,0,0];Ie==0?(ot=$,Le=Q):Ie==1?(ot=Q,Le=glyph_repeat_mode=="AXES_2D"?$:V):(ot=V,Le=$);var Mt=w[0]+Ye*I[0];We[0]=ot[0]*Mt,We[1]=ot[1]*Mt,We[2]=ot[2]*Mt,et[0]=We[1]*Le[2]-Le[1]*We[2],et[1]=We[2]*Le[0]-Le[2]*We[0],et[2]=We[0]*Le[1]-We[1]*Le[0];var pt=Math.sqrt(et[0]*et[0]+et[1]*et[1]+et[2]*et[2]);if(0<pt){var hn=(w[2]+Ye*I[2])/pt;T=="AXES_2D"&&0<Ie&&(hn*=-1),et[0]*=hn,et[1]*=hn,et[2]*=hn}if(it[0]=et[1]*We[2]-We[1]*et[2],it[1]=et[2]*We[0]-We[2]*et[0],it[2]=et[0]*We[1]-et[1]*We[0],pt=Math.sqrt(it[0]*it[0]+it[1]*it[1]+it[2]*it[2]),0<pt){var Mn=(w[1]+Ye*I[1])/pt;it[0]*=Mn,it[1]*=Mn,it[2]*=Mn}oe[Ie]=[He,We,it,et]}}return oe},ee=(F,$,Q,V,z)=>{var oe=1;T=="AXES_2D"||T=="MIRROR"?oe=2:T=="AXES_3D"&&(oe=3);var ae=F.length/3,le=0;G.length=oe;for(var fe=0;fe<ae;fe++){var be=3*fe,ye=[F[be],F[be+1],F[be+2]],he=[$[be],$[be+1],$[be+2]],ve=[Q[be],Q[be+1],Q[be+2]],se=[V[be],V[be+1],V[be+2]],we=[z[be],z[be+1],z[be+2]],pe=K(ye,he,ve,se,we,G);if(pe.length==oe)for(var ge=0;ge<oe;ge++){R.elements[0]=pe[ge][1][0],R.elements[1]=pe[ge][1][1],R.elements[2]=pe[ge][1][2],R.elements[3]=0,R.elements[4]=pe[ge][2][0],R.elements[5]=pe[ge][2][1],R.elements[6]=pe[ge][2][2],R.elements[7]=0,R.elements[8]=pe[ge][3][0],R.elements[9]=pe[ge][3][1],R.elements[10]=pe[ge][3][2],R.elements[11]=0,R.elements[12]=pe[ge][0][0],R.elements[13]=pe[ge][0][1],R.elements[14]=pe[ge][0][2],R.elements[15]=1,this.morph.setMatrixAt(le,R);var Ee=y[le];Ee&&Ee.setTransformation(pe[ge][0],pe[ge][1],pe[ge][2],pe[ge][3]),le++}}this.morph.instanceMatrix.needsUpdate=!0},q=F=>{var $=1;T=="AXES_2D"||T=="MIRROR"?$=2:T=="AXES_3D"&&($=3);for(var Q,V=F.length,z=0,oe=0;oe<V;oe++){Q=F[oe];for(var ae=0;ae<$;ae++){L.setHex(Q),this.morph.setColorAt(z,L);var le=y[z];le&&le.setColour(L),z++}}this.morph.instanceColor.needsUpdate=!0},ie=()=>{var F=k,$=U,Q=H,V=X,z=re,oe=j,ae=this.inbuildTime/this.duration*(E-1),le=Math.floor(ae),fe=1-(ae-le),be=Math.ceil(ae);if(C){var ye=v[le.toString()],he=v[be.toString()],ve=m[le.toString()],se=m[be.toString()],we=d[le.toString()],pe=d[be.toString()],ge=b[le.toString()],Ee=b[be.toString()],He=g[le.toString()],tt=g[be.toString()];k.length=ye.length,U.length=ye.length,H.length=ye.length,X.length=ye.length,re.length=ye.length;for(var Ie=0;Ie<ye.length;Ie++)F[Ie]=fe*ye[Ie]+(1-fe)*he[Ie],$[Ie]=fe*ve[Ie]+(1-fe)*se[Ie],Q[Ie]=fe*we[Ie]+(1-fe)*pe[Ie],V[Ie]=fe*ge[Ie]+(1-fe)*Ee[Ie],z[Ie]=fe*He[Ie]+(1-fe)*tt[Ie]}else v[0],c("current_positions"),m[0],c("current_axis1s"),d[0],c("current_axis2s"),b[0],c("current_axis3s"),g[0],c("current_scales");if(ee(F,$,Q,V,z),this.boundingBoxUpdateRequired=!0,M!=null){if(P){var ot=M[le.toString()],Le=M[be.toString()];oe.length=ot.length;for(var Ye=0;Ye<ot.length;Ye++)L.setHex(ot[Ye]),N.setHex(Le[Ye]),L.setRGB(L.r*fe+N.r*(1-fe),L.g*fe+N.g*(1-fe),L.b*fe+N.b*(1-fe)),oe[Ye]=L.getHex()}else M[0],c("current_colors");q(oe)}};this.showLabel=()=>{for(var F=0;F<y.length;F++)y[F].showLabel(this.morph.material?this.morph.material.color:void 0)};var Y=F=>{if(_!=null&&F)for(var $,Q=0;Q<S;Q++)$=new(u(16)).Glyph(void 0,void 0,Q,this),_!=null&&_[Q]!=null&&$.setLabel(_[Q]),0<E&&$.setFrustumCulled(!1),y[Q]=$,this.morph.add($.getGroup());_!=null&&F&&this.showLabel(this.morph.material?this.morph.material.color:void 0),ee(v[0],m[0],d[0],b[0],g[0]),M!=null&&q(M[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=F=>{F.isGlyph&&y.push(F),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(F,$)=>{if(F.isMesh){var Q=new(u(16)).Glyph(void 0,void 0,$,this);return Q.fromMesh(F),y.push(Q),this.morph.add(Q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,Q}},this.forEachGlyph=F=>{for(var $=0;$<y.length;$++)F(y[$])};var te=(F,$)=>(Q,V)=>{var z=Q.toBufferGeometry();this.geometry.copy(z),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),z.dispose(),V&&V[0]&&(this.morph.material=V[0]),Y($),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),Q.dispose(),F!=null&&typeof F=="function"&&F(this)};this.getClosestVertexIndex=function(){var F=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var $,Q=v[0],V=Q.length/3,z=-1,oe=0,ae=0;ae<V;ae++)$=3*ae,this._v2.set(Q[$],Q[$+1],Q[$+2]),oe=this._v1.distanceTo(this._v2),(z==-1||z>oe)&&(z=oe,F=ae)}return F},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var F=new f.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,R),F.setFromMatrixPosition(R),F}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){x.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var F=0;F<S;F++)this.morph.getMatrixAt(F,R),O.copy(x).applyMatrix4(R),F==0?B.copy(O):B.union(O);if(B)this.cachedBoundingBox.copy(B),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=F=>{this.inbuildTime=F>this.duration?this.duration:0>F?0:F,(P||C)&&(ie(),C&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<E)&&(P||C)),this.getCurrentTime=()=>this.inbuildTime,this.dispose=()=>{for(var F=y.length-1;0<=F;F--)y[F].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,M=void 0,this.ready=!1,this.groupName=void 0},this.render=(F,$,Q)=>{if($==!0){var V=this.inbuildTime+F;V>this.duration&&(V-=this.duration),this.inbuildTime=V,(P||C)&&ie()}this.updateMarker($,Q)}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=p},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>S});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,M=c.FileLoader,_=c.DefaultLoadingManager,E=u(21).VideoHandler;function S(w){typeof w=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),w=void 0),this.manager=w===void 0?_:w,this.withCredentials=!1,this.paramsString=""}Object.assign(S.prototype,{load:function(A,I,T,P){var C=this,R=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(A),L=new M(this.manager);A.split("?"),this.paramsString=A.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(A,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),P)return void P({responseURL:A})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+A+" should be loaded with THREE.ObjectLoader instead.")}if(C&&C.parse){var D=C.parse(x,R);I(D.geometry,D.materials)}},T,P)},setTexturePath:function(A){this.texturePath=A},parse:function(){function w(P,C){function R(we,pe){return we&1<<pe}var L,N,x,O,B,D,k,U,H,X,re,j,G,W,K,ee,q,ie,Y,te,F,$,Q,V,z,oe,ae,le=P.faces,fe=P.vertices,be=P.normals,ye=P.colors,he=P.scale,ve=0;if(P.uvs!==void 0){for(L=0;L<P.uvs.length;L++)P.uvs[L].length&&ve++;for(L=0;L<ve;L++)C.faceVertexUvs[L]=[]}for(O=0,B=fe.length;O<B;)ie=new y,ie.x=fe[O++]*he,ie.y=fe[O++]*he,ie.z=fe[O++]*he,C.vertices.push(ie);if(O=0,B=le.length,P.uvs)for(L=0;L<P.uvs.length;L++){C.uvs[L]=[];for(var se=0;se<P.uvs[L].length;se++)C.uvs[L][se]=P.uvs[L][se]}if(be)for(L=0;L<be.length;L++)C.normals[L]=be[L];if(ye)for(L=0;L<ye.length;L++)C.colors[L]=ye[L];for(;O<B;)if(X=le[O++],re=R(X,0),j=R(X,1),G=R(X,3),W=R(X,4),K=R(X,5),ee=R(X,6),q=R(X,7),re){if(te=new v,te.a=le[O],te.b=le[O+1],te.c=le[O+3],F=new v,F.a=le[O+1],F.b=le[O+2],F.c=le[O+3],O+=4,j&&(H=le[O++],te.materialIndex=H,F.materialIndex=H),x=C.faces.length,G)for(L=0;L<ve;L++)for(V=P.uvs[L],C.faceVertexUvs[L][x]=[],C.faceVertexUvs[L][x+1]=[],N=0;4>N;N++)U=le[O++],oe=V[2*U],ae=V[2*U+1],z=new b(oe,ae),N!==2&&C.faceVertexUvs[L][x].push(z),N!==0&&C.faceVertexUvs[L][x+1].push(z);if(W&&(k=3*le[O++],te.normal.set(be[k++],be[k++],be[k]),F.normal.copy(te.normal)),K)for(L=0;4>L;L++)k=3*le[O++],Q=new y(be[k++],be[k++],be[k]),L!==2&&te.vertexNormals.push(Q),L!==0&&F.vertexNormals.push(Q);if(ee&&(D=le[O++],$=ye[D],te.color.setHex($),F.color.setHex($)),q)for(L=0;4>L;L++)D=le[O++],$=ye[D],L!==2&&te.vertexColors.push(new d($)),L!==0&&F.vertexColors.push(new d($));C.faces.push(te),C.faces.push(F)}else{if(Y=new v,Y.a=le[O++],Y.b=le[O++],Y.c=le[O++],j&&(H=le[O++],Y.materialIndex=H),x=C.faces.length,G)for(L=0;L<ve;L++)for(V=P.uvs[L],C.faceVertexUvs[L][x]=[],N=0;3>N;N++)U=le[O++],oe=V[2*U],ae=V[2*U+1],z=new b(oe,ae),C.faceVertexUvs[L][x].push(z);if(W&&(k=3*le[O++],Y.normal.set(be[k++],be[k++],be[k])),K)for(L=0;3>L;L++)k=3*le[O++],Q=new y(be[k++],be[k++],be[k]),Y.vertexNormals.push(Q);if(ee&&(D=le[O++],Y.color.setHex(ye[D])),q)for(L=0;3>L;L++)D=le[O++],Y.vertexColors.push(new d(ye[D]));C.faces.push(Y)}}function A(P,C){var R=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var L=0,N=P.skinWeights.length;L<N;L+=R){var x=P.skinWeights[L],O=1<R?P.skinWeights[L+1]:0,B=2<R?P.skinWeights[L+2]:0,D=3<R?P.skinWeights[L+3]:0;C.skinWeights.push(new m(x,O,B,D))}if(P.skinIndices)for(var L=0,N=P.skinIndices.length;L<N;L+=R){var k=P.skinIndices[L],U=1<R?P.skinIndices[L+1]:0,H=2<R?P.skinIndices[L+2]:0,X=3<R?P.skinIndices[L+3]:0;C.skinIndices.push(new m(k,U,H,X))}C.bones=P.bones,C.bones&&0<C.bones.length&&(C.skinWeights.length!==C.skinIndices.length||C.skinIndices.length!==C.vertices.length)&&console.warn("When skinning, number of vertices ("+C.vertices.length+"), skinIndices ("+C.skinIndices.length+"), and skinWeights ("+C.skinWeights.length+") should match.")}function I(P,C){var R=P.scale;if(P.morphTargets!==void 0)for(var L=0,N=P.morphTargets.length;L<N;L++){C.morphTargets[L]={},C.morphTargets[L].name=P.morphTargets[L].name,C.morphTargets[L].vertices=[];for(var x,O=C.morphTargets[L].vertices,B=P.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new y,x.x=B[D]*R,x.y=B[D+1]*R,x.z=B[D+2]*R,O.push(x)}if(P.morphNormals!==void 0){for(var L=0,N=P.morphNormals.length;L<N;L++)if(C.morphTargets[L]){C.morphTargets[L].normals=[];for(var U,H=C.morphTargets[L].normals,X=P.morphNormals[L].normals,D=0,k=X.length;D<k;D+=3)U=new y,U.x=X[D],U.y=X[D+1],U.z=X[D+2],H.push(U);C.morphNormalsReady=!0}}if(P.morphColors!==void 0){var L,N,re,j,G,W,K;for(L=0,N=P.morphColors.length;L<N;L++)for(C.morphColors[L]={},C.morphColors[L].name=P.morphColors[L].name,C.morphColors[L].colors=[],G=C.morphColors[L].colors,W=P.morphColors[L].colors,re=0,j=W.length;re<j;re+=3)K=new c.Color(16755200),K.setRGB(W[re],W[re+1],W[re+2]),G.push(K)}}function T(P,C){var R=[],L=[];P.animation!==void 0&&L.push(P.animation),P.animations!==void 0&&(P.animations.length?L=L.concat(P.animations):L.push(P.animations));for(var N,x=0;x<L.length;x++)N=p.parseAnimation(L[x],C.bones),N&&R.push(N);if(C.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(C.morphTargets,10);R=R.concat(O)}0<R.length&&(C.animations=R)}return function(P,C){P.data!==void 0&&(P=P.data),P.scale=P.scale===void 0?1:1/P.scale;var R=new g;if(R.morphColors=[],w(P,R),A(P,R),I(P,R),T(P,R),R.computeFaceNormals(),R.computeBoundingSphere(),P.materials===void 0||P.materials.length===0)return{geometry:R};var L=f.prototype.initMaterials(P.materials,C,"Anonymous");if(P.materials[0].video){var N=C+P.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new E(N);R._video=x}return L&&0<L.length&&(L[0].side=P.materials[0].singleSided?c.FrontSide:P.materials[0].flipSided?c.BackSide:c.DoubleSide,P.materials[0].specularCoef&&(L[0].shininess=Math.floor(P.materials[0].specularCoef/3))),{geometry:R,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(w,A,I,T,P){var C,R=b+w,L=f.Handlers.get(R);L===null?(y.setCrossOrigin(v),C=y.load(R)):C=L.load(R),A!==void 0&&(C.repeat.fromArray(A),A[0]!==1&&(C.wrapS=c.RepeatWrapping),A[1]!==1&&(C.wrapT=c.RepeatWrapping)),I!==void 0&&C.offset.fromArray(I),T!==void 0&&(T[0]==="repeat"&&(C.wrapS=c.RepeatWrapping),T[0]==="mirror"&&(C.wrapS=c.MirroredRepeatWrapping),T[1]==="repeat"&&(C.wrapT=c.RepeatWrapping),T[1]==="mirror"&&(C.wrapT=c.MirroredRepeatWrapping)),P!==void 0&&(C.anisotropy=P);var N=c.MathUtils.generateUUID();return M[N]=C,N}var M={},_={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var S=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":_.name=S;break;case"blending":_.blending=h[S];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":_.color=p.fromArray(S).getHex();break;case"colorSpecular":_.specular=p.fromArray(S).getHex();break;case"colorEmissive":_.emissive=p.fromArray(S).getHex();break;case"specularCoef":_.shininess=S;break;case"shading":S.toLowerCase()==="basic"&&(_.type="MeshBasicMaterial"),S.toLowerCase()==="phong"&&(_.type="MeshPhongMaterial"),S.toLowerCase()==="standard"&&(_.type="MeshStandardMaterial");break;case"mapDiffuse":_.map=g(S,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":_.emissiveMap=g(S,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":_.lightMap=g(S,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":_.aoMap=g(S,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":_.bumpMap=g(S,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":_.bumpScale=S;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":_.normalMap=g(S,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":_.normalScale=S;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":_.specularMap=g(S,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":_.metalnessMap=g(S,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":_.roughnessMap=g(S,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":_.alphaMap=g(S,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":_.side=c.BackSide;break;case"doubleSided":_.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),_.opacity=S;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":_[E]=S;break;case"vertexColors":S===!0&&(_.vertexColors=c.VertexColors),S==="face"&&(_.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,S)}}return _.type==="MeshBasicMaterial"&&delete _.emissive,_.type!=="MeshPhongMaterial"&&delete _.specular,1>_.opacity&&(_.transparent=!0),m.setTextures(M),m.parse(_)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,M)=>{if(v&&g){var _=h(v,M),E=p();g.map=E;var S=new f(_,g);this.setMesh(S,M.localTimeEnabled,M.localMorphColour)}};var b=(v,g,M,_)=>{if(M){var E=new c.Color(_),S=new y(M,E);S.setPosition(g[0],g[1],g[2]);var w=S.getSprite();w.material.sizeAttenuation=!1,w.material.alphaTest=.5,w.material.transparent=!0,w.material.depthWrite=!1,w.material.depthTest=!1,this.group.add(w),d[v]=S}};this.addPoints=(v,g,M)=>{if(v&&0<v.length){var _=this.drawRange-1,E=this.addVertices(v),S=this.getMorph();if(!S){var w=new c.PointsMaterial({alphaTest:.5,size:10,color:M,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,w,{localTimeEnabled:!1,localMorphColour:!1})}var A=_+v.length,I=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(_;_+I<A;){var T=typeof g=="string"?g:g[I];b(I,v[I],T,M),I++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var M=this.getMorph(),_=g+v.length-1;if(!M||0>g||_>=this.drawRange)return;var E=M.geometry.getAttribute("position"),S=g;v.forEach(w=>{var A=d[S];A&&A.setPosition(w[0],w[1],w[2]),E.setXYZ(S++,w[0],w[1],w[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,M,_)=>{this.morph&&M&&(this.morph.sizePerPixel=M.pixelHeight),m.prototype.render.call(this,v,g,M,_)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var _=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,E=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=_,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(_){return super.copy(_),this.material=_.material,this.geometry=_.geometry,this}raycast(_,E){var S=this.geometry,w=this.matrixWorld,A=_.params.Points.threshold,I=S.drawRange;if(S.boundingSphere===null&&S.computeBoundingSphere(),p.copy(S.boundingSphere),p.applyMatrix4(w),p.radius+=A,_.ray.intersectsSphere(p)!==!1){f.copy(w).invert(),h.copy(_.ray).applyMatrix4(f);var T=A/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,P=T*T;if(S.isBufferGeometry){var C=S.index,R=S.attributes,L=R.position,N=S.morphAttributes.position;if(C!==null)for(var x,O=Math.max(0,I.start),B=Math.min(C.count,I.start+I.count),D=O;D<B;D++)x=C.getX(D),g(this,L,N,x),v(y,x,P,w,_,E,this);else for(var k=Math.max(0,I.start),U=Math.min(L.count,I.start+I.count),H=k;H<U;H++)g(this,L,N,H),v(y,H,P,w,_,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var _=this.geometry;if(_.isBufferGeometry){var E=_.morphAttributes,S=Object.keys(E);if(0<S.length){var w=E[S[0]];if(w!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var A,I=0,T=w.length;I<T;I++)A=w[I].name||I+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[A]=I}}}else{var P=_.morphTargets;P!==void 0&&0<P.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(M,_,E,S,w,A,I){var T=h.distanceSqToPoint(M);if(T<E){var P=new c.Vector3;h.closestPointToPoint(M,P),P.applyMatrix4(S);var C=w.ray.origin.distanceTo(P);if(C<w.near||C>w.far)return;A.push({distance:C,distanceToRay:Math.sqrt(T),point:P,index:_,face:null,object:I})}}function g(M,_,E,S){y.fromBufferAttribute(_,S);var w=M.morphTargetInfluences;if(M.material.morphTargets&&E&&w){m.set(0,0,0);for(var A=0,I=E.length;A<I;A++){var T=w[A],P=E[A];T!==0&&(d.fromBufferAttribute(P,S),m.addScaledVector(d.sub(y),T))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,m,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var M=new Image;M.crossOrigin="Anonymous";for(var _,E=document.createElement("canvas"),S=0,w=Array(d.length),A=0;A<d.length;A++)_=yield y.imageToUint8Array(y,M,d[A],E),_&&_.array&&(b=_.width,v=_.height,w[g]=_.array,S+=w[g].length,g++);var I=new Uint8Array(S);S=0,w.forEach(T=>{I.set(T,S),S+=T.length}),y.impl=new h.DataTexture2DArray(I,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;m.transparent&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,M){try{var _=y[g](M),E=_.value}catch(S){return void d(S)}_.done?m(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(E){c(_,b,v,g,M,"next",E)}function M(E){c(_,b,v,g,M,"throw",E)}var _=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(v,g){var M=Object.keys(v);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(v);g&&(_=_.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),M.push.apply(M,_)}return M}function f(v){for(var g,M=1;M<arguments.length;M++)g=arguments[M]==null?{}:arguments[M],M%2?c(Object(g),!0).forEach(function(_){h(v,_,g[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(_){Object.defineProperty(v,_,Object.getOwnPropertyDescriptor(g,_))});return v}function h(v,g,M){return g=p(g),g in v?Object.defineProperty(v,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):v[g]=M,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var M=v[Symbol.toPrimitive];if(M!==void 0){var _=M.call(v,g||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],M={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var _=!0;this.createSlides=w=>{w.forEach(A=>this.createSlide(A))};var E=(w,A)=>{var I=w.material,T=I.uniforms;switch(w.rotation.x=0,w.rotation.y=0,w.rotation.z=0,w.position.x=0,w.position.y=0,w.position.z=0,A.direction){case"x":var P=_?-Math.PI/2:Math.PI/2;w.rotation.y=P,T.direction.value=1,T.slide.value.set(A.value,0,0),w.position.x=A.value;break;case"y":w.rotation.x=Math.PI/2,T.direction.value=2,T.slide.value.set(0,A.value,0),w.position.y=A.value;break;case"z":T.direction.value=3,T.slide.value.set(0,0,A.value),w.position.z=A.value;break}I.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=w=>{w&&w.id&&w.id in M&&M[w.id]&&E(M[w.id],w)},this.createSlide=w=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&w&&w.direction&&w.value!==void 0){var A=new m.PlaneGeometry(1,1);A.translate(.5,.5,0);var I=d.getUniforms();I.diffuse.value=this.texture.impl,I.depth.value=this.texture.size.depth,I.flipY.value=_;var T={fs:d.fs,vs:d.vs,uniforms:I,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},P=this.texture.getMaterial(T);P.needsUpdate=!0;var C=new m.Mesh(A,P);C.name=this.groupName,C.userData=this;var R={value:w.value,direction:w.direction,id:C.id};return g.push(R),E(C,R),M[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=w=>{for(var A=0;A<g.length;A++)if(w===g[A].id)return f({},g[A])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=w=>{w&&this.removeSlideWithId(w.id)},this.removeSlideWithId=w=>{if(this.morph&&w in M&&M[w]){if(this.morph.getObjectById(w)){var A=M[w];this.morph.remove(A),A.clear(),A.geometry&&A.geometry.dispose(),A.material&&A.material.dispose(),this.boundingBoxUpdateRequired=!0}var I=g.findIndex(T=>T.id===w);-1<I&&g.splice(I,1)}},this.dispose=()=>{this.morph.children.forEach(w=>{w.geometry&&w.geometry.dispose(),w.material&&w.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var S=(w,A,I)=>{switch(A.direction.value){case 1:I.copy(A.slide.value),w.expandByPoint(I),I.setY(1),I.setZ(1),w.expandByPoint(I);break;case 2:I.copy(A.slide.value),w.expandByPoint(I),I.setX(1),I.setZ(1),w.expandByPoint(I);break;case 3:I.copy(A.slide.value),w.expandByPoint(I),I.setX(1),I.setY(1),w.expandByPoint(I);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var w=new m.Vector3(0,0,0);this.morph.children.forEach(A=>{S(this.cachedBoundingBox,A.material.uniforms,w)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(w,A,I)=>{var T=new m.Matrix4;T.set(w[0],w[1],w[2],0,w[3],w[4],w[5],0,w[6],w[7],w[8],0,0,0,0,0);var P=new m.Quaternion().setFromRotationMatrix(T);this.morph.position.set(...A),this.morph.quaternion.copy(P),this.morph.scale.set(...I),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(w,A)=>{if(w){var I=w.locations;I&&0<I.length&&(this.applyTransformation(I[0].orientation,I[0].position,I[0].scale),"flipY"in I[0]&&(_=I[0].flipY)),this.createSlides(w.settings.slides),A!=null&&typeof A=="function"&&A(this)}}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3185
3185
  precision highp float;
3186
3186
  precision highp int;
3187
3187
  precision highp sampler2DArray;
@@ -3224,11 +3224,11 @@ void main() {
3224
3224
  vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);
3225
3225
 
3226
3226
  }
3227
- `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};l.fs=h,l.vs=p,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(p,y)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,d=[];p.images.source.forEach(v=>{d.push(c(v))});var b=this;m.loadFromImages(d).then(()=>{b.texture=m,b.initialise(p,y)})}},this.initialise=(p,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var p=h,y=void 0,m=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,M=[],_=0,E=void 0,S=void 0,w=void 0,A=void 0,I=[],T=[],P=new c.Group,C=void 0,R=void 0,L=!1;this.getDrawingWidth=()=>p?p.clientWidth:C?typeof C.clientWidth>"u"?Math.round(C.width):Math.round(C.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:C?typeof C.clientHeight>"u"?Math.round(C.height):Math.round(C.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var O=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var D;p?(D=p.getBoundingClientRect(),y.setSize(O,B)):C&&(typeof C.getBoundingClientRect>"u"||(D=C.getBoundingClientRect(),C.width=O,C.height=B),y.setSize(O,B,!1)),D&&(D.left,D.top);var k=new c.Vector2;y.getSize(k),k.x,k.y}},this.initialiseVisualisation=O=>{if(O=O||{},O.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}O.antialias=!B}O.canvas&&(p=void 0,C=O.canvas),y=new c.WebGLRenderer(O),p!==void 0&&p.appendChild(y.domElement),y.setClearColor(16777215,1),C&&C.style&&(C.style.height="100%",C.style.width="100%"),y.autoClear=!1;var D=this.createScene("default");this.setCurrentScene(D)},this.getCurrentScene=()=>m,this.setCurrentScene=O=>{if(O){this.removeActiveScene(O);var B=m;m=O,B&&B.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(P),this.onWindowResize()}},this.getSceneByName=O=>I[O],this.createScene=O=>{if(I[O]==null){var B;return B=C?new(u(32)).Scene(C,y):new(u(32)).Scene(p,y),I[O]=B,B.sceneName=O,B}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var O=m.getBoundingBox();if(O){for(var B,D=0;D<T.length;D++)B=T[D].getBoundingBox(),B&&O.union(B);m.viewAllWithBoundingBox(O)}}},this.loadModelsURL=(O,B,D,k,U,H)=>{m.loadModelsURL(O,B,D,k,U,H)},this.loadViewURL=O=>{m.loadViewURL(O)},this.loadFromViewURL=(O,B)=>{m.loadFromViewURL(O,B)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var N=()=>{L?(E=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(E),E=void 0)};this.stopAnimate=()=>{L&&(d.stop(),L=!1)},this.animate=()=>{L||(d.start(),L=!0,N())},this.addPreRenderCallbackFunction=O=>(++g,v[g]=O,g),this.removePreRenderCallbackFunction=O=>{O in v&&delete v[O]},this.addPostRenderCallbackFunction=O=>(++_,M[_]=O,_),this.removePostRenderCallbackFunction=O=>{O in M&&delete M[O]},this.getPlayRate=()=>b,this.setPlayRate=O=>{b=O},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=O=>{m.setMorphsTime(O)},this.getZincGeometryByID=O=>m.getZincGeometryByID(O),this.addToScene=O=>{m.addObject(O)},this.addToOrthoScene=O=>{if(w==null&&(w=new c.Scene),S==null){var B=this.getDrawingWidth(),D=this.getDrawingHeight();S=new c.OrthographicCamera(-B/2,B/2,D/2,-D/2,1,10),S.position.z=10}w.add(O)};var x=O=>B=>{B.needsUpdate=!0;var D=new c.SpriteMaterial({map:B}),k=D.map.image.width,U=D.map.image.height;O.material=D,O.scale.set(k,U,1);var H=this.getDrawingWidth(),X=this.getDrawingHeight();O.position.set((H-k)/2,(-X+U)/2,1),this.addToOrthoScene(O)};this.addLogo=()=>{A=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,x(A))},this.render=()=>{R||(p?0<p.clientWidth&&0<p.clientHeight&&(R=new f(p,this.onWindowResize)):C&&0<C.width&&0<C.height&&(R=new f(C,this.onWindowResize)));var O=d.getDelta();m.renderGeometries(b,O,this.playAnimation);for(var B,D=0;D<T.length;D++)B=T[D],B.renderGeometries(b,O,this.playAnimation);for(var k in S!=null&&w!=null&&(y.clearDepth(),y.render(w,S)),v)v.hasOwnProperty(k)&&v[k].call();for(var U in m.render(y),M)M.hasOwnProperty(U)&&M[U].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=O=>{if(m===O)return!0;for(var B,D=0;D<T.length;D++)if(B=T[D],B===O)return!0;return!1},this.addActiveScene=O=>{this.isSceneActive(O)||(T.push(O),P.add(O.getThreeJSScene()))},this.removeActiveScene=O=>{for(var B,D=0;D<T.length;D++)if(B=T[D],B===O)return T.splice(D,1),void P.remove(O.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var O=0;O<T.length;O++)P.remove(T[O].getThreeJSScene());T.splice(0,T.length)},this.dispose=()=>{for(var O in L&&cancelAnimationFrame(E),I)I.hasOwnProperty(O)&&I[O].clearAll();I=[],T=[],P=new c.Group,this.stopAnimate(),v=[],g=0,S=void 0,w=void 0,A=void 0;var B=this.createScene("default");this.setCurrentScene(B),R=void 0},this.transitionScene=(O,B)=>{if(m){var D=m.getZincCameraControls(),k=O.getBoundingBox();if(k){var U=k.min.distanceTo(k.max)/2,H=(k.min.x+k.max.x)/2,X=(k.min.y+k.max.y)/2,re=(k.min.z+k.max.z)/2,j=D.getViewportFromCentreAndRadius(H,X,re,U,40,U*4),G=D.getCurrentViewport();D.cameraTransition(G,j,B),D.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=TB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,p=u(41).SceneExporter,y=u(43).Viewport,m=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=0,v=function(){return"sc"+b++},g=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},M=6e3;l.Scene=function(_,E){var S=this,w=_,A=void 0,I=new h(this),T=void 0,P={},C=0,R={},L=0,N=new c.Scene,x=new(u(44)).Region(void 0,this);N.add(x.getGroup());var O=new c.Group;N.add(O),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var B=6e3,D=void 0;this.sceneName=void 0;var k=!1,U=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var H={x:0,y:0},X=g(),re=new c.Vector2,j=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var G=new f(this);G.disable(),N.add(G.group);var W=()=>w?typeof w.clientWidth>"u"?w.width:w.clientWidth:0,q=()=>w?typeof w.clientHeight>"u"?w.height:w.clientHeight:0;this.getDownloadProgress=()=>I.getDownloadProgress(),this.onWindowResize=()=>{var F=q();this.camera.aspect=W()/F,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,D.onResize(),D.calculateHeightPerPixelAtZeroDepth(F)},this.resetView=()=>{this.onWindowResize(),D.resetView()},this.changeZoomByScrollRateUnit=F=>{D.changeZoomByScrollRateUnit(F)};var ee=()=>{this.camera=new c.PerspectiveCamera(40,W()/q(),0,10),this.ambient=new c.AmbientLight(16777215,.2),N.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),N.add(this.directionalLight),D=new(u(43)).CameraControls(this.camera,E.domElement,E,this),D.setDirectionalLight(this.directionalLight),D.resetView(),T=new(u(49)).Minimap(this)};ee(),this.loadView=F=>{var $=new y;return $.setFromObject(F),D.setCurrentCameraSettings($),!0},this.setupMultipleViews=(F,$)=>{for(var[Q,V]of Object.entries($)){var z=new y;z.setFromObject(V),D.addViewport(Q,z)}D.setDefaultViewport(F)},this.getBoundingBox=()=>x.getBoundingBox(!0),this.viewAllWithBoundingBox=F=>{if(F){var $=D.getViewportFromBoundingBox(F,1);D.setCurrentCameraSettings($),D.calculateHeightPerPixelAtZeroDepth(q()),G.markerUpdateRequired=!0}},this.viewAll=()=>{var F=this.getBoundingBox();this.viewAllWithBoundingBox(F),G.markerUpdateRequired=!0},this.forEachGeometry=F=>{x.forEachGeometry(F,!0)},this.forEachGlyphset=F=>{x.forEachGlyphset(F,!0)},this.forEachPointset=F=>{x.forEachPointset(F,!0)},this.forEachLine=F=>{x.forEachLine(F,!0)},this.findGeometriesWithGroupName=F=>x.findGeometriesWithGroupName(F,!0),this.findPointsetsWithGroupName=F=>x.findPointsetsWithGroupName(F,!0),this.findGlyphsetsWithGroupName=F=>x.findGlyphsetsWithGroupName(F,!0),this.findLinesWithGroupName=F=>x.findLinesWithGroupName(F,!0),this.findObjectsWithGroupName=F=>x.findObjectsWithGroupName(F,!0),this.findObjectsWithAnatomicalId=F=>x.findObjectsWithAnatomicalId(F,!0),this.getBoundingBoxOfZincObjects=F=>{for(var $,Q=void 0,V=0;V<F.length;V++)$=F[V].getBoundingBox(),$&&(Q?Q.union($):Q=$);return Q},this.vectorToScreenXY=F=>{F.project(this.camera);var $=W(),Q=q(),V=$/2,z=Q/2;return F.x=F.x*V+V,F.y=-(F.y*z)+z,F},this.getObjectsScreenXY=F=>{if(F&&0<F.length){var $=this.getBoundingBoxOfZincObjects(F),Q=new c.Vector3;return $.getCenter(Q),this.vectorToScreenXY(Q)}},this.getNamedObjectsScreenXY=F=>{var $=this.findObjectsWithGroupName(F);return this.getObjectsScreenXY($)},this.addZincObject=F=>{F&&(x.addZincObject(F),D&&D.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(F,$,Q,V)=>{I.loadGlyphsetURL(x,F,$,Q,V)},this.loadPointsetURL=(F,$,Q,V,z)=>{I.loadPointsetURL(x,F,$,Q,V,z)},this.loadLinesURL=(F,$,Q,V,z)=>{I.loadLinesURL(x,F,$,Q,V,z)},this.loadSTL=(F,$,Q)=>{I.loadSTL(x,F,$,Q)},this.loadOBJ=(F,$,Q)=>{I.loadOBJ(x,F,$,Q)},this.loadMetadataURL=(F,$,Q)=>{I.loadMetadataURL(x,F,$,Q)},this.loadModelsURL=(F,$,Q,V,z,oe)=>{I.loadModelsURL(x.urls,$,Q,V,z,oe)},this.loadViewURL=F=>{I.loadViewURL(F)},this.loadFromViewURL=(F,$)=>{I.loadFromViewURL(F,$)},this.loadGLTF=(F,$,Q,V)=>{I.loadGLTF(x,F,$,Q,V)},this.updateDirectionalLight=()=>{D.updateDirectionalLight()},this.addObject=F=>{N.add(F)},this.removeObject=F=>{N.remove(F)},this.getCurrentTime=()=>{if(A!=null)return A.getCurrentTime(B);var F=x.getCurrentTime();return F===-1?0:F},this.setMorphsTime=F=>{A!=null&&A.setMorphTime(F,B),x.setMorphTime(F,!0)},this.isTimeVarying=()=>!!(A&&A.video&&!A.video.error)||x.isTimeVarying(),this.renderGeometries=(F,$,Q)=>{var V={};if(V.camera=D,V.displayMarkers=this.displayMarkers,V.markerCluster=G,V.markersList=G.markers,V.ndcToBeUpdated=!1,Q&&(V.markerCluster.markerUpdateRequired=!0),!A)I.toBeDownloaded==0?(V.ndcToBeUpdated=D.update($),V.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(q()),x.renderGeometries(F,$,Q,D,V,!0)):D.update(0);else if(A.isReadyToPlay()){Q?A.video.play():A.video.pause();var z=A.video.currentTime/A.getVideoDuration()*B;I.toBeDownloaded==0?(D.setTime(z),V.ndcToBeUpdated=D.update(0),V.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(q()),x.setMorphTime(z,!0),x.renderGeometries(0,0,Q,D,V,!0)):D.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>N,this.setVideoHandler=F=>{A||(A=F)},this.setAdditionalScenesGroup=F=>{N.add(F)};var K=(F,$,Q,V,z,oe,ae)=>{var le=0,fe=0;return fe=F.includes("top")?ae-z-Q:F.includes("bottom")?Q:Math.floor((ae-z)/2),le=F.includes("left")?$:F.includes("right")?oe-$-V:Math.floor((oe-V)/2),{x:le,y:fe}},ie=F=>{this.displayMinimap===!0&&(F.setScissorTest(!0),F.getSize(re),this.minimapScissor.updateRequired&&(H=K(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,re.x,re.y),this.minimapScissor.updateRequired=!1),F.setScissor(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),F.setViewport(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),T.updateCamera(),N.add(T.mask),F.render(N,T.camera),N.remove(T.mask),F.setScissorTest(!1),F.setViewport(0,0,re.x,re.y))};this.render=F=>{this.autoClearFlag&&F.clear(),k&&U?U.render(N,this.camera):(F.render(N,this.camera),ie(F))},this.setInteractiveControlEnable=F=>{F==!0?D.enable():D.disable()},this.getZincCameraControls=()=>D,this.getThreeJSScene=()=>N,this.setDuration=F=>{x.setDuration(F),B=F,D.setPathDuration(F),I.duration=F},this.getDuration=()=>B,this.setStereoEffectEnable=F=>{F!=!0||U||(U=new u(43).StereoEffect(E)),E.setSize(W(),q()),this.camera.updateProjectionMatrix(),k=F},this.objectIsInScene=F=>x.objectIsInRegion(F,!0),this.alignBoundingBoxToCameraView=(F,$)=>{if(F){var Q=new c.Vector3;F.getCenter(Q);var V=this.getZincCameraControls().getCurrentViewport(),z=new c.Vector3(V.targetPosition[0],V.targetPosition[1],V.targetPosition[2]),oe=new c.Vector3(V.eyePosition[0],V.eyePosition[1],V.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(z,oe).normalize(),le.subVectors(z,Q).normalize();var fe=new c.Vector3;fe.crossVectors(ae,le);var be=ae.angleTo(le);0<$?(this.getZincCameraControls().rotateCameraTransition(fe,be,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(fe,be),G.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(F,$,Q)=>{if(F){var V=this.getZincCameraControls().getCurrentViewport(),z=this.getZincCameraControls().getViewportFromBoundingBox(F,$);0<Q&&(this.getZincCameraControls().cameraTransition(V,z,Q),this.getZincCameraControls().enableCameraTransition()),G.markerUpdateRequired=!0}},this.alignObjectToCameraView=(F,$)=>{if(this.objectIsInScene(F)){var Q=F.getBoundingBox();this.alignBoundingBoxToCameraView(Q,$)}},this.setCameraTargetToObject=F=>{if(this.objectIsInScene(F)){var $=new c.Vector3,Q=F.getBoundingBox(),V=this.getZincCameraControls().getCurrentViewport();Q.getCenter($);var z=new c.Vector3(V.targetPosition[0],V.targetPosition[1],V.targetPosition[2]),oe=new c.Vector3(V.eyePosition[0],V.eyePosition[1],V.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(oe,z),le.addVectors($,ae),V.eyePosition[0]=le.x,V.eyePosition[1]=le.y,V.eyePosition[2]=le.z,V.targetPosition[0]=$.x,V.targetPosition[1]=$.y,V.targetPosition[2]=$.z,this.getZincCameraControls().setCurrentCameraSettings(V),G.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>k,this.removeZincObject=F=>{x.removeZincObject(F),D&&D.calculateMaxAllowedDistance(this),G.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{j.length=0,G.isEnabled&&j.push(G.group),x.getPickableThreeJSObjects(j,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||x.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),j),this.getNormalisedMinimapCoordinates=(F,$)=>{if(this.displayMinimap){var Q=new c.Vector2;F.getSize(Q);var V=Q.y-$.clientY;if(H.x+this.minimapScissor.width>$.clientX&&$.clientX>H.x&&H.y+this.minimapScissor.height>V&&V>H.y){var z=2*(($.clientX-H.x)/this.minimapScissor.width)-1,oe=2*((V-H.y)/this.minimapScissor.height)-1;return{x:z,y:oe}}}},this.getMinimapDiffFromNormalised=(F,$)=>T?T.getDiffFromNormalised(F,$):void 0,this.isWebGL2=()=>E.isWebGL2(),this.clearAll=()=>{G.clear(),x.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),I.toBeDwonloaded=0,D&&D.calculateMaxAllowedDistance(this),G.markerUpdateRequired=!0},this.addMetadataTimeStamp=(F,$)=>{X.TimeStamps[F]=te($)},this.getMetadataTag=F=>X[F],this.getMetadata=()=>X,this.setMetadataTag=(F,$)=>{X[F]=$},this.removeMetadataTag=F=>{delete X[F]},this.resetMetadata=()=>{X=g()},this.resetDuration=()=>{this.setDuration(M)};var Y=F=>[...F.years?["".concat(F.years,"years")]:[],...F.months?["".concat(F.months,"months")]:[],...F.weeks?["".concat(F.weeks,"weeks")]:[],...F.days?["".concat(F.days,"days")]:[],...F.hours?["".concat(F.hours,"hours")]:[],...F.mins?["".concat(F.mins,"mins")]:[],...F.secs?["".concat(F.secs,"secs")]:[]].join(" "),te=F=>F.years?31536e6*F.years:0+F.months?2592e6*F.months:0+F.weeks?6048e5*F.weeks:0+F.days?864e5*F.days:0+F.hours?36e5*F.hours:0+F.mins?6e4*F.mins:0+F.secs?1e3*F.secs:0;this.setDurationFromObject=F=>{var $=Y(F),Q=te(F);this.setMetadataTag("Duration",$),this.setDuration(Q)},this.setOriginalDurationFromObject=F=>{var $=Y(F);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=F=>{var $=new p(this);return $.exportGLTF(F)},this.getRootRegion=()=>x,this.createLines=(F,$,Q,V)=>{var z=x.findChildFromPath(F);return z===void 0&&(z=x.createChildFromPath(F)),z.createLines($,Q,V)},this.createPoints=(F,$,Q,V,z)=>{var oe=x.findChildFromPath(F);return oe===void 0&&(oe=x.createChildFromPath(F)),oe.createPoints($,Q,V,z)},this.addZincObjectAddedCallbacks=F=>(++C,P[C]=F,C),this.addZincObjectRemovedCallbacks=F=>(++L,R[L]=F,L),this.removeZincObjectAddedCallbacks=F=>{F in C&&delete P[F]},this.removeZincObjectRemovedCallbacks=F=>{F in L&&delete R[F]},this.clearZincObjectAddedCallbacks=()=>{P={},C=0},this.clearZincObjectRemovedCallbacks=()=>{R={},L=0},this.triggerObjectAddedCallback=F=>{for(var $ in P)P.hasOwnProperty($)&&P[$](F)},this.triggerObjectRemovedCallback=F=>{for(var $ in R)R.hasOwnProperty($)&&R[$](F)},this.addTemporaryPoints=(F,$)=>{var Q=m(F.length,F),V=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),z=d();V.map=z;var oe=new(u(23)).Points(Q,V);return O.add(oe),oe},this.addTemporaryLines=(F,$)=>{var Q=m(F.length,F),V=new c.LineBasicMaterial({color:$}),z=new(u(12)).LineSegments(Q,V);return O.add(z),z},this.removeTemporaryPrimitive=F=>{O.remove(F),F.geometry.dispose(),F.material.dispose()},this.clearTemporaryPrimitives=()=>{var F=0,$=O.children;return $.forEach(Q=>{Q.geometry.dispose(),Q.material.dispose(),F++}),O.clear(),F},this.addBoundingBoxPrimitive=function(F,$,Q,V,z){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ae=x.findChildFromPath(F);ae===void 0&&(ae=x.createChildFromPath(F));var le=oe||S.getBoundingBox(),fe=new c.Vector3().subVectors(le.max,le.min),be=new c.BoxGeometry(fe.x,fe.y,fe.z),ye=ae.createGeometryFromThreeJSGeometry($,be,Q,V,z,1e4);return fe.addVectors(le.min,le.max).multiplyScalar(.5),ye.setPosition(fe.x,fe.y,fe.z),ye},this.addSlicesPrimitive=function(F,$,Q,V,z){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&Q&&3<=Q.length){var ae=x.findChildFromPath(F);ae===void 0&&(ae=x.createChildFromPath(F));var le=oe||S.getBoundingBox(),fe=new c.Vector3().subVectors(le.max,le.min),be=[],ye=0;return["x","y","z"].forEach(he=>{var ve;switch(he){case"x":ve=new c.PlaneGeometry(fe.z,fe.y),ve.rotateY(Math.PI/2);break;case"y":ve=new c.PlaneGeometry(fe.x,fe.z),ve.rotateX(Math.PI/2);break;case"z":ve=new c.PlaneGeometry(fe.x,fe.y);break}var se=ae.createGeometryFromThreeJSGeometry($[ye],ve,Q[ye],V,z,10001);be.push(se),ye++}),fe.addVectors(le.min,le.max).multiplyScalar(.5),be.forEach(he=>{he.setPosition(fe.x,fe.y,fe.z)}),be}},this.enableMarkerCluster=F=>{F?(G.markerUpdateRequired=!0,G.enable()):(G.markerUpdateRequired=!1,G.disable()),this.forcePickableObjectsUpdate=!0}}},(o,l,u)=>{function c(E,S){var w=Object.keys(E);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(E);S&&(A=A.filter(function(I){return Object.getOwnPropertyDescriptor(E,I).enumerable})),w.push.apply(w,A)}return w}function f(E){for(var S,w=1;w<arguments.length;w++)S=arguments[w]==null?{}:arguments[w],w%2?c(Object(S),!0).forEach(function(A){h(E,A,S[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(S)):c(Object(S)).forEach(function(A){Object.defineProperty(E,A,Object.getOwnPropertyDescriptor(S,A))});return E}function h(E,S,w){return S=p(S),S in E?Object.defineProperty(E,S,{value:w,enumerable:!0,configurable:!0,writable:!0}):E[S]=w,E}function p(E){var S=y(E,"string");return typeof S=="symbol"?S:S+""}function y(E,S){if(typeof E!="object"||!E)return E;var w=E[Symbol.toPrimitive];if(w!==void 0){var A=w.call(E,S||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(E)}var m=u(4),d=new Image(128,128);d.src=u(34);var b=new m.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),M=u(5).createNewSpriteText,_=function(E){u(10).ZincObject.call(this),this.texture=b;var S=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var w=!0,A=[];this.markers={};var I=new m.Vector2,T=new m.Vector2,P=Date.now();this.setSpriteSize=x=>{S.scale.set(.015,.02,1),S.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var C=x=>{var O=new m.Group,B=new m.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,O.add(B),this.group.add(O),{group:O,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},R=(x,O,B)=>{x.group.visible=!0,x.group.position.set(O.coords[0],O.coords[1],O.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=M(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=O.min,x.max=O.max},L=x=>{var O=0;for(x.forEach(B=>{var D=B.members.length,k=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(U=>{k+=U.getNumber(),U.setVisibility(!1)}),!A[O]&&A.push(C(O)),R(A[O],B,k),O++)}),O;O<A.length;O++)A[O].group.visible=!1},N=(x,O)=>{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},k=0;for(var U in x)B?(I.set(x[U].ndc.x,x[U].ndc.y),this._b1.setFromPoints([x[U].morph.position]),B=!1,D.members.push(x[U]),D.coords=[x[U].morph.position.x,x[U].morph.position.y,x[U].morph.position.z],O.push(D),delete x[U]):(T.set(x[U].ndc.x,x[U].ndc.y),k=I.distanceTo(T),.1>k&&(D.members.push(x[U]),this._b1.expandByPoint(x[U].morph.position),delete x[U]));D.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],D.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(x,O)};this.calculate=()=>{if(w){var x=Date.now();if(500<x-P){var O=[];N(f({},this.markers),O),L(O),P=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>w,this.enable=()=>{w=!0,this.morph.visible=!0},this.disable=()=>{for(var x in w=!1,this.morph.visible=!1,this.markers){var O;(O=this.markers[x])!==null&&O!==void 0&&O.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(...A[x].min),this._v2.set(...A[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),E.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&A[x]){var O;return(O=A[x].group)===null||O===void 0?void 0:O.visible}return!1}};_.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=_},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,p=u(36).STLLoader,y=u(37).OBJLoader,m=u(38).PrimitivesLoader;l.SceneLoader=function(d){var b=d;this.toBeDownloaded=0,this.progressMap={};var v=!1,g=!1,M=new m;this.getDownloadProgress=()=>{var j=0,G=0,W=!1;for(var q in this.progressMap){var ee=this.progressMap[q];j+=ee[1],G+=ee[0],ee[1]==0&&(W=!0)}return W&&(j=0),[j,G,g]},this.onProgress=j=>G=>{this.progressMap[j]=[G.loaded,G.total]},this.onError=j=>G=>{--this.toBeDownloaded,g=!0,console.error("There is an issue with external resource: ".concat(G==null?void 0:G.responseURL,".")),j&&j({type:"Error",xhr:G})};var _=(j,G)=>{var W=G.Default;if(G.Inline)b.setupMultipleViews(W,G.Entries);else{var q=[],ee=function(te){j&&(newURL=h(ie,j),q.push(new Promise((F,$)=>{fetch(newURL).then(Q=>Q.json()).then(Q=>F({key:te,data:Q})).catch(Q=>$(Q))})))};for(var[K,ie]of Object.entries(G.Entries))ee(K);Promise.all(q).then(Y=>{var te={};Y.forEach($=>{te[$.key]=$.data}),b.setupMultipleViews(W,te);var F=b.getZincCameraControls();F&&F.setCurrentViewport(W),v=!0})}};this.loadViewURL=(j,G)=>{this.toBeDownloaded+=1;var W=new XMLHttpRequest;W.onreadystatechange=()=>{if(W.readyState==4)if(W.status==200){var ee=JSON.parse(W.responseText);b.setupMultipleViews("default",{default:ee}),b.resetView(),v=!0,--this.toBeDownloaded,G!=null&&typeof G=="function"&&G()}else this.onError()};var q=f(j);W.open("GET",q,!0),W.send()},this.loadModelsURL=(j,G,W,q,ee,K,ie)=>{var Y=G.length;this.toBeDownloaded+=Y;for(var te=0;te<Y;te++){var F=G[te],$=u(0).defaultMaterialColor,Q=u(0).defaultOpacity;W!=null&&W[te]!=null&&($=!!W[te]),q!=null&&q[te]!=null&&(Q=q[te]);var V=0;ee!=null&&ee[te]!=null&&(V=!!ee[te]);var z=0;K!=null&&K[te]!=null&&(z=!!K[te]),M.load(f(F),L(j,$,Q,V,z,void 0,void 0,void 0,void 0,ie),this.onProgress(F),this.onError(ie))}},this.loadFromViewURL=(j,G,W)=>{var q=new XMLHttpRequest;q.onreadystatechange=()=>{if(q.readyState==4&&q.status==200){var K=JSON.parse(q.responseText);b.loadView(K);for(var ie,Y=[],te=G+"_",F=0;F<K.numberOfResources;F++)ie=te+(F+1)+".json",Y.push(ie);this.loadModelsURL(j,Y,K.colour,K.opacity,K.timeEnabled,K.morphColour,W)}};var ee=f(G+"_view.json");q.open("GET",ee,!0),q.send()};var E=(j,G,W,q,ee,K,ie,Y)=>(te,F)=>{var $=new(u(24)).Lines,Q=void 0;F&&F[0]&&(Q=new c.LineBasicMaterial({color:F[0].color.clone()}),1>F[0].opacity&&(Q.transparent=!0),Q.opacity=F[0].opacity,Q.morphTargets=G,Q.vertexColors=F[0].vertexColors);var V={localTimeEnabled:G,localMorphColour:W};if($&&($.createLineSegment(te,Q,V),$.setName(q),$.anatomicalId=ee,$.setRenderOrder(K),j.addZincObject($),$.setDuration(b.getDuration()),console.log(ie),ie&&ie.levels))for(var[z,oe]of Object.entries(ie.levels))$.addLOD(M,z,oe.URL,oe.Index,ie.preload);--this.toBeDownloaded,te.dispose(),Y!=null&&typeof Y=="function"&&Y($)};this.loadLinesURL=(j,G,W,q,ee,K,ie)=>{var Y=0;this.toBeDownloaded+=1;var te=!!(ie&&ie.isInline)&&ie.isInline,F=ie&&ie.anatomicalId?ie.anatomicalId:void 0,$=ie&&ie.renderOrder?ie.renderOrder:void 0;W!=null&&(Y=!!W);var Q=0;if(q!=null&&(Q=!!q),te){var V=M.parse(G);E(j,Y,Q,ee,F,$,ie.lod,K)(V.geometry,V.materials)}else M.load(G,E(j,Y,Q,ee,F,$,ie.lod,K),this.onProgress(G),this.onError(K),ie.loaderOptions)};var S=(j,G,W,q,ee,K)=>{var ie=K&&K.isInline?K.isInline:void 0,Y=K&&K.anatomicalId?K.anatomicalId:void 0,te=K&&K.displayLabels?K.displayLabels:void 0,F=K&&K.renderOrder?K.renderOrder:void 0,$=new(u(18)).Glyphset;$.setDuration(b.getDuration()),$.groupName=q;var Q=()=>{--this.toBeDownloaded,ee!=null&&typeof ee=="function"&&ee($)};++this.toBeDownloaded,ie?$.load(G,W,Q,ie,te):$.load(G,f(W),Q,ie,te),$.anatomicalId=Y,$.setRenderOrder(F),j.addZincObject($)},w=(j,G,W,q,ee,K)=>()=>{if(G.readyState==4&&G.status==200){var ie=JSON.parse(G.responseText);S(j,ie,W,q,ee,K)}},A=(j,G,W,q,ee,K,ie)=>(Y,te)=>{var F=new(u(22)).Pointset,$=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});te&&te[0]&&(1>te[0].opacity&&($.transparent=!0),$.opacity=te[0].opacity,$.color=te[0].color,$.morphTargets=G,$.vertexColors=te[0].vertexColors);var Q={};Q.localTimeEnabled=G,Q.localMorphColour=W,F&&(F.createMesh(Y,$,Q),F.setName(q),F.anatomicalId=ee,j.addZincObject(F),F.setDuration(b.getDuration()),F.setRenderOrder(K)),Y.dispose(),--this.toBeDownloaded,ie!=null&&typeof ie=="function"&&ie(F)};this.loadSTL=(j,G,W,q)=>{this.toBeDownloaded+=1;var ee=u(0).defaultMaterialColor,K=u(0).defaultOpacity,ie=new p;ie.crossOrigin="Anonymous",ie.load(f(G),L(j,ee,K,!1,!1,W,void 0,void 0,void 0,q))},this.loadOBJ=(j,G,W,q)=>{this.toBeDownloaded+=1;var ee=u(0).defaultMaterialColor,K=u(0).defaultOpacity,ie=new y;ie.crossOrigin="Anonymous",ie.load(f(G),L(j,ee,K,!1,!1,W,void 0,void 0,void 0,q))};var I=(j,G,W,q,ee,K,ie)=>{this.toBeDownloaded+=1;var Y=u(0).defaultMaterialColor,te=u(0).defaultOpacity,F=0,$=!!(ie&&ie.isInline)&&ie.isInline,Q=ie&&ie.fileFormat?ie.fileFormat:void 0,V=ie&&ie.anatomicalId?ie.anatomicalId:void 0,z=ie&&ie.renderOrder?ie.renderOrder:void 0;W!=null&&(F=!!W);var oe=0;q!=null&&(oe=!!q);var ae=M;if(Q!==void 0){if(Q=="STL")ae=new p;else if(Q=="OBJ")return ae=new y,ae.crossOrigin="Anonymous",void ae.load(G,objloader(j,Y,te,F,oe,ee,V,K),this.onProgress(G),this.onError,ie.loaderOptions)}if($){var le=M.parse(G);L(j,Y,te,F,oe,ee,V,z,ie,K)(le.geometry,le.materials)}else ae.crossOrigin="Anonymous",M.load(G,L(j,Y,te,F,oe,ee,V,z,ie,K),this.onProgress(G),this.onError(K),ie.loaderOptions)},T=function(G,W,q){var ee=0;return K=>{if(++ee,K&&W!=null&&typeof W=="function"){W(K);var ie=b.getZincCameraControls();ie&&ie.calculateMaxAllowedDistance(b)}ee==G&&(v==!1&&b.viewAll(),q!=null&&typeof q=="function"&&q())}};this.loadPointsetURL=(j,G,W,q,ee,K,ie)=>{var Y=0;this.toBeDownloaded+=1,W!=null&&(Y=!!W);var te=0;q!=null&&(te=!!q);var F=!!(ie&&ie.isInline)&&ie.isInline,$=ie&&ie.anatomicalId?ie.anatomicalId:void 0,Q=ie&&ie.renderOrder?ie.renderOrder:void 0;if(F){var V=M.parse(G);A(j,Y,te,ee,$,Q,K)(V.geometry,V.materials)}else M.load(G,A(j,Y,te,ee,$,Q,K),this.onProgress(G),this.onError(K),ie.loaderOptions)};var P=(j,G,W,q,ee,K)=>{var ie=K&&K.isInline?K.isInline:void 0,Y=K&&K.anatomicalId?K.anatomicalId:void 0,te=K&&K.renderOrder?K.renderOrder:void 0,F=void 0;if(W){if(G&&W.images&&W.images.source)for(var $,Q=W.images.source,V=0;V<Q.length;V++)$=h(Q[V],G),W.images.source[V]=$;if(W.type==="slides"&&(F=new(u(27)).TextureSlides),F){F.groupName=q;var z=()=>{--this.toBeDownloaded,ee!=null&&typeof ee=="function"&&ee(F)};++this.toBeDownloaded,F.load(W,z,ie),F.anatomicalId=Y,F.setRenderOrder(te),j.addZincObject(F)}}},C=(j,G,W,q,ee)=>()=>{if(G.readyState==4&&G.status==200){var K=JSON.parse(G.responseText);P(j,G.responseURL,K,W,q,ee)}};this.loadTextureURL=(j,G,W,q,ee)=>{var K=!!(ee&&ee.isInline)&&ee.isInline;if(K)P(j,void 0,G,W,q,ee);else{var ie=new XMLHttpRequest;ie.onreadystatechange=C(j,ie,W,q,ee),ie.open("GET",f(G),!0),ie.send()}},this.loadGlyphsetURL=(j,G,W,q,ee,K)=>{var ie=!!(K&&K.isInline)&&K.isInline;if(ie)S(j,G,W,q,ee,K);else{var Y=new XMLHttpRequest;Y.onreadystatechange=w(j,Y,W,q,ee,K),Y.open("GET",f(G),!0),Y.send()}};var R=(j,G,W,q,ee,K,ie,Y,te)=>{var F={colour:W,opacity:q,localTimeEnabled:ee,localMorphColour:K},$=new(u(3)).Geometry;return $.createMesh(G,Y,F),$.getMorph()?($.setName(te),j&&j.addZincObject($),$.setDuration(b.getDuration()),$.videoHandler&&b.setVideoHandler($.videoHandler),$):void 0},L=(j,G,W,q,ee,K,ie,Y,te,F)=>($,Q)=>{var V;Q&&Q[0]&&(V=Q[0]);var z=R(j,$,G,W,q,ee,void 0,V,K);if(z.anatomicalId=ie,z.setRenderOrder(Y),te.lod&&te.lod.levels)for(var[oe,ae]of Object.entries(te.lod.levels))z.addLOD(M,oe,ae.URL,ae.Index,te.lod.preload);--this.toBeDownloaded,$.dispose(),F!=null&&typeof F=="function"&&F(z)},N=j=>{var G=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,W,q,ee,K,ie,Y,te]=j.match(G);return{years:W,months:q,weeks:ee,days:K,hours:ie,mins:Y,secs:te}};this.loadSettings=j=>{if(j){if(j.Duration){var G=N(j.Duration);b.setDurationFromObject(G)}if(j.OriginalDuration){var W=N(j.OriginalDuration);b.setOriginalDurationFromObject(W)}if(j.TimeStamps)for(var q in j.TimeStamps){var ee=N(j.TimeStamps[q]);b.addMetadataTimeStamp(q,ee)}}};var x=(j,G,W,q,ee)=>{if(W){var K=void 0,ie=!1;W.URL?(K=W.URL,G&&(K=h(K,G))):W.Inline&&(K=W.Inline.URL,ie=!0);var Y={};if(W.LOD&&W.LOD.Levels){Y.preload=!!W.LOD.Preload,Y.levels={};for(var[te,F]of Object.entries(W.LOD.Levels))Y.levels[te]={},Y.levels[te].URL=h(F.URL,G),Y.levels[te].Index=F.Index}var $=W.GroupName;($===void 0||$==="")&&($="_Unnamed");var Q={loaderOptions:{index:W.Index},isInline:ie,fileFormat:W.FileFormat,anatomicalId:W.AnatomicalId,compression:W.compression,lod:Y,renderOrder:q};switch(W.Type){case"Surfaces":I(j,K,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Glyph":var V;ie?V=W.Inline.GlyphGeometriesURL:(V=W.GlyphGeometriesURL,V=h(W.GlyphGeometriesURL,G)),W.DisplayLabels&&(Q.displayLabels=!0),this.loadGlyphsetURL(j,K,V,$,ee,Q);break;case"Points":this.loadPointsetURL(j,K,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Lines":this.loadLinesURL(j,K,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Texture":this.loadTextureURL(j,K,$,ee,Q);break}}},O=(j,G,W)=>{if(G){var q=void 0,ee=!1;switch(G.URL?(q=G.URL,j&&(q=h(G.URL,j))):G.Inline&&(q=G.Inline.URL,ee=!0),G.Type){case"View":ee?(b.setupMultipleViews("default",{default:q}),v=!0,W!=null&&typeof W=="function"&&W()):this.loadViewURL(q,W);break;case"Settings":this.loadSettings(G);break}}};this.loadGLTF=(j,G,W,q,ee)=>{var K=new(u(39)).GLTFToZincJSLoader;K.load(b,j,G,W,q,ee)};var B=(j,G,W,q)=>{if(W.Primitives&&W.Primitives.forEach(Y=>{var te=1;Y.Order&&(te=Y.Order),x(j,G,Y,te,q)}),W.Transformation&&j.setTransformation(W.Transformation),W.Children)for(var[ee,K]of Object.entries(W.Children)){var ie=j.findOrCreateChildFromPath(ee);ie&&B(ie,G,K,q)}},D=(j,G)=>{if(Array.isArray(j)){for(var W=0,q=0;q<j.length;q++)j[q].Type&&(G&&j[q].Type==="View"||j[q].Type==="Surfaces"||j[q].Type==="Glyph"||j[q].Type==="Points"||j[q].Type==="Lines"||j[q].Type==="Texture")&&W++;return W}return 0},k=j=>{var G=j.Primitives?D(j.Primitives,!1):0;return j.Children&&Object.values(j.Children).forEach(W=>{G+=k(W)}),G},U=j=>Array.isArray(j)?D(j,!0):typeof j=="object"&&j!==null&&j.Version==="2.0"?k(j.Regions):void 0,H=(j,G,W,q,ee)=>{var K=j;W.RegionPath&&W.RegionPath!==""&&(K=j.findOrCreateChildFromPath(W.RegionPath)),x(K,G,W,2*q,ee)},X=(j,G,W,q,ee)=>{for(var K=U(G),ie=new T(K,q,ee),Y=0;Y<G.length;Y++)O(W,G[Y],ie);for(var te=0;te<G.length;te++)H(j,W,G[te],te,ie)},re=(j,G,W,q,ee)=>{var K=U(G),ie=new T(K,q,ee);G.Settings&&this.loadSettings(G.Settings),G.Views&&_(W,G.Views),G.Regions&&B(j,W,G.Regions,ie)};this.loadMetadataURL=(j,G,W,q)=>{var ee=new XMLHttpRequest,K=f(G);ee.onreadystatechange=()=>{if(ee.readyState==4&&ee.status==200){b.resetMetadata(),b.resetDuration(),v=!1;var ie=ee.responseURL;ie===void 0&&(ie=new URL(K).href);var Y=JSON.parse(ee.responseText);Array.isArray(Y)?X(j,Y,ie,W,q):typeof Y=="object"&&Y!==null&&Y.Version=="2.0"&&re(j,Y,ie,W,q)}},ee.open("GET",K,!0),ee.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,y,m,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(p,function(g){try{y(b.parse(g))}catch(M){d?d(M):console.error(M),b.manager.itemError(p)}},m,d)}parse(p){function y(d,b,v){for(var g=0,M=d.length;g<M;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var m=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(p);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],M=0;5>M;M++)if(y(g,b,M))return!1;return!0}(m)?function(d){for(var b,v,g,M,_,E,S,w,A=new DataView(d),I=A.getUint32(80,!0),T=!1,P=0;P<70;P++)A.getUint32(P,!1)==1129270351&&A.getUint8(P+4)==82&&A.getUint8(P+5)==61&&(T=!0,M=new Float32Array(3*(3*I)),_=A.getUint8(P+6)/255,E=A.getUint8(P+7)/255,S=A.getUint8(P+8)/255,w=A.getUint8(P+9)/255);for(var C=new c.BufferGeometry,R=new Float32Array(3*(3*I)),L=new Float32Array(3*(3*I)),N=0;N<I;N++){var x=84+N*50,O=A.getFloat32(x,!0),B=A.getFloat32(x+4,!0),D=A.getFloat32(x+8,!0);if(T){var k=A.getUint16(x+48,!0);32768&k?(b=_,v=E,g=S):(b=(31&k)/31,v=(31&k>>5)/31,g=(31&k>>10)/31)}for(var U=1;3>=U;U++){var H=x+12*U,X=3*(3*N)+3*(U-1);R[X]=A.getFloat32(H,!0),R[X+1]=A.getFloat32(H+4,!0),R[X+2]=A.getFloat32(H+8,!0),L[X]=O,L[X+1]=B,L[X+2]=D,T&&(M[X]=b,M[X+1]=v,M[X+2]=g)}}return C.setAttribute("position",new c.BufferAttribute(R,3)),C.setAttribute("normal",new c.BufferAttribute(L,3)),T&&(C.setAttribute("color",new c.BufferAttribute(M,3)),C.hasColors=!0,C.alpha=w),C}(m):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,M=/facet([\s\S]*?)endfacet/g,_=0,E=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,S=new RegExp("vertex"+E+E+E,"g"),w=new RegExp("normal"+E+E+E,"g"),A=[],I=[],T=new c.Vector3,P=0,C=0,R=0;(b=g.exec(d))!==null;){C=R;for(var L=b[0];(b=M.exec(L))!==null;){for(var N=0,x=0,O=b[0];(b=w.exec(O))!==null;)T.x=parseFloat(b[1]),T.y=parseFloat(b[2]),T.z=parseFloat(b[3]),x++;for(;(b=S.exec(O))!==null;)A.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),I.push(T.x,T.y,T.z),N++,R++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+_),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+_),_++}var B=C,D=R-C;v.addGroup(B,D,P),P++}return v.setAttribute("position",new c.Float32BufferAttribute(A,3)),v.setAttribute("normal",new c.Float32BufferAttribute(I,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>_});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,p=/^usemtl /,y=/^usemap /,m=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function M(){var E={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(w,A){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=w,void(this.object.fromDeclaration=A!==!1);var I=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:w||"",fromDeclaration:A!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(C,R){var L=this._finalize(!1);L&&(L.inherited||0>=L.groupCount)&&this.materials.splice(L.index,1);var N={index:this.materials.length,name:C||"",mtllib:Array.isArray(R)&&0<R.length?R[R.length-1]:"",smooth:L===void 0?this.smooth:L.smooth,groupStart:L===void 0?0:L.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(O){var B={index:typeof O=="number"?O:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(C){var R=this.currentMaterial();if(R&&R.groupEnd===-1&&(R.groupEnd=this.geometry.vertices.length/3,R.groupCount=R.groupEnd-R.groupStart,R.inherited=!1),C&&1<this.materials.length)for(var L=this.materials.length-1;0<=L;L--)0>=this.materials[L].groupCount&&this.materials.splice(L,1);return C&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),R}},I&&I.name&&typeof I.clone=="function"){var T=I.clone(0);T.inherited=!0,this.object.materials.push(T)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(w,A){var I=parseInt(w,10);return 3*(0<=I?I-1:I+A/3)},parseNormalIndex:function(w,A){var I=parseInt(w,10);return 3*(0<=I?I-1:I+A/3)},parseUVIndex:function(w,A){var I=parseInt(w,10);return 2*(0<=I?I-1:I+A/2)},addVertex:function(w,A,I){var T=this.vertices,P=this.object.geometry.vertices;P.push(T[w+0],T[w+1],T[w+2]),P.push(T[A+0],T[A+1],T[A+2]),P.push(T[I+0],T[I+1],T[I+2])},addVertexPoint:function(w){var A=this.vertices,I=this.object.geometry.vertices;I.push(A[w+0],A[w+1],A[w+2])},addVertexLine:function(w){var A=this.vertices,I=this.object.geometry.vertices;I.push(A[w+0],A[w+1],A[w+2])},addNormal:function(w,A,I){var T=this.normals,P=this.object.geometry.normals;P.push(T[w+0],T[w+1],T[w+2]),P.push(T[A+0],T[A+1],T[A+2]),P.push(T[I+0],T[I+1],T[I+2])},addFaceNormal:function(w,A,I){var T=this.vertices,P=this.object.geometry.normals;m.fromArray(T,w),d.fromArray(T,A),b.fromArray(T,I),g.subVectors(b,d),v.subVectors(m,d),g.cross(v),g.normalize(),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z)},addColor:function(w,A,I){var T=this.colors,P=this.object.geometry.colors;T[w]!==void 0&&P.push(T[w+0],T[w+1],T[w+2]),T[A]!==void 0&&P.push(T[A+0],T[A+1],T[A+2]),T[I]!==void 0&&P.push(T[I+0],T[I+1],T[I+2])},addUV:function(w,A,I){var T=this.uvs,P=this.object.geometry.uvs;P.push(T[w+0],T[w+1]),P.push(T[A+0],T[A+1]),P.push(T[I+0],T[I+1])},addDefaultUV:function(){var w=this.object.geometry.uvs;w.push(0,0),w.push(0,0),w.push(0,0)},addUVLine:function(w){var A=this.uvs,I=this.object.geometry.uvs;I.push(A[w+0],A[w+1])},addFace:function(w,A,I,T,P,C,R,L,N){var x=this.vertices.length,O=this.parseVertexIndex(w,x),B=this.parseVertexIndex(A,x),D=this.parseVertexIndex(I,x);if(this.addVertex(O,B,D),this.addColor(O,B,D),R!==void 0&&R!==""){var k=this.normals.length;O=this.parseNormalIndex(R,k),B=this.parseNormalIndex(L,k),D=this.parseNormalIndex(N,k),this.addNormal(O,B,D)}else this.addFaceNormal(O,B,D);if(T!==void 0&&T!==""){var U=this.uvs.length;O=this.parseUVIndex(T,U),B=this.parseUVIndex(P,U),D=this.parseUVIndex(C,U),this.addUV(O,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(w){this.object.geometry.type="Points";for(var A,I=this.vertices.length,T=0,P=w.length;T<P;T++)A=this.parseVertexIndex(w[T],I),this.addVertexPoint(A),this.addColor(A)},addLineGeometry:function(w,A){this.object.geometry.type="Line";for(var I=this.vertices.length,T=this.uvs.length,P=0,C=w.length;P<C;P++)this.addVertexLine(this.parseVertexIndex(w[P],I));for(var R=0,L=A.length;R<L;R++)this.addUVLine(this.parseUVIndex(A[R],T))}};return E.startObject("",!1),E}class _ extends c.Loader{constructor(S){super(S),this.materials=null}load(S,w,A,I){var T=this,P=new c.FileLoader(this.manager);P.setPath(this.path),P.setRequestHeader(this.requestHeader),P.setWithCredentials(this.withCredentials),P.load(S,function(C){try{w(T.parse(C))}catch(R){I?I(R):console.error(R),T.manager.itemError(S)}},A,I)}setMaterials(S){return this.materials=S,this}parse(S){var w=new M;S.indexOf(`\r
3227
+ `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};l.fs=h,l.vs=p,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(p,y)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,d=[];p.images.source.forEach(v=>{d.push(c(v))});var b=this;m.loadFromImages(d).then(()=>{b.texture=m,b.initialise(p,y)})}},this.initialise=(p,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var p=h,y=void 0,m=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,M=[],_=0,E=void 0,S=void 0,w=void 0,A=void 0,I=[],T=[],P=new c.Group,C=void 0,R=void 0,L=!1;this.getDrawingWidth=()=>p?p.clientWidth:C?typeof C.clientWidth>"u"?Math.round(C.width):Math.round(C.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:C?typeof C.clientHeight>"u"?Math.round(C.height):Math.round(C.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var O=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var D;p?(D=p.getBoundingClientRect(),y.setSize(O,B)):C&&(typeof C.getBoundingClientRect>"u"||(D=C.getBoundingClientRect(),C.width=O,C.height=B),y.setSize(O,B,!1)),D&&(D.left,D.top);var k=new c.Vector2;y.getSize(k),k.x,k.y}},this.initialiseVisualisation=O=>{if(O=O||{},O.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}O.antialias=!B}O.canvas&&(p=void 0,C=O.canvas),y=new c.WebGLRenderer(O),p!==void 0&&p.appendChild(y.domElement),y.setClearColor(16777215,1),C&&C.style&&(C.style.height="100%",C.style.width="100%"),y.autoClear=!1;var D=this.createScene("default");this.setCurrentScene(D)},this.getCurrentScene=()=>m,this.setCurrentScene=O=>{if(O){this.removeActiveScene(O);var B=m;m=O,B&&B.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(P),this.onWindowResize()}},this.getSceneByName=O=>I[O],this.createScene=O=>{if(I[O]==null){var B;return B=C?new(u(32)).Scene(C,y):new(u(32)).Scene(p,y),I[O]=B,B.sceneName=O,B}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var O=m.getBoundingBox();if(O){for(var B,D=0;D<T.length;D++)B=T[D].getBoundingBox(),B&&O.union(B);m.viewAllWithBoundingBox(O)}}},this.loadModelsURL=(O,B,D,k,U,H)=>{m.loadModelsURL(O,B,D,k,U,H)},this.loadViewURL=O=>{m.loadViewURL(O)},this.loadFromViewURL=(O,B)=>{m.loadFromViewURL(O,B)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var N=()=>{L?(E=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(E),E=void 0)};this.stopAnimate=()=>{L&&(d.stop(),L=!1)},this.animate=()=>{L||(d.start(),L=!0,N())},this.addPreRenderCallbackFunction=O=>(++g,v[g]=O,g),this.removePreRenderCallbackFunction=O=>{O in v&&delete v[O]},this.addPostRenderCallbackFunction=O=>(++_,M[_]=O,_),this.removePostRenderCallbackFunction=O=>{O in M&&delete M[O]},this.getPlayRate=()=>b,this.setPlayRate=O=>{b=O},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=O=>{m.setMorphsTime(O)},this.getZincGeometryByID=O=>m.getZincGeometryByID(O),this.addToScene=O=>{m.addObject(O)},this.addToOrthoScene=O=>{if(w==null&&(w=new c.Scene),S==null){var B=this.getDrawingWidth(),D=this.getDrawingHeight();S=new c.OrthographicCamera(-B/2,B/2,D/2,-D/2,1,10),S.position.z=10}w.add(O)};var x=O=>B=>{B.needsUpdate=!0;var D=new c.SpriteMaterial({map:B}),k=D.map.image.width,U=D.map.image.height;O.material=D,O.scale.set(k,U,1);var H=this.getDrawingWidth(),X=this.getDrawingHeight();O.position.set((H-k)/2,(-X+U)/2,1),this.addToOrthoScene(O)};this.addLogo=()=>{A=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,x(A))},this.render=()=>{R||(p?0<p.clientWidth&&0<p.clientHeight&&(R=new f(p,this.onWindowResize)):C&&0<C.width&&0<C.height&&(R=new f(C,this.onWindowResize)));var O=d.getDelta();m.renderGeometries(b,O,this.playAnimation);for(var B,D=0;D<T.length;D++)B=T[D],B.renderGeometries(b,O,this.playAnimation);for(var k in S!=null&&w!=null&&(y.clearDepth(),y.render(w,S)),v)v.hasOwnProperty(k)&&v[k].call();for(var U in m.render(y),M)M.hasOwnProperty(U)&&M[U].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=O=>{if(m===O)return!0;for(var B,D=0;D<T.length;D++)if(B=T[D],B===O)return!0;return!1},this.addActiveScene=O=>{this.isSceneActive(O)||(T.push(O),P.add(O.getThreeJSScene()))},this.removeActiveScene=O=>{for(var B,D=0;D<T.length;D++)if(B=T[D],B===O)return T.splice(D,1),void P.remove(O.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var O=0;O<T.length;O++)P.remove(T[O].getThreeJSScene());T.splice(0,T.length)},this.dispose=()=>{for(var O in L&&cancelAnimationFrame(E),I)I.hasOwnProperty(O)&&I[O].clearAll();I=[],T=[],P=new c.Group,this.stopAnimate(),v=[],g=0,S=void 0,w=void 0,A=void 0;var B=this.createScene("default");this.setCurrentScene(B),R=void 0},this.transitionScene=(O,B)=>{if(m){var D=m.getZincCameraControls(),k=O.getBoundingBox();if(k){var U=k.min.distanceTo(k.max)/2,H=(k.min.x+k.max.x)/2,X=(k.min.y+k.max.y)/2,re=(k.min.z+k.max.z)/2,j=D.getViewportFromCentreAndRadius(H,X,re,U,40,U*4),G=D.getCurrentViewport();D.cameraTransition(G,j,B),D.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=TB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,p=u(41).SceneExporter,y=u(43).Viewport,m=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=0,v=function(){return"sc"+b++},g=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},M=6e3;l.Scene=function(_,E){var S=this,w=_,A=void 0,I=new h(this),T=void 0,P={},C=0,R={},L=0,N=new c.Scene,x=new(u(44)).Region(void 0,this);N.add(x.getGroup());var O=new c.Group;N.add(O),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var B=6e3,D=void 0;this.sceneName=void 0;var k=!1,U=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var H={x:0,y:0},X=g(),re=new c.Vector2,j=[];this.forcePickableObjectsUpdate=!1,this.uuid=v();var G=new f(this);G.disable(),N.add(G.group);var W=()=>w?typeof w.clientWidth>"u"?w.width:w.clientWidth:0,K=()=>w?typeof w.clientHeight>"u"?w.height:w.clientHeight:0;this.getDownloadProgress=()=>I.getDownloadProgress(),this.onWindowResize=()=>{var F=K();this.camera.aspect=W()/F,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,D.onResize(),D.calculateHeightPerPixelAtZeroDepth(F)},this.resetView=()=>{this.onWindowResize(),D.resetView()},this.changeZoomByScrollRateUnit=F=>{D.changeZoomByScrollRateUnit(F)};var ee=()=>{this.camera=new c.PerspectiveCamera(40,W()/K(),0,10),this.ambient=new c.AmbientLight(16777215,.2),N.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),N.add(this.directionalLight),D=new(u(43)).CameraControls(this.camera,E.domElement,E,this),D.setDirectionalLight(this.directionalLight),D.resetView(),T=new(u(49)).Minimap(this)};ee(),this.loadView=F=>{var $=new y;return $.setFromObject(F),D.setCurrentCameraSettings($),!0},this.setupMultipleViews=(F,$)=>{for(var[Q,V]of Object.entries($)){var z=new y;z.setFromObject(V),D.addViewport(Q,z)}D.setDefaultViewport(F)},this.getBoundingBox=()=>x.getBoundingBox(!0),this.viewAllWithBoundingBox=F=>{if(F){var $=D.getViewportFromBoundingBox(F,1);D.setCurrentCameraSettings($),D.calculateHeightPerPixelAtZeroDepth(K()),G.markerUpdateRequired=!0}},this.viewAll=()=>{var F=this.getBoundingBox();this.viewAllWithBoundingBox(F),G.markerUpdateRequired=!0},this.forEachGeometry=F=>{x.forEachGeometry(F,!0)},this.forEachGlyphset=F=>{x.forEachGlyphset(F,!0)},this.forEachPointset=F=>{x.forEachPointset(F,!0)},this.forEachLine=F=>{x.forEachLine(F,!0)},this.findGeometriesWithGroupName=F=>x.findGeometriesWithGroupName(F,!0),this.findPointsetsWithGroupName=F=>x.findPointsetsWithGroupName(F,!0),this.findGlyphsetsWithGroupName=F=>x.findGlyphsetsWithGroupName(F,!0),this.findLinesWithGroupName=F=>x.findLinesWithGroupName(F,!0),this.findObjectsWithGroupName=F=>x.findObjectsWithGroupName(F,!0),this.findObjectsWithAnatomicalId=F=>x.findObjectsWithAnatomicalId(F,!0),this.getBoundingBoxOfZincObjects=F=>{for(var $,Q=void 0,V=0;V<F.length;V++)$=F[V].getBoundingBox(),$&&(Q?Q.union($):Q=$);return Q},this.vectorToScreenXY=F=>{F.project(this.camera);var $=W(),Q=K(),V=$/2,z=Q/2;return F.x=F.x*V+V,F.y=-(F.y*z)+z,F},this.getObjectsScreenXY=F=>{if(F&&0<F.length){var $=this.getBoundingBoxOfZincObjects(F),Q=new c.Vector3;return $.getCenter(Q),this.vectorToScreenXY(Q)}},this.getNamedObjectsScreenXY=F=>{var $=this.findObjectsWithGroupName(F);return this.getObjectsScreenXY($)},this.addZincObject=F=>{F&&(x.addZincObject(F),D&&D.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(F,$,Q,V)=>{I.loadGlyphsetURL(x,F,$,Q,V)},this.loadPointsetURL=(F,$,Q,V,z)=>{I.loadPointsetURL(x,F,$,Q,V,z)},this.loadLinesURL=(F,$,Q,V,z)=>{I.loadLinesURL(x,F,$,Q,V,z)},this.loadSTL=(F,$,Q)=>{I.loadSTL(x,F,$,Q)},this.loadOBJ=(F,$,Q)=>{I.loadOBJ(x,F,$,Q)},this.loadMetadataURL=(F,$,Q)=>{I.loadMetadataURL(x,F,$,Q)},this.loadModelsURL=(F,$,Q,V,z,oe)=>{I.loadModelsURL(x.urls,$,Q,V,z,oe)},this.loadViewURL=F=>{I.loadViewURL(F)},this.loadFromViewURL=(F,$)=>{I.loadFromViewURL(F,$)},this.loadGLTF=(F,$,Q,V)=>{I.loadGLTF(x,F,$,Q,V)},this.updateDirectionalLight=()=>{D.updateDirectionalLight()},this.addObject=F=>{N.add(F)},this.removeObject=F=>{N.remove(F)},this.getCurrentTime=()=>{if(A!=null)return A.getCurrentTime(B);var F=x.getCurrentTime();return F===-1?0:F},this.setMorphsTime=F=>{A!=null&&A.setMorphTime(F,B),x.setMorphTime(F,!0)},this.isTimeVarying=()=>!!(A&&A.video&&!A.video.error)||x.isTimeVarying(),this.renderGeometries=(F,$,Q)=>{var V={};if(V.camera=D,V.displayMarkers=this.displayMarkers,V.markerCluster=G,V.markersList=G.markers,V.ndcToBeUpdated=!1,Q&&(V.markerCluster.markerUpdateRequired=!0),!A)I.toBeDownloaded==0?(V.ndcToBeUpdated=D.update($),V.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(K()),x.renderGeometries(F,$,Q,D,V,!0)):D.update(0);else if(A.isReadyToPlay()){Q?A.video.play():A.video.pause();var z=A.video.currentTime/A.getVideoDuration()*B;I.toBeDownloaded==0?(D.setTime(z),V.ndcToBeUpdated=D.update(0),V.ndcToBeUpdated&&D.calculateHeightPerPixelAtZeroDepth(K()),x.setMorphTime(z,!0),x.renderGeometries(0,0,Q,D,V,!0)):D.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>N,this.setVideoHandler=F=>{A||(A=F)},this.setAdditionalScenesGroup=F=>{N.add(F)};var q=(F,$,Q,V,z,oe,ae)=>{var le=0,fe=0;return fe=F.includes("top")?ae-z-Q:F.includes("bottom")?Q:Math.floor((ae-z)/2),le=F.includes("left")?$:F.includes("right")?oe-$-V:Math.floor((oe-V)/2),{x:le,y:fe}},ie=F=>{this.displayMinimap===!0&&(F.setScissorTest(!0),F.getSize(re),this.minimapScissor.updateRequired&&(H=q(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,re.x,re.y),this.minimapScissor.updateRequired=!1),F.setScissor(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),F.setViewport(H.x,H.y,this.minimapScissor.width,this.minimapScissor.height),T.updateCamera(),N.add(T.mask),F.render(N,T.camera),N.remove(T.mask),F.setScissorTest(!1),F.setViewport(0,0,re.x,re.y))};this.render=F=>{this.autoClearFlag&&F.clear(),k&&U?U.render(N,this.camera):(F.render(N,this.camera),ie(F))},this.setInteractiveControlEnable=F=>{F==!0?D.enable():D.disable()},this.getZincCameraControls=()=>D,this.getThreeJSScene=()=>N,this.setDuration=F=>{x.setDuration(F),B=F,D.setPathDuration(F),I.duration=F},this.getDuration=()=>B,this.setStereoEffectEnable=F=>{F!=!0||U||(U=new u(43).StereoEffect(E)),E.setSize(W(),K()),this.camera.updateProjectionMatrix(),k=F},this.objectIsInScene=F=>x.objectIsInRegion(F,!0),this.alignBoundingBoxToCameraView=(F,$)=>{if(F){var Q=new c.Vector3;F.getCenter(Q);var V=this.getZincCameraControls().getCurrentViewport(),z=new c.Vector3(V.targetPosition[0],V.targetPosition[1],V.targetPosition[2]),oe=new c.Vector3(V.eyePosition[0],V.eyePosition[1],V.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(z,oe).normalize(),le.subVectors(z,Q).normalize();var fe=new c.Vector3;fe.crossVectors(ae,le);var be=ae.angleTo(le);0<$?(this.getZincCameraControls().rotateCameraTransition(fe,be,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(fe,be),G.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(F,$,Q)=>{if(F){var V=this.getZincCameraControls().getCurrentViewport(),z=this.getZincCameraControls().getViewportFromBoundingBox(F,$);0<Q&&(this.getZincCameraControls().cameraTransition(V,z,Q),this.getZincCameraControls().enableCameraTransition()),G.markerUpdateRequired=!0}},this.alignObjectToCameraView=(F,$)=>{if(this.objectIsInScene(F)){var Q=F.getBoundingBox();this.alignBoundingBoxToCameraView(Q,$)}},this.setCameraTargetToObject=F=>{if(this.objectIsInScene(F)){var $=new c.Vector3,Q=F.getBoundingBox(),V=this.getZincCameraControls().getCurrentViewport();Q.getCenter($);var z=new c.Vector3(V.targetPosition[0],V.targetPosition[1],V.targetPosition[2]),oe=new c.Vector3(V.eyePosition[0],V.eyePosition[1],V.eyePosition[2]),ae=new c.Vector3,le=new c.Vector3;ae.subVectors(oe,z),le.addVectors($,ae),V.eyePosition[0]=le.x,V.eyePosition[1]=le.y,V.eyePosition[2]=le.z,V.targetPosition[0]=$.x,V.targetPosition[1]=$.y,V.targetPosition[2]=$.z,this.getZincCameraControls().setCurrentCameraSettings(V),G.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>k,this.removeZincObject=F=>{x.removeZincObject(F),D&&D.calculateMaxAllowedDistance(this),G.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{j.length=0,G.isEnabled&&j.push(G.group),x.getPickableThreeJSObjects(j,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||x.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),j),this.getNormalisedMinimapCoordinates=(F,$)=>{if(this.displayMinimap){var Q=new c.Vector2;F.getSize(Q);var V=Q.y-$.clientY;if(H.x+this.minimapScissor.width>$.clientX&&$.clientX>H.x&&H.y+this.minimapScissor.height>V&&V>H.y){var z=2*(($.clientX-H.x)/this.minimapScissor.width)-1,oe=2*((V-H.y)/this.minimapScissor.height)-1;return{x:z,y:oe}}}},this.getMinimapDiffFromNormalised=(F,$)=>T?T.getDiffFromNormalised(F,$):void 0,this.isWebGL2=()=>E.isWebGL2(),this.clearAll=()=>{G.clear(),x.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),I.toBeDwonloaded=0,D&&D.calculateMaxAllowedDistance(this),G.markerUpdateRequired=!0},this.addMetadataTimeStamp=(F,$)=>{X.TimeStamps[F]=te($)},this.getMetadataTag=F=>X[F],this.getMetadata=()=>X,this.setMetadataTag=(F,$)=>{X[F]=$},this.removeMetadataTag=F=>{delete X[F]},this.resetMetadata=()=>{X=g()},this.resetDuration=()=>{this.setDuration(M)};var Y=F=>[...F.years?["".concat(F.years,"years")]:[],...F.months?["".concat(F.months,"months")]:[],...F.weeks?["".concat(F.weeks,"weeks")]:[],...F.days?["".concat(F.days,"days")]:[],...F.hours?["".concat(F.hours,"hours")]:[],...F.mins?["".concat(F.mins,"mins")]:[],...F.secs?["".concat(F.secs,"secs")]:[]].join(" "),te=F=>F.years?31536e6*F.years:0+F.months?2592e6*F.months:0+F.weeks?6048e5*F.weeks:0+F.days?864e5*F.days:0+F.hours?36e5*F.hours:0+F.mins?6e4*F.mins:0+F.secs?1e3*F.secs:0;this.setDurationFromObject=F=>{var $=Y(F),Q=te(F);this.setMetadataTag("Duration",$),this.setDuration(Q)},this.setOriginalDurationFromObject=F=>{var $=Y(F);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=F=>{var $=new p(this);return $.exportGLTF(F)},this.getRootRegion=()=>x,this.createLines=(F,$,Q,V)=>{var z=x.findChildFromPath(F);return z===void 0&&(z=x.createChildFromPath(F)),z.createLines($,Q,V)},this.createPoints=(F,$,Q,V,z)=>{var oe=x.findChildFromPath(F);return oe===void 0&&(oe=x.createChildFromPath(F)),oe.createPoints($,Q,V,z)},this.addZincObjectAddedCallbacks=F=>(++C,P[C]=F,C),this.addZincObjectRemovedCallbacks=F=>(++L,R[L]=F,L),this.removeZincObjectAddedCallbacks=F=>{F in C&&delete P[F]},this.removeZincObjectRemovedCallbacks=F=>{F in L&&delete R[F]},this.clearZincObjectAddedCallbacks=()=>{P={},C=0},this.clearZincObjectRemovedCallbacks=()=>{R={},L=0},this.triggerObjectAddedCallback=F=>{for(var $ in P)P.hasOwnProperty($)&&P[$](F)},this.triggerObjectRemovedCallback=F=>{for(var $ in R)R.hasOwnProperty($)&&R[$](F)},this.addTemporaryPoints=(F,$)=>{var Q=m(F.length,F),V=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),z=d();V.map=z;var oe=new(u(23)).Points(Q,V);return O.add(oe),oe},this.addTemporaryLines=(F,$)=>{var Q=m(F.length,F),V=new c.LineBasicMaterial({color:$}),z=new(u(12)).LineSegments(Q,V);return O.add(z),z},this.removeTemporaryPrimitive=F=>{O.remove(F),F.geometry.dispose(),F.material.dispose()},this.clearTemporaryPrimitives=()=>{var F=0,$=O.children;return $.forEach(Q=>{Q.geometry.dispose(),Q.material.dispose(),F++}),O.clear(),F},this.addBoundingBoxPrimitive=function(F,$,Q,V,z){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,ae=x.findChildFromPath(F);ae===void 0&&(ae=x.createChildFromPath(F));var le=oe||S.getBoundingBox(),fe=new c.Vector3().subVectors(le.max,le.min),be=new c.BoxGeometry(fe.x,fe.y,fe.z),ye=ae.createGeometryFromThreeJSGeometry($,be,Q,V,z,1e4);return fe.addVectors(le.min,le.max).multiplyScalar(.5),ye.setPosition(fe.x,fe.y,fe.z),ye},this.addSlicesPrimitive=function(F,$,Q,V,z){var oe=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&Q&&3<=Q.length){var ae=x.findChildFromPath(F);ae===void 0&&(ae=x.createChildFromPath(F));var le=oe||S.getBoundingBox(),fe=new c.Vector3().subVectors(le.max,le.min),be=[],ye=0;return["x","y","z"].forEach(he=>{var ve;switch(he){case"x":ve=new c.PlaneGeometry(fe.z,fe.y),ve.rotateY(Math.PI/2);break;case"y":ve=new c.PlaneGeometry(fe.x,fe.z),ve.rotateX(Math.PI/2);break;case"z":ve=new c.PlaneGeometry(fe.x,fe.y);break}var se=ae.createGeometryFromThreeJSGeometry($[ye],ve,Q[ye],V,z,10001);be.push(se),ye++}),fe.addVectors(le.min,le.max).multiplyScalar(.5),be.forEach(he=>{he.setPosition(fe.x,fe.y,fe.z)}),be}},this.enableMarkerCluster=F=>{F?(G.markerUpdateRequired=!0,G.enable()):(G.markerUpdateRequired=!1,G.disable()),this.forcePickableObjectsUpdate=!0}}},(o,l,u)=>{function c(E,S){var w=Object.keys(E);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(E);S&&(A=A.filter(function(I){return Object.getOwnPropertyDescriptor(E,I).enumerable})),w.push.apply(w,A)}return w}function f(E){for(var S,w=1;w<arguments.length;w++)S=arguments[w]==null?{}:arguments[w],w%2?c(Object(S),!0).forEach(function(A){h(E,A,S[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(S)):c(Object(S)).forEach(function(A){Object.defineProperty(E,A,Object.getOwnPropertyDescriptor(S,A))});return E}function h(E,S,w){return S=p(S),S in E?Object.defineProperty(E,S,{value:w,enumerable:!0,configurable:!0,writable:!0}):E[S]=w,E}function p(E){var S=y(E,"string");return typeof S=="symbol"?S:S+""}function y(E,S){if(typeof E!="object"||!E)return E;var w=E[Symbol.toPrimitive];if(w!==void 0){var A=w.call(E,S||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(E)}var m=u(4),d=new Image(128,128);d.src=u(34);var b=new m.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),M=u(5).createNewSpriteText,_=function(E){u(10).ZincObject.call(this),this.texture=b;var S=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var w=!0,A=[];this.markers={};var I=new m.Vector2,T=new m.Vector2,P=Date.now();this.setSpriteSize=x=>{S.scale.set(.015,.02,1),S.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var C=x=>{var O=new m.Group,B=new m.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,O.add(B),this.group.add(O),{group:O,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},R=(x,O,B)=>{x.group.visible=!0,x.group.position.set(O.coords[0],O.coords[1],O.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=M(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=O.min,x.max=O.max},L=x=>{var O=0;for(x.forEach(B=>{var D=B.members.length,k=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(U=>{k+=U.getNumber(),U.setVisibility(!1)}),!A[O]&&A.push(C(O)),R(A[O],B,k),O++)}),O;O<A.length;O++)A[O].group.visible=!1},N=(x,O)=>{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},k=0;for(var U in x)B?(I.set(x[U].ndc.x,x[U].ndc.y),this._b1.setFromPoints([x[U].morph.position]),B=!1,D.members.push(x[U]),D.coords=[x[U].morph.position.x,x[U].morph.position.y,x[U].morph.position.z],O.push(D),delete x[U]):(T.set(x[U].ndc.x,x[U].ndc.y),k=I.distanceTo(T),.1>k&&(D.members.push(x[U]),this._b1.expandByPoint(x[U].morph.position),delete x[U]));D.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],D.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(x,O)};this.calculate=()=>{if(w){var x=Date.now();if(500<x-P){var O=[];N(f({},this.markers),O),L(O),P=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>w,this.enable=()=>{w=!0,this.morph.visible=!0},this.disable=()=>{for(var x in w=!1,this.morph.visible=!1,this.markers){var O;(O=this.markers[x])!==null&&O!==void 0&&O.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(...A[x].min),this._v2.set(...A[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),E.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&A[x]){var O;return(O=A[x].group)===null||O===void 0?void 0:O.visible}return!1}};_.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=_},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,p=u(36).STLLoader,y=u(37).OBJLoader,m=u(38).PrimitivesLoader;l.SceneLoader=function(d){var b=d;this.toBeDownloaded=0,this.progressMap={};var v=!1,g=!1,M=new m;this.getDownloadProgress=()=>{var j=0,G=0,W=!1;for(var K in this.progressMap){var ee=this.progressMap[K];j+=ee[1],G+=ee[0],ee[1]==0&&(W=!0)}return W&&(j=0),[j,G,g]},this.onProgress=j=>G=>{this.progressMap[j]=[G.loaded,G.total]},this.onError=j=>G=>{--this.toBeDownloaded,g=!0,console.error("There is an issue with external resource: ".concat(G==null?void 0:G.responseURL,".")),j&&j({type:"Error",xhr:G})};var _=(j,G)=>{var W=G.Default;if(G.Inline)b.setupMultipleViews(W,G.Entries);else{var K=[],ee=function(te){j&&(newURL=h(ie,j),K.push(new Promise((F,$)=>{fetch(newURL).then(Q=>Q.json()).then(Q=>F({key:te,data:Q})).catch(Q=>$(Q))})))};for(var[q,ie]of Object.entries(G.Entries))ee(q);Promise.all(K).then(Y=>{var te={};Y.forEach($=>{te[$.key]=$.data}),b.setupMultipleViews(W,te);var F=b.getZincCameraControls();F&&F.setCurrentViewport(W),v=!0})}};this.loadViewURL=(j,G)=>{this.toBeDownloaded+=1;var W=new XMLHttpRequest;W.onreadystatechange=()=>{if(W.readyState==4)if(W.status==200){var ee=JSON.parse(W.responseText);b.setupMultipleViews("default",{default:ee}),b.resetView(),v=!0,--this.toBeDownloaded,G!=null&&typeof G=="function"&&G()}else this.onError()};var K=f(j);W.open("GET",K,!0),W.send()},this.loadModelsURL=(j,G,W,K,ee,q,ie)=>{var Y=G.length;this.toBeDownloaded+=Y;for(var te=0;te<Y;te++){var F=G[te],$=u(0).defaultMaterialColor,Q=u(0).defaultOpacity;W!=null&&W[te]!=null&&($=!!W[te]),K!=null&&K[te]!=null&&(Q=K[te]);var V=0;ee!=null&&ee[te]!=null&&(V=!!ee[te]);var z=0;q!=null&&q[te]!=null&&(z=!!q[te]),M.load(f(F),L(j,$,Q,V,z,void 0,void 0,void 0,void 0,ie),this.onProgress(F),this.onError(ie))}},this.loadFromViewURL=(j,G,W)=>{var K=new XMLHttpRequest;K.onreadystatechange=()=>{if(K.readyState==4&&K.status==200){var q=JSON.parse(K.responseText);b.loadView(q);for(var ie,Y=[],te=G+"_",F=0;F<q.numberOfResources;F++)ie=te+(F+1)+".json",Y.push(ie);this.loadModelsURL(j,Y,q.colour,q.opacity,q.timeEnabled,q.morphColour,W)}};var ee=f(G+"_view.json");K.open("GET",ee,!0),K.send()};var E=(j,G,W,K,ee,q,ie,Y)=>(te,F)=>{var $=new(u(24)).Lines,Q=void 0;F&&F[0]&&(Q=new c.LineBasicMaterial({color:F[0].color.clone()}),1>F[0].opacity&&(Q.transparent=!0),Q.opacity=F[0].opacity,Q.morphTargets=G,Q.vertexColors=F[0].vertexColors);var V={localTimeEnabled:G,localMorphColour:W};if($&&($.createLineSegment(te,Q,V),$.setName(K),$.anatomicalId=ee,$.setRenderOrder(q),j.addZincObject($),$.setDuration(b.getDuration()),ie&&ie.levels))for(var[z,oe]of Object.entries(ie.levels))$.addLOD(M,z,oe.URL,oe.Index,ie.preload);--this.toBeDownloaded,te.dispose(),Y!=null&&typeof Y=="function"&&Y($)};this.loadLinesURL=(j,G,W,K,ee,q,ie)=>{var Y=0;this.toBeDownloaded+=1;var te=!!(ie&&ie.isInline)&&ie.isInline,F=ie&&ie.anatomicalId?ie.anatomicalId:void 0,$=ie&&ie.renderOrder?ie.renderOrder:void 0;W!=null&&(Y=!!W);var Q=0;if(K!=null&&(Q=!!K),te){var V=M.parse(G);E(j,Y,Q,ee,F,$,ie.lod,q)(V.geometry,V.materials)}else M.load(G,E(j,Y,Q,ee,F,$,ie.lod,q),this.onProgress(G),this.onError(q),ie.loaderOptions)};var S=(j,G,W,K,ee,q)=>{var ie=q&&q.isInline?q.isInline:void 0,Y=q&&q.anatomicalId?q.anatomicalId:void 0,te=q&&q.displayLabels?q.displayLabels:void 0,F=q&&q.renderOrder?q.renderOrder:void 0,$=new(u(18)).Glyphset;$.setDuration(b.getDuration()),$.groupName=K;var Q=()=>{--this.toBeDownloaded,ee!=null&&typeof ee=="function"&&ee($)};++this.toBeDownloaded,ie?$.load(G,W,Q,ie,te):$.load(G,f(W),Q,ie,te),$.anatomicalId=Y,$.setRenderOrder(F),j.addZincObject($)},w=(j,G,W,K,ee,q)=>()=>{if(G.readyState==4&&G.status==200){var ie=JSON.parse(G.responseText);S(j,ie,W,K,ee,q)}},A=(j,G,W,K,ee,q,ie)=>(Y,te)=>{var F=new(u(22)).Pointset,$=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});te&&te[0]&&(1>te[0].opacity&&($.transparent=!0),$.opacity=te[0].opacity,$.color=te[0].color,$.morphTargets=G,$.vertexColors=te[0].vertexColors);var Q={};Q.localTimeEnabled=G,Q.localMorphColour=W,F&&(F.createMesh(Y,$,Q),F.setName(K),F.anatomicalId=ee,j.addZincObject(F),F.setDuration(b.getDuration()),F.setRenderOrder(q)),Y.dispose(),--this.toBeDownloaded,ie!=null&&typeof ie=="function"&&ie(F)};this.loadSTL=(j,G,W,K)=>{this.toBeDownloaded+=1;var ee=u(0).defaultMaterialColor,q=u(0).defaultOpacity,ie=new p;ie.crossOrigin="Anonymous",ie.load(f(G),L(j,ee,q,!1,!1,W,void 0,void 0,void 0,K))},this.loadOBJ=(j,G,W,K)=>{this.toBeDownloaded+=1;var ee=u(0).defaultMaterialColor,q=u(0).defaultOpacity,ie=new y;ie.crossOrigin="Anonymous",ie.load(f(G),L(j,ee,q,!1,!1,W,void 0,void 0,void 0,K))};var I=(j,G,W,K,ee,q,ie)=>{this.toBeDownloaded+=1;var Y=u(0).defaultMaterialColor,te=u(0).defaultOpacity,F=0,$=!!(ie&&ie.isInline)&&ie.isInline,Q=ie&&ie.fileFormat?ie.fileFormat:void 0,V=ie&&ie.anatomicalId?ie.anatomicalId:void 0,z=ie&&ie.renderOrder?ie.renderOrder:void 0;W!=null&&(F=!!W);var oe=0;K!=null&&(oe=!!K);var ae=M;if(Q!==void 0){if(Q=="STL")ae=new p;else if(Q=="OBJ")return ae=new y,ae.crossOrigin="Anonymous",void ae.load(G,objloader(j,Y,te,F,oe,ee,V,q),this.onProgress(G),this.onError,ie.loaderOptions)}if($){var le=M.parse(G);L(j,Y,te,F,oe,ee,V,z,ie,q)(le.geometry,le.materials)}else ae.crossOrigin="Anonymous",M.load(G,L(j,Y,te,F,oe,ee,V,z,ie,q),this.onProgress(G),this.onError(q),ie.loaderOptions)},T=function(G,W,K){var ee=0;return q=>{if(++ee,q&&W!=null&&typeof W=="function"&&W(q),ee==G&&(v==!1&&b.viewAll(),K!=null&&typeof K=="function")){K();var ie=b.getZincCameraControls();ie&&ie.calculateMaxAllowedDistance(b)}}};this.loadPointsetURL=(j,G,W,K,ee,q,ie)=>{var Y=0;this.toBeDownloaded+=1,W!=null&&(Y=!!W);var te=0;K!=null&&(te=!!K);var F=!!(ie&&ie.isInline)&&ie.isInline,$=ie&&ie.anatomicalId?ie.anatomicalId:void 0,Q=ie&&ie.renderOrder?ie.renderOrder:void 0;if(F){var V=M.parse(G);A(j,Y,te,ee,$,Q,q)(V.geometry,V.materials)}else M.load(G,A(j,Y,te,ee,$,Q,q),this.onProgress(G),this.onError(q),ie.loaderOptions)};var P=(j,G,W,K,ee,q)=>{var ie=q&&q.isInline?q.isInline:void 0,Y=q&&q.anatomicalId?q.anatomicalId:void 0,te=q&&q.renderOrder?q.renderOrder:void 0,F=void 0;if(W){if(G&&W.images&&W.images.source)for(var $,Q=W.images.source,V=0;V<Q.length;V++)$=h(Q[V],G),W.images.source[V]=$;if(W.type==="slides"&&(F=new(u(27)).TextureSlides),F){F.groupName=K;var z=()=>{--this.toBeDownloaded,ee!=null&&typeof ee=="function"&&ee(F)};++this.toBeDownloaded,F.load(W,z,ie),F.anatomicalId=Y,F.setRenderOrder(te),j.addZincObject(F)}}},C=(j,G,W,K,ee)=>()=>{if(G.readyState==4&&G.status==200){var q=JSON.parse(G.responseText);P(j,G.responseURL,q,W,K,ee)}};this.loadTextureURL=(j,G,W,K,ee)=>{var q=!!(ee&&ee.isInline)&&ee.isInline;if(q)P(j,void 0,G,W,K,ee);else{var ie=new XMLHttpRequest;ie.onreadystatechange=C(j,ie,W,K,ee),ie.open("GET",f(G),!0),ie.send()}},this.loadGlyphsetURL=(j,G,W,K,ee,q)=>{var ie=!!(q&&q.isInline)&&q.isInline;if(ie)S(j,G,W,K,ee,q);else{var Y=new XMLHttpRequest;Y.onreadystatechange=w(j,Y,W,K,ee,q),Y.open("GET",f(G),!0),Y.send()}};var R=(j,G,W,K,ee,q,ie,Y,te)=>{var F={colour:W,opacity:K,localTimeEnabled:ee,localMorphColour:q},$=new(u(3)).Geometry;return $.createMesh(G,Y,F),$.getMorph()?($.setName(te),j&&j.addZincObject($),$.setDuration(b.getDuration()),$.videoHandler&&b.setVideoHandler($.videoHandler),$):void 0},L=(j,G,W,K,ee,q,ie,Y,te,F)=>($,Q)=>{var V;Q&&Q[0]&&(V=Q[0]);var z=R(j,$,G,W,K,ee,void 0,V,q);if(z.anatomicalId=ie,z.setRenderOrder(Y),te.lod&&te.lod.levels)for(var[oe,ae]of Object.entries(te.lod.levels))z.addLOD(M,oe,ae.URL,ae.Index,te.lod.preload);--this.toBeDownloaded,$.dispose(),F!=null&&typeof F=="function"&&F(z)},N=j=>{var G=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,W,K,ee,q,ie,Y,te]=j.match(G);return{years:W,months:K,weeks:ee,days:q,hours:ie,mins:Y,secs:te}};this.loadSettings=j=>{if(j){if(j.Duration){var G=N(j.Duration);b.setDurationFromObject(G)}if(j.OriginalDuration){var W=N(j.OriginalDuration);b.setOriginalDurationFromObject(W)}if(j.TimeStamps)for(var K in j.TimeStamps){var ee=N(j.TimeStamps[K]);b.addMetadataTimeStamp(K,ee)}}};var x=(j,G,W,K,ee)=>{if(W){var q=void 0,ie=!1;W.URL?(q=W.URL,G&&(q=h(q,G))):W.Inline&&(q=W.Inline.URL,ie=!0);var Y={};if(W.LOD&&W.LOD.Levels){Y.preload=!!W.LOD.Preload,Y.levels={};for(var[te,F]of Object.entries(W.LOD.Levels))Y.levels[te]={},Y.levels[te].URL=h(F.URL,G),Y.levels[te].Index=F.Index}var $=W.GroupName;($===void 0||$==="")&&($="_Unnamed");var Q={loaderOptions:{index:W.Index},isInline:ie,fileFormat:W.FileFormat,anatomicalId:W.AnatomicalId,compression:W.compression,lod:Y,renderOrder:K};switch(W.Type){case"Surfaces":I(j,q,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Glyph":var V;ie?V=W.Inline.GlyphGeometriesURL:(V=W.GlyphGeometriesURL,V=h(W.GlyphGeometriesURL,G)),W.DisplayLabels&&(Q.displayLabels=!0),this.loadGlyphsetURL(j,q,V,$,ee,Q);break;case"Points":this.loadPointsetURL(j,q,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Lines":this.loadLinesURL(j,q,W.MorphVertices,W.MorphColours,$,ee,Q);break;case"Texture":this.loadTextureURL(j,q,$,ee,Q);break}}},O=(j,G,W)=>{if(G){var K=void 0,ee=!1;switch(G.URL?(K=G.URL,j&&(K=h(G.URL,j))):G.Inline&&(K=G.Inline.URL,ee=!0),G.Type){case"View":ee?(b.setupMultipleViews("default",{default:K}),v=!0,W!=null&&typeof W=="function"&&W()):this.loadViewURL(K,W);break;case"Settings":this.loadSettings(G);break}}};this.loadGLTF=(j,G,W,K,ee)=>{var q=new(u(39)).GLTFToZincJSLoader;q.load(b,j,G,W,K,ee)};var B=(j,G,W,K)=>{if(W.Primitives&&W.Primitives.forEach(Y=>{var te=1;Y.Order&&(te=Y.Order),x(j,G,Y,te,K)}),W.Transformation&&j.setTransformation(W.Transformation),W.Children)for(var[ee,q]of Object.entries(W.Children)){var ie=j.findOrCreateChildFromPath(ee);ie&&B(ie,G,q,K)}},D=(j,G)=>{if(Array.isArray(j)){for(var W=0,K=0;K<j.length;K++)j[K].Type&&(G&&j[K].Type==="View"||j[K].Type==="Surfaces"||j[K].Type==="Glyph"||j[K].Type==="Points"||j[K].Type==="Lines"||j[K].Type==="Texture")&&W++;return W}return 0},k=j=>{var G=j.Primitives?D(j.Primitives,!1):0;return j.Children&&Object.values(j.Children).forEach(W=>{G+=k(W)}),G},U=j=>Array.isArray(j)?D(j,!0):typeof j=="object"&&j!==null&&j.Version==="2.0"?k(j.Regions):void 0,H=(j,G,W,K,ee)=>{var q=j;W.RegionPath&&W.RegionPath!==""&&(q=j.findOrCreateChildFromPath(W.RegionPath)),x(q,G,W,2*K,ee)},X=(j,G,W,K,ee)=>{for(var q=U(G),ie=new T(q,K,ee),Y=0;Y<G.length;Y++)O(W,G[Y],ie);for(var te=0;te<G.length;te++)H(j,W,G[te],te,ie)},re=(j,G,W,K,ee)=>{var q=U(G),ie=new T(q,K,ee);G.Settings&&this.loadSettings(G.Settings),G.Views&&_(W,G.Views),G.Regions&&B(j,W,G.Regions,ie)};this.loadMetadataURL=(j,G,W,K)=>{var ee=new XMLHttpRequest,q=f(G);ee.onreadystatechange=()=>{if(ee.readyState==4&&ee.status==200){b.resetMetadata(),b.resetDuration(),v=!1;var ie=ee.responseURL;ie===void 0&&(ie=new URL(q).href);var Y=JSON.parse(ee.responseText);Array.isArray(Y)?X(j,Y,ie,W,K):typeof Y=="object"&&Y!==null&&Y.Version=="2.0"&&re(j,Y,ie,W,K)}},ee.open("GET",q,!0),ee.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,y,m,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(p,function(g){try{y(b.parse(g))}catch(M){d?d(M):console.error(M),b.manager.itemError(p)}},m,d)}parse(p){function y(d,b,v){for(var g=0,M=d.length;g<M;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var m=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(p);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],M=0;5>M;M++)if(y(g,b,M))return!1;return!0}(m)?function(d){for(var b,v,g,M,_,E,S,w,A=new DataView(d),I=A.getUint32(80,!0),T=!1,P=0;P<70;P++)A.getUint32(P,!1)==1129270351&&A.getUint8(P+4)==82&&A.getUint8(P+5)==61&&(T=!0,M=new Float32Array(3*(3*I)),_=A.getUint8(P+6)/255,E=A.getUint8(P+7)/255,S=A.getUint8(P+8)/255,w=A.getUint8(P+9)/255);for(var C=new c.BufferGeometry,R=new Float32Array(3*(3*I)),L=new Float32Array(3*(3*I)),N=0;N<I;N++){var x=84+N*50,O=A.getFloat32(x,!0),B=A.getFloat32(x+4,!0),D=A.getFloat32(x+8,!0);if(T){var k=A.getUint16(x+48,!0);32768&k?(b=_,v=E,g=S):(b=(31&k)/31,v=(31&k>>5)/31,g=(31&k>>10)/31)}for(var U=1;3>=U;U++){var H=x+12*U,X=3*(3*N)+3*(U-1);R[X]=A.getFloat32(H,!0),R[X+1]=A.getFloat32(H+4,!0),R[X+2]=A.getFloat32(H+8,!0),L[X]=O,L[X+1]=B,L[X+2]=D,T&&(M[X]=b,M[X+1]=v,M[X+2]=g)}}return C.setAttribute("position",new c.BufferAttribute(R,3)),C.setAttribute("normal",new c.BufferAttribute(L,3)),T&&(C.setAttribute("color",new c.BufferAttribute(M,3)),C.hasColors=!0,C.alpha=w),C}(m):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,M=/facet([\s\S]*?)endfacet/g,_=0,E=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,S=new RegExp("vertex"+E+E+E,"g"),w=new RegExp("normal"+E+E+E,"g"),A=[],I=[],T=new c.Vector3,P=0,C=0,R=0;(b=g.exec(d))!==null;){C=R;for(var L=b[0];(b=M.exec(L))!==null;){for(var N=0,x=0,O=b[0];(b=w.exec(O))!==null;)T.x=parseFloat(b[1]),T.y=parseFloat(b[2]),T.z=parseFloat(b[3]),x++;for(;(b=S.exec(O))!==null;)A.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),I.push(T.x,T.y,T.z),N++,R++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+_),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+_),_++}var B=C,D=R-C;v.addGroup(B,D,P),P++}return v.setAttribute("position",new c.Float32BufferAttribute(A,3)),v.setAttribute("normal",new c.Float32BufferAttribute(I,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>_});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,p=/^usemtl /,y=/^usemap /,m=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function M(){var E={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(w,A){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=w,void(this.object.fromDeclaration=A!==!1);var I=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:w||"",fromDeclaration:A!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(C,R){var L=this._finalize(!1);L&&(L.inherited||0>=L.groupCount)&&this.materials.splice(L.index,1);var N={index:this.materials.length,name:C||"",mtllib:Array.isArray(R)&&0<R.length?R[R.length-1]:"",smooth:L===void 0?this.smooth:L.smooth,groupStart:L===void 0?0:L.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(O){var B={index:typeof O=="number"?O:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(C){var R=this.currentMaterial();if(R&&R.groupEnd===-1&&(R.groupEnd=this.geometry.vertices.length/3,R.groupCount=R.groupEnd-R.groupStart,R.inherited=!1),C&&1<this.materials.length)for(var L=this.materials.length-1;0<=L;L--)0>=this.materials[L].groupCount&&this.materials.splice(L,1);return C&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),R}},I&&I.name&&typeof I.clone=="function"){var T=I.clone(0);T.inherited=!0,this.object.materials.push(T)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(w,A){var I=parseInt(w,10);return 3*(0<=I?I-1:I+A/3)},parseNormalIndex:function(w,A){var I=parseInt(w,10);return 3*(0<=I?I-1:I+A/3)},parseUVIndex:function(w,A){var I=parseInt(w,10);return 2*(0<=I?I-1:I+A/2)},addVertex:function(w,A,I){var T=this.vertices,P=this.object.geometry.vertices;P.push(T[w+0],T[w+1],T[w+2]),P.push(T[A+0],T[A+1],T[A+2]),P.push(T[I+0],T[I+1],T[I+2])},addVertexPoint:function(w){var A=this.vertices,I=this.object.geometry.vertices;I.push(A[w+0],A[w+1],A[w+2])},addVertexLine:function(w){var A=this.vertices,I=this.object.geometry.vertices;I.push(A[w+0],A[w+1],A[w+2])},addNormal:function(w,A,I){var T=this.normals,P=this.object.geometry.normals;P.push(T[w+0],T[w+1],T[w+2]),P.push(T[A+0],T[A+1],T[A+2]),P.push(T[I+0],T[I+1],T[I+2])},addFaceNormal:function(w,A,I){var T=this.vertices,P=this.object.geometry.normals;m.fromArray(T,w),d.fromArray(T,A),b.fromArray(T,I),g.subVectors(b,d),v.subVectors(m,d),g.cross(v),g.normalize(),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z),P.push(g.x,g.y,g.z)},addColor:function(w,A,I){var T=this.colors,P=this.object.geometry.colors;T[w]!==void 0&&P.push(T[w+0],T[w+1],T[w+2]),T[A]!==void 0&&P.push(T[A+0],T[A+1],T[A+2]),T[I]!==void 0&&P.push(T[I+0],T[I+1],T[I+2])},addUV:function(w,A,I){var T=this.uvs,P=this.object.geometry.uvs;P.push(T[w+0],T[w+1]),P.push(T[A+0],T[A+1]),P.push(T[I+0],T[I+1])},addDefaultUV:function(){var w=this.object.geometry.uvs;w.push(0,0),w.push(0,0),w.push(0,0)},addUVLine:function(w){var A=this.uvs,I=this.object.geometry.uvs;I.push(A[w+0],A[w+1])},addFace:function(w,A,I,T,P,C,R,L,N){var x=this.vertices.length,O=this.parseVertexIndex(w,x),B=this.parseVertexIndex(A,x),D=this.parseVertexIndex(I,x);if(this.addVertex(O,B,D),this.addColor(O,B,D),R!==void 0&&R!==""){var k=this.normals.length;O=this.parseNormalIndex(R,k),B=this.parseNormalIndex(L,k),D=this.parseNormalIndex(N,k),this.addNormal(O,B,D)}else this.addFaceNormal(O,B,D);if(T!==void 0&&T!==""){var U=this.uvs.length;O=this.parseUVIndex(T,U),B=this.parseUVIndex(P,U),D=this.parseUVIndex(C,U),this.addUV(O,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(w){this.object.geometry.type="Points";for(var A,I=this.vertices.length,T=0,P=w.length;T<P;T++)A=this.parseVertexIndex(w[T],I),this.addVertexPoint(A),this.addColor(A)},addLineGeometry:function(w,A){this.object.geometry.type="Line";for(var I=this.vertices.length,T=this.uvs.length,P=0,C=w.length;P<C;P++)this.addVertexLine(this.parseVertexIndex(w[P],I));for(var R=0,L=A.length;R<L;R++)this.addUVLine(this.parseUVIndex(A[R],T))}};return E.startObject("",!1),E}class _ extends c.Loader{constructor(S){super(S),this.materials=null}load(S,w,A,I){var T=this,P=new c.FileLoader(this.manager);P.setPath(this.path),P.setRequestHeader(this.requestHeader),P.setWithCredentials(this.withCredentials),P.load(S,function(C){try{w(T.parse(C))}catch(R){I?I(R):console.error(R),T.manager.itemError(S)}},A,I)}setMaterials(S){return this.materials=S,this}parse(S){var w=new M;S.indexOf(`\r
3228
3228
  `)!==-1&&(S=S.replace(/\r\n/g,`
3229
3229
  `)),S.indexOf(`\\
3230
3230
  `)!==-1&&(S=S.replace(/\\\n/g,""));for(var A=S.split(`
3231
- `),I="",T="",P=0,C=[],R=typeof"".trimLeft=="function",L=0,N=A.length;L<N;L++)if(I=A[L],I=R?I.trimLeft():I.trim(),P=I.length,P!==0&&(T=I.charAt(0),T!=="#"))if(T==="v"){var x=I.split(/\s+/);switch(x[0]){case"v":w.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?w.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):w.colors.push(void 0,void 0,void 0);break;case"vn":w.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":w.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(T==="f"){for(var O,B=I.substr(1).trim(),D=B.split(/\s+/),k=[],U=0,H=D.length;U<H;U++)if(O=D[U],0<O.length){var X=O.split("/");k.push(X)}for(var re=k[0],j=1,G=k.length-1;j<G;j++){var W=k[j],q=k[j+1];w.addFace(re[0],W[0],q[0],re[1],W[1],q[1],re[2],W[2],q[2])}}else if(T==="l"){var ee=I.substring(1).trim().split(" "),K=[],ie=[];if(I.indexOf("/")===-1)K=ee;else for(var Y,te=0,F=ee.length;te<F;te++)Y=ee[te].split("/"),Y[0]!==""&&K.push(Y[0]),Y[1]!==""&&ie.push(Y[1]);w.addLineGeometry(K,ie)}else if(T==="p"){var $=I.substr(1).trim(),Q=$.split(" ");w.addPointGeometry(Q)}else if((C=f.exec(I))!==null){var V=(" "+C[0].substr(1).trim()).substr(1);w.startObject(V)}else if(p.test(I))w.object.startMaterial(I.substring(7).trim(),w.materialLibraries);else if(h.test(I))w.materialLibraries.push(I.substring(7).trim());else if(y.test(I))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(T==="s"){if(C=I.split(" "),1<C.length){var z=C[1].trim().toLowerCase();w.object.smooth=z!=="0"&&z!=="off"}else w.object.smooth=!0;var oe=w.object.currentMaterial();oe&&(oe.smooth=w.object.smooth)}else{if(I==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+I+'"')}w.finalize();var ae=new c.Group;ae.materialLibraries=[].concat(w.materialLibraries);var le=w.objects.length!==1||w.objects[0].geometry.vertices.length!==0;if(le==!0)for(var fe=0,be=w.objects.length;fe<be;fe++){var ye=w.objects[fe],he=ye.geometry,ve=ye.materials,se=he.type==="Line",we=he.type==="Points",pe=!1;if(he.vertices.length!==0){var ge=new c.BufferGeometry;ge.setAttribute("position",new c.Float32BufferAttribute(he.vertices,3)),0<he.normals.length&&ge.setAttribute("normal",new c.Float32BufferAttribute(he.normals,3)),0<he.colors.length&&(pe=!0,ge.setAttribute("color",new c.Float32BufferAttribute(he.colors,3))),he.hasUVIndices===!0&&ge.setAttribute("uv",new c.Float32BufferAttribute(he.uvs,2));for(var Ee=[],He=0,tt=ve.length;He<tt;He++){var Ie=ve[He],ot=Ie.name+"_"+Ie.smooth+"_"+pe,Le=w.materials[ot];if(this.materials!==null){if(Le=this.materials.create(Ie.name),se&&Le&&!(Le instanceof c.LineBasicMaterial)){var Ye=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ye,Le),Ye.color.copy(Le.color),Le=Ye}else if(we&&Le&&!(Le instanceof c.PointsMaterial)){var We=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(We,Le),We.color.copy(Le.color),We.map=Le.map,Le=We}}Le===void 0&&(Le=se?new c.LineBasicMaterial:we?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Le.name=Ie.name,Le.flatShading=!Ie.smooth,Le.vertexColors=pe,w.materials[ot]=Le),Ee.push(Le)}var it=void 0;if(1<Ee.length){for(var et,Mt=0,pt=ve.length;Mt<pt;Mt++)et=ve[Mt],ge.addGroup(et.groupStart,et.groupCount,Mt);it=se?new c.LineSegments(ge,Ee):we?new c.Points(ge,Ee):new c.Mesh(ge,Ee)}else it=se?new c.LineSegments(ge,Ee[0]):we?new c.Points(ge,Ee[0]):new c.Mesh(ge,Ee[0]);it.name=ye.name,ae.add(it)}}else if(0<w.vertices.length){var hn=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Mn=new c.BufferGeometry;Mn.setAttribute("position",new c.Float32BufferAttribute(w.vertices,3)),0<w.colors.length&&w.colors[0]!==void 0&&(Mn.setAttribute("color",new c.Float32BufferAttribute(w.colors,3)),hn.vertexColors=!0);var jn=new c.Points(Mn,hn);ae.add(jn)}return ae}}},(o,l,u)=>{function c(_,E){var S=Object.keys(_);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(_);E&&(w=w.filter(function(A){return Object.getOwnPropertyDescriptor(_,A).enumerable})),S.push.apply(S,w)}return S}function f(_){for(var E,S=1;S<arguments.length;S++)E=arguments[S]==null?{}:arguments[S],S%2?c(Object(E),!0).forEach(function(w){h(_,w,E[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(w){Object.defineProperty(_,w,Object.getOwnPropertyDescriptor(E,w))});return _}function h(_,E,S){return E=p(E),E in _?Object.defineProperty(_,E,{value:S,enumerable:!0,configurable:!0,writable:!0}):_[E]=S,_}function p(_){var E=y(_,"string");return typeof E=="symbol"?E:E+""}function y(_,E){if(typeof _!="object"||!_)return _;var S=_[Symbol.toPrimitive];if(S!==void 0){var w=S.call(_,E||"default");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(_)}var m=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=_=>{var E=(w,A)=>{w.merge(A)};if(_&&0<_.length){for(;1<_.length;){var S=_.splice(1,1);E(_[0],S[0])}return _[0]}},g=function(E,S,w){var A=new b,I=new m;A.crossOrigin=S;var T=E,P=w,C=void 0,R=!1,L=!1,N=void 0,x=[],O=U=>{var H=C[U.index];if(H){var X=I.parse(H);U.onLoad(X.geometry,X.materials)}else B(U)},B=U=>{U.onError&&(!N&&(N={responseURL:T}),U.onError(N))};this.downloadCompleted=U=>{try{C=JSON.parse(U[0]),R=!1,L=!0,Array.isArray(C)?x.forEach(H=>O(H)):x.forEach(H=>B(H))}catch{x.forEach(X=>B(X))}};var D=()=>U=>{N=U,L=!0,R=!1,x.forEach(H=>{B(H)})},k=()=>U=>{x.forEach(H=>{H.onProgress&&H.onProgress(U)})};this.load=(U,H,X,re)=>{var j={index:U,onLoad:H,onProgress:X,onError:re};L?C?O(j):B(N):R?x.push(j):(x.push(j),R=!0,A.load(T,P,k,D))}},M=function(E,S){var w=[],A=E,I=S,T=0;this.itemDownloaded=(P,C)=>{if(w[P]=C,T++,T==A){for(var R=w[0][1],L=w.map(O=>O[0]),N=v(L),x=1;x<A;x++)w[P][0].dispose(),w[P][1].forEach(O=>O.dispose());I(N,R)}}};l.PrimitivesLoader=function(){var _=0,E=20;this.crossOrigin="Anonymous";var S=new m,w=[],A={},I=(R,L,N,x,O)=>{var B=R.length,D=new M(B,L),k=0;R.forEach(U=>{var H=O?f({},O):{};H.msHandler=D,H.order=k,k++,P(U,L,N,x,H)})},T=(R,L,N,x,O)=>{var B=O?f({},O):{},D=A[R];if(!D)if(E>_){var k=new C(void 0,this,B);++_,D=new g(R,this.crossOrigin,k),A[R]=D}else w.push({url:R,onLoad:L,onProgress:N,onError:x,options:O});D&&(B.isHandler=D,D.load(O.index,L,N,x))},P=(R,L,N,x,O)=>{if(O&&O.index!==void 0)T(R,L,N,x,O);else if(E>_){++_;var B=new C(L,this,O),D=new C(x,this,O);S.crossOrigin=this.crossOrigin,S.load(R,B,N,D)}else w.push({url:R,onLoad:L,onProgress:N,onError:x,options:O})};this.load=(R,L,N,x,O)=>{Array.isArray(R)?I(R,L,N,x,O):P(R,L,N,x,O)},this.loadFromWaitingList=()=>{for(;E>_;){var R=w.shift();if(R)this.load(R.url,R.onLoad,R.onProgress,R.onError,R.options);else return}},this.itemRemainingCheck=()=>{if(w.length===0&&_==0)for(var R in A)A.hasOwnProperty(R)&&delete A[R]};var C=function(L,N,x){return function(){--_;for(var O=arguments.length,B=Array(O),D=0;D<O;D++)B[D]=arguments[D];x!=null&&x.msHandler?x.msHandler.itemDownloaded(x.order,B):x!=null&&x.isHandler?x.isHandler.downloadCompleted(B):L&&L(...B),N.loadFromWaitingList(),N.itemRemainingCheck()}};this.parse=R=>S.parse(R)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(p,y,m,d)=>{var b=y;if(m!==0){if(p.type!=="Object3D"){var v;if(p.type==="Mesh"?v=new(u(3)).Geometry:p.type==="LineSegments"?v=new(u(24)).Lines:p.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,M=!1;p.geometry&&p.geometry.morphAttributes&&(g=!!p.geometry.morphAttributes.position,M=!!p.geometry.morphAttributes.color),v.setMesh(p.clone(),g,M);var _=v.getMorph();v.groupName=_.name,_.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(p.name!==""&&(y&&(b=y.findOrCreateChildFromPath(p.name)),b)){var E=b.getGroup();E.position.copy(p.position),E.rotation.copy(p.rotation),E.quaternion.copy(p.quaternion),E.matrixAutoUpdate=!0}}m++,p.children.forEach(S=>{h.parseGLTFObjects(S,b,m,d)})},this.setCamera=p=>{p.viewAll();var y=p.getZincCameraControls(),m=y.getCurrentViewport();y.addViewport("default",m),y.setDefaultViewport("default")},this.load=(p,y,m,d,b)=>{var v=m.substring(0,m.lastIndexOf("/")+1),g=m.substring(m.lastIndexOf("/")+1,m.length),M=new c().setPath(v);M.load(g,function(_){console.log(_),h.parseGLTFObjects(_.scene,y,0,d),h.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=XB},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var p=h;this.exportGLTF=y=>{var m=p.getRootRegion(),d=m.getAllObjects(!0),b=[];d.forEach(M=>{M.animationClip&&b.push({clip:M.animationClip[0],mesh:M.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(M=>{v.parse(p.getThreeJSScene(),function(_){M(_)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new C(x)}),this.register(function(x){return new R(x)}),this.register(function(x){return new L(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,O,B){for(var D=new P,k=[],U=0,H=this.pluginCallbacks.length;U<H;U++)k.push(this.pluginCallbacks[U](D));D.setPlugins(k),D.write(x,O,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=h.NEAREST,p[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=h.LINEAR,p[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,p[c.RepeatWrapping]=h.REPEAT,p[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,d=1179937895,b=2,v=8,g=1313821514,M=5130562;function _(N,x){return N.length===x.length&&N.every(function(O,B){return O===x[B]})}function E(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var x,O=new Uint8Array(new ArrayBuffer(N.length)),B=0,D=N.length;B<D;B++)x=N.charCodeAt(B),O[B]=255<x?32:x;return O.buffer}function S(N){return _(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function w(N,x,O){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},D=x;D<x+O;D++)for(var k,U=0;U<N.itemSize;U++)k=void 0,4<N.itemSize?k=N.array[D*N.itemSize+U]:U===0?k=N.getX(D):U===1?k=N.getY(D):U===2?k=N.getZ(D):U==3&&(k=N.getW(D)),B.min[U]=Math.min(B.min[U],k),B.max[U]=Math.max(B.max[U],k);return B}function A(N){return 4*Math.ceil(N/4)}function I(N){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,O=A(N.byteLength);if(O!==N.byteLength){var B=new Uint8Array(O);if(B.set(new Uint8Array(N)),x!==0)for(var D=N.byteLength;D<O;D++)B[D]=x;return B.buffer}return N}var T=null;class P{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,O,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var D=this;Promise.all(this.pending).then(function(){var k=D.buffers,U=D.json,H=D.options,X=D.extensionsUsed,re=new Blob(k,{type:"application/octet-stream"}),j=Object.keys(X);if(0<j.length&&(U.extensionsUsed=j),U.buffers&&0<U.buffers.length&&(U.buffers[0].byteLength=re.size),H.binary===!0){var G=new window.FileReader;G.readAsArrayBuffer(re),G.onloadend=function(){var q=I(G.result),ee=new DataView(new ArrayBuffer(v));ee.setUint32(0,q.byteLength,!0),ee.setUint32(4,M,!0);var K=I(E(JSON.stringify(U)),32),ie=new DataView(new ArrayBuffer(v));ie.setUint32(0,K.byteLength,!0),ie.setUint32(4,g,!0);var Y=new ArrayBuffer(m),te=new DataView(Y);te.setUint32(0,d,!0),te.setUint32(4,b,!0);var F=m+ie.byteLength+K.byteLength+ee.byteLength+q.byteLength;te.setUint32(8,F,!0);var $=new Blob([Y,ie,K,ee,q],{type:"application/octet-stream"}),Q=new window.FileReader;Q.readAsArrayBuffer($),Q.onloadend=function(){O(Q.result)}}}else if(U.buffers&&0<U.buffers.length){var W=new window.FileReader;W.readAsDataURL(re),W.onloadend=function(){var q=W.result;U.buffers[0].uri=q,O(U)}}else O(U)})}serializeUserData(x,O){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,D=this.extensionsUsed;try{var k=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&k.gltfExtensions){for(var U in O.extensions===void 0&&(O.extensions={}),k.gltfExtensions)O.extensions[U]=k.gltfExtensions[U],D[U]=!0;delete k.gltfExtensions}0<Object.keys(k).length&&(O.extras=k)}catch(H){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+H.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,D=0,k=x.count;D<k;D++)if(5e-4<Math.abs(B.fromBufferAttribute(x,D).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return O.attributesNormalized.get(x);for(var B=x.clone(),D=new c.Vector3,k=0,U=B.count;k<U;k++)D.fromBufferAttribute(B,k),D.x===0&&D.y===0&&D.z===0?D.setX(1):D.normalize(),B.setXYZ(k,D.x,D.y,D.z);return O.attributesNormalized.set(x,B),B}applyTextureTransform(x,O){var B=!1,D={};(O.offset.x!==0||O.offset.y!==0)&&(D.offset=O.offset.toArray(),B=!0),O.rotation!==0&&(D.rotation=O.rotation,B=!0),(O.repeat.x!==1||O.repeat.y!==1)&&(D.scale=O.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=D,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var O=this.json,B=this.buffers;return O.buffers||(O.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,O,B,D,k){var U=this.json;U.bufferViews||(U.bufferViews=[]);for(var H=O===h.UNSIGNED_BYTE?1:O===h.UNSIGNED_SHORT?2:4,X=A(D*x.itemSize*H),re=new DataView(new ArrayBuffer(X)),j=0,G=B;G<B+D;G++)for(var W,q=0;q<x.itemSize;q++)W=void 0,4<x.itemSize?W=x.array[G*x.itemSize+q]:q===0?W=x.getX(G):q===1?W=x.getY(G):q===2?W=x.getZ(G):q==3&&(W=x.getW(G)),O===h.FLOAT?re.setFloat32(j,W,!0):O===h.UNSIGNED_INT?re.setUint32(j,W,!0):O===h.UNSIGNED_SHORT?re.setUint16(j,W,!0):O===h.UNSIGNED_BYTE&&re.setUint8(j,W),j+=H;var ee={buffer:this.processBuffer(re.buffer),byteOffset:this.byteOffset,byteLength:X};k!==void 0&&(ee.target=k),k===h.ARRAY_BUFFER&&(ee.byteStride=x.itemSize*H),this.byteOffset+=X,U.bufferViews.push(ee);var K={id:U.bufferViews.length-1,byteLength:0};return K}processBufferViewImage(x){var O=this,B=O.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(D){var k=new window.FileReader;k.readAsArrayBuffer(x),k.onloadend=function(){var U=I(k.result),H={buffer:O.processBuffer(U),byteOffset:O.byteOffset,byteLength:U.byteLength};O.byteOffset+=U.byteLength,D(B.bufferViews.push(H)-1)}})}processAccessor(x,O,B,D){var k,U=this.options,H=this.json;if(x.array.constructor===Float32Array)k=h.FLOAT;else if(x.array.constructor===Uint32Array)k=h.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)k=h.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)k=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),D===void 0&&(D=x.count),U.truncateDrawRange&&O!==void 0&&O.index===null){var X=B+D,re=O.drawRange.count===1/0?x.count:O.drawRange.start+O.drawRange.count;B=Math.max(B,O.drawRange.start),D=Math.min(X,re)-B,0>D&&(D=0)}if(D===0)return null;var j,G=w(x,B,D);O!==void 0&&(j=x===O.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var W=this.processBufferView(x,k,B,D,j),q={bufferView:W.id,byteOffset:W.byteOffset,componentType:k,count:D,max:G.max,min:G.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(q.normalized=!0),H.accessors||(H.accessors=[]),H.accessors.push(q)-1}processImage(x,O,B){var D=this,k=D.cache,U=D.json,H=D.options,X=D.pending;k.images.has(x)||k.images.set(x,{});var re=k.images.get(x),j=O===c.RGBAFormat?"image/png":"image/jpeg",G=j+":flipY/"+B.toString();if(re[G]!==void 0)return re[G];U.images||(U.images=[]);var W={mimeType:j};if(H.embedImages){var q=T=T||document.createElement("canvas");q.width=Math.min(x.width,H.maxTextureSize),q.height=Math.min(x.height,H.maxTextureSize);var ee=q.getContext("2d");if(B===!0&&(ee.translate(0,q.height),ee.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)ee.drawImage(x,0,0,q.width,q.height);else{O!==c.RGBAFormat&&O!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>H.maxTextureSize||x.height>H.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var K=new Uint8ClampedArray(4*(x.height*x.width));if(O===c.RGBAFormat)for(var ie=0;ie<K.length;ie+=4)K[ie+0]=x.data[ie+0],K[ie+1]=x.data[ie+1],K[ie+2]=x.data[ie+2],K[ie+3]=x.data[ie+3];else for(var Y=0,te=0;Y<K.length;Y+=4,te+=3)K[Y+0]=x.data[te+0],K[Y+1]=x.data[te+1],K[Y+2]=x.data[te+2],K[Y+3]=255;ee.putImageData(new ImageData(K,x.width,x.height),0,0)}H.binary===!0?X.push(new Promise(function($){q.toBlob(function(Q){D.processBufferViewImage(Q).then(function(V){W.bufferView=V,$()})},j)})):W.uri=q.toDataURL(j)}else W.uri=x.src;var F=U.images.push(W)-1;return re[G]=F,F}processSampler(x){var O=this.json;O.samplers||(O.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return O.samplers.push(B)-1}processTexture(x){var O=this.cache,B=this.json;if(O.textures.has(x))return O.textures.get(x);B.textures||(B.textures=[]);var D={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(D.name=x.name),this._invokeAll(function(U){U.writeTexture&&U.writeTexture(x,D)});var k=B.textures.push(D)-1;return O.textures.set(x,k),k}processMaterial(x){var O=this.cache,B=this.json;if(O.materials.has(x))return O.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var D={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var k=x.color.toArray().concat([x.opacity]);if(_(k,[1,1,1,1])||(D.pbrMetallicRoughness.baseColorFactor=k),x.isMeshStandardMaterial?(D.pbrMetallicRoughness.metallicFactor=x.metalness,D.pbrMetallicRoughness.roughnessFactor=x.roughness):(D.pbrMetallicRoughness.metallicFactor=.5,D.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var U={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(U,x.metalnessMap),D.pbrMetallicRoughness.metallicRoughnessTexture=U}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var H={index:this.processTexture(x.map)};this.applyTextureTransform(H,x.map),D.pbrMetallicRoughness.baseColorTexture=H}if(x.emissive){var X=x.emissive.clone().multiplyScalar(x.emissiveIntensity),re=Math.max(X.r,X.g,X.b);if(1<re&&(X.multiplyScalar(1/re),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<re&&(D.emissiveFactor=X.toArray()),x.emissiveMap){var j={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(j,x.emissiveMap),D.emissiveTexture=j}}if(x.normalMap){var G={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),G.scale=x.normalScale.x),this.applyTextureTransform(G,x.normalMap),D.normalTexture=G}if(x.aoMap){var W={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(W.strength=x.aoMapIntensity),this.applyTextureTransform(W,x.aoMap),D.occlusionTexture=W}x.transparent?D.alphaMode="BLEND":0<x.alphaTest&&(D.alphaMode="MASK",D.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(D.doubleSided=!0),x.name!==""&&(D.name=x.name),this.serializeUserData(x,D),this._invokeAll(function(ee){ee.writeMaterial&&ee.writeMaterial(x,D)});var q=B.materials.push(D)-1;return O.materials.set(x,q),q}processMesh(x){var O=this.cache,B=this.json,D=[x.geometry.uuid];if(Array.isArray(x.material))for(var k=0,U=x.material.length;k<U;k++)D.push(x.material[k].uuid);else D.push(x.material.uuid);var H=D.join(":");if(O.meshes.has(H))return O.meshes.get(H);var X,re=x.geometry;if(X=x.isLineSegments?h.LINES:x.isLineLoop?h.LINE_LOOP:x.isLine?h.LINE_STRIP:x.isPoints?h.POINTS:x.material.wireframe?h.LINES:h.TRIANGLES,re.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var j={},G={},W=[],q=[],ee={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},K=re.getAttribute("normal");K===void 0||this.isNormalizedNormalAttribute(K)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),re.setAttribute("normal",this.createNormalizedNormalAttribute(K)));var ie=null;for(var Y in re.attributes)if(Y.substr(0,5)!=="morph"){var te=re.attributes[Y];Y=ee[Y]||Y.toUpperCase();var F=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(F.test(Y)||(Y="_"+Y),O.attributes.has(this.getUID(te))){G[Y]=O.attributes.get(this.getUID(te));continue}ie=null;var $=te.array;Y!=="JOINTS_0"||$ instanceof Uint16Array||$ instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),ie=new c.BufferAttribute(new Uint16Array($),te.itemSize,te.normalized));var Q=this.processAccessor(ie||te,re);Q!==null&&(G[Y]=Q,O.attributes.set(this.getUID(te),Q))}if(K!==void 0&&re.setAttribute("normal",K),Object.keys(G).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var V=[],z=[],oe={};if(x.morphTargetDictionary!==void 0)for(var ae in x.morphTargetDictionary)oe[x.morphTargetDictionary[ae]]=ae;for(var le=0;le<x.morphTargetInfluences.length;++le){var fe={},be=!1;for(var ye in re.morphAttributes){if(ye!="position"&&ye!=="normal"&&ye!=="color"){be||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),be=!0);continue}var he=re.morphAttributes[ye][le],ve=ye.toUpperCase();ee[ye]&&(ve=ee[ye]);var se=re.attributes[ye];if(O.attributes.has(this.getUID(he))){fe[ve]=O.attributes.get(this.getUID(he));continue}var we=se.clone();if(!re.morphTargetsRelative)if(se)for(var pe=0,ge=he.count;pe<ge;pe++)se.count>pe&&we.setXYZ(pe,he.getX(pe)-se.getX(pe),he.getY(pe)-se.getY(pe),he.getZ(pe)-se.getZ(pe));else for(var Ee=0,He=he.count;Ee<He;Ee++)we.setXYZ(Ee,0,0,0);fe[ve]=this.processAccessor(we,re),O.attributes.set(this.getUID(se),fe[ve])}q.push(fe),V.push(x.morphTargetInfluences[le]),x.morphTargetDictionary!==void 0&&z.push(oe[le])}j.weights=V,0<z.length&&(j.extras={},j.extras.targetNames=z)}var tt=Array.isArray(x.material);if(tt&&re.groups.length===0)return null;for(var Ie,ot=tt?x.material:[x.material],Le=tt?re.groups:[{materialIndex:0,start:void 0,count:void 0}],Ye=0,We=Le.length;Ye<We;Ye++){if(Ie={mode:X,attributes:G},this.serializeUserData(re,Ie),0<q.length&&(Ie.targets=q),re.index!==null){var it=this.getUID(re.index);(Le[Ye].start!==void 0||Le[Ye].count!==void 0)&&(it+=":"+Le[Ye].start+":"+Le[Ye].count),O.attributes.has(it)?Ie.indices=O.attributes.get(it):(Ie.indices=this.processAccessor(re.index,re,Le[Ye].start,Le[Ye].count),O.attributes.set(it,Ie.indices)),Ie.indices===null&&delete Ie.indices}var et=this.processMaterial(ot[Le[Ye].materialIndex]);et!==null&&(Ie.material=et),W.push(Ie)}j.primitives=W,B.meshes||(B.meshes=[]),this._invokeAll(function(pt){pt.writeMesh&&pt.writeMesh(x,j)});var Mt=B.meshes.push(j)-1;return O.meshes.set(H,Mt),Mt}processCamera(x){var O=this.json;O.cameras||(O.cameras=[]);var B=x.isOrthographicCamera,D={type:B?"orthographic":"perspective"};return B?D.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:D.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(D.name=x.type),O.cameras.push(D)-1}processAnimation(x,O){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),O);for(var k=x.tracks,U=[],H=[],X=0;X<k.length;++X){var re=k[X],j=c.PropertyBinding.parseTrackName(re.name),G=c.PropertyBinding.findNode(O,j.nodeName),W=y[j.propertyName];if(j.objectName==="bones"&&(G.isSkinnedMesh===!0?G=G.skeleton.getBoneByName(j.objectIndex):G=void 0),!G||!W)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',re.name),null;var q=1,ee=re.values.length/re.times.length;W===y.morphTargetInfluences&&(ee/=G.morphTargetInfluences.length);var K=void 0;re.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(K="CUBICSPLINE",ee/=3):re.getInterpolation()===c.InterpolateDiscrete?K="STEP":K="LINEAR",H.push({input:this.processAccessor(new c.BufferAttribute(re.times,q)),output:this.processAccessor(new c.BufferAttribute(re.values,ee)),interpolation:K}),U.push({sampler:H.length-1,target:{node:D.get(G),path:W}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:H,channels:U}),B.animations.length-1}processSkin(x){var O=this.json,B=this.nodeMap,D=O.nodes[B.get(x)],k=x.skeleton;if(k===void 0)return null;var U=x.skeleton.bones[0];if(U===void 0)return null;for(var H=[],X=new Float32Array(16*k.bones.length),re=new c.Matrix4,j=0;j<k.bones.length;++j)H.push(B.get(k.bones[j])),re.copy(k.boneInverses[j]),re.multiply(x.bindMatrix).toArray(X,16*j);O.skins===void 0&&(O.skins=[]),O.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(X,16)),joints:H,skeleton:B.get(U)});var G=D.skin=O.skins.length-1;return G}processNode(x){var O=this.json,B=this.options,D=this.nodeMap;O.nodes||(O.nodes=[]);var k={};if(B.trs){var U=x.quaternion.toArray(),H=x.position.toArray(),X=x.scale.toArray();_(U,[0,0,0,1])||(k.rotation=U),_(H,[0,0,0])||(k.translation=H),_(X,[1,1,1])||(k.scale=X)}else x.matrixAutoUpdate&&x.updateMatrix(),S(x.matrix)===!1&&(k.matrix=x.matrix.elements);if(x.name!==""&&(k.name=x.name+""),this.serializeUserData(x,k),x.isMesh||x.isLine||x.isPoints){var re=this.processMesh(x);re!==null&&(k.mesh=re)}else x.isCamera&&(k.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var j,G=[],W=0,q=x.children.length;W<q;W++)if(j=x.children[W],j.visible||B.onlyVisible===!1){var ee=this.processNode(j);ee!==null&&G.push(ee)}0<G.length&&(k.children=G)}this._invokeAll(function(ie){ie.writeNode&&ie.writeNode(x,k)});var K=O.nodes.push(k)-1;return D.set(x,K),K}processScene(x){var O=this.json,B=this.options;O.scenes||(O.scenes=[],O.scene=0);var D={};x.name!==""&&(D.name=x.name),O.scenes.push(D);for(var k,U=[],H=0,X=x.children.length;H<X;H++)if(k=x.children[H],k.visible||B.onlyVisible===!1){var re=this.processNode(k);re!==null&&U.push(re)}0<U.length&&(D.nodes=U),this.serializeUserData(x,D)}processObjects(x){var O=new c.Scene;O.name="AuxScene";for(var B=0;B<x.length;B++)O.children.push(x[B]);this.processScene(O)}processInput(x){var O=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(H){H.beforeParse&&H.beforeParse(x)});for(var B=[],D=0;D<x.length;D++)x[D]instanceof c.Scene?this.processScene(x[D]):B.push(x[D]);0<B.length&&this.processObjects(B);for(var k=0;k<this.skins.length;++k)this.processSkin(this.skins[k]);for(var U=0;U<O.animations.length;++U)this.processAnimation(O.animations[U].clip,O.animations[U].mesh);this._invokeAll(function(H){H.afterParse&&H.afterParse(x)})}_invokeAll(x){for(var O=0,B=this.plugins.length;O<B;O++)x(this.plugins[O])}}class C{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,O){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,D=B.json,k=B.extensionsUsed,U={};x.name&&(U.name=x.name),U.color=x.color.toArray(),U.intensity=x.intensity,x.isDirectionalLight?U.type="directional":x.isPointLight?(U.type="point",0<x.distance&&(U.range=x.distance)):x.isSpotLight&&(U.type="spot",0<x.distance&&(U.range=x.distance),U.spot={},U.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),U.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),k[this.name]||(D.extensions=D.extensions||{},D.extensions[this.name]={lights:[]},k[this.name]=!0);var H=D.extensions[this.name].lights;H.push(U),O.extensions=O.extensions||{},O.extensions[this.name]={light:H.length-1}}}}class R{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,O){if(x.isMeshBasicMaterial){var B=this.writer,D=B.extensionsUsed;O.extensions=O.extensions||{},O.extensions[this.name]={},D[this.name]=!0,O.pbrMetallicRoughness.metallicFactor=0,O.pbrMetallicRoughness.roughnessFactor=.9}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,O){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,D=B.extensionsUsed,k={};O.pbrMetallicRoughness.baseColorFactor&&(k.diffuseFactor=O.pbrMetallicRoughness.baseColorFactor);var U=[1,1,1];if(x.specular.toArray(U,0),k.specularFactor=U,k.glossinessFactor=x.glossiness,O.pbrMetallicRoughness.baseColorTexture&&(k.diffuseTexture=O.pbrMetallicRoughness.baseColorTexture),x.specularMap){var H={index:B.processTexture(x.specularMap)};B.applyTextureTransform(H,x.specularMap),k.specularGlossinessTexture=H}O.extensions=O.extensions||{},O.extensions[this.name]=k,D[this.name]=!0}}}f.Utils={insertKeyframe:function(x,O){var B,D=.001,k=x.getValueSize(),U=new x.TimeBufferType(x.times.length+1),H=new x.ValueBufferType(x.values.length+k),X=x.createInterpolant(new x.ValueBufferType(k));if(x.times.length===0){U[0]=O;for(var re=0;re<k;re++)H[re]=0;B=0}else if(O<x.times[0]){if(Math.abs(x.times[0]-O)<D)return 0;U[0]=O,U.set(x.times,1),H.set(X.evaluate(O),0),H.set(x.values,k),B=0}else if(O>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-O)<D)return x.times.length-1;U[U.length-1]=O,U.set(x.times,0),H.set(x.values,0),H.set(X.evaluate(O),x.values.length),B=U.length-1}else for(var j=0;j<x.times.length;j++){if(Math.abs(x.times[j]-O)<D)return j;if(x.times[j]<O&&x.times[j+1]>O){U.set(x.times.slice(0,j+1),0),U[j+1]=O,U.set(x.times.slice(j+1),j+2),H.set(x.values.slice(0,(j+1)*k),0),H.set(X.evaluate(O),(j+1)*k),H.set(x.values.slice((j+1)*k),(j+2)*k),B=j+1;break}}return x.times=U,x.values=H,B},mergeMorphTargetTracks:function(x,O){for(var B=[],D={},k=x.tracks,U=0;U<k.length;++U){var H=k[U],X=c.PropertyBinding.parseTrackName(H.name),re=c.PropertyBinding.findNode(O,X.nodeName);if(X.propertyName!=="morphTargetInfluences"||X.propertyIndex===void 0){B.push(H);continue}if(H.createInterpolant!==H.InterpolantFactoryMethodDiscrete&&H.createInterpolant!==H.InterpolantFactoryMethodLinear){if(H.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),H=H.clone(),H.setInterpolation(c.InterpolateLinear)}var j=re.morphTargetInfluences.length,G=re.morphTargetDictionary[X.propertyIndex];if(G===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+X.propertyIndex);var W=void 0;if(D[re.uuid]===void 0){W=H.clone();for(var q=new W.ValueBufferType(j*W.times.length),ee=0;ee<W.times.length;ee++)q[ee*j+G]=W.values[ee];W.name=(X.nodeName||"")+".morphTargetInfluences",W.values=q,D[re.uuid]=W,B.push(W);continue}var K=H.createInterpolant(new H.ValueBufferType(1));W=D[re.uuid];for(var ie=0;ie<W.times.length;ie++)W.values[ie*j+G]=K.evaluate(W.times[ie]);for(var Y,te=0;te<H.times.length;te++)Y=this.insertKeyframe(W,H.times[te]),W.values[Y*j+G]=H.values[te]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var E=this;this.setFromObject=S=>{var{nearPlane:w,farPlane:A,eyePosition:I,targetPosition:T,upVector:P}=S;E.nearPlane=w,E.farPlane=A,E.eyePosition=I,E.targetPosition=T,E.upVector=P}},p=function(E,S,w,A){var I={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},T={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},P={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},C={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},R={};R.MAIN=T.ROTATE,R.AUXILIARY=T.ZOOM,R.SECONDARY=T.PAN,this.cameraObject=E,this.domElement=S===void 0?document:S,this.renderer=w,this.scene=A,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var L=6e3,N=!0,x=0,O=void 0,B=void 0,D=!1,k=500,U=void 0,H="default",X=I.DEFAULT,re=void 0,j=void 0,G=void 0,W=0,q=P.FREE;this._state=T.NONE;var ee;this.targetTouchId=-1;var K=void 0,ie=new c.Vector3,Y=new c.Vector3,te=new c.Vector3,F=new c.Vector3,$=new c.Vector3,Q=new c.Vector3,V=new c.Vector3,z=new c.Vector3,oe=new c.Sphere,ae=new c.Vector3,le=!1,fe=void 0,be=0,ye={default:new h};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=ne=>{var Me=ne.getBoundingBox();if(Me){Me.getBoundingSphere(oe),be=6*oe.radius;var Ce=0;this.cameraObject&&(Ce=this.cameraObject.position.distanceTo(oe.center)),be=Ce>be?Ce:be}else be=0},this.addViewport=(ne,Me)=>{ne&&Me&&(ye[ne]=Me)},this.setDefaultViewport=ne=>!!(ne&&ne in ye)&&(H=ne,!0),this.getDefaultViewport=()=>H,this.getViewportOfName=ne=>ye[ne],this.setCurrentViewport=ne=>ne in ye&&(this.setCurrentCameraSettings(ye[ne]),!0),this.setRotationMode=ne=>{switch(ne){case"none":q=P.NONE;break;case"horizontal":q=P.HORIZONTAL;break;case"vertical":q=P.VERTICAL;break;case"free":default:q=P.FREE}},this.onResize=()=>{K&&(K=void 0),fe&&fe.setCurrentCameraSettings(this.cameraObject,ye[H])},this.getVisibleHeightAtZDepth=ne=>{var Me=this.cameraObject.position.distanceTo(this.cameraObject.target);ne<Me?ne-=Me:ne+=Me;var Ce=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ce/2)*Math.abs(ne)},this.calculateHeightPerPixelAtZeroDepth=ne=>{var Me=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=Me/ne,this.pixelHeight},this.getNDCFromDocumentCoords=(ne,Me,Ce)=>{Le(!1);var Be=Ce||new c.Vector2,Je=2*((ne-K.left)/K.width)-1,Z=2*-((Me-K.top)/K.height)+1;return Be.set(Je,Z)},this.getRelativeCoordsFromNDC=(ne,Me,Ce)=>{Le(!1);var Be=Ce||new c.Vector2;return Be.x=(ne+1)*K.width/2,Be.y=(1-Me)*K.height/2,Be},this.setMouseButtonAction=(ne,Me)=>{R[ne]=T[Me]};var he=(ne,Me)=>{ne instanceof HTMLCanvasElement&&(ne.tabIndex=Me)},ve=()=>{if(0<be){var ne=ae.distanceTo(oe.center);return be>ne||this.cameraObject.position.distanceTo(oe.center)>ne}return!0},se=ne=>{ae.copy(this.cameraObject.position).add(ne),ve()&&(this.cameraObject.target.add(ne),this.cameraObject.position.add(ne),this.updateDirectionalLight())},we=ne=>{Le(!1);var Me;if(X===I.DEFAULT&&(Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,ne)),!Me)ne.button==0?ne.ctrlKey?this._state=R.AUXILIARY:ne.shiftKey?this._state=R.SECONDARY:this._state=R.MAIN:ne.button==1?(ne.preventDefault(),this._state=R.AUXILIARY):ne.button==2&&(this._state=R.SECONDARY),this.pointer_x=ne.clientX-K.left,this.pointer_y=ne.clientY-K.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{X=I.MINIMAP;var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);se(Ce)}},pe=ne=>{if(Le(!1),K)if(this.pointer_x=ne.clientX-K.left,this.pointer_y=ne.clientY-K.top,X===I.MINIMAP){var Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,ne);if(Me){var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);se(Ce)}}else this._state===T.NONE&&ee!==void 0&&ee.move(this,ne.clientX,ne.clientY,this.renderer)},ge=ne=>{this._state=T.NONE,X==I.MINIMAP&&(X=I.DEFAULT),ee!==void 0&&this.pointer_x_start==ne.clientX-K.left&&this.pointer_y_start==ne.clientY-K.top&&ee.pick(this,ne.clientX,ne.clientY,this.renderer)},Ee=ne=>{this._state=T.NONE},He=ne=>{Le(!1);var Me=ne.touches.length;if(Me==1){var Ce,Be;this._state=T.TOUCH_ROTATE,this.pointer_x=ne.touches[0].clientX-((Ce=K)===null||Ce===void 0?void 0:Ce.left),this.pointer_y=ne.touches[0].clientY-((Be=K)===null||Be===void 0?void 0:Be.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(Me==2){this._state=T.TOUCH_ZOOM;var Je=ne.touches[0].clientX-ne.touches[1].clientX,Z=ne.touches[0].clientY-ne.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Je*Je+Z*Z)}else if(Me==3){var de,ce;this._state=T.TOUCH_PAN,this.targetTouchId=ne.touches[0].identifier,this.pointer_x=ne.touches[0].clientX-((de=K)===null||de===void 0?void 0:de.left),this.pointer_y=ne.touches[0].clientY-((ce=K)===null||ce===void 0?void 0:ce.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},tt=ne=>{ne.preventDefault(),ne.stopPropagation();var Me=ne.touches.length;if(Me==1)this.pointer_x=ne.touches[0].clientX-K.left,this.pointer_y=ne.touches[0].clientY-K.top;else if(Me==2){if(this._state===T.TOUCH_ZOOM){var Ce=ne.touches[0].clientX-ne.touches[1].clientX,Be=ne.touches[0].clientY-ne.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ce*Ce+Be*Be)}}else if(Me==3&&this._state===T.TOUCH_PAN)for(var Je=0;3>Je;Je++)ne.touches[Je].identifier==this.targetTouchId&&(this.pointer_x=ne.touches[0].clientX-K.left,this.pointer_y=ne.touches[0].clientY-K.top)},Ie=ne=>{var Me=ne.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=T.NONE,Me==1&&ee!==void 0&&this.pointer_x_start==ne.touches[0].clientX-K.left&&this.pointer_y_start==ne.touches[0].clientY-K.top&&ee.pick(this.cameraObject,ne.touches[0].clientX,ne.touches[0].clientY,this.renderer)},ot=()=>{Le(!0)},Le=ne=>{if(ne||K===void 0){var Me=new IntersectionObserver(Ce=>{for(var Be of Ce)K=Be.boundingClientRect;Me.disconnect()});Me.observe(this.domElement)}},Ye=ne=>{Le(!1),this._state=T.SCROLL;var Me=0;0<ne.deltaY?Me=this.zoomRate:0>ne.deltaY&&(Me=-1*this.zoomRate),W+=Me,ne.preventDefault(),ne.stopImmediatePropagation()},We=ne=>{Le(!1);var Me=0;if(ne.keyCode===C.EQUAL||ne.keyCode===C.MINUS||ne.keyCode===C.NUMPADADD||ne.keyCode===C.NUMPADSUBTRACT){this._state=T.KEYBOARD_ZOOM;var Ce=1;ne.shiftKey&&(Ce*=2),ne.keyCode===C.EQUAL||ne.keyCode===C.NUMPADADD?Me=-1*(this.zoomRate*Ce):(ne.keyCode===C.MINUS||ne.keyCode===C.NUMPADSUBTRACT)&&(Me=this.zoomRate*Ce),W+=Me}else(ne.keyCode===C.ARROWLEFT||ne.keyCode===C.ARROWUP||ne.keyCode===C.ARROWRIGHT||ne.keyCode===C.ARROWDOWN)&&(ne.shiftKey?(this._state=T.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,Me=this.rotateRate):(this._state=T.KEYBOARD_PAN,Me=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,ne.keyCode===C.ARROWLEFT?this.pointer_x=this.pointer_x-Me-K.left:ne.keyCode===C.ARROWUP?this.pointer_y=this.pointer_y-Me-K.left:ne.keyCode===C.ARROWRIGHT?this.pointer_x=this.pointer_x+Me-K.top:ne.keyCode===C.ARROWDOWN&&(this.pointer_y=this.pointer_y+Me-K.top))},it=ne=>{this._state=T.NONE},et=()=>{if(typeof this.cameraObject<"u"){var ne=K.height,Me=this.cameraObject.position.distanceTo(this.cameraObject.target),Ce=0;this.cameraObject.far>this.cameraObject.near&&Me>=this.cameraObject.near&&Me<=this.cameraObject.far&&(Ce=(Me-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),Y.set(this.previous_pointer_x,ne-this.previous_pointer_y,0),te.set(this.previous_pointer_x,ne-this.previous_pointer_y,1),F.set(this.pointer_x,ne-this.pointer_y,0),$.set(this.pointer_x,ne-this.pointer_y,1),Y.unproject(this.cameraObject),te.unproject(this.cameraObject),F.unproject(this.cameraObject),$.unproject(this.cameraObject);var Be=-.002;F.sub(Y).multiplyScalar(1-Ce),$.sub(te).multiplyScalar(Ce),F.add($).multiplyScalar(Be),se(F)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(ne,Me)=>{ne.normalize(),V.copy(this.cameraObject.position).sub(this.cameraObject.target),z.copy(V),V.normalize(),.8<Math.abs(V.dot(ne))&&V.copy(this.cameraObject.up),Y.crossVectors(ne,V).normalize(),te.crossVectors(ne,Y);var Ce=ne.dot(z),Be=Y.dot(z),Je=te.dot(z),Z=ne.dot(this.cameraObject.up),de=Y.dot(this.cameraObject.up),ce=te.dot(this.cameraObject.up),me=Math.cos(Me),Se=Math.sin(Me);return F.set(me*Y.x+Se*te.x,me*Y.y+Se*te.y,me*Y.z+Se*te.z),$.set(me*te.x-Se*Y.x,me*te.y-Se*Y.y,me*te.z-Se*Y.z),V.copy(this.cameraObject.target),V.x=V.x+ne.x*Ce+F.x*Be+$.x*Je,V.y=V.y+ne.y*Ce+F.y*Be+$.y*Je,V.z=V.z+ne.z*Ce+F.z*Be+$.z*Je,ie.set(ne.x*Z+F.x*de+$.x*ce,ne.y*Z+F.y*de+$.y*ce,ne.z*Z+F.z*de+$.z*ce),{position:V,up:ie}},this.rotateAboutLookAtpoint=(ne,Me)=>{var Ce=this.getVectorsFromRotateAboutLookAtPoints(ne,Me);this.cameraObject.position.copy(Ce.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ce.up)};var Mt=()=>{if(typeof this.cameraObject<"u"){var ne,Me,Ce=(ne=K)===null||ne===void 0?void 0:ne.width,Be=(Me=K)===null||Me===void 0?void 0:Me.height;if(0<Ce&&0<Be){var Je=.25*(Ce+Be),Z=0,de=0;(q===P.FREE||q===P.HORIZONTAL)&&(Z=this.pointer_x-this.previous_pointer_x),(q===P.FREE||q===P.VERTICAL)&&(de=this.previous_pointer_y-this.pointer_y);var ce=Math.sqrt(Z*Z+de*de);if(0<ce){var me=1*-de/ce,Se=1*Z/ce,ue=0;q===P.FREE&&me*(this.pointer_x-.5*(Ce-1))+Se*(.5*(Be-1)-this.pointer_y);var xe=Math.acos(ue/Je)-.5*Math.PI,Te=this.tumble_rate*ce/Je;ie.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),Y.copy(this.cameraObject.up).normalize(),te.copy(Y).cross(ie).normalize().multiplyScalar(me),Y.multiplyScalar(Se),Q.addVectors(te,Y).multiplyScalar(Math.cos(xe)),ie.multiplyScalar(Math.sin(xe)),Q.add(ie),this.rotateAboutLookAtpoint(Q,-Te)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},pt=()=>{var ne=0;return this._state===T.ZOOM?ne=this.previous_pointer_y-this.pointer_y:this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM?ne=W:(ne=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),ne};this.changeZoomByScrollRateUnit=ne=>{var Me=ne*this.zoomRate;this.changeZoomByValue(Me)},this.changeZoomByValue=ne=>{if(typeof this.cameraObject<"u"){var Me=K.height,Ce=this.cameraObject.position.clone();Ce.sub(this.cameraObject.target);var Be=Ce.length(),Je=1.5*ne/Me;if(.01<Be+Je*Be&&(Ce.normalize(),ae.copy(this.cameraObject.position),ae.x+=Ce.x*Je*Be,ae.y+=Ce.y*Je*Be,ae.z+=Ce.z*Je*Be,ve())){this.cameraObject.position.copy(ae),this.updateDirectionalLight();var Z=1e-5;if(Z*this.cameraObject.far<this.cameraObject.near+Je*Be+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Je*Be,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Je*Be,this.cameraObject.far+=Je*Be));else{if(this.near_plane_fly_debt==0){var de=this.cameraObject.near-Z*this.cameraObject.far;this.cameraObject.near=Z*this.cameraObject.far,this.cameraObject.far-=de,this.near_plane_fly_debt-=Z*this.cameraObject.far}this.near_plane_fly_debt+=Je*Be}le=!0}}};var hn=()=>{var ne=pt();this.changeZoomByValue(ne),this._state===T.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(W=0,this._state=T.NONE)};this.setDirectionalLight=ne=>{this.directionalLight=ne},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){N=!0,this.domElement&&this.domElement.addEventListener&&(he(this.domElement,1),this.domElement.addEventListener("mousedown",we,!1),this.domElement.addEventListener("mousemove",pe,!1),this.domElement.addEventListener("mouseup",ge,!1),this.domElement.addEventListener("mouseleave",Ee,!1),this.domElement.addEventListener("touchstart",He,!1),this.domElement.addEventListener("touchmove",tt,!1),this.domElement.addEventListener("touchend",Ie,!1),this.domElement.addEventListener("wheel",Ye,!1),this.domElement.addEventListener("mouseenter",ot,!1),this.domElement.addEventListener("contextmenu",ne=>{ne.preventDefault()},!1),this.domElement.addEventListener("keydown",We,!1),this.domElement.addEventListener("keyup",it,!1))},this.disable=function(){N=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",we,!1),this.domElement.removeEventListener("mousemove",pe,!1),this.domElement.removeEventListener("mouseup",ge,!1),this.domElement.removeEventListener("mouseleave",Ee,!1),this.domElement.removeEventListener("touchstart",He,!1),this.domElement.removeEventListener("touchmove",tt,!1),this.domElement.removeEventListener("touchend",Ie,!1),this.domElement.removeEventListener("wheel",Ye,!1),this.domElement.removeEventListener("mouseenter",ot,!1),this.domElement.removeEventListener("contextmenu",ne=>{ne.preventDefault()},!1),this.domElement.removeEventListener("keydown",We,!1),this.domElement.removeEventListener("keyup",it,!1),he(this.domElement,-1))},this.loadPath=ne=>{O=ne.CameraPath,B=ne.NumberOfPoints},this.loadPathURL=(ne,Me)=>{var Ce=new XMLHttpRequest;Ce.onreadystatechange=()=>{if(Ce.readyState==4&&Ce.status==200){var Je=JSON.parse(Ce.responseText);this.loadPath(Je),Me!=null&&typeof Me=="function"&&Me()}};var Be=f(ne);Ce.open("GET",Be,!0),Ce.send()},this.setPathDuration=ne=>{L=ne,re&&re.setDuration(L),j&&j.setDuration(L)},this.getPlayRate=()=>k,this.setPlayRate=ne=>{k=ne};var Mn=ne=>{var Me=x+ne;Me>L&&(Me-=L),x=Me};this.getTime=()=>x,this.setTime=ne=>{x=ne>L?L:0>ne?0:ne},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var ne=x/L*(B-1),Me=Math.floor(ne),Ce=1-(ne-Me),Be=Math.ceil(ne);return Me==Be?Me==B-1?[Me-1,Be,0]:[Me,Be+1,1]:[Me,Be,Ce]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=ne=>{2<B&&(x=L*ne/(B-1),0>x&&(x=0),x>L&&(x=L))};var jn=ne=>{if(X===I.PATH&&(Mn(ne),O)){for(var Me=this.getCurrentTimeFrame(),Ce=Me[0],Be=Me[1],Je=Me[2],Z=[O[3*Ce],O[3*Ce+1],O[3*Ce+2]],de=[O[3*Be],O[3*Be+1],O[3*Be+2]],ce=[],me=0;me<Z.length;me++)ce.push(Je*Z[me]+(1-Je)*de[me]);this.cameraObject.position.set(ce[0],ce[1],ce[2]),this.cameraObject.target.set(de[0],de[1],de[2]),U&&this.cameraObject.lookAt(this.cameraObject.target),D&&(this.directionalLight.position.set(ce[0],ce[1],ce[2]),this.directionalLight.target.position.set(de[0],de[1],de[2]))}};this.calculatePathNow=()=>{jn(0)};var us=()=>{this._state===T.ROTATE||this._state===T.TOUCH_ROTATE||this._state===T.KEYBOARD_ROTATE?Mt():this._state===T.PAN||this._state===T.TOUCH_PAN||this._state===T.KEYBOARD_PAN?(et(),fe.triggerCallback()):(this._state===T.ZOOM||this._state===T.TOUCH_ZOOM||this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(fe.zoom(pt()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(this._state=T.NONE),W=0,fe.triggerCallback())};this.update=ne=>{var Me=ne*k,Ce=N,Be=!0;return X===I.PATH?jn(Me):X===I.SMOOTH_CAMERA_TRANSITION&&re?(re.update(Me),re.isTransitionCompleted()&&(X=I.DEFAULT),Ce=!1):X===I.ROTATE_CAMERA_TRANSITION&&j?(j.update(Me),j.isTransitionCompleted()&&(X=I.DEFAULT),Ce=!1):X===I.AUTO_TUMBLE&&G?G.update(Me):X===I.SYNC_CONTROL&&fe?(us(),Ce=!1):Be=!1,Ce&&(this._state!==T.NONE&&(Be=!0),this._state===T.ROTATE||this._state===T.TOUCH_ROTATE||this._state===T.KEYBOARD_ROTATE?Mt():this._state===T.PAN||this._state===T.TOUCH_PAN||this._state===T.KEYBOARD_PAN?et():(this._state===T.ZOOM||this._state===T.TOUCH_ZOOM||this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&hn(),this._state!==T.NONE&&X===I.AUTO_TUMBLE&&G&&G.stopOnCameraInput,this._state===T.SCROLL&&(this._state=T.NONE)),U?(Be=!0,U.update()):this.cameraObject.lookAt(this.cameraObject.target),Be=Be||le,le=!1,Be},this.playPath=()=>{X=I.PATH},this.stopPath=()=>{X=I.DEFAULT},this.isPlayingPath=()=>X===I.PATH,this.enableDirectionalLightUpdateWithPath=ne=>{D=ne},this.enableDeviceOrientation=()=>{U||(U=new M(this.cameraObject))},this.disableDeviceOrientation=()=>{U&&(U.dispose(),U=void 0)},this.isDeviceOrientationEnabled=()=>!!U,this.resetView=()=>{var ne=ye[H];this.cameraObject.near=ne.nearPlane,this.cameraObject.far=ne.farPlane,this.cameraObject.position.set(ne.eyePosition[0],ne.eyePosition[1],ne.eyePosition[2]),this.cameraObject.target.set(ne.targetPosition[0],ne.targetPosition[1],ne.targetPosition[2]),this.cameraObject.up.set(ne.upVector[0],ne.upVector[1],ne.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=ne=>{ne.nearPlane&&(this.cameraObject.near=ne.nearPlane),ne.farPlane&&(this.cameraObject.far=ne.farPlane),ne.eyePosition&&this.cameraObject.position.set(ne.eyePosition[0],ne.eyePosition[1],ne.eyePosition[2]),ne.targetPosition&&this.cameraObject.target.set(ne.targetPosition[0],ne.targetPosition[1],ne.targetPosition[2]),ne.upVector&&this.cameraObject.up.set(ne.upVector[0],ne.upVector[1],ne.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),le=!0},this.getViewportFromCentreAndRadius=(ne,Me,Ce,Be,Je,Z)=>{var de=this.cameraObject.position.x-this.cameraObject.target.x,ce=this.cameraObject.position.y-this.cameraObject.target.y,me=this.cameraObject.position.z-this.cameraObject.target.z,Se=1/Math.sqrt(de*de+ce*ce+me*me);de*=Se,ce*=Se,me*=Se;var ue=[ne,Me,Ce],xe=Be/Math.tan(Je*Math.PI/360),Te=[ne+de*xe,Me+ce*xe,Ce+me*xe],Pe=xe+Z,Ne=0,ze=.95;Ne=Z>ze*xe?(1-ze)*xe:xe-Z;var Fe=new h;return Fe.nearPlane=Ne,Fe.farPlane=Pe,Fe.eyePosition=Te,Fe.targetPosition=ue,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(ne,Me)=>{var Ce=ne.min.distanceTo(ne.max)/2*Me,Be=(ne.min.x+ne.max.x)/2,Je=(ne.min.y+ne.max.y)/2,Z=(ne.min.z+ne.max.z)/2,de=4,ce=this.getViewportFromCentreAndRadius(Be,Je,Z,Ce,40,Ce*de);return ce},this.getCurrentViewport=()=>{var ne=new h;return ne.nearPlane=this.cameraObject.near,ne.farPlane=this.cameraObject.far,ne.eyePosition[0]=this.cameraObject.position.x,ne.eyePosition[1]=this.cameraObject.position.y,ne.eyePosition[2]=this.cameraObject.position.z,ne.targetPosition[0]=this.cameraObject.target.x,ne.targetPosition[1]=this.cameraObject.target.y,ne.targetPosition[2]=this.cameraObject.target.z,ne.upVector[0]=this.cameraObject.up.x,ne.upVector[1]=this.cameraObject.up.y,ne.upVector[2]=this.cameraObject.up.z,ne},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(ne,Me,Ce)=>{j==null&&(re=new y(ne,Me,this,Ce))},this.rotateCameraTransition=(ne,Me,Ce)=>{re==null&&(j=new m(ne,Me,this,Ce))},this.enableCameraTransition=()=>{re&&(X=I.SMOOTH_CAMERA_TRANSITION),j&&(X=I.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{X=I.DEFAULT},this.stopCameraTransition=()=>{X=I.DEFAULT,re=void 0,j=void 0},this.isTransitioningCamera=()=>X===I.SMOOTH_CAMERA_TRANSITION||X===I.ROTATE_CAMERA_TRANSITION,this.autoTumble=(ne,Me,Ce)=>{G=new b(ne,Me,Ce,this)},this.enableAutoTumble=()=>{X=I.AUTO_TUMBLE},this.stopAutoTumble=()=>{X=I.DEFAULT,G=void 0},this.updateAutoTumble=()=>{G&&(G.requireUpdate=!0)},this.isAutoTumble=()=>X===I.AUTO_TUMBLE,this.enableRaycaster=(ne,Me,Ce)=>{ee==null&&(ee=new d(ne,this.scene,Me,Ce,this.renderer))},this.disableRaycaster=()=>{ee.disable(),ee=void 0},this.isSyncControl=()=>currentMpde===I.SYNC_CONTROL,this.enableSyncControl=()=>(X=I.SYNC_CONTROL,fe||(fe=new _),fe.setCurrentCameraSettings(this.cameraObject,ye[H]),fe),this.disableSyncControl=()=>{X=I.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(S,w,A,I){var T=S.eyePosition,P=S.targetPosition,C=S.upVector,R=w.eyePosition,L=w.targetPosition,N=w.upVector,x=A,O=I,B=0,D=!1;x.near=Math.min(S.nearPlane,w.nearPlane),x.far=Math.max(S.farPlane,w.farPlane),x.cameraObject.up.set(w.upVector[0],w.upVector[1],w.upVector[2]),this.setDuration=H=>{O=H};var k=H=>{var X=B+H;X>O&&(X=O),B=X},U=()=>{var H=B/O,X=[T[0]*(1-H)+R[0]*H,T[1]*(1-H)+R[1]*H,T[2]*(1-H)+R[2]*H],re=[P[0]*(1-H)+L[0]*H,P[1]*(1-H)+L[1]*H,P[2]*(1-H)+L[2]*H];C[0]*(1-H)+N[0]*H,C[1]*(1-H)+N[1]*H,C[2]*(1-H)+N[2]*H,x.cameraObject.position.set(X[0],X[1],X[2]),x.cameraObject.target.set(re[0],re[1],re[2])};this.update=H=>{this.enabled===!1||(k(H),U(),B==O&&(D=!0))},this.isTransitionCompleted=()=>D},m=function(S,w,A,I){var T=S,P=w,C=A,R=I,L=0,N=!1;this.setDuration=O=>{R=O};var x=O=>{var B=L,D=L+O;D>R&&(D=R),L=D;var k=L-B,U=k/R,H=U*P;C.rotateAboutLookAtpoint(T,H)};this.update=O=>{this.enabled===!1||(x(O),L==R&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(S,w,A,I,T){var P=S,C=w,R=T,L=A,N=I,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var O=new c.Vector2,B=!1,D=new Date,k=!1,U=0,H=[],X={zincCamera:void 0,x:-1,y:-1},re=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=W=>{if(C!==P){var q=P.getThreeJSScene();R.render(q,W.cameraObject)}var ee=re||P.getPickableThreeJSObjects();return H.length=0,x.intersectObjects(ee,!0,H)},this.setPickableObjects=W=>{W===void 0?re=void 0:(re=[],W.forEach(q=>{q.getGroup()&&q.getGroup().visible&&re.push(q.getGroup())}))},this.getIntersectsObjectWithOrigin=(W,q,ee)=>(x.set(q,ee),this.getIntersectsObject(W)),this.getIntersectsObjectWithCamera=(W,q,ee)=>(W.getNDCFromDocumentCoords(q,ee,O),x.setFromCamera(O,W.cameraObject),this.getIntersectsObject(W)),this.pick=(W,q,ee)=>{if(R&&P&&W&&L){this.getIntersectsObjectWithCamera(W,q,ee);for(var K,ie=H.length,Y=0;Y<ie;Y++)if(K=H[Y].object?H[Y].object.userData:void 0,K&&K.isMarkerCluster&&K.visible&&K.clusterIsVisible(H[Y].object.clusterIndex)&&K.zoomToCluster(H[Y].object.clusterIndex))return;L(H,q,ee)}};var j=(W,q,ee)=>{if(R&&P&&W&&N){if(this.getIntersectsObjectWithCamera(W,q,ee),D.setTime(Date.now()),H.length===0){if(k)return;k=!0}else k=!1;N(H,q,ee)}};this.move=(W,q,ee)=>{R&&P&&W&&N&&(P.displayMarkers?j(W,q,ee):(X.zincCamera=W,X.x=q,X.y=ee,!B&&(U=D?Date.now()-D.getTime():250,250<=U?j(W,q,ee):(B=!0,setTimeout(G(X),U)))))};var G=W=>function(){B=!1,j(W.zincCamera,W.x,W.y)}},b=function(S,w,A,I){var T=new c.Vector3,P=-w,C=I,R=S;this.stopOnCameraInput=A,this.requireUpdate=!0;var L=new c.Vector3,N=new c.Vector3,x=O=>{var B=Math.sqrt(O[0]*O[0]+O[1]*O[1]),D=4*Math.abs(O[0]),k=4*Math.abs(O[1]),U=.25*(D+k),H=-O[1]/B,X=O[0]/B,re=H*O[0]+X*-O[1];re>U?re=U:re<-U&&(re=-U);var j=Math.acos(re/U)-.5*Math.PI;T.copy(C.cameraObject.position).sub(C.cameraObject.target).normalize(),L.copy(C.cameraObject.up).normalize(),N.crossVectors(L,T).normalize().multiplyScalar(H),L.multiplyScalar(X),L.add(N).multiplyScalar(Math.cos(j)),T.multiplyScalar(Math.sin(j)).add(L)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(x(R),this.requireUpdate=!1),C.rotateAboutLookAtpoint(T,P*O/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var E,S,w,A,I,T,P=new c.Matrix4,C=new c.Matrix4;return function(L){var N=E!==L.focus||S!==L.fov||w!==L.aspect*this.aspect||A!==L.near||I!==L.far||T!==L.zoom;if(N){E=L.focus,S=L.fov,w=L.aspect*this.aspect,A=L.near,I=L.far,T=L.zoom;var x,O,B=L.projectionMatrix.clone(),D=.064/2,k=D*A/E,U=A*Math.tan(.5*(c.Math.DEG2RAD*S))/L.zoom;C.elements[12]=-D,P.elements[12]=D,x=-U*w+k,O=U*w+k,B.elements[0]=2*A/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraL.projectionMatrix.copy(B),x=-U*w-k,O=U*w-k,B.elements[0]=2*A/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(L.matrixWorld).multiply(C),this.cameraR.matrixWorld.copy(L.matrixWorld).multiply(P)}})()});var g=function(S){var w=new v;w.aspect=.5,this.setSize=(A,I)=>{S.setSize(A,I)},this.render=(A,I)=>{A.updateMatrixWorld(),I.parent===null&&I.updateMatrixWorld(),w.update(I);var T=S.getSize();S.setScissorTest(!0),S.clear(),S.setScissor(0,0,T.width/2,T.height),S.setViewport(0,0,T.width/2,T.height),S.render(A,w.cameraL),S.setScissor(T.width/2,0,T.width/2,T.height),S.setViewport(T.width/2,0,T.width/2,T.height),S.render(A,w.cameraR),S.setScissorTest(!1)}},M=function(S){var w=this;this.object=S,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var A=P=>{w.deviceOrientation=P},I=()=>{typeof window<"u"&&(w.screenOrientation=window.orientation||0)},T=(()=>{var P=new c.Vector3(0,0,1),C=new c.Euler,R=new c.Quaternion,L=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,x,O,B,D)=>{var k=new c.Vector3(0,0,1);k.subVectors(N.target,N.position),C.set(O,x,-B,"YXZ");var U=new c.Quaternion;U.setFromEuler(C),U.multiply(L),U.multiply(R.setFromAxisAngle(P,-D)),k.applyQuaternion(U),k.addVectors(N.position,k),N.lookAt(k)}})();this.connect=()=>{I(),typeof window<"u"&&(window.addEventListener("orientationchange",I,!1),window.addEventListener("deviceorientation",A,!1)),w.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",I,!1),window.removeEventListener("deviceorientation",A,!1)),w.enabled=!1},this.update=()=>{if(w.enabled!==!1){var P=w.deviceOrientation.alpha?c.Math.degToRad(w.deviceOrientation.alpha):0,C=w.deviceOrientation.beta?c.Math.degToRad(w.deviceOrientation.beta):0,R=w.deviceOrientation.gamma?c.Math.degToRad(w.deviceOrientation.gamma):0,L=w.screenOrientation?c.Math.degToRad(w.screenOrientation):0;T(w.object,P,C,R,L)}},this.dispose=function(){this.disconnect()},this.connect()},_=function(){var S=void 0,w=void 0,A=void 0,I=new c.Vector3,T=new c.Vector3,P=new c.Vector3,C=new c.Vector3,R=void 0;this.setCurrentCameraSettings=(L,N)=>{S=L.clone(),w=L,A=N,S.near=A.nearPlane,A.farPlane&&(S.far=A.farPlane),A.eyePosition&&S.position.set(A.eyePosition[0],A.eyePosition[1],A.eyePosition[2]),A.upVector&&S.up.set(A.upVector[0],A.upVector[1],A.upVector[2]),A.targetPosition&&(S.target=new c.Vector3(A.targetPosition[0],A.targetPosition[1],A.targetPosition[2]),S.lookAt(S.target)),S.updateProjectionMatrix(),I.copy(S.position).project(S),T.copy(S.target).project(S)},this.getCurrentPosition=()=>(T.copy(w.target).project(S),[T.x,T.y]),this.zoom=L=>{var N=.002*L,x=Math.max(w.zoom-N,1);w.zoom=x,w.updateProjectionMatrix()},this.zoomToBox=(L,N)=>{L.getCenter(P),P.project(S),this.setCenterZoom([P.x,P.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:w.zoom}),this.setCenterZoom=(L,N)=>{P.set(L[0],L[1],T.z).unproject(S),C.copy(P).sub(w.target),w.target.copy(P),w.lookAt(w.target),w.position.add(C),w.zoom=N,w.updateProjectionMatrix()},this.setEventCallback=L=>{(L===void 0||typeof L=="function")&&(R=L)},this.triggerCallback=()=>{R!==void 0&&typeof R=="function"&&R()}};l.Viewport=h,l.CameraControls=p,l.SmoothCameraTransition=y,l.RotateCameraTransition=m,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=_},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var p=u(45).Lines2,y=u(3).Geometry,m=u(4),d=0,b=function(){return"re"+d++},v=function(g,M){var _=g,E=new c;E.matrixAutoUpdate=!1,E.userData=this;var S=[],w="",A=[],I=M,T=new f,P=3e3;T.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{S.forEach(C=>C.hideAllPrimitives()),A.forEach(C=>C.setVisibility(!1))},this.showAllPrimitives=()=>{S.forEach(C=>C.showAllPrimitives()),A.forEach(C=>C.setVisibility(!0))},this.setVisibility=C=>{C!=E.visible&&(E.visible=C,this.pickableUpdateRequired=!0)},this.getVisibility=()=>E.visible,this.getGroup=()=>E,this.setTransformation=C=>{T.set(...C),E.matrix.copy(T),E.updateMatrixWorld()},this.setName=C=>{C&&C!==""&&(w=C)},this.getName=()=>w,this.getParent=()=>_,this.getFullSeparatedPath=()=>{var C=[];if(w!==""){C.push(w);for(var R,L=_;L!==void 0;)R=L.getName(),R!==""&&C.unshift(R),L=L.getParent()}return C},this.getFullPath=()=>{var C=this.getFullSeparatedPath();if(0<C.length){var R=C.shift();return C.forEach(L=>{R=R.concat("/",L)}),R}return""},this.createChild=C=>{var R=new v(this,I);return R.setName(C),S.push(R),E.add(R.getGroup()),R},this.getChildWithName=C=>{if(C){for(var R=C.toLowerCase(),L=0;L<S.length;L++)if(S[L].getName().toLowerCase()===R)return S[L]}},this.findChildFromSeparatedPath=C=>{if(C&&0<C.length&&C[0]===""&&C.shift(),C&&0<C.length){var R=this.getChildWithName(C[0]);return R?(C.shift(),R.findChildFromSeparatedPath(C)):void 0}return this},this.findChildFromPath=C=>{var R=C.split("/");return this.findChildFromSeparatedPath(R)},this.createChildFromSeparatedPath=C=>{if(0<C.length&&C[0]===""&&C.shift(),0<C.length){var R=this.getChildWithName(C[0]);return R||(R=this.createChild(C[0])),C.shift(),R.createChildFromSeparatedPath(C)}return this},this.createChildFromPath=C=>{var R=C.split("/");return this.createChildFromSeparatedPath(R)},this.findOrCreateChildFromPath=C=>{var R=this.findChildFromPath(C);return R||(R=this.createChildFromPath(C)),R},this.addZincObject=C=>{C&&(C.setRegion(this),E.add(C.getGroup()),A.push(C),this.pickableUpdateRequired=!0,I&&I.triggerObjectAddedCallback(C))},this.removeZincObject=C=>{for(var R=0;R<A.length;R++)if(C===A[R])return E.remove(C.getGroup()),A.splice(R,1),I&&I.triggerObjectRemovedCallback(C),C.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=C=>{if(this.pickableUpdateRequired)return!0;if(C){for(var R=!1,L=0;L<S.length;L++)if(R=S[L].checkPickableUpdateRequred(C),R)return!0}return!1},this.getPickableThreeJSObjects=(C,R)=>(E.visible&&(A.forEach(L=>{if(L.getGroup()&&L.getGroup().visible){var N=L.marker;N&&N.isEnabled()&&C.push(N.getMorph()),C.push(L.getGroup())}}),R&&S.forEach(L=>{L.getPickableThreeJSObjects(C,R)}),this.pickableUpdateRequired=!1),C),this.setDuration=C=>{P=C,A.forEach(R=>R.setDuration(C)),S.forEach(R=>R.setDuration(C))},this.getDuration=()=>P,this.getBoundingBox=C=>{var R,L;return A.forEach(N=>{L=N.getBoundingBox(),L&&(R==null?R=L.clone():R.union(L))}),C&&S.forEach(N=>{L=N.getBoundingBox(C),L&&(R==null?R=L.clone():R.union(L))}),R},this.clear=C=>{C&&S.forEach(R=>R.clear(C)),A.forEach(R=>{E.remove(R.getGroup()),R.dispose()}),S=[],A=[]},this.objectIsInRegion=(C,R)=>{for(var L=0;L<A.length;L++)if(C===A[L])return!0;if(R){for(var N=0;N<S.length;N++)if(S[N].objectIsInRegion(C,R))return!0}return!1},this.forEachGeometry=(C,R)=>{A.forEach(L=>{L.isGeometry&&C(L)}),R&&S.forEach(L=>L.forEachGeometry(C,R))},this.forEachGlyphset=(C,R)=>{A.forEach(L=>{L.isGlyphset&&C(L)}),R&&S.forEach(L=>L.forEachGlyphset(C,R))},this.forEachPointset=(C,R)=>{A.forEach(L=>{L.isPointset&&C(L)}),R&&S.forEach(L=>L.forEachPointset(C,R))},this.forEachLine=(C,R)=>{A.forEach(L=>{L.isLines&&C(L)}),R&&S.forEach(L=>L.forEachLine(C,R))},this.findObjectsWithAnatomicalId=(C,R)=>(A.forEach(L=>{L.anatomicalId===C&&objectsArray.push(L)}),R&&S.forEach(L=>{var N=L.findObjectsWithAnatomicalId(C,R);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(C,R)=>{var L=[];return A.forEach(N=>{var x=N.groupName?N.groupName.toLowerCase():N.groupName,O=C&&C.toLowerCase();x===O&&L.push(N)}),R&&S.forEach(N=>{var x=N.findObjectsWithGroupName(C,R);L.push(...x)}),L},this.findGeometriesWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isGeometry);return N},this.findPointsetsWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isPointset);return N},this.findGlyphsetsWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isGlyphset);return N},this.findLinesWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isLines);return N},this.getAllObjects=C=>{var R=[...A];return C&&S.forEach(L=>{var N=L.getAllObjects(C);R.push(...N)}),R},this.getChildRegions=C=>{var R=[...S];return C&&S.forEach(L=>{var N=L.getChildRegions(C);R.push(...N)}),R},this.getCurrentTime=()=>{if(A[0]!=null)return A[0].getCurrentTime();for(var C,R=0;R<S.length;R++)if(C=S[R].getCurrentTime(),C!==-1)return C;return-1},this.setMorphTime=(C,R)=>{A.forEach(L=>{L.setMorphTime(C)}),R&&S.forEach(L=>{L.setMorphTime(C)})},this.isTimeVarying=()=>{for(var C=0;C<A.length;C++)if(A[C].isTimeVarying())return!0;for(var R=0;R<S.length;R++)if(S[R].isTimeVarying())return!0;return!1},this.renderGeometries=(C,R,L,N,x,O)=>{var B,D=this.getAllObjects(O);D.forEach(k=>{k.render(C*R,L,N,x)}),x&&L===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(C,R,L,N)=>{var x=!1,O=this.findObjectsWithGroupName(C,!1),B=O.findIndex(k=>k.isPointset),D=-1<B?O[B]:new h;return D.addPoints(R,L,N),B===-1?(D.setName(C),this.addZincObject(D),x=!0):this.pickableUpdateRequired=!0,{zincObject:D,isNew:x}},this.createLines=(C,R,L)=>{var N=!1,x=this.findObjectsWithGroupName(C,!1),O=x.findIndex(D=>D.isLines),B=-1<O?x[O]:new p;return B.addLines(R,L),O===-1?(B.setName(C),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(C,R,L,N,x,O)=>{var B=new y,D=new m.MeshPhongMaterial({color:L,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:m.DoubleSide});return B.createMesh(R,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(C),B.setRenderOrder(O),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(m,d,b)=>{if(m&&d){var v=new h;v.setPositions(m),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=m[0][0],y[b++]=m[0][1],y[b++]=m[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(m){var d=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(m,d){if(m&&m.length){var b=this.getMorph(),v=d+m.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(m.forEach(M=>{y[g++]=M[0],y[g++]=M[1],y[g++]=M[2]}),g=3*this.drawRange;300>g;)y[g++]=m[0][0],y[g++]=m[0][1],y[g++]=m[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(m,d)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>A});var c=u(4),f=u(47),h=u(48),p=new c.Vector3,y=new c.Vector3,m=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,M=new c.Line3,_=new c.Vector3,E=new c.Box3,S=new c.Sphere,w=new c.Vector4;class A extends c.Mesh{constructor(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(T,P),this.type="LineSegments2"}computeLineDistances(){for(var T=this.geometry,P=T.attributes.instanceStart,C=T.attributes.instanceEnd,R=new Float32Array(2*P.count),L=0,N=0,x=P.count;L<x;L++,N+=2)p.fromBufferAttribute(P,L),y.fromBufferAttribute(C,L),R[N]=N==0?0:R[N-1],R[N+1]=R[N]+p.distanceTo(y);var O=new c.InstancedInterleavedBuffer(R,2,1);return T.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(O,1,0)),T.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(O,1,1)),this}raycast(T,P){T.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var C=T.params.Line2===void 0?0:T.params.Line2.threshold||0,R=T.ray,L=T.camera,N=L.projectionMatrix,x=this.matrixWorld,O=this.geometry,B=this.material,D=B.resolution,k=B.linewidth+C,U=O.attributes.instanceStart,H=O.attributes.instanceEnd,X=-L.near,re=2*Math.max(k/D.width,k/D.height);O.boundingSphere===null&&O.computeBoundingSphere(),S.copy(O.boundingSphere).applyMatrix4(x);var j=Math.max(L.near,S.distanceToPoint(R.origin));w.set(0,0,-j,1).applyMatrix4(L.projectionMatrix),w.multiplyScalar(1/w.w),w.applyMatrix4(L.projectionMatrixInverse);var G=.5*Math.abs(re/w.w);if(S.radius+=G,T.ray.intersectsSphere(S)!==!1){O.boundingBox===null&&O.computeBoundingBox(),E.copy(O.boundingBox).applyMatrix4(x);var W=Math.max(L.near,E.distanceToPoint(R.origin));w.set(0,0,-W,1).applyMatrix4(L.projectionMatrix),w.multiplyScalar(1/w.w),w.applyMatrix4(L.projectionMatrixInverse);var q=.5*Math.abs(re/w.w);if(E.max.x+=q,E.max.y+=q,E.max.z+=q,E.min.x-=q,E.min.y-=q,E.min.z-=q,T.ray.intersectsBox(E)!==!1){R.at(1,b),b.w=1,b.applyMatrix4(L.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=D.x/2,b.y*=D.y/2,b.z=0,v.copy(b),g.multiplyMatrices(L.matrixWorldInverse,x);for(var ee=0,K=U.count;ee<K;ee++){m.fromBufferAttribute(U,ee),d.fromBufferAttribute(H,ee),m.w=1,d.w=1,m.applyMatrix4(g),d.applyMatrix4(g);var ie=m.z>X&&d.z>X;if(!ie){if(m.z>X){var Y=m.z-d.z,te=(m.z-X)/Y;m.lerp(d,te)}else if(d.z>X){var F=d.z-m.z,$=(d.z-X)/F;d.lerp(m,$)}m.applyMatrix4(N),d.applyMatrix4(N),m.multiplyScalar(1/m.w),d.multiplyScalar(1/d.w),m.x*=D.x/2,m.y*=D.y/2,d.x*=D.x/2,d.y*=D.y/2,M.start.copy(m),M.start.z=0,M.end.copy(d),M.end.z=0;var Q=M.closestPointToPointParameter(v,!0);M.at(Q,_);var V=c.MathUtils.lerp(m.z,d.z,Q),z=-1<=V&&1>=V,oe=v.distanceTo(_)<.5*k;if(z&&oe){M.start.fromBufferAttribute(U,ee),M.end.fromBufferAttribute(H,ee),M.start.applyMatrix4(x),M.end.applyMatrix4(x);var ae=new c.Vector3,le=new c.Vector3;R.distanceSqToSegment(M.start,M.end,le,ae),P.push({point:le,pointOnLine:ae,distance:R.origin.distanceTo(le),object:this,face:null,faceIndex:ee,uv:null,uv2:null})}}}}}}}A.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,h=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(m),b.applyMatrix4(m),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var d=m.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;m!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(m!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,M=m.count;g<M;g++)h.fromBufferAttribute(m,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3231
+ `),I="",T="",P=0,C=[],R=typeof"".trimLeft=="function",L=0,N=A.length;L<N;L++)if(I=A[L],I=R?I.trimLeft():I.trim(),P=I.length,P!==0&&(T=I.charAt(0),T!=="#"))if(T==="v"){var x=I.split(/\s+/);switch(x[0]){case"v":w.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?w.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):w.colors.push(void 0,void 0,void 0);break;case"vn":w.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":w.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(T==="f"){for(var O,B=I.substr(1).trim(),D=B.split(/\s+/),k=[],U=0,H=D.length;U<H;U++)if(O=D[U],0<O.length){var X=O.split("/");k.push(X)}for(var re=k[0],j=1,G=k.length-1;j<G;j++){var W=k[j],K=k[j+1];w.addFace(re[0],W[0],K[0],re[1],W[1],K[1],re[2],W[2],K[2])}}else if(T==="l"){var ee=I.substring(1).trim().split(" "),q=[],ie=[];if(I.indexOf("/")===-1)q=ee;else for(var Y,te=0,F=ee.length;te<F;te++)Y=ee[te].split("/"),Y[0]!==""&&q.push(Y[0]),Y[1]!==""&&ie.push(Y[1]);w.addLineGeometry(q,ie)}else if(T==="p"){var $=I.substr(1).trim(),Q=$.split(" ");w.addPointGeometry(Q)}else if((C=f.exec(I))!==null){var V=(" "+C[0].substr(1).trim()).substr(1);w.startObject(V)}else if(p.test(I))w.object.startMaterial(I.substring(7).trim(),w.materialLibraries);else if(h.test(I))w.materialLibraries.push(I.substring(7).trim());else if(y.test(I))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(T==="s"){if(C=I.split(" "),1<C.length){var z=C[1].trim().toLowerCase();w.object.smooth=z!=="0"&&z!=="off"}else w.object.smooth=!0;var oe=w.object.currentMaterial();oe&&(oe.smooth=w.object.smooth)}else{if(I==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+I+'"')}w.finalize();var ae=new c.Group;ae.materialLibraries=[].concat(w.materialLibraries);var le=w.objects.length!==1||w.objects[0].geometry.vertices.length!==0;if(le==!0)for(var fe=0,be=w.objects.length;fe<be;fe++){var ye=w.objects[fe],he=ye.geometry,ve=ye.materials,se=he.type==="Line",we=he.type==="Points",pe=!1;if(he.vertices.length!==0){var ge=new c.BufferGeometry;ge.setAttribute("position",new c.Float32BufferAttribute(he.vertices,3)),0<he.normals.length&&ge.setAttribute("normal",new c.Float32BufferAttribute(he.normals,3)),0<he.colors.length&&(pe=!0,ge.setAttribute("color",new c.Float32BufferAttribute(he.colors,3))),he.hasUVIndices===!0&&ge.setAttribute("uv",new c.Float32BufferAttribute(he.uvs,2));for(var Ee=[],He=0,tt=ve.length;He<tt;He++){var Ie=ve[He],ot=Ie.name+"_"+Ie.smooth+"_"+pe,Le=w.materials[ot];if(this.materials!==null){if(Le=this.materials.create(Ie.name),se&&Le&&!(Le instanceof c.LineBasicMaterial)){var Ye=new c.LineBasicMaterial;c.Material.prototype.copy.call(Ye,Le),Ye.color.copy(Le.color),Le=Ye}else if(we&&Le&&!(Le instanceof c.PointsMaterial)){var We=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(We,Le),We.color.copy(Le.color),We.map=Le.map,Le=We}}Le===void 0&&(Le=se?new c.LineBasicMaterial:we?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Le.name=Ie.name,Le.flatShading=!Ie.smooth,Le.vertexColors=pe,w.materials[ot]=Le),Ee.push(Le)}var it=void 0;if(1<Ee.length){for(var et,Mt=0,pt=ve.length;Mt<pt;Mt++)et=ve[Mt],ge.addGroup(et.groupStart,et.groupCount,Mt);it=se?new c.LineSegments(ge,Ee):we?new c.Points(ge,Ee):new c.Mesh(ge,Ee)}else it=se?new c.LineSegments(ge,Ee[0]):we?new c.Points(ge,Ee[0]):new c.Mesh(ge,Ee[0]);it.name=ye.name,ae.add(it)}}else if(0<w.vertices.length){var hn=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Mn=new c.BufferGeometry;Mn.setAttribute("position",new c.Float32BufferAttribute(w.vertices,3)),0<w.colors.length&&w.colors[0]!==void 0&&(Mn.setAttribute("color",new c.Float32BufferAttribute(w.colors,3)),hn.vertexColors=!0);var jn=new c.Points(Mn,hn);ae.add(jn)}return ae}}},(o,l,u)=>{function c(_,E){var S=Object.keys(_);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(_);E&&(w=w.filter(function(A){return Object.getOwnPropertyDescriptor(_,A).enumerable})),S.push.apply(S,w)}return S}function f(_){for(var E,S=1;S<arguments.length;S++)E=arguments[S]==null?{}:arguments[S],S%2?c(Object(E),!0).forEach(function(w){h(_,w,E[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(w){Object.defineProperty(_,w,Object.getOwnPropertyDescriptor(E,w))});return _}function h(_,E,S){return E=p(E),E in _?Object.defineProperty(_,E,{value:S,enumerable:!0,configurable:!0,writable:!0}):_[E]=S,_}function p(_){var E=y(_,"string");return typeof E=="symbol"?E:E+""}function y(_,E){if(typeof _!="object"||!_)return _;var S=_[Symbol.toPrimitive];if(S!==void 0){var w=S.call(_,E||"default");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(_)}var m=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=_=>{var E=(w,A)=>{w.merge(A)};if(_&&0<_.length){for(;1<_.length;){var S=_.splice(1,1);E(_[0],S[0])}return _[0]}},g=function(E,S,w){var A=new b,I=new m;A.crossOrigin=S;var T=E,P=w,C=void 0,R=!1,L=!1,N=void 0,x=[],O=U=>{var H=C[U.index];if(H){var X=I.parse(H);U.onLoad(X.geometry,X.materials)}else B(U)},B=U=>{U.onError&&(!N&&(N={responseURL:T}),U.onError(N))};this.downloadCompleted=U=>{try{C=JSON.parse(U[0]),R=!1,L=!0,Array.isArray(C)?x.forEach(H=>O(H)):x.forEach(H=>B(H))}catch{x.forEach(X=>B(X))}};var D=()=>U=>{N=U,L=!0,R=!1,x.forEach(H=>{B(H)})},k=()=>U=>{x.forEach(H=>{H.onProgress&&H.onProgress(U)})};this.load=(U,H,X,re)=>{var j={index:U,onLoad:H,onProgress:X,onError:re};L?C?O(j):B(N):R?x.push(j):(x.push(j),R=!0,A.load(T,P,k,D))}},M=function(E,S){var w=[],A=E,I=S,T=0;this.itemDownloaded=(P,C)=>{if(w[P]=C,T++,T==A){for(var R=w[0][1],L=w.map(O=>O[0]),N=v(L),x=1;x<A;x++)w[P][0].dispose(),w[P][1].forEach(O=>O.dispose());I(N,R)}}};l.PrimitivesLoader=function(){var _=0,E=20;this.crossOrigin="Anonymous";var S=new m,w=[],A={},I=(R,L,N,x,O)=>{var B=R.length,D=new M(B,L),k=0;R.forEach(U=>{var H=O?f({},O):{};H.msHandler=D,H.order=k,k++,P(U,L,N,x,H)})},T=(R,L,N,x,O)=>{var B=O?f({},O):{},D=A[R];if(!D)if(E>_){var k=new C(void 0,this,B);++_,D=new g(R,this.crossOrigin,k),A[R]=D}else w.push({url:R,onLoad:L,onProgress:N,onError:x,options:O});D&&(B.isHandler=D,D.load(O.index,L,N,x))},P=(R,L,N,x,O)=>{if(O&&O.index!==void 0)T(R,L,N,x,O);else if(E>_){++_;var B=new C(L,this,O),D=new C(x,this,O);S.crossOrigin=this.crossOrigin,S.load(R,B,N,D)}else w.push({url:R,onLoad:L,onProgress:N,onError:x,options:O})};this.load=(R,L,N,x,O)=>{Array.isArray(R)?I(R,L,N,x,O):P(R,L,N,x,O)},this.loadFromWaitingList=()=>{for(;E>_;){var R=w.shift();if(R)this.load(R.url,R.onLoad,R.onProgress,R.onError,R.options);else return}},this.itemRemainingCheck=()=>{if(w.length===0&&_==0)for(var R in A)A.hasOwnProperty(R)&&delete A[R]};var C=function(L,N,x){return function(){--_;for(var O=arguments.length,B=Array(O),D=0;D<O;D++)B[D]=arguments[D];x!=null&&x.msHandler?x.msHandler.itemDownloaded(x.order,B):x!=null&&x.isHandler?x.isHandler.downloadCompleted(B):L&&L(...B),N.loadFromWaitingList(),N.itemRemainingCheck()}};this.parse=R=>S.parse(R)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(p,y,m,d)=>{var b=y;if(m!==0){if(p.type!=="Object3D"){var v;if(p.type==="Mesh"?v=new(u(3)).Geometry:p.type==="LineSegments"?v=new(u(24)).Lines:p.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,M=!1;p.geometry&&p.geometry.morphAttributes&&(g=!!p.geometry.morphAttributes.position,M=!!p.geometry.morphAttributes.color),v.setMesh(p.clone(),g,M);var _=v.getMorph();v.groupName=_.name,_.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(p.name!==""&&(y&&(b=y.findOrCreateChildFromPath(p.name)),b)){var E=b.getGroup();E.position.copy(p.position),E.rotation.copy(p.rotation),E.quaternion.copy(p.quaternion),E.matrixAutoUpdate=!0}}m++,p.children.forEach(S=>{h.parseGLTFObjects(S,b,m,d)})},this.setCamera=p=>{p.viewAll();var y=p.getZincCameraControls(),m=y.getCurrentViewport();y.addViewport("default",m),y.setDefaultViewport("default")},this.load=(p,y,m,d,b)=>{var v=m.substring(0,m.lastIndexOf("/")+1),g=m.substring(m.lastIndexOf("/")+1,m.length),M=new c().setPath(v);M.load(g,function(_){console.log(_),h.parseGLTFObjects(_.scene,y,0,d),h.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=XB},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var p=h;this.exportGLTF=y=>{var m=p.getRootRegion(),d=m.getAllObjects(!0),b=[];d.forEach(M=>{M.animationClip&&b.push({clip:M.animationClip[0],mesh:M.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(M=>{v.parse(p.getThreeJSScene(),function(_){M(_)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new C(x)}),this.register(function(x){return new R(x)}),this.register(function(x){return new L(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,O,B){for(var D=new P,k=[],U=0,H=this.pluginCallbacks.length;U<H;U++)k.push(this.pluginCallbacks[U](D));D.setPlugins(k),D.write(x,O,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=h.NEAREST,p[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=h.LINEAR,p[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,p[c.RepeatWrapping]=h.REPEAT,p[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,d=1179937895,b=2,v=8,g=1313821514,M=5130562;function _(N,x){return N.length===x.length&&N.every(function(O,B){return O===x[B]})}function E(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var x,O=new Uint8Array(new ArrayBuffer(N.length)),B=0,D=N.length;B<D;B++)x=N.charCodeAt(B),O[B]=255<x?32:x;return O.buffer}function S(N){return _(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function w(N,x,O){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},D=x;D<x+O;D++)for(var k,U=0;U<N.itemSize;U++)k=void 0,4<N.itemSize?k=N.array[D*N.itemSize+U]:U===0?k=N.getX(D):U===1?k=N.getY(D):U===2?k=N.getZ(D):U==3&&(k=N.getW(D)),B.min[U]=Math.min(B.min[U],k),B.max[U]=Math.max(B.max[U],k);return B}function A(N){return 4*Math.ceil(N/4)}function I(N){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,O=A(N.byteLength);if(O!==N.byteLength){var B=new Uint8Array(O);if(B.set(new Uint8Array(N)),x!==0)for(var D=N.byteLength;D<O;D++)B[D]=x;return B.buffer}return N}var T=null;class P{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,O,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var D=this;Promise.all(this.pending).then(function(){var k=D.buffers,U=D.json,H=D.options,X=D.extensionsUsed,re=new Blob(k,{type:"application/octet-stream"}),j=Object.keys(X);if(0<j.length&&(U.extensionsUsed=j),U.buffers&&0<U.buffers.length&&(U.buffers[0].byteLength=re.size),H.binary===!0){var G=new window.FileReader;G.readAsArrayBuffer(re),G.onloadend=function(){var K=I(G.result),ee=new DataView(new ArrayBuffer(v));ee.setUint32(0,K.byteLength,!0),ee.setUint32(4,M,!0);var q=I(E(JSON.stringify(U)),32),ie=new DataView(new ArrayBuffer(v));ie.setUint32(0,q.byteLength,!0),ie.setUint32(4,g,!0);var Y=new ArrayBuffer(m),te=new DataView(Y);te.setUint32(0,d,!0),te.setUint32(4,b,!0);var F=m+ie.byteLength+q.byteLength+ee.byteLength+K.byteLength;te.setUint32(8,F,!0);var $=new Blob([Y,ie,q,ee,K],{type:"application/octet-stream"}),Q=new window.FileReader;Q.readAsArrayBuffer($),Q.onloadend=function(){O(Q.result)}}}else if(U.buffers&&0<U.buffers.length){var W=new window.FileReader;W.readAsDataURL(re),W.onloadend=function(){var K=W.result;U.buffers[0].uri=K,O(U)}}else O(U)})}serializeUserData(x,O){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,D=this.extensionsUsed;try{var k=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&k.gltfExtensions){for(var U in O.extensions===void 0&&(O.extensions={}),k.gltfExtensions)O.extensions[U]=k.gltfExtensions[U],D[U]=!0;delete k.gltfExtensions}0<Object.keys(k).length&&(O.extras=k)}catch(H){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+H.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,D=0,k=x.count;D<k;D++)if(5e-4<Math.abs(B.fromBufferAttribute(x,D).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var O=this.cache;if(O.attributesNormalized.has(x))return O.attributesNormalized.get(x);for(var B=x.clone(),D=new c.Vector3,k=0,U=B.count;k<U;k++)D.fromBufferAttribute(B,k),D.x===0&&D.y===0&&D.z===0?D.setX(1):D.normalize(),B.setXYZ(k,D.x,D.y,D.z);return O.attributesNormalized.set(x,B),B}applyTextureTransform(x,O){var B=!1,D={};(O.offset.x!==0||O.offset.y!==0)&&(D.offset=O.offset.toArray(),B=!0),O.rotation!==0&&(D.rotation=O.rotation,B=!0),(O.repeat.x!==1||O.repeat.y!==1)&&(D.scale=O.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=D,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var O=this.json,B=this.buffers;return O.buffers||(O.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,O,B,D,k){var U=this.json;U.bufferViews||(U.bufferViews=[]);for(var H=O===h.UNSIGNED_BYTE?1:O===h.UNSIGNED_SHORT?2:4,X=A(D*x.itemSize*H),re=new DataView(new ArrayBuffer(X)),j=0,G=B;G<B+D;G++)for(var W,K=0;K<x.itemSize;K++)W=void 0,4<x.itemSize?W=x.array[G*x.itemSize+K]:K===0?W=x.getX(G):K===1?W=x.getY(G):K===2?W=x.getZ(G):K==3&&(W=x.getW(G)),O===h.FLOAT?re.setFloat32(j,W,!0):O===h.UNSIGNED_INT?re.setUint32(j,W,!0):O===h.UNSIGNED_SHORT?re.setUint16(j,W,!0):O===h.UNSIGNED_BYTE&&re.setUint8(j,W),j+=H;var ee={buffer:this.processBuffer(re.buffer),byteOffset:this.byteOffset,byteLength:X};k!==void 0&&(ee.target=k),k===h.ARRAY_BUFFER&&(ee.byteStride=x.itemSize*H),this.byteOffset+=X,U.bufferViews.push(ee);var q={id:U.bufferViews.length-1,byteLength:0};return q}processBufferViewImage(x){var O=this,B=O.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(D){var k=new window.FileReader;k.readAsArrayBuffer(x),k.onloadend=function(){var U=I(k.result),H={buffer:O.processBuffer(U),byteOffset:O.byteOffset,byteLength:U.byteLength};O.byteOffset+=U.byteLength,D(B.bufferViews.push(H)-1)}})}processAccessor(x,O,B,D){var k,U=this.options,H=this.json;if(x.array.constructor===Float32Array)k=h.FLOAT;else if(x.array.constructor===Uint32Array)k=h.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)k=h.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)k=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),D===void 0&&(D=x.count),U.truncateDrawRange&&O!==void 0&&O.index===null){var X=B+D,re=O.drawRange.count===1/0?x.count:O.drawRange.start+O.drawRange.count;B=Math.max(B,O.drawRange.start),D=Math.min(X,re)-B,0>D&&(D=0)}if(D===0)return null;var j,G=w(x,B,D);O!==void 0&&(j=x===O.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var W=this.processBufferView(x,k,B,D,j),K={bufferView:W.id,byteOffset:W.byteOffset,componentType:k,count:D,max:G.max,min:G.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(K.normalized=!0),H.accessors||(H.accessors=[]),H.accessors.push(K)-1}processImage(x,O,B){var D=this,k=D.cache,U=D.json,H=D.options,X=D.pending;k.images.has(x)||k.images.set(x,{});var re=k.images.get(x),j=O===c.RGBAFormat?"image/png":"image/jpeg",G=j+":flipY/"+B.toString();if(re[G]!==void 0)return re[G];U.images||(U.images=[]);var W={mimeType:j};if(H.embedImages){var K=T=T||document.createElement("canvas");K.width=Math.min(x.width,H.maxTextureSize),K.height=Math.min(x.height,H.maxTextureSize);var ee=K.getContext("2d");if(B===!0&&(ee.translate(0,K.height),ee.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)ee.drawImage(x,0,0,K.width,K.height);else{O!==c.RGBAFormat&&O!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>H.maxTextureSize||x.height>H.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var q=new Uint8ClampedArray(4*(x.height*x.width));if(O===c.RGBAFormat)for(var ie=0;ie<q.length;ie+=4)q[ie+0]=x.data[ie+0],q[ie+1]=x.data[ie+1],q[ie+2]=x.data[ie+2],q[ie+3]=x.data[ie+3];else for(var Y=0,te=0;Y<q.length;Y+=4,te+=3)q[Y+0]=x.data[te+0],q[Y+1]=x.data[te+1],q[Y+2]=x.data[te+2],q[Y+3]=255;ee.putImageData(new ImageData(q,x.width,x.height),0,0)}H.binary===!0?X.push(new Promise(function($){K.toBlob(function(Q){D.processBufferViewImage(Q).then(function(V){W.bufferView=V,$()})},j)})):W.uri=K.toDataURL(j)}else W.uri=x.src;var F=U.images.push(W)-1;return re[G]=F,F}processSampler(x){var O=this.json;O.samplers||(O.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return O.samplers.push(B)-1}processTexture(x){var O=this.cache,B=this.json;if(O.textures.has(x))return O.textures.get(x);B.textures||(B.textures=[]);var D={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(D.name=x.name),this._invokeAll(function(U){U.writeTexture&&U.writeTexture(x,D)});var k=B.textures.push(D)-1;return O.textures.set(x,k),k}processMaterial(x){var O=this.cache,B=this.json;if(O.materials.has(x))return O.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var D={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var k=x.color.toArray().concat([x.opacity]);if(_(k,[1,1,1,1])||(D.pbrMetallicRoughness.baseColorFactor=k),x.isMeshStandardMaterial?(D.pbrMetallicRoughness.metallicFactor=x.metalness,D.pbrMetallicRoughness.roughnessFactor=x.roughness):(D.pbrMetallicRoughness.metallicFactor=.5,D.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var U={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(U,x.metalnessMap),D.pbrMetallicRoughness.metallicRoughnessTexture=U}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var H={index:this.processTexture(x.map)};this.applyTextureTransform(H,x.map),D.pbrMetallicRoughness.baseColorTexture=H}if(x.emissive){var X=x.emissive.clone().multiplyScalar(x.emissiveIntensity),re=Math.max(X.r,X.g,X.b);if(1<re&&(X.multiplyScalar(1/re),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<re&&(D.emissiveFactor=X.toArray()),x.emissiveMap){var j={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(j,x.emissiveMap),D.emissiveTexture=j}}if(x.normalMap){var G={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),G.scale=x.normalScale.x),this.applyTextureTransform(G,x.normalMap),D.normalTexture=G}if(x.aoMap){var W={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(W.strength=x.aoMapIntensity),this.applyTextureTransform(W,x.aoMap),D.occlusionTexture=W}x.transparent?D.alphaMode="BLEND":0<x.alphaTest&&(D.alphaMode="MASK",D.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(D.doubleSided=!0),x.name!==""&&(D.name=x.name),this.serializeUserData(x,D),this._invokeAll(function(ee){ee.writeMaterial&&ee.writeMaterial(x,D)});var K=B.materials.push(D)-1;return O.materials.set(x,K),K}processMesh(x){var O=this.cache,B=this.json,D=[x.geometry.uuid];if(Array.isArray(x.material))for(var k=0,U=x.material.length;k<U;k++)D.push(x.material[k].uuid);else D.push(x.material.uuid);var H=D.join(":");if(O.meshes.has(H))return O.meshes.get(H);var X,re=x.geometry;if(X=x.isLineSegments?h.LINES:x.isLineLoop?h.LINE_LOOP:x.isLine?h.LINE_STRIP:x.isPoints?h.POINTS:x.material.wireframe?h.LINES:h.TRIANGLES,re.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var j={},G={},W=[],K=[],ee={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},q=re.getAttribute("normal");q===void 0||this.isNormalizedNormalAttribute(q)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),re.setAttribute("normal",this.createNormalizedNormalAttribute(q)));var ie=null;for(var Y in re.attributes)if(Y.substr(0,5)!=="morph"){var te=re.attributes[Y];Y=ee[Y]||Y.toUpperCase();var F=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(F.test(Y)||(Y="_"+Y),O.attributes.has(this.getUID(te))){G[Y]=O.attributes.get(this.getUID(te));continue}ie=null;var $=te.array;Y!=="JOINTS_0"||$ instanceof Uint16Array||$ instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),ie=new c.BufferAttribute(new Uint16Array($),te.itemSize,te.normalized));var Q=this.processAccessor(ie||te,re);Q!==null&&(G[Y]=Q,O.attributes.set(this.getUID(te),Q))}if(q!==void 0&&re.setAttribute("normal",q),Object.keys(G).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var V=[],z=[],oe={};if(x.morphTargetDictionary!==void 0)for(var ae in x.morphTargetDictionary)oe[x.morphTargetDictionary[ae]]=ae;for(var le=0;le<x.morphTargetInfluences.length;++le){var fe={},be=!1;for(var ye in re.morphAttributes){if(ye!="position"&&ye!=="normal"&&ye!=="color"){be||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),be=!0);continue}var he=re.morphAttributes[ye][le],ve=ye.toUpperCase();ee[ye]&&(ve=ee[ye]);var se=re.attributes[ye];if(O.attributes.has(this.getUID(he))){fe[ve]=O.attributes.get(this.getUID(he));continue}var we=se.clone();if(!re.morphTargetsRelative)if(se)for(var pe=0,ge=he.count;pe<ge;pe++)se.count>pe&&we.setXYZ(pe,he.getX(pe)-se.getX(pe),he.getY(pe)-se.getY(pe),he.getZ(pe)-se.getZ(pe));else for(var Ee=0,He=he.count;Ee<He;Ee++)we.setXYZ(Ee,0,0,0);fe[ve]=this.processAccessor(we,re),O.attributes.set(this.getUID(se),fe[ve])}K.push(fe),V.push(x.morphTargetInfluences[le]),x.morphTargetDictionary!==void 0&&z.push(oe[le])}j.weights=V,0<z.length&&(j.extras={},j.extras.targetNames=z)}var tt=Array.isArray(x.material);if(tt&&re.groups.length===0)return null;for(var Ie,ot=tt?x.material:[x.material],Le=tt?re.groups:[{materialIndex:0,start:void 0,count:void 0}],Ye=0,We=Le.length;Ye<We;Ye++){if(Ie={mode:X,attributes:G},this.serializeUserData(re,Ie),0<K.length&&(Ie.targets=K),re.index!==null){var it=this.getUID(re.index);(Le[Ye].start!==void 0||Le[Ye].count!==void 0)&&(it+=":"+Le[Ye].start+":"+Le[Ye].count),O.attributes.has(it)?Ie.indices=O.attributes.get(it):(Ie.indices=this.processAccessor(re.index,re,Le[Ye].start,Le[Ye].count),O.attributes.set(it,Ie.indices)),Ie.indices===null&&delete Ie.indices}var et=this.processMaterial(ot[Le[Ye].materialIndex]);et!==null&&(Ie.material=et),W.push(Ie)}j.primitives=W,B.meshes||(B.meshes=[]),this._invokeAll(function(pt){pt.writeMesh&&pt.writeMesh(x,j)});var Mt=B.meshes.push(j)-1;return O.meshes.set(H,Mt),Mt}processCamera(x){var O=this.json;O.cameras||(O.cameras=[]);var B=x.isOrthographicCamera,D={type:B?"orthographic":"perspective"};return B?D.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:D.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(D.name=x.type),O.cameras.push(D)-1}processAnimation(x,O){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),O);for(var k=x.tracks,U=[],H=[],X=0;X<k.length;++X){var re=k[X],j=c.PropertyBinding.parseTrackName(re.name),G=c.PropertyBinding.findNode(O,j.nodeName),W=y[j.propertyName];if(j.objectName==="bones"&&(G.isSkinnedMesh===!0?G=G.skeleton.getBoneByName(j.objectIndex):G=void 0),!G||!W)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',re.name),null;var K=1,ee=re.values.length/re.times.length;W===y.morphTargetInfluences&&(ee/=G.morphTargetInfluences.length);var q=void 0;re.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(q="CUBICSPLINE",ee/=3):re.getInterpolation()===c.InterpolateDiscrete?q="STEP":q="LINEAR",H.push({input:this.processAccessor(new c.BufferAttribute(re.times,K)),output:this.processAccessor(new c.BufferAttribute(re.values,ee)),interpolation:q}),U.push({sampler:H.length-1,target:{node:D.get(G),path:W}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:H,channels:U}),B.animations.length-1}processSkin(x){var O=this.json,B=this.nodeMap,D=O.nodes[B.get(x)],k=x.skeleton;if(k===void 0)return null;var U=x.skeleton.bones[0];if(U===void 0)return null;for(var H=[],X=new Float32Array(16*k.bones.length),re=new c.Matrix4,j=0;j<k.bones.length;++j)H.push(B.get(k.bones[j])),re.copy(k.boneInverses[j]),re.multiply(x.bindMatrix).toArray(X,16*j);O.skins===void 0&&(O.skins=[]),O.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(X,16)),joints:H,skeleton:B.get(U)});var G=D.skin=O.skins.length-1;return G}processNode(x){var O=this.json,B=this.options,D=this.nodeMap;O.nodes||(O.nodes=[]);var k={};if(B.trs){var U=x.quaternion.toArray(),H=x.position.toArray(),X=x.scale.toArray();_(U,[0,0,0,1])||(k.rotation=U),_(H,[0,0,0])||(k.translation=H),_(X,[1,1,1])||(k.scale=X)}else x.matrixAutoUpdate&&x.updateMatrix(),S(x.matrix)===!1&&(k.matrix=x.matrix.elements);if(x.name!==""&&(k.name=x.name+""),this.serializeUserData(x,k),x.isMesh||x.isLine||x.isPoints){var re=this.processMesh(x);re!==null&&(k.mesh=re)}else x.isCamera&&(k.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var j,G=[],W=0,K=x.children.length;W<K;W++)if(j=x.children[W],j.visible||B.onlyVisible===!1){var ee=this.processNode(j);ee!==null&&G.push(ee)}0<G.length&&(k.children=G)}this._invokeAll(function(ie){ie.writeNode&&ie.writeNode(x,k)});var q=O.nodes.push(k)-1;return D.set(x,q),q}processScene(x){var O=this.json,B=this.options;O.scenes||(O.scenes=[],O.scene=0);var D={};x.name!==""&&(D.name=x.name),O.scenes.push(D);for(var k,U=[],H=0,X=x.children.length;H<X;H++)if(k=x.children[H],k.visible||B.onlyVisible===!1){var re=this.processNode(k);re!==null&&U.push(re)}0<U.length&&(D.nodes=U),this.serializeUserData(x,D)}processObjects(x){var O=new c.Scene;O.name="AuxScene";for(var B=0;B<x.length;B++)O.children.push(x[B]);this.processScene(O)}processInput(x){var O=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(H){H.beforeParse&&H.beforeParse(x)});for(var B=[],D=0;D<x.length;D++)x[D]instanceof c.Scene?this.processScene(x[D]):B.push(x[D]);0<B.length&&this.processObjects(B);for(var k=0;k<this.skins.length;++k)this.processSkin(this.skins[k]);for(var U=0;U<O.animations.length;++U)this.processAnimation(O.animations[U].clip,O.animations[U].mesh);this._invokeAll(function(H){H.afterParse&&H.afterParse(x)})}_invokeAll(x){for(var O=0,B=this.plugins.length;O<B;O++)x(this.plugins[O])}}class C{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,O){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,D=B.json,k=B.extensionsUsed,U={};x.name&&(U.name=x.name),U.color=x.color.toArray(),U.intensity=x.intensity,x.isDirectionalLight?U.type="directional":x.isPointLight?(U.type="point",0<x.distance&&(U.range=x.distance)):x.isSpotLight&&(U.type="spot",0<x.distance&&(U.range=x.distance),U.spot={},U.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),U.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),k[this.name]||(D.extensions=D.extensions||{},D.extensions[this.name]={lights:[]},k[this.name]=!0);var H=D.extensions[this.name].lights;H.push(U),O.extensions=O.extensions||{},O.extensions[this.name]={light:H.length-1}}}}class R{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,O){if(x.isMeshBasicMaterial){var B=this.writer,D=B.extensionsUsed;O.extensions=O.extensions||{},O.extensions[this.name]={},D[this.name]=!0,O.pbrMetallicRoughness.metallicFactor=0,O.pbrMetallicRoughness.roughnessFactor=.9}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,O){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,D=B.extensionsUsed,k={};O.pbrMetallicRoughness.baseColorFactor&&(k.diffuseFactor=O.pbrMetallicRoughness.baseColorFactor);var U=[1,1,1];if(x.specular.toArray(U,0),k.specularFactor=U,k.glossinessFactor=x.glossiness,O.pbrMetallicRoughness.baseColorTexture&&(k.diffuseTexture=O.pbrMetallicRoughness.baseColorTexture),x.specularMap){var H={index:B.processTexture(x.specularMap)};B.applyTextureTransform(H,x.specularMap),k.specularGlossinessTexture=H}O.extensions=O.extensions||{},O.extensions[this.name]=k,D[this.name]=!0}}}f.Utils={insertKeyframe:function(x,O){var B,D=.001,k=x.getValueSize(),U=new x.TimeBufferType(x.times.length+1),H=new x.ValueBufferType(x.values.length+k),X=x.createInterpolant(new x.ValueBufferType(k));if(x.times.length===0){U[0]=O;for(var re=0;re<k;re++)H[re]=0;B=0}else if(O<x.times[0]){if(Math.abs(x.times[0]-O)<D)return 0;U[0]=O,U.set(x.times,1),H.set(X.evaluate(O),0),H.set(x.values,k),B=0}else if(O>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-O)<D)return x.times.length-1;U[U.length-1]=O,U.set(x.times,0),H.set(x.values,0),H.set(X.evaluate(O),x.values.length),B=U.length-1}else for(var j=0;j<x.times.length;j++){if(Math.abs(x.times[j]-O)<D)return j;if(x.times[j]<O&&x.times[j+1]>O){U.set(x.times.slice(0,j+1),0),U[j+1]=O,U.set(x.times.slice(j+1),j+2),H.set(x.values.slice(0,(j+1)*k),0),H.set(X.evaluate(O),(j+1)*k),H.set(x.values.slice((j+1)*k),(j+2)*k),B=j+1;break}}return x.times=U,x.values=H,B},mergeMorphTargetTracks:function(x,O){for(var B=[],D={},k=x.tracks,U=0;U<k.length;++U){var H=k[U],X=c.PropertyBinding.parseTrackName(H.name),re=c.PropertyBinding.findNode(O,X.nodeName);if(X.propertyName!=="morphTargetInfluences"||X.propertyIndex===void 0){B.push(H);continue}if(H.createInterpolant!==H.InterpolantFactoryMethodDiscrete&&H.createInterpolant!==H.InterpolantFactoryMethodLinear){if(H.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),H=H.clone(),H.setInterpolation(c.InterpolateLinear)}var j=re.morphTargetInfluences.length,G=re.morphTargetDictionary[X.propertyIndex];if(G===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+X.propertyIndex);var W=void 0;if(D[re.uuid]===void 0){W=H.clone();for(var K=new W.ValueBufferType(j*W.times.length),ee=0;ee<W.times.length;ee++)K[ee*j+G]=W.values[ee];W.name=(X.nodeName||"")+".morphTargetInfluences",W.values=K,D[re.uuid]=W,B.push(W);continue}var q=H.createInterpolant(new H.ValueBufferType(1));W=D[re.uuid];for(var ie=0;ie<W.times.length;ie++)W.values[ie*j+G]=q.evaluate(W.times[ie]);for(var Y,te=0;te<H.times.length;te++)Y=this.insertKeyframe(W,H.times[te]),W.values[Y*j+G]=H.values[te]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var E=this;this.setFromObject=S=>{var{nearPlane:w,farPlane:A,eyePosition:I,targetPosition:T,upVector:P}=S;E.nearPlane=w,E.farPlane=A,E.eyePosition=I,E.targetPosition=T,E.upVector=P}},p=function(E,S,w,A){var I={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},T={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},P={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},C={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},R={};R.MAIN=T.ROTATE,R.AUXILIARY=T.ZOOM,R.SECONDARY=T.PAN,this.cameraObject=E,this.domElement=S===void 0?document:S,this.renderer=w,this.scene=A,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var L=6e3,N=!0,x=0,O=void 0,B=void 0,D=!1,k=500,U=void 0,H="default",X=I.DEFAULT,re=void 0,j=void 0,G=void 0,W=0,K=P.FREE;this._state=T.NONE;var ee;this.targetTouchId=-1;var q=void 0,ie=new c.Vector3,Y=new c.Vector3,te=new c.Vector3,F=new c.Vector3,$=new c.Vector3,Q=new c.Vector3,V=new c.Vector3,z=new c.Vector3,oe=new c.Sphere,ae=new c.Vector3,le=!1,fe=void 0,be=0,ye={default:new h};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=ne=>{var Me=ne.getBoundingBox();if(Me){Me.getBoundingSphere(oe),be=6*oe.radius;var Ce=0;this.cameraObject&&(Ce=this.cameraObject.position.distanceTo(oe.center)),be=Ce>be?1.5*Ce:be}else be=0},this.addViewport=(ne,Me)=>{ne&&Me&&(ye[ne]=Me)},this.setDefaultViewport=ne=>!!(ne&&ne in ye)&&(H=ne,!0),this.getDefaultViewport=()=>H,this.getViewportOfName=ne=>ye[ne],this.setCurrentViewport=ne=>ne in ye&&(this.setCurrentCameraSettings(ye[ne]),!0),this.setRotationMode=ne=>{switch(ne){case"none":K=P.NONE;break;case"horizontal":K=P.HORIZONTAL;break;case"vertical":K=P.VERTICAL;break;case"free":default:K=P.FREE}},this.onResize=()=>{q&&(q=void 0),fe&&fe.setCurrentCameraSettings(this.cameraObject,ye[H])},this.getVisibleHeightAtZDepth=ne=>{var Me=this.cameraObject.position.distanceTo(this.cameraObject.target);ne<Me?ne-=Me:ne+=Me;var Ce=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ce/2)*Math.abs(ne)},this.calculateHeightPerPixelAtZeroDepth=ne=>{var Me=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=Me/ne,this.pixelHeight},this.getNDCFromDocumentCoords=(ne,Me,Ce)=>{Le(!1);var Be=Ce||new c.Vector2,Je=2*((ne-q.left)/q.width)-1,Z=2*-((Me-q.top)/q.height)+1;return Be.set(Je,Z)},this.getRelativeCoordsFromNDC=(ne,Me,Ce)=>{Le(!1);var Be=Ce||new c.Vector2;return Be.x=(ne+1)*q.width/2,Be.y=(1-Me)*q.height/2,Be},this.setMouseButtonAction=(ne,Me)=>{R[ne]=T[Me]};var he=(ne,Me)=>{ne instanceof HTMLCanvasElement&&(ne.tabIndex=Me)},ve=()=>{if(0<be){var ne=ae.distanceTo(oe.center);return be>ne||this.cameraObject.position.distanceTo(oe.center)>ne}return!0},se=ne=>{ae.copy(this.cameraObject.position).add(ne),ve()&&(this.cameraObject.target.add(ne),this.cameraObject.position.add(ne),this.updateDirectionalLight())},we=ne=>{Le(!1);var Me;if(X===I.DEFAULT&&(Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,ne)),!Me)ne.button==0?ne.ctrlKey?this._state=R.AUXILIARY:ne.shiftKey?this._state=R.SECONDARY:this._state=R.MAIN:ne.button==1?(ne.preventDefault(),this._state=R.AUXILIARY):ne.button==2&&(this._state=R.SECONDARY),this.pointer_x=ne.clientX-q.left,this.pointer_y=ne.clientY-q.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{X=I.MINIMAP;var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);se(Ce)}},pe=ne=>{if(Le(!1),q)if(this.pointer_x=ne.clientX-q.left,this.pointer_y=ne.clientY-q.top,X===I.MINIMAP){var Me=this.scene.getNormalisedMinimapCoordinates(this.renderer,ne);if(Me){var Ce=this.scene.getMinimapDiffFromNormalised(Me.x,Me.y);se(Ce)}}else this._state===T.NONE&&ee!==void 0&&ee.move(this,ne.clientX,ne.clientY,this.renderer)},ge=ne=>{this._state=T.NONE,X==I.MINIMAP&&(X=I.DEFAULT),ee!==void 0&&this.pointer_x_start==ne.clientX-q.left&&this.pointer_y_start==ne.clientY-q.top&&ee.pick(this,ne.clientX,ne.clientY,this.renderer)},Ee=ne=>{this._state=T.NONE},He=ne=>{Le(!1);var Me=ne.touches.length;if(Me==1){var Ce,Be;this._state=T.TOUCH_ROTATE,this.pointer_x=ne.touches[0].clientX-((Ce=q)===null||Ce===void 0?void 0:Ce.left),this.pointer_y=ne.touches[0].clientY-((Be=q)===null||Be===void 0?void 0:Be.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(Me==2){this._state=T.TOUCH_ZOOM;var Je=ne.touches[0].clientX-ne.touches[1].clientX,Z=ne.touches[0].clientY-ne.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Je*Je+Z*Z)}else if(Me==3){var de,ce;this._state=T.TOUCH_PAN,this.targetTouchId=ne.touches[0].identifier,this.pointer_x=ne.touches[0].clientX-((de=q)===null||de===void 0?void 0:de.left),this.pointer_y=ne.touches[0].clientY-((ce=q)===null||ce===void 0?void 0:ce.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},tt=ne=>{ne.preventDefault(),ne.stopPropagation();var Me=ne.touches.length;if(Me==1)this.pointer_x=ne.touches[0].clientX-q.left,this.pointer_y=ne.touches[0].clientY-q.top;else if(Me==2){if(this._state===T.TOUCH_ZOOM){var Ce=ne.touches[0].clientX-ne.touches[1].clientX,Be=ne.touches[0].clientY-ne.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ce*Ce+Be*Be)}}else if(Me==3&&this._state===T.TOUCH_PAN)for(var Je=0;3>Je;Je++)ne.touches[Je].identifier==this.targetTouchId&&(this.pointer_x=ne.touches[0].clientX-q.left,this.pointer_y=ne.touches[0].clientY-q.top)},Ie=ne=>{var Me=ne.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=T.NONE,Me==1&&ee!==void 0&&this.pointer_x_start==ne.touches[0].clientX-q.left&&this.pointer_y_start==ne.touches[0].clientY-q.top&&ee.pick(this.cameraObject,ne.touches[0].clientX,ne.touches[0].clientY,this.renderer)},ot=()=>{Le(!0)},Le=ne=>{if(ne||q===void 0){var Me=new IntersectionObserver(Ce=>{for(var Be of Ce)q=Be.boundingClientRect;Me.disconnect()});Me.observe(this.domElement)}},Ye=ne=>{Le(!1),this._state=T.SCROLL;var Me=0;0<ne.deltaY?Me=this.zoomRate:0>ne.deltaY&&(Me=-1*this.zoomRate),W+=Me,ne.preventDefault(),ne.stopImmediatePropagation()},We=ne=>{Le(!1);var Me=0;if(ne.keyCode===C.EQUAL||ne.keyCode===C.MINUS||ne.keyCode===C.NUMPADADD||ne.keyCode===C.NUMPADSUBTRACT){this._state=T.KEYBOARD_ZOOM;var Ce=1;ne.shiftKey&&(Ce*=2),ne.keyCode===C.EQUAL||ne.keyCode===C.NUMPADADD?Me=-1*(this.zoomRate*Ce):(ne.keyCode===C.MINUS||ne.keyCode===C.NUMPADSUBTRACT)&&(Me=this.zoomRate*Ce),W+=Me}else(ne.keyCode===C.ARROWLEFT||ne.keyCode===C.ARROWUP||ne.keyCode===C.ARROWRIGHT||ne.keyCode===C.ARROWDOWN)&&(ne.shiftKey?(this._state=T.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,Me=this.rotateRate):(this._state=T.KEYBOARD_PAN,Me=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,ne.keyCode===C.ARROWLEFT?this.pointer_x-=Me:ne.keyCode===C.ARROWUP?this.pointer_y-=Me:ne.keyCode===C.ARROWRIGHT?this.pointer_x+=Me:ne.keyCode===C.ARROWDOWN&&(this.pointer_y+=Me));ne.preventDefault()},it=ne=>{this._state=T.NONE},et=()=>{if(typeof this.cameraObject<"u"){var ne=q.height,Me=this.cameraObject.position.distanceTo(this.cameraObject.target),Ce=0;this.cameraObject.far>this.cameraObject.near&&Me>=this.cameraObject.near&&Me<=this.cameraObject.far&&(Ce=(Me-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),Y.set(this.previous_pointer_x,ne-this.previous_pointer_y,0),te.set(this.previous_pointer_x,ne-this.previous_pointer_y,1),F.set(this.pointer_x,ne-this.pointer_y,0),$.set(this.pointer_x,ne-this.pointer_y,1),Y.unproject(this.cameraObject),te.unproject(this.cameraObject),F.unproject(this.cameraObject),$.unproject(this.cameraObject);var Be=-.002;F.sub(Y).multiplyScalar(1-Ce),$.sub(te).multiplyScalar(Ce),F.add($).multiplyScalar(Be),se(F)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(ne,Me)=>{ne.normalize(),V.copy(this.cameraObject.position).sub(this.cameraObject.target),z.copy(V),V.normalize(),.8<Math.abs(V.dot(ne))&&V.copy(this.cameraObject.up),Y.crossVectors(ne,V).normalize(),te.crossVectors(ne,Y);var Ce=ne.dot(z),Be=Y.dot(z),Je=te.dot(z),Z=ne.dot(this.cameraObject.up),de=Y.dot(this.cameraObject.up),ce=te.dot(this.cameraObject.up),me=Math.cos(Me),Se=Math.sin(Me);return F.set(me*Y.x+Se*te.x,me*Y.y+Se*te.y,me*Y.z+Se*te.z),$.set(me*te.x-Se*Y.x,me*te.y-Se*Y.y,me*te.z-Se*Y.z),V.copy(this.cameraObject.target),V.x=V.x+ne.x*Ce+F.x*Be+$.x*Je,V.y=V.y+ne.y*Ce+F.y*Be+$.y*Je,V.z=V.z+ne.z*Ce+F.z*Be+$.z*Je,ie.set(ne.x*Z+F.x*de+$.x*ce,ne.y*Z+F.y*de+$.y*ce,ne.z*Z+F.z*de+$.z*ce),{position:V,up:ie}},this.rotateAboutLookAtpoint=(ne,Me)=>{var Ce=this.getVectorsFromRotateAboutLookAtPoints(ne,Me);this.cameraObject.position.copy(Ce.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ce.up)};var Mt=()=>{if(typeof this.cameraObject<"u"){var ne,Me,Ce=(ne=q)===null||ne===void 0?void 0:ne.width,Be=(Me=q)===null||Me===void 0?void 0:Me.height;if(0<Ce&&0<Be){var Je=.25*(Ce+Be),Z=0,de=0;(K===P.FREE||K===P.HORIZONTAL)&&(Z=this.pointer_x-this.previous_pointer_x),(K===P.FREE||K===P.VERTICAL)&&(de=this.previous_pointer_y-this.pointer_y);var ce=Math.sqrt(Z*Z+de*de);if(0<ce){var me=1*-de/ce,Se=1*Z/ce,ue=0;K===P.FREE&&me*(this.pointer_x-.5*(Ce-1))+Se*(.5*(Be-1)-this.pointer_y);var xe=Math.acos(ue/Je)-.5*Math.PI,Te=this.tumble_rate*ce/Je;ie.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),Y.copy(this.cameraObject.up).normalize(),te.copy(Y).cross(ie).normalize().multiplyScalar(me),Y.multiplyScalar(Se),Q.addVectors(te,Y).multiplyScalar(Math.cos(xe)),ie.multiplyScalar(Math.sin(xe)),Q.add(ie),this.rotateAboutLookAtpoint(Q,-Te)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},pt=()=>{var ne=0;return this._state===T.ZOOM?ne=this.previous_pointer_y-this.pointer_y:this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM?ne=W:(ne=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),ne};this.changeZoomByScrollRateUnit=ne=>{var Me=ne*this.zoomRate;this.changeZoomByValue(Me)},this.changeZoomByValue=ne=>{if(typeof this.cameraObject<"u"){var Me=q.height,Ce=this.cameraObject.position.clone();Ce.sub(this.cameraObject.target);var Be=Ce.length(),Je=1.5*ne/Me;if(.01<Be+Je*Be&&(Ce.normalize(),ae.copy(this.cameraObject.position),ae.x+=Ce.x*Je*Be,ae.y+=Ce.y*Je*Be,ae.z+=Ce.z*Je*Be,ve())){this.cameraObject.position.copy(ae),this.updateDirectionalLight();var Z=1e-5;if(Z*this.cameraObject.far<this.cameraObject.near+Je*Be+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Je*Be,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Je*Be,this.cameraObject.far+=Je*Be));else{if(this.near_plane_fly_debt==0){var de=this.cameraObject.near-Z*this.cameraObject.far;this.cameraObject.near=Z*this.cameraObject.far,this.cameraObject.far-=de,this.near_plane_fly_debt-=Z*this.cameraObject.far}this.near_plane_fly_debt+=Je*Be}le=!0}}};var hn=()=>{var ne=pt();this.changeZoomByValue(ne),this._state===T.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(W=0,this._state=T.NONE)};this.setDirectionalLight=ne=>{this.directionalLight=ne},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){N=!0,this.domElement&&this.domElement.addEventListener&&(he(this.domElement,0),this.domElement.addEventListener("mousedown",we,!1),this.domElement.addEventListener("mousemove",pe,!1),this.domElement.addEventListener("mouseup",ge,!1),this.domElement.addEventListener("mouseleave",Ee,!1),this.domElement.addEventListener("touchstart",He,!1),this.domElement.addEventListener("touchmove",tt,!1),this.domElement.addEventListener("touchend",Ie,!1),this.domElement.addEventListener("wheel",Ye,!1),this.domElement.addEventListener("mouseenter",ot,!1),this.domElement.addEventListener("contextmenu",ne=>{ne.preventDefault()},!1),this.domElement.addEventListener("keydown",We,!1),this.domElement.addEventListener("keyup",it,!1))},this.disable=function(){N=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",we,!1),this.domElement.removeEventListener("mousemove",pe,!1),this.domElement.removeEventListener("mouseup",ge,!1),this.domElement.removeEventListener("mouseleave",Ee,!1),this.domElement.removeEventListener("touchstart",He,!1),this.domElement.removeEventListener("touchmove",tt,!1),this.domElement.removeEventListener("touchend",Ie,!1),this.domElement.removeEventListener("wheel",Ye,!1),this.domElement.removeEventListener("mouseenter",ot,!1),this.domElement.removeEventListener("contextmenu",ne=>{ne.preventDefault()},!1),this.domElement.removeEventListener("keydown",We,!1),this.domElement.removeEventListener("keyup",it,!1),he(this.domElement,-1))},this.loadPath=ne=>{O=ne.CameraPath,B=ne.NumberOfPoints},this.loadPathURL=(ne,Me)=>{var Ce=new XMLHttpRequest;Ce.onreadystatechange=()=>{if(Ce.readyState==4&&Ce.status==200){var Je=JSON.parse(Ce.responseText);this.loadPath(Je),Me!=null&&typeof Me=="function"&&Me()}};var Be=f(ne);Ce.open("GET",Be,!0),Ce.send()},this.setPathDuration=ne=>{L=ne,re&&re.setDuration(L),j&&j.setDuration(L)},this.getPlayRate=()=>k,this.setPlayRate=ne=>{k=ne};var Mn=ne=>{var Me=x+ne;Me>L&&(Me-=L),x=Me};this.getTime=()=>x,this.setTime=ne=>{x=ne>L?L:0>ne?0:ne},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var ne=x/L*(B-1),Me=Math.floor(ne),Ce=1-(ne-Me),Be=Math.ceil(ne);return Me==Be?Me==B-1?[Me-1,Be,0]:[Me,Be+1,1]:[Me,Be,Ce]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=ne=>{2<B&&(x=L*ne/(B-1),0>x&&(x=0),x>L&&(x=L))};var jn=ne=>{if(X===I.PATH&&(Mn(ne),O)){for(var Me=this.getCurrentTimeFrame(),Ce=Me[0],Be=Me[1],Je=Me[2],Z=[O[3*Ce],O[3*Ce+1],O[3*Ce+2]],de=[O[3*Be],O[3*Be+1],O[3*Be+2]],ce=[],me=0;me<Z.length;me++)ce.push(Je*Z[me]+(1-Je)*de[me]);this.cameraObject.position.set(ce[0],ce[1],ce[2]),this.cameraObject.target.set(de[0],de[1],de[2]),U&&this.cameraObject.lookAt(this.cameraObject.target),D&&(this.directionalLight.position.set(ce[0],ce[1],ce[2]),this.directionalLight.target.position.set(de[0],de[1],de[2]))}};this.calculatePathNow=()=>{jn(0)};var us=()=>{this._state===T.ROTATE||this._state===T.TOUCH_ROTATE||this._state===T.KEYBOARD_ROTATE?Mt():this._state===T.PAN||this._state===T.TOUCH_PAN||this._state===T.KEYBOARD_PAN?(et(),fe.triggerCallback()):(this._state===T.ZOOM||this._state===T.TOUCH_ZOOM||this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(fe.zoom(pt()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&(this._state=T.NONE),W=0,fe.triggerCallback())};this.update=ne=>{var Me=ne*k,Ce=N,Be=!0;return X===I.PATH?jn(Me):X===I.SMOOTH_CAMERA_TRANSITION&&re?(re.update(Me),re.isTransitionCompleted()&&(X=I.DEFAULT),Ce=!1):X===I.ROTATE_CAMERA_TRANSITION&&j?(j.update(Me),j.isTransitionCompleted()&&(X=I.DEFAULT),Ce=!1):X===I.AUTO_TUMBLE&&G?G.update(Me):X===I.SYNC_CONTROL&&fe?(us(),Ce=!1):Be=!1,Ce&&(this._state!==T.NONE&&(Be=!0),this._state===T.ROTATE||this._state===T.TOUCH_ROTATE||this._state===T.KEYBOARD_ROTATE?Mt():this._state===T.PAN||this._state===T.TOUCH_PAN||this._state===T.KEYBOARD_PAN?et():(this._state===T.ZOOM||this._state===T.TOUCH_ZOOM||this._state===T.SCROLL||this._state===T.KEYBOARD_ZOOM)&&hn(),this._state!==T.NONE&&X===I.AUTO_TUMBLE&&G&&G.stopOnCameraInput,this._state===T.SCROLL&&(this._state=T.NONE)),U?(Be=!0,U.update()):this.cameraObject.lookAt(this.cameraObject.target),Be=Be||le,le=!1,Be},this.playPath=()=>{X=I.PATH},this.stopPath=()=>{X=I.DEFAULT},this.isPlayingPath=()=>X===I.PATH,this.enableDirectionalLightUpdateWithPath=ne=>{D=ne},this.enableDeviceOrientation=()=>{U||(U=new M(this.cameraObject))},this.disableDeviceOrientation=()=>{U&&(U.dispose(),U=void 0)},this.isDeviceOrientationEnabled=()=>!!U,this.resetView=()=>{var ne=ye[H];this.cameraObject.near=ne.nearPlane,this.cameraObject.far=ne.farPlane,this.cameraObject.position.set(ne.eyePosition[0],ne.eyePosition[1],ne.eyePosition[2]),this.cameraObject.target.set(ne.targetPosition[0],ne.targetPosition[1],ne.targetPosition[2]),this.cameraObject.up.set(ne.upVector[0],ne.upVector[1],ne.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=ne=>{ne.nearPlane&&(this.cameraObject.near=ne.nearPlane),ne.farPlane&&(this.cameraObject.far=ne.farPlane),ne.eyePosition&&this.cameraObject.position.set(ne.eyePosition[0],ne.eyePosition[1],ne.eyePosition[2]),ne.targetPosition&&this.cameraObject.target.set(ne.targetPosition[0],ne.targetPosition[1],ne.targetPosition[2]),ne.upVector&&this.cameraObject.up.set(ne.upVector[0],ne.upVector[1],ne.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),le=!0},this.getViewportFromCentreAndRadius=(ne,Me,Ce,Be,Je,Z)=>{var de=this.cameraObject.position.x-this.cameraObject.target.x,ce=this.cameraObject.position.y-this.cameraObject.target.y,me=this.cameraObject.position.z-this.cameraObject.target.z,Se=1/Math.sqrt(de*de+ce*ce+me*me);de*=Se,ce*=Se,me*=Se;var ue=[ne,Me,Ce],xe=Be/Math.tan(Je*Math.PI/360),Te=[ne+de*xe,Me+ce*xe,Ce+me*xe],Pe=xe+Z,Ne=0,ze=.95;Ne=Z>ze*xe?(1-ze)*xe:xe-Z;var Fe=new h;return Fe.nearPlane=Ne,Fe.farPlane=Pe,Fe.eyePosition=Te,Fe.targetPosition=ue,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(ne,Me)=>{var Ce=ne.min.distanceTo(ne.max)/2*Me,Be=(ne.min.x+ne.max.x)/2,Je=(ne.min.y+ne.max.y)/2,Z=(ne.min.z+ne.max.z)/2,de=4,ce=this.getViewportFromCentreAndRadius(Be,Je,Z,Ce,40,Ce*de);return ce},this.getCurrentViewport=()=>{var ne=new h;return ne.nearPlane=this.cameraObject.near,ne.farPlane=this.cameraObject.far,ne.eyePosition[0]=this.cameraObject.position.x,ne.eyePosition[1]=this.cameraObject.position.y,ne.eyePosition[2]=this.cameraObject.position.z,ne.targetPosition[0]=this.cameraObject.target.x,ne.targetPosition[1]=this.cameraObject.target.y,ne.targetPosition[2]=this.cameraObject.target.z,ne.upVector[0]=this.cameraObject.up.x,ne.upVector[1]=this.cameraObject.up.y,ne.upVector[2]=this.cameraObject.up.z,ne},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(ne,Me,Ce)=>{j==null&&(re=new y(ne,Me,this,Ce))},this.rotateCameraTransition=(ne,Me,Ce)=>{re==null&&(j=new m(ne,Me,this,Ce))},this.enableCameraTransition=()=>{re&&(X=I.SMOOTH_CAMERA_TRANSITION),j&&(X=I.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{X=I.DEFAULT},this.stopCameraTransition=()=>{X=I.DEFAULT,re=void 0,j=void 0},this.isTransitioningCamera=()=>X===I.SMOOTH_CAMERA_TRANSITION||X===I.ROTATE_CAMERA_TRANSITION,this.autoTumble=(ne,Me,Ce)=>{G=new b(ne,Me,Ce,this)},this.enableAutoTumble=()=>{X=I.AUTO_TUMBLE},this.stopAutoTumble=()=>{X=I.DEFAULT,G=void 0},this.updateAutoTumble=()=>{G&&(G.requireUpdate=!0)},this.isAutoTumble=()=>X===I.AUTO_TUMBLE,this.enableRaycaster=(ne,Me,Ce)=>{ee==null&&(ee=new d(ne,this.scene,Me,Ce,this.renderer))},this.disableRaycaster=()=>{ee.disable(),ee=void 0},this.isSyncControl=()=>currentMpde===I.SYNC_CONTROL,this.enableSyncControl=()=>(X=I.SYNC_CONTROL,fe||(fe=new _),fe.setCurrentCameraSettings(this.cameraObject,ye[H]),fe),this.disableSyncControl=()=>{X=I.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(S,w,A,I){var T=S.eyePosition,P=S.targetPosition,C=S.upVector,R=w.eyePosition,L=w.targetPosition,N=w.upVector,x=A,O=I,B=0,D=!1;x.near=Math.min(S.nearPlane,w.nearPlane),x.far=Math.max(S.farPlane,w.farPlane),x.cameraObject.up.set(w.upVector[0],w.upVector[1],w.upVector[2]),this.setDuration=H=>{O=H};var k=H=>{var X=B+H;X>O&&(X=O),B=X},U=()=>{var H=B/O,X=[T[0]*(1-H)+R[0]*H,T[1]*(1-H)+R[1]*H,T[2]*(1-H)+R[2]*H],re=[P[0]*(1-H)+L[0]*H,P[1]*(1-H)+L[1]*H,P[2]*(1-H)+L[2]*H];C[0]*(1-H)+N[0]*H,C[1]*(1-H)+N[1]*H,C[2]*(1-H)+N[2]*H,x.cameraObject.position.set(X[0],X[1],X[2]),x.cameraObject.target.set(re[0],re[1],re[2])};this.update=H=>{this.enabled===!1||(k(H),U(),B==O&&(D=!0))},this.isTransitionCompleted=()=>D},m=function(S,w,A,I){var T=S,P=w,C=A,R=I,L=0,N=!1;this.setDuration=O=>{R=O};var x=O=>{var B=L,D=L+O;D>R&&(D=R),L=D;var k=L-B,U=k/R,H=U*P;C.rotateAboutLookAtpoint(T,H)};this.update=O=>{this.enabled===!1||(x(O),L==R&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(S,w,A,I,T){var P=S,C=w,R=T,L=A,N=I,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var O=new c.Vector2,B=!1,D=new Date,k=!1,U=0,H=[],X={zincCamera:void 0,x:-1,y:-1},re=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=W=>{if(C!==P){var K=P.getThreeJSScene();R.render(K,W.cameraObject)}var ee=re||P.getPickableThreeJSObjects();return H.length=0,x.intersectObjects(ee,!0,H)},this.setPickableObjects=W=>{W===void 0?re=void 0:(re=[],W.forEach(K=>{K.getGroup()&&K.getGroup().visible&&re.push(K.getGroup())}))},this.getIntersectsObjectWithOrigin=(W,K,ee)=>(x.set(K,ee),this.getIntersectsObject(W)),this.getIntersectsObjectWithCamera=(W,K,ee)=>(W.getNDCFromDocumentCoords(K,ee,O),x.setFromCamera(O,W.cameraObject),this.getIntersectsObject(W)),this.pick=(W,K,ee)=>{if(R&&P&&W&&L){this.getIntersectsObjectWithCamera(W,K,ee);for(var q,ie=H.length,Y=0;Y<ie;Y++)if(q=H[Y].object?H[Y].object.userData:void 0,q&&q.isMarkerCluster&&q.visible&&q.clusterIsVisible(H[Y].object.clusterIndex)&&q.zoomToCluster(H[Y].object.clusterIndex))return;L(H,K,ee)}};var j=(W,K,ee)=>{if(R&&P&&W&&N){if(this.getIntersectsObjectWithCamera(W,K,ee),D.setTime(Date.now()),H.length===0){if(k)return;k=!0}else k=!1;N(H,K,ee)}};this.move=(W,K,ee)=>{R&&P&&W&&N&&(P.displayMarkers?j(W,K,ee):(X.zincCamera=W,X.x=K,X.y=ee,!B&&(U=D?Date.now()-D.getTime():250,250<=U?j(W,K,ee):(B=!0,setTimeout(G(X),U)))))};var G=W=>function(){B=!1,j(W.zincCamera,W.x,W.y)}},b=function(S,w,A,I){var T=new c.Vector3,P=-w,C=I,R=S;this.stopOnCameraInput=A,this.requireUpdate=!0;var L=new c.Vector3,N=new c.Vector3,x=O=>{var B=Math.sqrt(O[0]*O[0]+O[1]*O[1]),D=4*Math.abs(O[0]),k=4*Math.abs(O[1]),U=.25*(D+k),H=-O[1]/B,X=O[0]/B,re=H*O[0]+X*-O[1];re>U?re=U:re<-U&&(re=-U);var j=Math.acos(re/U)-.5*Math.PI;T.copy(C.cameraObject.position).sub(C.cameraObject.target).normalize(),L.copy(C.cameraObject.up).normalize(),N.crossVectors(L,T).normalize().multiplyScalar(H),L.multiplyScalar(X),L.add(N).multiplyScalar(Math.cos(j)),T.multiplyScalar(Math.sin(j)).add(L)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(x(R),this.requireUpdate=!1),C.rotateAboutLookAtpoint(T,P*O/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var E,S,w,A,I,T,P=new c.Matrix4,C=new c.Matrix4;return function(L){var N=E!==L.focus||S!==L.fov||w!==L.aspect*this.aspect||A!==L.near||I!==L.far||T!==L.zoom;if(N){E=L.focus,S=L.fov,w=L.aspect*this.aspect,A=L.near,I=L.far,T=L.zoom;var x,O,B=L.projectionMatrix.clone(),D=.064/2,k=D*A/E,U=A*Math.tan(.5*(c.Math.DEG2RAD*S))/L.zoom;C.elements[12]=-D,P.elements[12]=D,x=-U*w+k,O=U*w+k,B.elements[0]=2*A/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraL.projectionMatrix.copy(B),x=-U*w-k,O=U*w-k,B.elements[0]=2*A/(O-x),B.elements[8]=(O+x)/(O-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(L.matrixWorld).multiply(C),this.cameraR.matrixWorld.copy(L.matrixWorld).multiply(P)}})()});var g=function(S){var w=new v;w.aspect=.5,this.setSize=(A,I)=>{S.setSize(A,I)},this.render=(A,I)=>{A.updateMatrixWorld(),I.parent===null&&I.updateMatrixWorld(),w.update(I);var T=S.getSize();S.setScissorTest(!0),S.clear(),S.setScissor(0,0,T.width/2,T.height),S.setViewport(0,0,T.width/2,T.height),S.render(A,w.cameraL),S.setScissor(T.width/2,0,T.width/2,T.height),S.setViewport(T.width/2,0,T.width/2,T.height),S.render(A,w.cameraR),S.setScissorTest(!1)}},M=function(S){var w=this;this.object=S,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var A=P=>{w.deviceOrientation=P},I=()=>{typeof window<"u"&&(w.screenOrientation=window.orientation||0)},T=(()=>{var P=new c.Vector3(0,0,1),C=new c.Euler,R=new c.Quaternion,L=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,x,O,B,D)=>{var k=new c.Vector3(0,0,1);k.subVectors(N.target,N.position),C.set(O,x,-B,"YXZ");var U=new c.Quaternion;U.setFromEuler(C),U.multiply(L),U.multiply(R.setFromAxisAngle(P,-D)),k.applyQuaternion(U),k.addVectors(N.position,k),N.lookAt(k)}})();this.connect=()=>{I(),typeof window<"u"&&(window.addEventListener("orientationchange",I,!1),window.addEventListener("deviceorientation",A,!1)),w.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",I,!1),window.removeEventListener("deviceorientation",A,!1)),w.enabled=!1},this.update=()=>{if(w.enabled!==!1){var P=w.deviceOrientation.alpha?c.Math.degToRad(w.deviceOrientation.alpha):0,C=w.deviceOrientation.beta?c.Math.degToRad(w.deviceOrientation.beta):0,R=w.deviceOrientation.gamma?c.Math.degToRad(w.deviceOrientation.gamma):0,L=w.screenOrientation?c.Math.degToRad(w.screenOrientation):0;T(w.object,P,C,R,L)}},this.dispose=function(){this.disconnect()},this.connect()},_=function(){var S=void 0,w=void 0,A=void 0,I=new c.Vector3,T=new c.Vector3,P=new c.Vector3,C=new c.Vector3,R=void 0;this.setCurrentCameraSettings=(L,N)=>{S=L.clone(),w=L,A=N,S.near=A.nearPlane,A.farPlane&&(S.far=A.farPlane),A.eyePosition&&S.position.set(A.eyePosition[0],A.eyePosition[1],A.eyePosition[2]),A.upVector&&S.up.set(A.upVector[0],A.upVector[1],A.upVector[2]),A.targetPosition&&(S.target=new c.Vector3(A.targetPosition[0],A.targetPosition[1],A.targetPosition[2]),S.lookAt(S.target)),S.updateProjectionMatrix(),I.copy(S.position).project(S),T.copy(S.target).project(S)},this.getCurrentPosition=()=>(T.copy(w.target).project(S),[T.x,T.y]),this.zoom=L=>{var N=.002*L,x=Math.max(w.zoom-N,1);w.zoom=x,w.updateProjectionMatrix()},this.zoomToBox=(L,N)=>{L.getCenter(P),P.project(S),this.setCenterZoom([P.x,P.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:w.zoom}),this.setCenterZoom=(L,N)=>{P.set(L[0],L[1],T.z).unproject(S),C.copy(P).sub(w.target),w.target.copy(P),w.lookAt(w.target),w.position.add(C),w.zoom=N,w.updateProjectionMatrix()},this.setEventCallback=L=>{(L===void 0||typeof L=="function")&&(R=L)},this.triggerCallback=()=>{R!==void 0&&typeof R=="function"&&R()}};l.Viewport=h,l.CameraControls=p,l.SmoothCameraTransition=y,l.RotateCameraTransition=m,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=_},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var p=u(45).Lines2,y=u(3).Geometry,m=u(4),d=0,b=function(){return"re"+d++},v=function(g,M){var _=g,E=new c;E.matrixAutoUpdate=!1,E.userData=this;var S=[],w="",A=[],I=M,T=new f,P=3e3;T.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{S.forEach(C=>C.hideAllPrimitives()),A.forEach(C=>C.setVisibility(!1))},this.showAllPrimitives=()=>{S.forEach(C=>C.showAllPrimitives()),A.forEach(C=>C.setVisibility(!0))},this.setVisibility=C=>{C!=E.visible&&(E.visible=C,this.pickableUpdateRequired=!0)},this.getVisibility=()=>E.visible,this.getGroup=()=>E,this.setTransformation=C=>{T.set(...C),E.matrix.copy(T),E.updateMatrixWorld()},this.setName=C=>{C&&C!==""&&(w=C)},this.getName=()=>w,this.getParent=()=>_,this.getFullSeparatedPath=()=>{var C=[];if(w!==""){C.push(w);for(var R,L=_;L!==void 0;)R=L.getName(),R!==""&&C.unshift(R),L=L.getParent()}return C},this.getFullPath=()=>{var C=this.getFullSeparatedPath();if(0<C.length){var R=C.shift();return C.forEach(L=>{R=R.concat("/",L)}),R}return""},this.createChild=C=>{var R=new v(this,I);return R.setName(C),S.push(R),E.add(R.getGroup()),R},this.getChildWithName=C=>{if(C){for(var R=C.toLowerCase(),L=0;L<S.length;L++)if(S[L].getName().toLowerCase()===R)return S[L]}},this.findChildFromSeparatedPath=C=>{if(C&&0<C.length&&C[0]===""&&C.shift(),C&&0<C.length){var R=this.getChildWithName(C[0]);return R?(C.shift(),R.findChildFromSeparatedPath(C)):void 0}return this},this.findChildFromPath=C=>{var R=C.split("/");return this.findChildFromSeparatedPath(R)},this.createChildFromSeparatedPath=C=>{if(0<C.length&&C[0]===""&&C.shift(),0<C.length){var R=this.getChildWithName(C[0]);return R||(R=this.createChild(C[0])),C.shift(),R.createChildFromSeparatedPath(C)}return this},this.createChildFromPath=C=>{var R=C.split("/");return this.createChildFromSeparatedPath(R)},this.findOrCreateChildFromPath=C=>{var R=this.findChildFromPath(C);return R||(R=this.createChildFromPath(C)),R},this.addZincObject=C=>{C&&(C.setRegion(this),E.add(C.getGroup()),A.push(C),this.pickableUpdateRequired=!0,I&&I.triggerObjectAddedCallback(C))},this.removeZincObject=C=>{for(var R=0;R<A.length;R++)if(C===A[R])return E.remove(C.getGroup()),A.splice(R,1),I&&I.triggerObjectRemovedCallback(C),C.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=C=>{if(this.pickableUpdateRequired)return!0;if(C){for(var R=!1,L=0;L<S.length;L++)if(R=S[L].checkPickableUpdateRequred(C),R)return!0}return!1},this.getPickableThreeJSObjects=(C,R)=>(E.visible&&(A.forEach(L=>{if(L.getGroup()&&L.getGroup().visible){var N=L.marker;N&&N.isEnabled()&&C.push(N.getMorph()),C.push(L.getGroup())}}),R&&S.forEach(L=>{L.getPickableThreeJSObjects(C,R)}),this.pickableUpdateRequired=!1),C),this.setDuration=C=>{P=C,A.forEach(R=>R.setDuration(C)),S.forEach(R=>R.setDuration(C))},this.getDuration=()=>P,this.getBoundingBox=C=>{var R,L;return A.forEach(N=>{L=N.getBoundingBox(),L&&(R==null?R=L.clone():R.union(L))}),C&&S.forEach(N=>{L=N.getBoundingBox(C),L&&(R==null?R=L.clone():R.union(L))}),R},this.clear=C=>{C&&S.forEach(R=>R.clear(C)),A.forEach(R=>{E.remove(R.getGroup()),R.dispose()}),S=[],A=[]},this.objectIsInRegion=(C,R)=>{for(var L=0;L<A.length;L++)if(C===A[L])return!0;if(R){for(var N=0;N<S.length;N++)if(S[N].objectIsInRegion(C,R))return!0}return!1},this.forEachGeometry=(C,R)=>{A.forEach(L=>{L.isGeometry&&C(L)}),R&&S.forEach(L=>L.forEachGeometry(C,R))},this.forEachGlyphset=(C,R)=>{A.forEach(L=>{L.isGlyphset&&C(L)}),R&&S.forEach(L=>L.forEachGlyphset(C,R))},this.forEachPointset=(C,R)=>{A.forEach(L=>{L.isPointset&&C(L)}),R&&S.forEach(L=>L.forEachPointset(C,R))},this.forEachLine=(C,R)=>{A.forEach(L=>{L.isLines&&C(L)}),R&&S.forEach(L=>L.forEachLine(C,R))},this.findObjectsWithAnatomicalId=(C,R)=>(A.forEach(L=>{L.anatomicalId===C&&objectsArray.push(L)}),R&&S.forEach(L=>{var N=L.findObjectsWithAnatomicalId(C,R);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(C,R)=>{var L=[];return A.forEach(N=>{var x=N.groupName?N.groupName.toLowerCase():N.groupName,O=C&&C.toLowerCase();x===O&&L.push(N)}),R&&S.forEach(N=>{var x=N.findObjectsWithGroupName(C,R);L.push(...x)}),L},this.findGeometriesWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isGeometry);return N},this.findPointsetsWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isPointset);return N},this.findGlyphsetsWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isGlyphset);return N},this.findLinesWithGroupName=(C,R)=>{var L=this.findObjectsWithGroupName(C,R),N=L.filter(x=>x.isLines);return N},this.getAllObjects=C=>{var R=[...A];return C&&S.forEach(L=>{var N=L.getAllObjects(C);R.push(...N)}),R},this.getChildRegions=C=>{var R=[...S];return C&&S.forEach(L=>{var N=L.getChildRegions(C);R.push(...N)}),R},this.getCurrentTime=()=>{if(A[0]!=null)return A[0].getCurrentTime();for(var C,R=0;R<S.length;R++)if(C=S[R].getCurrentTime(),C!==-1)return C;return-1},this.setMorphTime=(C,R)=>{A.forEach(L=>{L.setMorphTime(C)}),R&&S.forEach(L=>{L.setMorphTime(C)})},this.isTimeVarying=()=>{for(var C=0;C<A.length;C++)if(A[C].isTimeVarying())return!0;for(var R=0;R<S.length;R++)if(S[R].isTimeVarying())return!0;return!1},this.renderGeometries=(C,R,L,N,x,O)=>{var B,D=this.getAllObjects(O);D.forEach(k=>{k.render(C*R,L,N,x)}),x&&L===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(C,R,L,N)=>{var x=!1,O=this.findObjectsWithGroupName(C,!1),B=O.findIndex(k=>k.isPointset),D=-1<B?O[B]:new h;return D.addPoints(R,L,N),B===-1?(D.setName(C),this.addZincObject(D),x=!0):this.pickableUpdateRequired=!0,{zincObject:D,isNew:x}},this.createLines=(C,R,L)=>{var N=!1,x=this.findObjectsWithGroupName(C,!1),O=x.findIndex(D=>D.isLines),B=-1<O?x[O]:new p;return B.addLines(R,L),O===-1?(B.setName(C),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(C,R,L,N,x,O)=>{var B=new y,D=new m.MeshPhongMaterial({color:L,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:m.DoubleSide});return B.createMesh(R,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(C),B.setRenderOrder(O),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(m,d,b)=>{if(m&&d){var v=new h;v.setPositions(m),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=m[0][0],y[b++]=m[0][1],y[b++]=m[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(m){var d=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(m,d){if(m&&m.length){var b=this.getMorph(),v=d+m.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(m.forEach(M=>{y[g++]=M[0],y[g++]=M[1],y[g++]=M[2]}),g=3*this.drawRange;300>g;)y[g++]=m[0][0],y[g++]=m[0][1],y[g++]=m[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(m,d)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>A});var c=u(4),f=u(47),h=u(48),p=new c.Vector3,y=new c.Vector3,m=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,M=new c.Line3,_=new c.Vector3,E=new c.Box3,S=new c.Sphere,w=new c.Vector4;class A extends c.Mesh{constructor(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(T,P),this.type="LineSegments2"}computeLineDistances(){for(var T=this.geometry,P=T.attributes.instanceStart,C=T.attributes.instanceEnd,R=new Float32Array(2*P.count),L=0,N=0,x=P.count;L<x;L++,N+=2)p.fromBufferAttribute(P,L),y.fromBufferAttribute(C,L),R[N]=N==0?0:R[N-1],R[N+1]=R[N]+p.distanceTo(y);var O=new c.InstancedInterleavedBuffer(R,2,1);return T.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(O,1,0)),T.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(O,1,1)),this}raycast(T,P){T.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var C=T.params.Line2===void 0?0:T.params.Line2.threshold||0,R=T.ray,L=T.camera,N=L.projectionMatrix,x=this.matrixWorld,O=this.geometry,B=this.material,D=B.resolution,k=B.linewidth+C,U=O.attributes.instanceStart,H=O.attributes.instanceEnd,X=-L.near,re=2*Math.max(k/D.width,k/D.height);O.boundingSphere===null&&O.computeBoundingSphere(),S.copy(O.boundingSphere).applyMatrix4(x);var j=Math.max(L.near,S.distanceToPoint(R.origin));w.set(0,0,-j,1).applyMatrix4(L.projectionMatrix),w.multiplyScalar(1/w.w),w.applyMatrix4(L.projectionMatrixInverse);var G=.5*Math.abs(re/w.w);if(S.radius+=G,T.ray.intersectsSphere(S)!==!1){O.boundingBox===null&&O.computeBoundingBox(),E.copy(O.boundingBox).applyMatrix4(x);var W=Math.max(L.near,E.distanceToPoint(R.origin));w.set(0,0,-W,1).applyMatrix4(L.projectionMatrix),w.multiplyScalar(1/w.w),w.applyMatrix4(L.projectionMatrixInverse);var K=.5*Math.abs(re/w.w);if(E.max.x+=K,E.max.y+=K,E.max.z+=K,E.min.x-=K,E.min.y-=K,E.min.z-=K,T.ray.intersectsBox(E)!==!1){R.at(1,b),b.w=1,b.applyMatrix4(L.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=D.x/2,b.y*=D.y/2,b.z=0,v.copy(b),g.multiplyMatrices(L.matrixWorldInverse,x);for(var ee=0,q=U.count;ee<q;ee++){m.fromBufferAttribute(U,ee),d.fromBufferAttribute(H,ee),m.w=1,d.w=1,m.applyMatrix4(g),d.applyMatrix4(g);var ie=m.z>X&&d.z>X;if(!ie){if(m.z>X){var Y=m.z-d.z,te=(m.z-X)/Y;m.lerp(d,te)}else if(d.z>X){var F=d.z-m.z,$=(d.z-X)/F;d.lerp(m,$)}m.applyMatrix4(N),d.applyMatrix4(N),m.multiplyScalar(1/m.w),d.multiplyScalar(1/d.w),m.x*=D.x/2,m.y*=D.y/2,d.x*=D.x/2,d.y*=D.y/2,M.start.copy(m),M.start.z=0,M.end.copy(d),M.end.z=0;var Q=M.closestPointToPointParameter(v,!0);M.at(Q,_);var V=c.MathUtils.lerp(m.z,d.z,Q),z=-1<=V&&1>=V,oe=v.distanceTo(_)<.5*k;if(z&&oe){M.start.fromBufferAttribute(U,ee),M.end.fromBufferAttribute(H,ee),M.start.applyMatrix4(x),M.end.applyMatrix4(x);var ae=new c.Vector3,le=new c.Vector3;R.distanceSqToSegment(M.start,M.end,le,ae),P.push({point:le,pointOnLine:ae,distance:R.origin.distanceTo(le),object:this,face:null,faceIndex:ee,uv:null,uv2:null})}}}}}}}A.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,h=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(m),b.applyMatrix4(m),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var d=m.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;m!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(m!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,M=m.count;g<M;g++)h.fromBufferAttribute(m,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3232
3232
  #include <common>
3233
3233
  #include <color_pars_vertex>
3234
3234
  #include <fog_pars_vertex>
@@ -3455,4 +3455,4 @@ void main() {
3455
3455
  state: () => new MyClass()
3456
3456
  Found in store "${w.$id}".`),m&&s&&t.hydrate&&t.hydrate(w.$state,m),c=!0,f=!0,w}function DF(n,e,t){let i,r;const s=typeof e=="function";i=n,r=s?t:e;function o(l,u){const c=a.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&Ha&&Ha._testing?null:l)||(c?a.inject(PF,null):null),l&&tu(l),process.env.NODE_ENV!=="production"&&!Ha)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
3457
3457
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
3458
- This will fail in production.`);l=Ha,l._s.has(i)||(s?Ff(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+i,p=s?Ff(h,e,r,l,!0):Gx(h,Rn({},r),l,!0);u._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&ja){const h=a.getCurrentInstance();if(h&&h.proxy&&!u){const p=h.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:Dn,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:mt,Popover:Pl,Row:qn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Dn,c=Cs,f=qn,h=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>[a.createTextVNode("Delete this feature?")]),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[2]||(e[2]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>[a.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[3]||(e[3]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>[a.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Vi(BF,[["render",zF],["__scopeId","data-v-e665391a"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Vf(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Vf(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Vf(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var kf=Vf(UF,{path:"/"}),li=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},xt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},ki,$a,ci,Qt,Sr;const GF=1e4;class HF{constructor(e){ki.add(this),$a.set(this,void 0),ci.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?li(this,$a,e.slice(0,-1),"f"):li(this,$a,e,"f")}get currentUser(){return xt(this,ci,"f")}get currentError(){return xt(this,Qt,"f")}async authenticate(e){li(this,Qt,null,"f"),li(this,ci,null,"f");const t=await xt(this,ki,"m",Sr).call(this,e,"authenticate");return"error"in t?(kf.remove("annotation-key"),Promise.resolve(xt(this,Qt,"f"))):(kf.set("annotation-key",t.session,{secure:!0,expires:1}),li(this,ci,t.data,"f"),Promise.resolve(xt(this,ci,"f")))}async unauthenticate(e){li(this,Qt,null,"f"),li(this,ci,null,"f");const t=await xt(this,ki,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(xt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await xt(this,ki,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await xt(this,ki,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await xt(this,ki,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await xt(this,ki,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(xt(this,ci,"f")&&xt(this,ci,"f").canUpdate){const i=Object.assign({creator:xt(this,ci,"f"),created:new Date().toISOString()},t),r=await xt(this,ki,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);li(this,Qt,r,"f")}else li(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(xt(this,Qt,"f"))}}$a=new WeakMap,ci=new WeakMap,Qt=new WeakMap,ki=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${xt(this,$a,"f")}/${t}`;const c=kf.get("annotation-key")||"";if(i==="GET"){const h=[];for(const[p,y]of Object.entries(r))h.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);h.push(`key=${encodeURIComponent(e)}`),h.push(`session=${encodeURIComponent(c)}`),u+="?"+h.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const h=Object.assign({key:e,session:c},r);l.body=JSON.stringify(h),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(li(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(xt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},zf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},wn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};wn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,zf.NAME_CHANGED)}},wn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.SETTINGS_CHANGED)},wn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},wn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},wn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},wn.prototype.getName=function(){return this.instanceName},wn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.DESTROYED);delete this},wn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},wn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},wn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return iu(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Uf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},wt=function(){wn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Uf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};wt.prototype=Object.create(wn.prototype),wt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return 2}return 0});let t=e.indexOf(1);return t=t>-1?t:e.indexOf(2),n[t]}},wt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},wt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},wt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},wt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Uf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},wt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},wt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},wt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},wt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},wt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},wt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},wt.prototype.changeBackgroundColour=function(n){const e=new Uf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},wt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},wt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},wt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},wt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},wt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},wt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},wt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),wn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){wt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(T){let P=6e3;e.scene&&(P=e.scene.getDuration());const C=T/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(C),e.sceneData.currentTime=T};const f=function(){let T=3e3;e.scene&&(T=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let C=0;C<i.length;C++)i[C](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/T),e.sceneData.currentTime=P/T*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(T,P)=>{let C=this.scene.getZincCameraControls();T?(C.resetView(),this.NDCCameraControl=C.enableSyncControl(),C.setRotationMode(P)):(C.disableSyncControl(),this.NDCCameraControl=void 0,C.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=T=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(T,2)},this.setSyncControlCallback=T=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(T)},this.setSyncControlCenterZoom=(T,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(T,P)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const T=new Mr.THREE.Vector3;T.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(T);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(T){i.push(T)},this.setTexturePos=function(T){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(T)},this.addSceneChangedCallback=function(T){r.push(T)},this.addOrganPartAddedCallback=function(T){s.push(T)},this.addOrganPartRemovedCallback=function(T){o.push(T)},this.setFinishDownloadCallback=function(T){l=T},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(T){u=T},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(T,P){const C=new Mr.THREE.Vector3;C.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return C.project(P),C.x=C.x*R+R,C.y=-(C.y*L)+L,C};const m=function(T){let P,C;if(T!==void 0){let R=!1;T.object.userData&&T.object.userData.isMarker?(R=!0,C=T.object.userData.parent.getMorph()):C=T.object;try{C.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(C)if(C.name)P=C.name;else{const L=e.getAnnotationsFromObjects([C]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:C}},d=function(){return function(T,P,C){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:T},x={x:P,y:C};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(T,P,C){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:C};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(T,P,C,R){if(R=="all"||R=="geometries"){const L=T.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="glyphsets"){const L=T.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="pointsets"){const L=T.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="lines"){const L=T.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}};this.changeGeometriesVisibility=function(T,P){v(e.scene,T,P,"geometries")},this.changeGlyphsetsVisibility=function(T,P){v(e.scene,T,P,"glyphsets")},this.changeLinesVisibility=function(T,P){v(e.scene,T,P,"lines")},this.changePointsetsVisibility=function(T,P){v(e.scene,T,P,"pointsets")},this.changeOrganPartsVisibility=function(T,P,C){let R="all";C!==void 0&&(R=C),v(e.scene,T,P,R)},this.changeOrganPartsVisibilityCallback=function(T){return function(P){e.changeOrganPartsVisibility(T,P)}},this.changeBackgroundColour=function(T){const P=new Mr.THREE.Color(T);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(T,P,C,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:T,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},M=function(T,P,C,R){for(let L=0;L<o.length;L++)o[L](R)},_=function(T,P,C){return function(R){g(T,P,C,R)}},E=function(T,P,C){return function(R){M(T,P,C,R)}},S=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},w=function(){return function(T){if((T==null?void 0:T.type)==="Error"&&u){const P={xhr:T.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(T,P){for(let C=0;C<T.length;C++)if(P!=C){const R=T[C].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const C=T[P].PartName;if(e.scene.findGeometriesWithGroupName(C).length>0||e.scene.findGlyphsetsWithGroupName(C).length>0)e.changeOrganPartsVisibility(C,!0);else{const R=getOrganDetails(T[P].SystemName,C);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(T,P,C){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=T&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(C)&&R.push(N)}return R},this.getCentreAndSize=function(){const T=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(T);const C=[T.x,T.y,T.z];P.getSize(T);const R=[T.x,T.y,T.z];return{centre:C,size:R}};const A=function(T,P,C,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=T,e.sceneData.currentSystem=P,e.sceneData.currentPart=C,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";T&&(L=T+"/"),P&&(L=P+"/"),C&&(L=C),e.sceneData.currentName=L};this.loadOrgansFromURL=function(T,P,C,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==T){A(P,C,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let D=0;D<r.length;D++)r[D](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,O.addZincObjectAddedCallbacks(_(C,R,!1)),O.addZincObjectRemovedCallbacks(E(void 0,R,!1)),O.loadMetadataURL(T,w(),S()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(T,P,C){if(e.zincRenderer&&P&&e.sceneData.metaURL!==T){A(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?C&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,L.addZincObjectAddedCallbacks(_(void 0,P,!1)),L.addZincObjectRemovedCallbacks(E(void 0,P,!1)),L.loadGLTF(T,void 0,S()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(T){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,T)},this.exportSettings=function(){const T={};return T.name=e.instanceName,e.sceneData.currentSystem&&(T.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(T.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(T.part=e.sceneData.currentPart),T.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(T.viewURL=e.sceneData.viewURL),T.dialog="Organ Viewer",T},this.importSettings=function(T){return T&&T.dialog==this.typeName?(e.setName(T.name),T.metaURL!==void 0&&T.metaURL!=""?e.loadOrgansFromURL(T.metaURL,T.species,T.system,T.part,T.viewURL,!0):e.loadOrgans(T.species,T.system,T.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(wt.prototype);var ct=function(){return ct=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ct.apply(this,arguments)};function KF(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 l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ze(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Gf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Ze(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,M=g-o,_=r[g],E=Math.max(0,d-t-1),S=Math.min(o-1,d+t),w=E;w<S;++w){var A=v!==e[w],I=r[M+w]+ +A,T=r[M+w+1]+1,P=r[g+w]+1,C=r[g+w+1]=Math.min(I,T,P);C<_&&(_=C)}if(_>t)continue e}Jx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Hf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Pt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Pt($f(o),2),u=l[0],c=l[1];try{for(var f=Ze(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Gf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ze(this),s=r.next();!s.done;s=r.next()){var o=Pt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Wf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Wf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Gf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Gf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=Pt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ze(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Wf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ze(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Wf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},jf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Ze(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Pt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Pt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Pt($f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Pt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Pt($f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},$f=function(n){return n[n.length-1]},Xa,Zf="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?qf:e.autoVacuum;this._options=ct(ct(ct({},Yf),e),{autoVacuum:t,searchOptions:ct(ct({},ew),e.searchOptions||{}),autoSuggestOptions:ct(ct({},lV),e.autoSuggestOptions||{})}),this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Kf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Ze(p),v=b.next();!v.done;v=b.next()){var g=v.value,M=c(e,g);if(M!=null){var _=f(M.toString(),g),E=this._fieldIds[g],S=new Set(_).size;this.addFieldLength(d,E,this._documentCount-1,S);try{for(var w=(r=void 0,Ze(_)),A=w.next();!A.done;A=w.next()){var I=A.value,T=h(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Ze(T)),C=P.next();!C.done;C=P.next()){var R=C.value;this.addTerm(E,d,R)}}catch(L){o={error:L}}finally{try{C&&!C.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.addTerm(E,d,T)}}catch(L){r={error:L}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Ze(p),v=b.next();!v.done;v=b.next()){var g=v.value,M=h(e,g);if(M!=null){var _=c(M.toString(),g),E=this._fieldIds[g],S=new Set(_).size;this.removeFieldLength(d,E,this._documentCount,S);try{for(var w=(r=void 0,Ze(_)),A=w.next();!A.done;A=w.next()){var I=A.value,T=f(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Ze(T)),C=P.next();!C.done;C=P.next()){var R=C.value;this.removeTerm(E,d,R)}}catch(L){o={error:L}}finally{try{C&&!C.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.removeTerm(E,d,T)}}catch(L){r={error:L}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Kf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,M,_,E,S,w,A,I,T,P;return qF(this,function(C){switch(C.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Jf.batchSize,s=e.batchWait||Jf.batchWait,o=1,C.label=1;case 1:C.trys.push([1,7,8,9]),l=Ze(this._index),u=l.next(),C.label=2;case 2:if(u.done)return[3,6];c=Pt(u.value,2),f=c[0],h=c[1];try{for(p=(A=void 0,Ze(h)),y=p.next();!y.done;y=p.next()){m=Pt(y.value,2),d=m[0],b=m[1];try{for(v=(T=void 0,Ze(b)),g=v.next();!g.done;g=v.next())M=Pt(g.value,1),_=M[0],!this._documentIds.has(_)&&(b.size<=1?h.delete(d):b.delete(_))}catch(R){T={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(T)throw T.error}}}}catch(R){A={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(A)throw A.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:C.sent(),C.label=4;case 4:o+=1,C.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return E=C.sent(),S={error:E},[3,9];case 8:try{u&&!u.done&&(w=l.return)&&w.call(l)}finally{if(S)throw S.error}return[7];case 9:this._dirtCount-=i,C.label=10;case 10:return[4,null];case 11:return C.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||qf.minDirtCount,i=i||qf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Ze(s),u=l.next();!u.done;u=l.next()){var c=Pt(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=ct(ct({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ze(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(E){i={error:E}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Ze(l),v=b.next();!v.done;v=b.next()){var g=Pt(v.value,2),m=g[0],M=g[1],h=M.score,p=M.terms,_=M.count;d.push({suggestion:m,terms:p,score:h/_})}}catch(E){s={error:E}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(nw),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Yf.hasOwnProperty(e))return Xf(Yf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var M=new n(t);M._documentCount=f,M._nextId=h,M._documentIds=su(p),M._idToShortId=new Map,M._fieldIds=y,M._fieldLength=su(m),M._avgFieldLength=d,M._storedFields=su(b),M._dirtCount=v||0,M._index=new Hf;try{for(var _=Ze(M._documentIds),E=_.next();!E.done;E=_.next()){var S=Pt(E.value,2),w=S[0],A=S[1];M._idToShortId.set(A,w)}}catch(D){i={error:D}}finally{try{E&&!E.done&&(r=_.return)&&r.call(_)}finally{if(i)throw i.error}}try{for(var I=Ze(c),T=I.next();!T.done;T=I.next()){var P=Pt(T.value,2),C=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Ze(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}M._index.set(C,L)}}catch(D){s={error:D}}finally{try{T&&!T.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return M},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=ct(ct(ct({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=ct(ct({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=ct(ct({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return ct(ct({},O),(D={},D[B]=Xf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=ct(ct({},ew.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,M;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var _=e.fuzzy===!0?.2:e.fuzzy,E=_<1?Math.min(h,Math.round(e.term.length*_)):_;E&&(M=this._index.fuzzyGet(e.term,E))}if(g)try{for(var S=Ze(g),w=S.next();!w.done;w=S.next()){var A=Pt(w.value,2),I=A[0],T=A[1],P=I.length-e.term.length;if(P){M==null||M.delete(I);var C=d*I.length/(I.length+.3*P);this.termResults(e.term,I,C,T,u,c,p,v)}}}catch(O){i={error:O}}finally{try{w&&!w.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}if(M)try{for(var R=Ze(M.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Pt(M.get(I),2),x=N[0],P=N[1];if(P){var C=m*I.length/(I.length+P);this.termResults(e.term,I,C,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=ct(ct({},this._options.searchOptions),e);try{for(var o=Ze(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Pt(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Zf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ze(this._index),l=o.next();!l.done;l=o.next()){var u=Pt(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Ze(f)),y=p.next();!y.done;y=p.next()){var m=Pt(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Ze(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],M=r.get(g);if(M!=null){var _=M.size,E=this._avgFieldLength[g];try{for(var S=(h=void 0,Ze(M.keys())),w=S.next();!w.done;w=S.next()){var A=w.value;if(!this._documentIds.has(A)){this.removeTerm(g,A,t),_-=1;continue}var I=o?o(this._documentIds.get(A),t,this._storedFields.get(A)):1;if(I){var T=M.get(A),P=this._fieldLength.get(A)[g],C=oV(T,_,this._documentCount,P,E,l),R=i*v*I*C,L=u.get(A);if(L){L.score+=R,cV(L.terms,e);var N=Xf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(A,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{w&&!w.done&&(p=S.return)&&p.call(S)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Ze(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Ze(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Xf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[Zf]=function(n,e){var t,i;try{for(var r=Ze(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Ze(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;tw(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Ze(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Yf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:Zf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Jf={batchSize:1e3,batchWait:10},Kf={minDirtFactor:.1,minDirtCount:20},qf=ct(ct({},Jf),Kf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Ze(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=cF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:Dn,Loading:YR,Option:Rs,Popover:Pl,Row:qn,Select:As,Slider:Cn,TabPane:jg,Tabs:Wg,MapSvgIcon:ep.MapSvgIcon,MapSvgSpriteColor:ep.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:lm,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},enableLocalAnnotations:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,userInformation:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],activeDrawTool:void 0,activeDrawMode:void 0,localAnnotationsList:a.markRaw([]),boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?n[1]:n[0]:n}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromLocalAnnotationList:function(n,e){for(let t=0;t<this.localAnnotationsList.length;t++){const i=this.localAnnotationsList[t];if(i.region===n&&i.group===e){this.localAnnotationsList.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.region.getFullPath(),t=n.groupName;n.region.findObjectsWithGroupName(t,!1).length===0&&(this.$_searchIndex.removeZincObject(n,n.uuid),this.removeFromLocalAnnotationList(e,t))}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Ax(this.annotator,this.userToken,t,n,e,this.url,i);if(this.enableLocalAnnotations){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.removeFromLocalAnnotationList(s,e),this.localAnnotationsList.push(r)}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName;Ax(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted")&&this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject)}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(aF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){if(this.createData.toBeDeleted=!1,n==="mode")this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0;else if(n==="tool"){if(this.annotationDisplay)return;this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1}},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.userInformation||this.enableLocalAnnotations)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=sF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)this.viewingMode==="Annotation"?(this.tData.label=i,this.tData.region=r,this.activateAnnotationMode(e,n)):(this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers));else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Cx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},changeViewingMode:function(n){if(this.$module){if(n&&(this.viewingMode=n),this.viewingMode==="Annotation"){let e=!1;this.userInformation&&(e=!0),this.userInformation=void 0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.userInformation=t,e||(Rx(this.annotator,this.userToken,this.url).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)}),Rx(this.annotator,this.userToken,encodeURIComponent(this.url)).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)})))})}else this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape="");this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate()}},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Cx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.localAnnotationsList.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getLocalAnnotations:function(){return[...this.localAnnotationsList]},importLocalAnnotations:function(n){if(this.enableLocalAnnotations){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Of(this.$module.scene,e),n.forEach(t=>{this.localAnnotationsList.push({...t})})}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},Qf=n=>(a.pushScopeId("data-v-93905793"),n=n(),a.popScopeId(),n),fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),mV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),gV={class:"primitive-controls-box"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"purple"},wV={class:"animation-data"},MV={class:"bottom-right-control"},SV=Qf(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),_V={style:{"margin-bottom":"2px"}},EV={key:0,class:"viewing-mode-title"},TV=["onClick"],CV=["onClick"];function AV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=lm,f=mt,h=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),d=Cn,b=qn,v=jg,g=Rs,M=As,_=Wg,E=Cs,S=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,onConfirmCreate:e[0]||(e[0]=w=>s.confirmCreate(w)),onCancelCreate:e[1]||(e[1]=w=>s.cancelCreate()),onConfirmDelete:e[2]||(e[2]=w=>s.confirmDelete()),onTooltipHide:e[3]||(e[3]=w=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[4]||(e[4]=a.withKeys((...w)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...w),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.userInformation||t.enableLocalAnnotations)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[5]||(e[5]=w=>s.showHelpText(7)),onMouseout:e[6]||(e[6]=w=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),pV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[7]||(e[7]=w=>s.showHelpText(8)),onMouseout:e[8]||(e[8]=w=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),mV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",gV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(_,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[9]||(e[9]=w=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[10]||(e[10]=w=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[11]||(e[11]=w=>s.timeChange(w))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",yV,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",vV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",bV,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",xV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",wV,[a.createTextVNode(" Playback speed "),a.createVNode(M,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[12]||(e[12]=w=>s.speedChanged(w))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,w=>(a.openBlock(),a.createBlock(g,{key:w.value,label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",MV,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[13]||(e[13]=w=>s.zoomIn()),onMouseover:e[14]||(e[14]=w=>s.showHelpText(0)),onMouseout:e[15]||(e[15]=w=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[16]||(e[16]=w=>s.zoomOut()),onMouseover:e[17]||(e[17]=w=>s.showHelpText(1)),onMouseout:e[18]||(e[18]=w=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[19]||(e[19]=w=>s.fitWindow()),onMouseover:e[20]||(e[20]=w=>s.showHelpText(2)),onMouseout:e[21]||(e[21]=w=>s.hideHelpText(2))})]),default:a.withCtx(()=>[SV]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,w=>(a.openBlock(),a.createBlock(b,{key:w.key},{default:a.withCtx(()=>[a.createVNode(E,{type:"primary",plain:"",onClick:A=>n.$emit("open-map",w.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(w.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",_V,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(w,A,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:A},[A===n.viewingMode?(a.openBlock(),a.createElementBlock("span",EV,[a.createElementVNode("b",null,a.toDisplayString(A),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:T=>s.changeViewingMode(A)},a.toDisplayString(A),9,TV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1})]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,w=>(a.openBlock(),a.createElementBlock("div",{key:w,class:a.normalizeClass(["backgroundChoice",w,w==n.currentBackground?"active":""]),onClick:A=>s.backgroundChangeCallback(w)},null,10,CV))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[22]||(e[22]=w=>s.showHelpText(3)),onMouseout:e[23]||(e[23]=w=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[24]||(e[24]=w=>s.showHelpText(4)),onMouseout:e[25]||(e[25]=w=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[S,n.loading]])}const RV=Vi(hV,[["render",AV],["__scopeId","data-v-93905793"]]);Ht.ScaffoldVuer=RV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
3458
+ This will fail in production.`);l=Ha,l._s.has(i)||(s?Ff(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+i,p=s?Ff(h,e,r,l,!0):Gx(h,Rn({},r),l,!0);u._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&ja){const h=a.getCurrentInstance();if(h&&h.proxy&&!u){const p=h.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:Dn,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:mt,Popover:Pl,Row:qn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Dn,c=Cs,f=qn,h=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>[a.createTextVNode("Delete this feature?")]),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[2]||(e[2]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>[a.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[3]||(e[3]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>[a.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Vi(BF,[["render",zF],["__scopeId","data-v-e665391a"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Vf(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Vf(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Vf(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var kf=Vf(UF,{path:"/"}),li=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},xt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},ki,$a,ci,Qt,Sr;const GF=1e4;class HF{constructor(e){ki.add(this),$a.set(this,void 0),ci.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?li(this,$a,e.slice(0,-1),"f"):li(this,$a,e,"f")}get currentUser(){return xt(this,ci,"f")}get currentError(){return xt(this,Qt,"f")}async authenticate(e){li(this,Qt,null,"f"),li(this,ci,null,"f");const t=await xt(this,ki,"m",Sr).call(this,e,"authenticate");return"error"in t?(kf.remove("annotation-key"),Promise.resolve(xt(this,Qt,"f"))):(kf.set("annotation-key",t.session,{secure:!0,expires:1}),li(this,ci,t.data,"f"),Promise.resolve(xt(this,ci,"f")))}async unauthenticate(e){li(this,Qt,null,"f"),li(this,ci,null,"f");const t=await xt(this,ki,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(xt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await xt(this,ki,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await xt(this,ki,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await xt(this,ki,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await xt(this,ki,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(xt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(xt(this,ci,"f")&&xt(this,ci,"f").canUpdate){const i=Object.assign({creator:xt(this,ci,"f"),created:new Date().toISOString()},t),r=await xt(this,ki,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);li(this,Qt,r,"f")}else li(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(xt(this,Qt,"f"))}}$a=new WeakMap,ci=new WeakMap,Qt=new WeakMap,ki=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${xt(this,$a,"f")}/${t}`;const c=kf.get("annotation-key")||"";if(i==="GET"){const h=[];for(const[p,y]of Object.entries(r))h.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);h.push(`key=${encodeURIComponent(e)}`),h.push(`session=${encodeURIComponent(c)}`),u+="?"+h.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const h=Object.assign({key:e,session:c},r);l.body=JSON.stringify(h),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(li(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(xt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},zf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},wn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};wn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,zf.NAME_CHANGED)}},wn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.SETTINGS_CHANGED)},wn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},wn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},wn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},wn.prototype.getName=function(){return this.instanceName},wn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,zf.DESTROYED);delete this},wn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},wn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},wn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return iu(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Uf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},wt=function(){wn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Uf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};wt.prototype=Object.create(wn.prototype),wt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return 2}return 0});let t=e.indexOf(1);return t=t>-1?t:e.indexOf(2),n[t]}},wt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},wt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},wt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},wt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Uf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},wt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},wt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},wt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},wt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},wt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},wt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},wt.prototype.changeBackgroundColour=function(n){const e=new Uf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},wt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},wt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},wt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},wt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},wt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},wt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},wt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),wn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){wt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(T){let P=6e3;e.scene&&(P=e.scene.getDuration());const C=T/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(C),e.sceneData.currentTime=T};const f=function(){let T=3e3;e.scene&&(T=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let C=0;C<i.length;C++)i[C](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/T),e.sceneData.currentTime=P/T*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(T,P)=>{let C=this.scene.getZincCameraControls();T?(C.resetView(),this.NDCCameraControl=C.enableSyncControl(),C.setRotationMode(P)):(C.disableSyncControl(),this.NDCCameraControl=void 0,C.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=T=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(T,2)},this.setSyncControlCallback=T=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(T)},this.setSyncControlCenterZoom=(T,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(T,P)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const T=new Mr.THREE.Vector3;T.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(T);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(T){i.push(T)},this.setTexturePos=function(T){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(T)},this.addSceneChangedCallback=function(T){r.push(T)},this.addOrganPartAddedCallback=function(T){s.push(T)},this.addOrganPartRemovedCallback=function(T){o.push(T)},this.setFinishDownloadCallback=function(T){l=T},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(T){u=T},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(T,P){const C=new Mr.THREE.Vector3;C.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return C.project(P),C.x=C.x*R+R,C.y=-(C.y*L)+L,C};const m=function(T){let P,C;if(T!==void 0){let R=!1;T.object.userData&&T.object.userData.isMarker?(R=!0,C=T.object.userData.parent.getMorph()):C=T.object;try{C.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(C)if(C.name)P=C.name;else{const L=e.getAnnotationsFromObjects([C]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:C}},d=function(){return function(T,P,C){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:T},x={x:P,y:C};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(T,P,C){var O;const R=e.getIntersectedObject(T),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:C};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(T,P,C,R){if(R=="all"||R=="geometries"){const L=T.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="glyphsets"){const L=T.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="pointsets"){const L=T.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}if(R=="all"||R=="lines"){const L=T.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(C)}};this.changeGeometriesVisibility=function(T,P){v(e.scene,T,P,"geometries")},this.changeGlyphsetsVisibility=function(T,P){v(e.scene,T,P,"glyphsets")},this.changeLinesVisibility=function(T,P){v(e.scene,T,P,"lines")},this.changePointsetsVisibility=function(T,P){v(e.scene,T,P,"pointsets")},this.changeOrganPartsVisibility=function(T,P,C){let R="all";C!==void 0&&(R=C),v(e.scene,T,P,R)},this.changeOrganPartsVisibilityCallback=function(T){return function(P){e.changeOrganPartsVisibility(T,P)}},this.changeBackgroundColour=function(T){const P=new Mr.THREE.Color(T);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(T,P,C,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:T,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},M=function(T,P,C,R){for(let L=0;L<o.length;L++)o[L](R)},_=function(T,P,C){return function(R){g(T,P,C,R)}},E=function(T,P,C){return function(R){M(T,P,C,R)}},S=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},w=function(){return function(T){if((T==null?void 0:T.type)==="Error"&&u){const P={xhr:T.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(T,P){for(let C=0;C<T.length;C++)if(P!=C){const R=T[C].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const C=T[P].PartName;if(e.scene.findGeometriesWithGroupName(C).length>0||e.scene.findGlyphsetsWithGroupName(C).length>0)e.changeOrganPartsVisibility(C,!0);else{const R=getOrganDetails(T[P].SystemName,C);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(T,P,C){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=T&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(C)&&R.push(N)}return R},this.getCentreAndSize=function(){const T=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(T);const C=[T.x,T.y,T.z];P.getSize(T);const R=[T.x,T.y,T.z];return{centre:C,size:R}};const A=function(T,P,C,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=T,e.sceneData.currentSystem=P,e.sceneData.currentPart=C,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";T&&(L=T+"/"),P&&(L=P+"/"),C&&(L=C),e.sceneData.currentName=L};this.loadOrgansFromURL=function(T,P,C,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==T){A(P,C,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let D=0;D<r.length;D++)r[D](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,O.addZincObjectAddedCallbacks(_(C,R,!1)),O.addZincObjectRemovedCallbacks(E(void 0,R,!1)),O.loadMetadataURL(T,w(),S()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(T,P,C){if(e.zincRenderer&&P&&e.sceneData.metaURL!==T){A(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?C&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=T,L.addZincObjectAddedCallbacks(_(void 0,P,!1)),L.addZincObjectRemovedCallbacks(E(void 0,P,!1)),L.loadGLTF(T,void 0,S()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(T){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,T)},this.exportSettings=function(){const T={};return T.name=e.instanceName,e.sceneData.currentSystem&&(T.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(T.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(T.part=e.sceneData.currentPart),T.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(T.viewURL=e.sceneData.viewURL),T.dialog="Organ Viewer",T},this.importSettings=function(T){return T&&T.dialog==this.typeName?(e.setName(T.name),T.metaURL!==void 0&&T.metaURL!=""?e.loadOrgansFromURL(T.metaURL,T.species,T.system,T.part,T.viewURL,!0):e.loadOrgans(T.species,T.system,T.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(wt.prototype);var ct=function(){return ct=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ct.apply(this,arguments)};function KF(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 l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ze(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Gf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Ze(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,M=g-o,_=r[g],E=Math.max(0,d-t-1),S=Math.min(o-1,d+t),w=E;w<S;++w){var A=v!==e[w],I=r[M+w]+ +A,T=r[M+w+1]+1,P=r[g+w]+1,C=r[g+w+1]=Math.min(I,T,P);C<_&&(_=C)}if(_>t)continue e}Jx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Hf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Pt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Pt($f(o),2),u=l[0],c=l[1];try{for(var f=Ze(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Gf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ze(this),s=r.next();!s.done;s=r.next()){var o=Pt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Wf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Wf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Gf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=jf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Gf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=Pt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ze(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Wf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ze(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Wf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},jf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Ze(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Pt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Pt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Pt($f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Pt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Pt($f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},$f=function(n){return n[n.length-1]},Xa,Zf="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?qf:e.autoVacuum;this._options=ct(ct(ct({},Yf),e),{autoVacuum:t,searchOptions:ct(ct({},ew),e.searchOptions||{}),autoSuggestOptions:ct(ct({},lV),e.autoSuggestOptions||{})}),this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Kf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Ze(p),v=b.next();!v.done;v=b.next()){var g=v.value,M=c(e,g);if(M!=null){var _=f(M.toString(),g),E=this._fieldIds[g],S=new Set(_).size;this.addFieldLength(d,E,this._documentCount-1,S);try{for(var w=(r=void 0,Ze(_)),A=w.next();!A.done;A=w.next()){var I=A.value,T=h(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Ze(T)),C=P.next();!C.done;C=P.next()){var R=C.value;this.addTerm(E,d,R)}}catch(L){o={error:L}}finally{try{C&&!C.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.addTerm(E,d,T)}}catch(L){r={error:L}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Ze(p),v=b.next();!v.done;v=b.next()){var g=v.value,M=h(e,g);if(M!=null){var _=c(M.toString(),g),E=this._fieldIds[g],S=new Set(_).size;this.removeFieldLength(d,E,this._documentCount,S);try{for(var w=(r=void 0,Ze(_)),A=w.next();!A.done;A=w.next()){var I=A.value,T=f(I,g);if(Array.isArray(T))try{for(var P=(o=void 0,Ze(T)),C=P.next();!C.done;C=P.next()){var R=C.value;this.removeTerm(E,d,R)}}catch(L){o={error:L}}finally{try{C&&!C.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else T&&this.removeTerm(E,d,T)}}catch(L){r={error:L}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Hf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Ze(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Kf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,M,_,E,S,w,A,I,T,P;return qF(this,function(C){switch(C.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Jf.batchSize,s=e.batchWait||Jf.batchWait,o=1,C.label=1;case 1:C.trys.push([1,7,8,9]),l=Ze(this._index),u=l.next(),C.label=2;case 2:if(u.done)return[3,6];c=Pt(u.value,2),f=c[0],h=c[1];try{for(p=(A=void 0,Ze(h)),y=p.next();!y.done;y=p.next()){m=Pt(y.value,2),d=m[0],b=m[1];try{for(v=(T=void 0,Ze(b)),g=v.next();!g.done;g=v.next())M=Pt(g.value,1),_=M[0],!this._documentIds.has(_)&&(b.size<=1?h.delete(d):b.delete(_))}catch(R){T={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(T)throw T.error}}}}catch(R){A={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(A)throw A.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:C.sent(),C.label=4;case 4:o+=1,C.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return E=C.sent(),S={error:E},[3,9];case 8:try{u&&!u.done&&(w=l.return)&&w.call(l)}finally{if(S)throw S.error}return[7];case 9:this._dirtCount-=i,C.label=10;case 10:return[4,null];case 11:return C.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||qf.minDirtCount,i=i||qf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Ze(s),u=l.next();!u.done;u=l.next()){var c=Pt(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=ct(ct({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ze(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(E){i={error:E}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Ze(l),v=b.next();!v.done;v=b.next()){var g=Pt(v.value,2),m=g[0],M=g[1],h=M.score,p=M.terms,_=M.count;d.push({suggestion:m,terms:p,score:h/_})}}catch(E){s={error:E}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(nw),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Yf.hasOwnProperty(e))return Xf(Yf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var M=new n(t);M._documentCount=f,M._nextId=h,M._documentIds=su(p),M._idToShortId=new Map,M._fieldIds=y,M._fieldLength=su(m),M._avgFieldLength=d,M._storedFields=su(b),M._dirtCount=v||0,M._index=new Hf;try{for(var _=Ze(M._documentIds),E=_.next();!E.done;E=_.next()){var S=Pt(E.value,2),w=S[0],A=S[1];M._idToShortId.set(A,w)}}catch(D){i={error:D}}finally{try{E&&!E.done&&(r=_.return)&&r.call(_)}finally{if(i)throw i.error}}try{for(var I=Ze(c),T=I.next();!T.done;T=I.next()){var P=Pt(T.value,2),C=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Ze(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}M._index.set(C,L)}}catch(D){s={error:D}}finally{try{T&&!T.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return M},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=ct(ct(ct({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=ct(ct({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=ct(ct({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return ct(ct({},O),(D={},D[B]=Xf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=ct(ct({},ew.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,M;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var _=e.fuzzy===!0?.2:e.fuzzy,E=_<1?Math.min(h,Math.round(e.term.length*_)):_;E&&(M=this._index.fuzzyGet(e.term,E))}if(g)try{for(var S=Ze(g),w=S.next();!w.done;w=S.next()){var A=Pt(w.value,2),I=A[0],T=A[1],P=I.length-e.term.length;if(P){M==null||M.delete(I);var C=d*I.length/(I.length+.3*P);this.termResults(e.term,I,C,T,u,c,p,v)}}}catch(O){i={error:O}}finally{try{w&&!w.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}if(M)try{for(var R=Ze(M.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Pt(M.get(I),2),x=N[0],P=N[1];if(P){var C=m*I.length/(I.length+P);this.termResults(e.term,I,C,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=ct(ct({},this._options.searchOptions),e);try{for(var o=Ze(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Pt(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Zf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ze(this._index),l=o.next();!l.done;l=o.next()){var u=Pt(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Ze(f)),y=p.next();!y.done;y=p.next()){var m=Pt(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Ze(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],M=r.get(g);if(M!=null){var _=M.size,E=this._avgFieldLength[g];try{for(var S=(h=void 0,Ze(M.keys())),w=S.next();!w.done;w=S.next()){var A=w.value;if(!this._documentIds.has(A)){this.removeTerm(g,A,t),_-=1;continue}var I=o?o(this._documentIds.get(A),t,this._storedFields.get(A)):1;if(I){var T=M.get(A),P=this._fieldLength.get(A)[g],C=oV(T,_,this._documentCount,P,E,l),R=i*v*I*C,L=u.get(A);if(L){L.score+=R,cV(L.terms,e);var N=Xf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(A,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{w&&!w.done&&(p=S.return)&&p.call(S)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Ze(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Ze(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Xf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[Zf]=function(n,e){var t,i;try{for(var r=Ze(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Ze(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;tw(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Ze(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Yf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:Zf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Jf={batchSize:1e3,batchWait:10},Kf={minDirtFactor:.1,minDirtCount:20},qf=ct(ct({},Jf),Kf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Ze(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Ze(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=cF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:Dn,Loading:YR,Option:Rs,Popover:Pl,Row:qn,Select:As,Slider:Cn,TabPane:jg,Tabs:Wg,MapSvgIcon:ep.MapSvgIcon,MapSvgSpriteColor:ep.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:lm,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},enableLocalAnnotations:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,userInformation:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],activeDrawTool:void 0,activeDrawMode:void 0,localAnnotationsList:a.markRaw([]),boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?n[1]:n[0]:n}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromLocalAnnotationList:function(n,e){for(let t=0;t<this.localAnnotationsList.length;t++){const i=this.localAnnotationsList[t];if(i.region===n&&i.group===e){this.localAnnotationsList.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.region.getFullPath(),t=n.groupName;n.region.findObjectsWithGroupName(t,!1).length===0&&(this.$_searchIndex.removeZincObject(n,n.uuid),this.removeFromLocalAnnotationList(e,t))}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Ax(this.annotator,this.userToken,t,n,e,this.url,i);if(this.enableLocalAnnotations){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.removeFromLocalAnnotationList(s,e),this.localAnnotationsList.push(r)}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName;Ax(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted")&&this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject)}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(aF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){if(this.createData.toBeDeleted=!1,n==="mode")this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0;else if(n==="tool"){if(this.annotationDisplay)return;this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1}},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.userInformation||this.enableLocalAnnotations)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=sF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)this.viewingMode==="Annotation"?(this.tData.label=i,this.tData.region=r,this.activateAnnotationMode(e,n)):(this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers));else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Cx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},changeViewingMode:function(n){if(this.$module){if(n&&(this.viewingMode=n),this.viewingMode==="Annotation"){let e=!1;this.userInformation&&(e=!0),this.userInformation=void 0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.userInformation=t,e||(Rx(this.annotator,this.userToken,this.url).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)}),Rx(this.annotator,this.userToken,encodeURIComponent(this.url)).then(i=>{i&&i.features&&Of(this.$module.scene,i.features)})))})}else this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape="");this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate()}},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Cx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.localAnnotationsList.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getLocalAnnotations:function(){return[...this.localAnnotationsList]},importLocalAnnotations:function(n){if(this.enableLocalAnnotations){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Of(this.$module.scene,e),n.forEach(t=>{this.localAnnotationsList.push({...t})})}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},Qf=n=>(a.pushScopeId("data-v-3f6a68de"),n=n(),a.popScopeId(),n),fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),mV=Qf(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),gV={class:"primitive-controls-box"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"purple"},wV={class:"animation-data"},MV={class:"bottom-right-control"},SV=Qf(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),_V={style:{"margin-bottom":"2px"}},EV={key:0,class:"viewing-mode-title"},TV=["onClick"],CV=["onClick"];function AV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=lm,f=mt,h=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),d=Cn,b=qn,v=jg,g=Rs,M=As,_=Wg,E=Cs,S=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,onConfirmCreate:e[0]||(e[0]=w=>s.confirmCreate(w)),onCancelCreate:e[1]||(e[1]=w=>s.cancelCreate()),onConfirmDelete:e[2]||(e[2]=w=>s.confirmDelete()),onTooltipHide:e[3]||(e[3]=w=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[4]||(e[4]=a.withKeys((...w)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...w),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.userInformation||t.enableLocalAnnotations)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[5]||(e[5]=w=>s.showHelpText(7)),onMouseout:e[6]||(e[6]=w=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),pV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[7]||(e[7]=w=>s.showHelpText(8)),onMouseout:e[8]||(e[8]=w=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),mV],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",gV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(_,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[9]||(e[9]=w=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[10]||(e[10]=w=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[11]||(e[11]=w=>s.timeChange(w))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",yV,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",vV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",bV,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",xV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",wV,[a.createTextVNode(" Playback speed "),a.createVNode(M,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[12]||(e[12]=w=>s.speedChanged(w))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,w=>(a.openBlock(),a.createBlock(g,{key:w.value,label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",MV,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[13]||(e[13]=w=>s.zoomIn()),onMouseover:e[14]||(e[14]=w=>s.showHelpText(0)),onMouseout:e[15]||(e[15]=w=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[16]||(e[16]=w=>s.zoomOut()),onMouseover:e[17]||(e[17]=w=>s.showHelpText(1)),onMouseout:e[18]||(e[18]=w=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[19]||(e[19]=w=>s.fitWindow()),onMouseover:e[20]||(e[20]=w=>s.showHelpText(2)),onMouseout:e[21]||(e[21]=w=>s.hideHelpText(2))})]),default:a.withCtx(()=>[SV]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,w=>(a.openBlock(),a.createBlock(b,{key:w.key},{default:a.withCtx(()=>[a.createVNode(E,{type:"primary",plain:"",onClick:A=>n.$emit("open-map",w.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(w.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",_V,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(w,A,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:A},[A===n.viewingMode?(a.openBlock(),a.createElementBlock("span",EV,[a.createElementVNode("b",null,a.toDisplayString(A),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:T=>s.changeViewingMode(A)},a.toDisplayString(A),9,TV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1})]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,w=>(a.openBlock(),a.createElementBlock("div",{key:w,class:a.normalizeClass(["backgroundChoice",w,w==n.currentBackground?"active":""]),onClick:A=>s.backgroundChangeCallback(w)},null,10,CV))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[22]||(e[22]=w=>s.showHelpText(3)),onMouseout:e[23]||(e[23]=w=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[24]||(e[24]=w=>s.showHelpText(4)),onMouseout:e[25]||(e[25]=w=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[S,n.loading]])}const RV=Vi(hV,[["render",AV],["__scopeId","data-v-3f6a68de"]]);Ht.ScaffoldVuer=RV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});