2024-09-29 19:46:45 +00:00
const _ _vite _ _mapDeps = ( i , m = _ _vite _ _mapDeps , d = ( m . f || ( m . f = [ "assets/stackoverflow-dark-8CFru5b-.css" , "assets/stackoverflow-light-CpIvNHzo.css" ] ) ) ) => i . map ( i => d [ i ] ) ;
2024-10-20 20:24:55 +00:00
var eI = Object . defineProperty ; var tI = ( n , e , t ) => e in n ? eI ( n , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : n [ e ] = t ; var qt = ( n , e , t ) => tI ( n , typeof e != "symbol" ? e + "" : e , t ) ; ( function ( ) { const e = document . createElement ( "link" ) . relList ; if ( e && e . supports && e . supports ( "modulepreload" ) ) return ; for ( const i of document . querySelectorAll ( 'link[rel="modulepreload"]' ) ) s ( i ) ; new MutationObserver ( i => { for ( const r of i ) if ( r . type === "childList" ) for ( const o of r . addedNodes ) o . tagName === "LINK" && o . rel === "modulepreload" && s ( o ) } ) . observe ( document , { childList : ! 0 , subtree : ! 0 } ) ; function t ( i ) { const r = { } ; return i . integrity && ( r . integrity = i . integrity ) , i . referrerPolicy && ( r . referrerPolicy = i . referrerPolicy ) , i . crossOrigin === "use-credentials" ? r . credentials = "include" : i . crossOrigin === "anonymous" ? r . credentials = "omit" : r . credentials = "same-origin" , r } function s ( i ) { if ( i . ep ) return ; i . ep = ! 0 ; const r = t ( i ) ; fetch ( i . href , r ) } } ) ( ) ; / * *
2024-09-29 19:46:45 +00:00
* @ vue / shared v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-10-20 21:50:56 +00:00
* * //*! #__NO_SIDE_EFFECTS__ */function Ub(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Yt={},jo=[],ii=()=>{},nI=()=>!1,Au=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Bb=n=>n.startsWith("onUpdate:"),ln=Object.assign,Gb=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},sI=Object.prototype.hasOwnProperty,Dt=(n,e)=>sI.call(n,e),rt=Array.isArray,Qo=n=>ka(n)==="[object Map]",Ia=n=>ka(n)==="[object Set]",Ky=n=>ka(n)==="[object Date]",iI=n=>ka(n)==="[object RegExp]",ft=n=>typeof n=="function",Xt=n=>typeof n=="string",ai=n=>typeof n=="symbol",Vt=n=>n!==null&&typeof n=="object",_2=n=>(Vt(n)||ft(n))&&ft(n.then)&&ft(n.catch),m2=Object.prototype.toString,ka=n=>m2.call(n),rI=n=>ka(n).slice(8,-1),h2=n=>ka(n)==="[object Object]",Vb=n=>Xt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,yl=Ub(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Mu=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},oI=/-(\w)/g,xs=Mu(n=>n.replace(oI,(e,t)=>t?t.toUpperCase():"")),aI=/\B([A-Z])/g,Tr=Mu(n=>n.replace(aI,"-$1").toLowerCase()),Nu=Mu(n=>n.charAt(0).toUpperCase()+n.slice(1)),Sd=Mu(n=>n?`on${Nu(n)}`:""),Er=(n,e)=>!Object.is(n,e),Xo=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},g2=(n,e,t,s=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:s,value:t})},Vd=n=>{const e=parseFloat(n);return isNaN(e)?n:e},lI=n=>{const e=Xt(n)?Number(n):NaN;return isNaN(e)?n:e};let jy;const b2=()=>jy||(jy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Wt(n){if(rt(n)){const e={};for(let t=0;t<n.length;t++){const s=n[t],i=Xt(s)?pI(s):Wt(s);if(i)for(const r in i)e[r]=i[r]}return e}else if(Xt(n)||Vt(n))return n}const cI=/;(?![^(]*\))/g,dI=/:([^]+)/,uI=/\/\*[^]*?\*\//g;function pI(n){const e={};return n.replace(uI,"").split(cI).forEach(t=>{if(t){const s=t.split(dI);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Ue(n){let e="";if(Xt(n))e=n;else if(rt(n))for(let t=0;t<n.length;t++){const s=Ue(n[t]);s&&(e+=s+" ")}else if(Vt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const fI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_I=Ub(fI);function y2(n){return!!n||n===""}function mI(n,e){if(n.length!==e.length)return!1;let t=!0;for(let s=0;t&&s<n.length;s++)t=ro(n[s],e[s]);return t}function ro(n,e){if(n===e)return!0;let t=Ky(n),s=Ky(e);if(t||s)return t&&s?n.getTime()===e.getTime():!1;if(t=ai(n),s=ai(e),t||s)return n===e;if(t=rt(n),s=rt(e),t||s)return t&&s?mI(n,e):!1;if(t=Vt(n),s=Vt(e),t||s){if(!t||!s)return!1;const i=Object.keys(n).length,r=Object.keys(e).length;if(i!==r)return!1;for(const o in n){const a=n.hasOwnProperty(o),c=e.hasOwnProperty(o);if(a&&!c||!a&&c||!ro(n[o],e[o]))return!1}}return String(n)===String(e)}function zb(n,e){return n.findIndex(t=>ro(t,e))}const E2=n=>!!(n&&n.__v_isRef===!0),$=n=>Xt(n)?n:n==null?"":rt(n)||Vt(n)&&(n.toString===m2||!ft(n.toString))?E2(n)?$(n.value):JSON.stringify(n,v2,2):String(n),v2=(n,e)=>E2(e)?v2(n,e.value):Qo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[s,i],r)=>(t[Ip(s,r)+" =>"]=i,t),{})}:Ia(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Ip(t))}:ai(e)?Ip(e):Vt(e)&&!rt(e)&&!h2(e)?String(e):e,Ip=(n,e="")=>{var t;return ai(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/**
2024-09-29 19:46:45 +00:00
* @ vue / reactivity v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-10-20 21:50:56 +00:00
* * / l e t U n ; c l a s s S 2 { c o n s t r u c t o r ( e = ! 1 ) { t h i s . d e t a c h e d = e , t h i s . _ a c t i v e = ! 0 , t h i s . e f f e c t s = [ ] , t h i s . c l e a n u p s = [ ] , t h i s . _ i s P a u s e d = ! 1 , t h i s . p a r e n t = U n , ! e & & U n & & ( t h i s . i n d e x = ( U n . s c o p e s | | ( U n . s c o p e s = [ ] ) ) . p u s h ( t h i s ) - 1 ) } g e t a c t i v e ( ) { r e t u r n t h i s . _ a c t i v e } p a u s e ( ) { i f ( t h i s . _ a c t i v e ) { t h i s . _ i s P a u s e d = ! 0 ; l e t e , t ; i f ( t h i s . s c o p e s ) f o r ( e = 0 , t = t h i s . s c o p e s . l e n g t h ; e < t ; e + + ) t h i s . s c o p e s [ e ] . p a u s e ( ) ; f o r ( e = 0 , t = t h i s . e f f e c t s . l e n g t h ; e < t ; e + + ) t h i s . e f f e c t s [ e ] . p a u s e ( ) } } r e s u m e ( ) { i f ( t h i s . _ a c t i v e & & t h i s . _ i s P a u s e d ) { t h i s . _ i s P a u s e d = ! 1 ; l e t e , t ; i f ( t h i s . s c o p e s ) f o r ( e = 0 , t = t h i s . s c o p e s . l e n g t h ; e < t ; e + + ) t h i s . s c o p e s [ e ] . r e s u m e ( ) ; f o r ( e = 0 , t = t h i s . e f f e c t s . l e n g t h ; e < t ; e + + ) t h i s . e f f e c t s [ e ] . r e s u m e ( ) } } r u n ( e ) { i f ( t h i s . _ a c t i v e ) { c o n s t t = U n ; t r y { r e t u r n U n = t h i s , e ( ) } f i n a l l y { U n = t } } } o n ( ) { U n = t h i s } o f f ( ) { U n = t h i s . p a r e n t } s t o p ( e ) { i f ( t h i s . _ a c t i v e ) { l e t t , s ; f o r ( t = 0 , s = t h i s . e f f e c t s . l e n g t h ; t < s ; t + + ) t h i s . e f f e c t s [ t ] . s t o p ( ) ; f o r ( t = 0 , s = t h i s . c l e a n u p s . l e n g t h ; t < s ; t + + ) t h i s . c l e a n u p s [ t ] ( ) ; i f ( t h i s . s c o p e s ) f o r ( t = 0 , s = t h i s . s c o p e s . l e n g t h ; t < s ; t + + ) t h i s . s c o p e s [ t ] . s t o p ( ! 0 ) ; i f ( ! t h i s . d e t a c h e d & & t h i s . p a r e n t & & ! e ) { c o n s t i = t h i s . p a r e n t . s c o p e s . p o p ( ) ; i & & i ! = = t h i s & & ( t h i s . p a r e n t . s c o p e s [ t h i s . i n d e x ] = i , i . i n d e x = t h i s . i n d e x ) } t h i s . p a r e n t = v o i d 0 , t h i s . _ a c t i v e = ! 1 } } } f u n c t i o n h I ( n ) { r e t u r n n e w S 2 ( n ) } f u n c t i o n T 2 ( ) { r e t u r n U n } f u n c t i o n g I ( n , e = ! 1 ) { U n & & U n . c l e a n u p s . p u s h ( n ) } l e t K t ; c o n s t k p = n e w W e a k S e t ; c l a s s x 2 { c o n s t r u c t o r ( e ) { t h i s . f n = e , t h i s . d e p s = v o i d 0 , t h i s . d e p s T a i l = v o i d 0 , t h i s . f l a g s = 5 , t h i s . n e x t = v o i d 0 , t h i s . c l e a n u p = v o i d 0 , t h i s . s c h e d u l e r = v o i d 0 , U n & & U n . a c t i v e & & U n . e f f e c t s . p u s h ( t h i s ) } p a u s e ( ) { t h i s . f l a g s | = 6 4 } r e s u m e ( ) { t h i s . f l a g s & 6 4 & & ( t h i s . f l a g s & = - 6 5 , k p . h a s ( t h i s ) & & ( k p . d e l e t e ( t h i s ) , t h i s . t r i g g e r ( ) ) ) } n o t i f y ( ) { t h i s . f l a g s & 2 & & ! ( t h i s . f l a g s & 3 2 ) | | t h i s . f l a g s & 8 | | w 2 ( t h i s ) } r u n ( ) { i f ( ! ( t h i s . f l a g s & 1 ) ) r e t u r n t h i s . f n ( ) ; t h i s . f l a g s | = 2 , Q y ( t h i s ) , R 2 ( t h i s ) ; c o n s t e = K t , t = F s ; K t = t h i s , F s = ! 0 ; t r y { r e t u r n t h i s . f n ( ) } f i n a l l y { A 2 ( t h i s ) , K t = e , F s = t , t h i s . f l a g s & = - 3 } } s t o p ( ) { i f ( t h i s . f l a g s & 1 ) { f o r ( l e t e = t h i s . d e p s ; e ; e = e . n e x t D e p ) Y b ( e ) ; t h i s . d e p s = t h i s . d e p s T a i l = v o i d 0 , Q y ( t h i s ) , t h i s . o n S t o p & & t h i s . o n S t o p ( ) , t h i s . f l a g s & = - 2 } } t r i g g e r ( ) { t h i s . f l a g s & 6 4 ? k p . a d d ( t h i s ) : t h i s . s c h e d u l e r ? t h i s . s c h e d u l e r ( ) : t h i s . r u n I f D i r t y ( ) } r u n I f D i r t y ( ) { O g ( t h i s ) & & t h i s . r u n ( ) } g e t d i r t y ( ) { r e t u r n O g ( t h i s ) } } l e t C 2 = 0 , Y o ; f u n c t i o n w 2 ( n ) { n . f l a g s | = 8 , n . n e x t = Y o , Y o = n } f u n c t i o n H b ( ) { C 2 + + } f u n c t i o n q b ( ) { i f ( - - C 2 > 0 ) r e t u r n ; l e t n ; f o r ( ; Y o ; ) { l e t e = Y o , t ; f o r ( ; e ; ) e . f l a g s & 1 | | ( e . f l a g s & = - 9 ) , e = e . n e x t ; f o r ( e = Y o , Y o = v o i d 0 ; e ; ) { i f ( t = e . n e x t , e . n e x t = v o i d 0 , e . f l a g s & = - 9 , e . f l a g s & 1 ) t r y { e . t r i g g e r ( ) } c a t c h ( s ) { n | | ( n = s ) } e = t } } i f ( n ) t h r o w n } f u n c t i o n R 2 ( n ) { f o r ( l e t e = n . d e p s ; e ; e = e . n e x t D e p ) e . v e r s i o n = - 1 , e . p r e v A c t i v e L i n k = e . d e p . a c t i v e L i n k , e . d e p . a c t i v e L i n k = e } f u n c t i o n A 2 ( n ) { l e t e , t = n . d e p s T a i l , s = t ; f o r ( ; s ; ) { c o n s t i = s . p r e v D e p ; s . v e r s i o n = = = - 1 ? ( s = = = t & & ( t = i ) , Y b ( s ) , b I ( s ) ) : e = s , s . d e p . a c t i v e L i n k = s . p r e v A c t i v e L i n k , s . p r e v A c t i v e L i n k = v o i d 0 , s = i } n . d e p s = e , n . d e p s T a i l = t } f u n c t i o n O g ( n ) { f o r ( l e t e = n . d e p s ; e ; e = e . n e x t D e p ) i f ( e . d e p . v e r s i o n ! = = e . v e r s i o n | | e . d e p . c o m p u t e d & & ( M 2 ( e . d e p . c o m p u t e d ) | | e . d e p . v e r s i o n ! = = e . v e r s i o n ) ) r e t u r n ! 0 ; r e t u r n ! ! n . _ d i r t y } f u n c t i o n M 2 ( n ) { i f ( n . f l a g s & 4 & & ! ( n . f l a g s & 1 6 ) | | ( n . f l a g s & = - 1 7 , n . g l o b a l V e r s i o n = = = P l ) ) r e t u r n ; n . g l o b a l V e r s i o n = P l ; c o n s t e = n . d e p ; i f ( n . f l a g s | = 2 , e . v e r s i o n > 0 & & ! n . i s S S R & & n . d e p s & & ! O g ( n ) ) { n . f l a g s & = - 3 ; r e t u r n } c o n s t t = K t , s = F s ; K t = n , F s = ! 0 ; t r y { R 2 ( n ) ; c o n s t i = n . f n ( n . _ v a l u e ) ; ( e . v e r s i o n = = = 0 | | E r ( i , n . _ v a l u e ) ) & & ( n . _ v a l u e = i , e . v e r s i o n + + ) } c a t c h ( i ) { t h r o w e . v e r s i o n + + , i } f i n a l l y { K t = t , F s = s , A 2 ( n ) , n . f l a g s & = - 3 } } f u n c t i o n Y b ( n , e = ! 1 ) { c o n s t { d e p : t , p r e v S u b : s , n e x t S u b : i } = n ; i f ( s & & ( s . n e x t S u b = i , n . p r e v S u b = v o i d 0 ) , i & & ( i . p r e v S u b = s , n . n e x t S u b = v o i d 0 ) , t . s u b s = = = n & & ( t . s u b s = s ) , ! t . s u b s & & t . c o m p u t e d ) { t . c o m p u t e d . f l a g s & = - 5 ; f o r ( l e t r = t . c o m p u t e d . d e p s ; r ; r = r . n e x t D e p ) Y b ( r , ! 0 ) } ! e & & ! - - t . s c & & t . m a p & & t . m a p . d e l e t e ( t . k e y ) } f u n c t i o n b I ( n ) { c o n s t { p r e v D e p : e , n e x t D e p : t } = n ; e & & ( e . n e x t D e p = t , n . p r e v D e p = v o i d 0 ) , t & & ( t . p r e v D e p = e , n . n e x t D e p = v o i d 0 ) } l e t F s = ! 0 ; c o n s t N 2 = [ ] ; f u n c t i o n x r ( ) { N 2 . p u s h ( F s ) , F s = ! 1 } f u n c t i o n C r ( ) { c o n s t n = N 2 . p o p ( ) ; F s = n = = = v o i d 0 ? ! 0 : n } f u n c t i o n Q y ( n ) { c o n s t { c l e a n u p : e } = n ; i f ( n . c l e a n u p = v o i d 0 , e ) { c o n s t t = K t ; K t = v o i d 0 ; t r y { e ( ) } f i n a l l y { K t = t } } } l e t P l = 0 ; c l a s s y I { c o n s t r u c t o r ( e , t ) { t h i s . s u b = e , t h i s . d e p = t , t h i s . v e r s i o n = t . v e r s i o n , t h i s . n e x t D e p = t h i s . p r e v D e p = t h i s . n e x t S u b = t h i s . p r e v S u b = t h i s . p r e v A c t i v e L i n k = v o i d 0 } } c l a s s O u { c o n s t r u c t o r ( e ) { t h i s . c o m p u t e d = e , t h i s . v e r s i o n = 0 , t h i s . a c t i v e L i n k = v o i d 0 , t h i s . s u b s = v o i d 0 , t h i s . t a r g e t = v o
2024-09-29 19:46:45 +00:00
* @ vue / runtime - core v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-10-20 21:50:56 +00:00
* * /function tc(n,e,t,s){try{return s?n(...s):n()}catch(i){Fu(i,e,t)}}function Vs(n,e,t,s){if(ft(n)){const i=tc(n,e,t,s);return i&&_2(i)&&i.catch(r=>{Fu(r,e,t)}),i}if(rt(n)){const i=[];for(let r=0;r<n.length;r++)i.push(Vs(n[r],e,t,s));return i}}function Fu(n,e,t,s=!0){const i=e?e.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Yt;if(e){let a=e.parent;const c=e.proxy,d=`https:/ / vuejs . org / error - reference / # runtime - $ { t } ` ;for(;a;){const u=a.ec;if(u){for(let _=0;_<u.length;_++)if(u[_](n,c,d)===!1)return}a=a.parent}if(r){xr(),tc(r,null,10,[n,c,d]),Cr();return}}JI(n,t,i,s,o)}function JI(n,e,t,s=!0,i=!1){if(i)throw n;console.error(n)}let Ul=!1,kg=!1;const Bn=[];let js=0;const Jo=[];let tr=null,Ho=0;const Y2=Promise.resolve();let jb=null;function De(n){const e=jb||Y2;return n?e.then(this?n.bind(this):n):e}function ek(n){let e=Ul?js+1:0,t=Bn.length;for(;e<t;){const s=e+t>>>1,i=Bn[s],r=Bl(i);r<n||r===n&&i.flags&2?e=s+1:t=s}return e}function Qb(n){if(!(n.flags&1)){const e=Bl(n),t=Bn[Bn.length-1];!t||!(n.flags&2)&&e>=Bl(t)?Bn.push(n):Bn.splice(ek(e),0,n),n.flags|=1, $ 2()}}function $ 2(){!Ul&&!kg&&(kg=!0,jb=Y2.then(K2))}function tk(n){rt(n)?Jo.push(...n):tr&&n.id===-1?tr.splice(Ho+1,0,n):n.flags&1||(Jo.push(n),n.flags|=1), $ 2()}function nE(n,e,t=Ul?js+1:0){for(;t<Bn.length;t++){const s=Bn[t];if(s&&s.flags&2){if(n&&s.id!==n.uid)continue;Bn.splice(t,1),t--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function W2(n){if(Jo.length){const e=[...new Set(Jo)].sort((t,s)=>Bl(t)-Bl(s));if(Jo.length=0,tr){tr.push(...e);return}for(tr=e,Ho=0;Ho<tr.length;Ho++){const t=tr[Ho];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}tr=null,Ho=0}}const Bl=n=>n.id==null?n.flags&2?-1:1/0:n.id;function K2(n){kg=!1,Ul=!0;try{for(js=0;js<Bn.length;js++){const e=Bn[js];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),tc(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;js<Bn.length;js++){const e=Bn[js];e&&(e.flags&=-2)}js=0,Bn.length=0,W2(),Ul=!1,jb=null,(Bn.length||Jo.length)&&K2()}}let bn=null,j2=null;function Yd(n){const e=bn;return bn=n,j2=n&&n.type.__scopeId||null,e}function Ie(n,e=bn,t){if(!e||n._n)return n;const s=(...i)=>{s._d&&fE(-1);const r=Yd(e);let o;try{o=n(...i)}finally{Yd(r),s._d&&fE(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function k(n,e){if(bn===null)return n;const t=qu(bn),s=n.dirs||(n.dirs=[]);for(let i=0;i<e.length;i++){let[r,o,a,c=Yt]=e[i];r&&(ft(r)&&(r={mounted:r,updated:r}),r.deep&&Ri(o),s.push({dir:r,instance:t,value:o,oldValue:void 0,arg:a,modifiers:c}))}return n}function Nr(n,e,t,s){const i=n.dirs,r=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];r&&(a.oldValue=r[o].value);let c=a.dir[s];c&&(xr(),Vs(c,t,8,[n.el,a,n,e]),Cr())}}const Q2=Symbol("_vte"),X2=n=>n.__isTeleport,El=n=>n&&(n.disabled||n.disabled===""),nk=n=>n&&(n.defer||n.defer===""),sE=n=>typeof SVGElement<"u"&&n instanceof SVGElement,iE=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Dg=(n,e)=>{const t=n&&n.to;return Xt(t)?e?e(t):null:t},sk={name:"Teleport",__isTeleport:!0,process(n,e,t,s,i,r,o,a,c,d){const{mc:u,pc:_,pbc:m,o:{insert:h,querySelector:f,createText:g,createComment:b}}=d,y=El(e.props);let{shapeFlag:E,children:v,dynamicChildren:S}=e;if(n==null){const R=e.el=g(""),C=e.anchor=g("");h(R,t,s),h(C,t,s);const A=(x,M)=>{E&16&&(i&&i.isCE&&(i.ce._teleportTarget=x),u(v,x,M,i,r,o,a,c))},I=()=>{const x=e.target=Dg(e.props,f),M=Z2(x,e,g,h);x&&(o!=="svg"&&sE(x)?o="svg":o!=="mathml"&&iE(x)&&(o="mathml"),y||(A(x,M),Td(e)))};y&&(A(t,C),Td(e)),nk(e.props)?hn(I,r):I()}else{e.el=n.el,e.targetStart=n.targetStart;const R=e.anchor=n.anchor,C=e.target=n.target,A=e.targetAnchor=n.targetAnchor,I=El(n.props),x=I?t:C,M=I?R:A;if(o==="svg"||sE(C)?o="svg":(o==="mathml"||iE(C))&&(o="mathml"),S?(m(n.dynamicChildren,S,x,i,r,o,a),e0(n,e,!0)):c||_(n,e,x,M,i,r,o,a,!1),y)I?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Nc(e,t,R,d,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const G=e.target=Dg(e.props,f);G&&Nc(e,G,null,d,0)}else I&&Nc(e,C,A,d,1);Td(e)}},remove(n,e,t,{um:s,o:{remove:i}},r){const{shapeF
2024-09-29 19:46:45 +00:00
* @ vue / runtime - dom v3 . 5.10
* ( c ) 2018 - present Yuxi ( Evan ) You and Vue contributors
* @ license MIT
2024-10-20 22:07:51 +00:00
* * /let zg;const gE=typeof window<"u"&&window.trustedTypes;if(gE)try{zg=gE.createPolicy("vue",{createHTML:n=>n})}catch{}const OR=zg?n=>zg.createHTML(n):n=>n,oD="http:/ / www . w3 . org / 2000 / svg ",aD=" http : //www.w3.org/1998/Math/MathML",wi=typeof document<"u"?document:null,bE=wi&&wi.createElement("template"),lD={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,s)=>{const i=e==="svg"?wi.createElementNS(oD,n):e==="mathml"?wi.createElementNS(aD,n):t?wi.createElement(n,{is:t}):wi.createElement(n);return n==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:n=>wi.createTextNode(n),createComment:n=>wi.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>wi.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,s,i,r){const o=t?t.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),t),!(i===r||!(i=i.nextSibling)););else{bE.innerHTML=OR(s==="svg"?`<svg>${n}</svg>`:s==="mathml"?`<math>${n}</math>`:n);const a=bE.content;if(s==="svg"||s==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Yi="transition",Xa="animation",la=Symbol("_vtc"),IR={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kR=ln({},eR,IR),cD=n=>(n.displayName="Transition",n.props=kR,n),Ii=cD((n,{slots:e})=>s0(ak,DR(n),e)),Ir=(n,e=[])=>{rt(n)?n.forEach(t=>t(...e)):n&&n(...e)},yE=n=>n?rt(n)?n.some(e=>e.length>1):n.length>1:!1;function DR(n){const e={};for(const V in n)V in IR||(e[V]=n[V]);if(n.css===!1)return e;const{name:t="v",type:s,duration:i,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:d=o,appearToClass:u=a,leaveFromClass:_=`${t}-leave-from`,leaveActiveClass:m=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,f=dD(i),g=f&&f[0],b=f&&f[1],{onBeforeEnter:y,onEnter:E,onEnterCancelled:v,onLeave:S,onLeaveCancelled:R,onBeforeAppear:C=y,onAppear:A=E,onAppearCancelled:I=v}=e,x=(V,te,O)=>{er(V,te?u:a),er(V,te?d:o),O&&O()},M=(V,te)=>{V._isLeaving=!1,er(V,_),er(V,h),er(V,m),te&&te()},G=V=>(te,O)=>{const H=V?A:E,q=()=>x(te,V,O);Ir(H,[te,q]),EE(()=>{er(te,V?c:r),xi(te,V?u:a),yE(H)||vE(te,s,g,q)})};return ln(e,{onBeforeEnter(V){Ir(y,[V]),xi(V,r),xi(V,o)},onBeforeAppear(V){Ir(C,[V]),xi(V,c),xi(V,d)},onEnter:G(!1),onAppear:G(!0),onLeave(V,te){V._isLeaving=!0;const O=()=>M(V,te);xi(V,_),xi(V,m),PR(),EE(()=>{V._isLeaving&&(er(V,_),xi(V,h),yE(S)||vE(V,s,b,O))}),Ir(S,[V,O])},onEnterCancelled(V){x(V,!1),Ir(v,[V])},onAppearCancelled(V){x(V,!0),Ir(I,[V])},onLeaveCancelled(V){M(V),Ir(R,[V])}})}function dD(n){if(n==null)return null;if(Vt(n))return[Vp(n.enter),Vp(n.leave)];{const e=Vp(n);return[e,e]}}function Vp(n){return lI(n)}function xi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[la]||(n[la]=new Set)).add(e)}function er(n,e){e.split(/\s+/).forEach(s=>s&&n.classList.remove(s));const t=n[la];t&&(t.delete(e),t.size||(n[la]=void 0))}function EE(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let uD=0;function vE(n,e,t,s){const i=n._endId=++uD,r=()=>{i===n._endId&&s()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=LR(n,e);if(!o)return s();const d=o+"end";let u=0;const _=()=>{n.removeEventListener(d,m),r()},m=h=>{h.target===n&&++u>=c&&_()};setTimeout(()=>{u<c&&_()},a+1),n.addEventListener(d,m)}function LR(n,e){const t=window.getComputedStyle(n),s=f=>(t[f]||"").split(", "),i=s(`${Yi}Delay`),r=s(`${Yi}Duration`),o=SE(i,r),a=s(`${Xa}Delay`),c=s(`${Xa}Duration`),d=SE(a,c);let u=null,_=0,m=0;e===Yi?o>0&&(u=Yi,_=o,m=r.length
2024-09-29 19:46:45 +00:00
* vuex v4 . 1.0
* ( c ) 2022 Evan You
* @ license MIT
2024-10-20 22:07:51 +00:00
* /var zR="store";function QD(n){return n===void 0&&(n=null),is(n!==null?n:zR)}function La(n,e){Object.keys(n).forEach(function(t){return e(n[t],t)})}function HR(n){return n!==null&&typeof n=="object"}function XD(n){return n&&typeof n.then=="function"}function ZD(n,e){return function(){return n(e)}}function qR(n,e,t){return e.indexOf(n)<0&&(t&&t.prepend?e.unshift(n):e.push(n)),function(){var s=e.indexOf(n);s>-1&&e.splice(s,1)}}function YR(n,e){n._actions=Object.create(null),n._mutations=Object.create(null),n._wrappedGetters=Object.create(null),n._modulesNamespaceMap=Object.create(null);var t=n.state;Yu(n,t,[],n._modules.root,!0),i0(n,t,e)}function i0(n,e,t){var s=n._state,i=n._scope;n.getters={},n._makeLocalGettersCache=Object.create(null);var r=n._wrappedGetters,o={},a={},c=hI(!0);c.run(function(){La(r,function(d,u){o[u]=ZD(d,n),a[u]=Je(function(){return o[u]()}),Object.defineProperty(n.getters,u,{get:function(){return a[u].value},enumerable:!0})})}),n._state=Hn({data:e}),n._scope=c,n.strict&&sL(n),s&&t&&n._withCommit(function(){s.data=null}),i&&i.stop()}function Yu(n,e,t,s,i){var r=!t.length,o=n._modules.getNamespace(t);if(s.namespaced&&(n._modulesNamespaceMap[o],n._modulesNamespaceMap[o]=s),!r&&!i){var a=r0(e,t.slice(0,-1)),c=t[t.length-1];n._withCommit(function(){a[c]=s.state})}var d=s.context=JD(n,o,t);s.forEachMutation(function(u,_){var m=o+_;eL(n,m,u,d)}),s.forEachAction(function(u,_){var m=u.root?_:o+_,h=u.handler||u;tL(n,m,h,d)}),s.forEachGetter(function(u,_){var m=o+_;nL(n,m,u,d)}),s.forEachChild(function(u,_){Yu(n,e,t.concat(_),u,i)})}function JD(n,e,t){var s=e==="",i={dispatch:s?n.dispatch:function(r,o,a){var c=Zd(r,o,a),d=c.payload,u=c.options,_=c.type;return(!u||!u.root)&&(_=e+_),n.dispatch(_,d)},commit:s?n.commit:function(r,o,a){var c=Zd(r,o,a),d=c.payload,u=c.options,_=c.type;(!u||!u.root)&&(_=e+_),n.commit(_,d,u)}};return Object.defineProperties(i,{getters:{get:s?function(){return n.getters}:function(){return $R(n,e)}},state:{get:function(){return r0(n.state,t)}}}),i}function $R(n,e){if(!n._makeLocalGettersCache[e]){var t={},s=e.length;Object.keys(n.getters).forEach(function(i){if(i.slice(0,s)===e){var r=i.slice(s);Object.defineProperty(t,r,{get:function(){return n.getters[i]},enumerable:!0})}}),n._makeLocalGettersCache[e]=t}return n._makeLocalGettersCache[e]}function eL(n,e,t,s){var i=n._mutations[e]||(n._mutations[e]=[]);i.push(function(o){t.call(n,s.state,o)})}function tL(n,e,t,s){var i=n._actions[e]||(n._actions[e]=[]);i.push(function(o){var a=t.call(n,{dispatch:s.dispatch,commit:s.commit,getters:s.getters,state:s.state,rootGetters:n.getters,rootState:n.state},o);return XD(a)||(a=Promise.resolve(a)),n._devtoolHook?a.catch(function(c){throw n._devtoolHook.emit("vuex:error",c),c}):a})}function nL(n,e,t,s){n._wrappedGetters[e]||(n._wrappedGetters[e]=function(r){return t(s.state,s.getters,r.state,r.getters)})}function sL(n){Tn(function(){return n._state.data},function(){},{deep:!0,flush:"sync"})}function r0(n,e){return e.reduce(function(t,s){return t[s]},n)}function Zd(n,e,t){return HR(n)&&n.type&&(t=e,e=n,n=n.type),{type:n,payload:e,options:t}}var iL="vuex bindings",FE="vuex:mutations",qp="vuex:actions",To="vuex",rL=0;function oL(n,e){jD({id:"org.vuejs.vuex",app:n,label:"Vuex",homepage:"https:/ / next . vuex . vuejs . org / ",logo:" https : //vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[iL]},function(t){t.addTimelineLayer({id:FE,label:"Vuex Mutations",color:UE}),t.addTimelineLayer({id:qp,label:"Vuex Actions",color:UE}),t.addInspector({id:To,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),t.on.getInspectorTree(function(s){if(s.app===n&&s.inspectorId===To)if(s.filter){var i=[];QR(i,e._modules.root,s.filter,""),s.rootNodes=i}else s.rootNodes=[jR(e._modules.root,"")]}),t.on.getInspectorState(function(s){if(s.app===n&&s.inspectorId===To){var i=s.nodeId;$R(e,i),s.state=cL(uL(e._modules,i),i==="root"?e.getters:e._makeLocalGettersCache,i)}}),t.on.editInspectorState(function(s){if(s.app===n&&s.inspectorId===To){var i=s.nodeId,r=s.path;i!=="root"&&(r=i.split("/").fi
2024-10-18 23:54:04 +00:00
` ).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),s=o.substring(i+1).trim(),!(!t||e[t]&&yP[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},qE=Symbol("internals");function Ja(n){return n&&String(n).trim().toLowerCase()}function Ad(n){return n===!1||n==null?n:Te.isArray(n)?n.map(Ad):String(n)}function vP(n){const e=Object.create(null),t=/([^ \s ,;=]+) \s *(?:= \s *([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const SP=n=>/^[-_a-zA-Z0-9^ ` | ~ , ! # $ % & ' * + . ] + $ / . test ( n . trim ( ) ) ; function $p ( n , e , t , s , i ) { if ( Te . isFunction ( s ) ) return s . call ( this , e , t ) ; if ( i && ( e = t ) , ! ! Te . isString ( e ) ) { if ( Te . isString ( s ) ) return e . indexOf ( s ) !== - 1 ; if ( Te . isRegExp ( s ) ) return s . test ( e ) } } function TP ( n ) { return n . trim ( ) . toLowerCase ( ) . replace ( /([a-z\d])(\w*)/g , ( e , t , s ) => t . toUpperCase ( ) + s ) } function xP ( n , e ) { const t = Te . toCamelCase ( " " + e ) ; [ "get" , "set" , "has" ] . forEach ( s => { Object . defineProperty ( n , s + t , { value : function ( i , r , o ) { return this [ s ] . call ( this , e , i , r , o ) } , configurable : ! 0 } ) } ) } class Kn { constructor ( e ) { e && this . set ( e ) } set ( e , t , s ) { const i = this ; function r ( a , c , d ) { const u = Ja ( c ) ; if ( ! u ) throw new Error ( "header name must be a non-empty string" ) ; const _ = Te . findKey ( i , u ) ; ( ! _ || i [ _ ] === void 0 || d === ! 0 || d === void 0 && i [ _ ] !== ! 1 ) && ( i [ _ || c ] = Ad ( a ) ) } const o = ( a , c ) => Te . forEach ( a , ( d , u ) => r ( d , u , c ) ) ; if ( Te . isPlainObject ( e ) || e instanceof this . constructor ) o ( e , t ) ; else if ( Te . isString ( e ) && ( e = e . trim ( ) ) && ! SP ( e ) ) o ( EP ( e ) , t ) ; else if ( Te . isHeaders ( e ) ) for ( const [ a , c ] of e . entries ( ) ) r ( c , a , s ) ; else e != null && r ( t , e , s ) ; return this } get ( e , t ) { if ( e = Ja ( e ) , e ) { const s = Te . findKey ( this , e ) ; if ( s ) { const i = this [ s ] ; if ( ! t ) return i ; if ( t === ! 0 ) return vP ( i ) ; if ( Te . isFunction ( t ) ) return t . call ( this , i , s ) ; if ( Te . isRegExp ( t ) ) return t . exec ( i ) ; throw new TypeError ( "parser must be boolean|regexp|function" ) } } } has ( e , t ) { if ( e = Ja ( e ) , e ) { const s = Te . findKey ( this , e ) ; return ! ! ( s && this [ s ] !== void 0 && ( ! t || $p ( this , this [ s ] , s , t ) ) ) } return ! 1 } delete ( e , t ) { const s = this ; let i = ! 1 ; function r ( o ) { if ( o = Ja ( o ) , o ) { const a = Te . findKey ( s , o ) ; a && ( ! t || $p ( s , s [ a ] , a , t ) ) && ( delete s [ a ] , i = ! 0 ) } } return Te . isArray ( e ) ? e . forEach ( r ) : r ( e ) , i } clear ( e ) { const t = Object . keys ( this ) ; let s = t . length , i = ! 1 ; for ( ; s -- ; ) { const r = t [ s ] ; ( ! e || $p ( this , this [ r ] , r , e , ! 0 ) ) && ( delete this [ r ] , i = ! 0 ) } return i } normalize ( e ) { const t = this , s = { } ; return Te . forEach ( this , ( i , r ) => { const o = Te . findKey ( s , r ) ; if ( o ) { t [ o ] = Ad ( i ) , delete t [ r ] ; return } const a = e ? TP ( r ) : String ( r ) . trim ( ) ; a !== r && delete t [ r ] , t [ a ] = Ad ( i ) , s [ a ] = ! 0 } ) , this } concat ( ... e ) { return this . constructor . concat ( this , ... e ) } toJSON ( e ) { const t = Object . create ( null ) ; return Te . forEach ( this , ( s , i ) => { s != null && s !== ! 1 && ( t [ i ] = e && Te . isArray ( s ) ? s . join ( ", " ) : s ) } ) , t } [ Symbol . iterator ] ( ) { return Object . entries ( this . toJSON ( ) ) [ Symbol . iterator ] ( ) } toString ( ) { return Object . entries ( this . toJSON ( ) ) . map ( ( [ e , t ] ) => e + ": " + t ) . join ( `
2024-10-20 22:07:51 +00:00
` )}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[qE]=this[qE]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=Ja(o);s[a]||(xP(i,o),s[a]=!0)}return Te.isArray(e)?e.forEach(r):r(e),this}}Kn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Te.reduceDescriptors(Kn.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}});Te.freezeMethods(Kn);function Wp(n,e){const t=this||oc,s=e||t,i=Kn.from(s.headers);let r=s.data;return Te.forEach(n,function(a){r=a.call(t,r,i.normalize(),e?e.status:void 0)}),i.normalize(),r}function _A(n){return!!(n&&n.__CANCEL__)}function Fa(n,e,t){bt.call(this,n??"canceled",bt.ERR_CANCELED,e,t),this.name="CanceledError"}Te.inherits(Fa,bt,{__CANCEL__:!0});function mA(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new bt("Request failed with status code "+t.status,[bt.ERR_BAD_REQUEST,bt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function CP(n){const e=/^([-+ \w ]{1,25})(:? \/ \/ |:)/.exec(n);return e&&e[1]||""}function wP(n,e){n=n||10;const t=new Array(n),s=new Array(n);let i=0,r=0,o;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),u=s[r];o||(o=d),t[i]=c,s[i]=d;let _=r,m=0;for(;_!==i;)m+=t[_++],_=_%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),d-o<e)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function RP(n,e){let t=0,s=1e3/e,i,r;const o=(d,u=Date.now())=>{t=u,i=null,r&&(clearTimeout(r),r=null),n.apply(null,d)};return[(...d)=>{const u=Date.now(),_=u-t;_>=s?o(d,u):(i=d,r||(r=setTimeout(()=>{r=null,o(i)},s-_)))},()=>i&&o(i)]}const Jd=(n,e,t=3)=>{let s=0;const i=wP(50,250);return RP(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,c=o-s,d=i(c),u=o<=a;s=o;const _={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&u?(a-o)/d:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(_)},t)},YE=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]}, $ E=n=>(...e)=>Te.asap(()=>n(...e)),AP=Wn.hasStandardBrowserEnv?function(){const e=Wn.navigator&&/(msie|trident)/i.test(Wn.navigator.userAgent),t=document.createElement("a");let s;function i(r){let o=r;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/: $ /,""):"",host:t.host,search:t.search?t.search.replace(/^ \? /,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=i(window.location.href),function(o){const a=Te.isString(o)?i(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),MP=Wn.hasStandardBrowserEnv?{write(n,e,t,s,i,r){const o=[n+"="+encodeURIComponent(e)];Te.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),Te.isString(s)&&o.push("path="+s),Te.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|; \\ s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function NP(n){return/^([a-z][a-z \d + \- .]*:)? \/ \/ /i.test(n)}function OP(n,e){return e?n.replace(/ \/ ? \/ $ /,"")+"/"+e.replace(/^ \/ +/,""):n}function hA(n,e){return n&&!NP(e)?OP(n,e):e}const WE=n=>n instanceof Kn?{...n}:n;function ao(n,e){e=e||{};const t={};function s(d,u,_){return Te.isPlainObject(d)&&Te.isPlainObject(u)?Te.merge.call({caseless:_},d,u):Te.isPlainObject(u)?Te.merge({},u):Te.isArray(u)?u.slice():u}function i(d,u,_){if(Te.isUndefined(u)){if(!Te.isUndefined(d))return s(void 0,d,_)}else return s(d,u,_)}function r(d,u){if(!Te.isUndefined(u))return s(void 0,u)}function o(d,u){if(Te.isUndefined(u)){if(!Te.isUndefined(d))return s(void 0,d)}else return s(void 0,u)}function a(d,u,_){if(_ in e)return s(d,u);if(_ in n
2024-09-29 19:46:45 +00:00
` +r.map(QE).join( `
2024-10-20 22:07:51 +00:00
` ):" "+QE(r[0]):"as no adapter specified";throw new bt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:jg};function Kp(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Fa(null,n)}function XE(n){return Kp(n),n.headers=Kn.from(n.headers),n.data=Wp.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),EA.getAdapter(n.adapter||oc.adapter)(n).then(function(s){return Kp(n),s.data=Wp.call(n,n.transformResponse,s),s.headers=Kn.from(s.headers),s},function(s){return _A(s)||(Kp(n),s&&s.response&&(s.response.data=Wp.call(n,n.transformResponse,s.response),s.response.headers=Kn.from(s.response.headers))),Promise.reject(s)})}const vA="1.7.7",d0={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{d0[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const ZE={};d0.transitional=function(e,t,s){function i(r,o){return"[Axios v"+vA+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,a)=>{if(e===!1)throw new bt(i(o," has been removed"+(t?" in "+t:"")),bt.ERR_DEPRECATED);return t&&!ZE[o]&&(ZE[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(r,o,a):!0}};function qP(n,e,t){if(typeof n!="object")throw new bt("options must be an object",bt.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],o=e[r];if(o){const a=n[r],c=a===void 0||o(a,r,n);if(c!==!0)throw new bt("option "+r+" must be "+c,bt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new bt("Unknown option "+r,bt.ERR_BAD_OPTION)}}const Qg={assertOptions:qP,validators:d0}, $ i=Qg.validators;class Zr{constructor(e){this.defaults=e,this.interceptors={request:new HE,response:new HE}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const r=i.stack?i.stack.replace(/^.+ \n /,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+ \n .+ \n /,""))&&(s.stack+= `
` +r):s.stack=r}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ao(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:r}=t;s!==void 0&&Qg.assertOptions(s,{silentJSONParsing: $ i.transitional( $ i.boolean),forcedJSONParsing: $ i.transitional( $ i.boolean),clarifyTimeoutError: $ i.transitional( $ i.boolean)},!1),i!=null&&(Te.isFunction(i)?t.paramsSerializer={serialize:i}:Qg.assertOptions(i,{encode: $ i.function,serialize: $ i.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&Te.merge(r.common,r[t.method]);r&&Te.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),t.headers=Kn.concat(o,r);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,_=0,m;if(!c){const f=[XE.bind(this),void 0];for(f.unshift.apply(f,a),f.push.apply(f,d),m=f.length,u=Promise.resolve(t);_<m;)u=u.then(f[_++],f[_++]);return u}m=a.length;let h=t;for(_=0;_<m;){const f=a[_++],g=a[_++];try{h=f(h)}catch(b){g.call(this,b);break}}try{u=XE.call(this,h)}catch(f){return Promise.reject(f)}for(_=0,m=d.length;_<m;)u=u.then(d[_++],d[_++]);return u}getUri(e){e=ao(this.defaults,e);const t=hA(e.baseURL,e.url);return uA(t,e.params,e.paramsSerializer)}}Te.forEach(["delete","get","head","options"],function(e){Zr.prototype[e]=function(t,s){return this.request(ao(s||{},{method:e,url:t,data:(s||{}).data}))}});Te.forEach(["post","put","patch"],function(e){function t(s){return function(r,o,a){return this.request(ao(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Zr.prototype[e]=t(),Zr.prototype[e+"Form"]=t(!0)});class u0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(r){t=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{s.subscribe(a),r=a}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},e(function(r,o,a){s.reason||(s.reason=new Fa(r,o,a),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new u0(function(i){e=i}),cancel:e}}}function YP(n){return function(t){return n.apply(null,t)}}function $ P(n){return Te.isObject(n)&&n.isAxiosError===!0}const Xg={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticat
2024-09-29 19:46:45 +00:00
* vue - router v4 . 4.5
* ( c ) 2024 Eduardo San Martin Morote
* @ license MIT
2024-10-20 21:50:56 +00:00
* /const qo=typeof document<"u";function TA(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function WP(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&TA(n.default)}const Ft=Object.assign;function jp(n,e){const t={};for(const s in e){const i=e[s];t[s]=Hs(i)?i.map(n):n(i)}return t}const Tl=()=>{},Hs=Array.isArray,xA=/ # / g , KP = /&/g , jP = /\//g , QP = /=/g , XP = /\?/g , CA = /\+/g , ZP = /%5B/g , JP = /%5D/g , wA = /%5E/g , e3 = /%60/g , RA = /%7B/g , t3 = /%7C/g , AA = /%7D/g , n3 = /%20/g ; function p0 ( n ) { return encodeURI ( "" + n ) . replace ( t3 , "|" ) . replace ( ZP , "[" ) . replace ( JP , "]" ) } function s3 ( n ) { return p0 ( n ) . replace ( RA , "{" ) . replace ( AA , "}" ) . replace ( wA , "^" ) } function Zg ( n ) { return p0 ( n ) . replace ( CA , "%2B" ) . replace ( n3 , "+" ) . replace ( xA , "%23" ) . replace ( KP , "%26" ) . replace ( e3 , "`" ) . replace ( RA , "{" ) . replace ( AA , "}" ) . replace ( wA , "^" ) } function i3 ( n ) { return Zg ( n ) . replace ( QP , "%3D" ) } function r3 ( n ) { return p0 ( n ) . replace ( xA , "%23" ) . replace ( XP , "%3F" ) } function o3 ( n ) { return n == null ? "" : r3 ( n ) . replace ( jP , "%2F" ) } function Hl ( n ) { try { return decodeURIComponent ( "" + n ) } catch { } return "" + n } const a3 = /\/$/ , l3 = n => n . replace ( a3 , "" ) ; function Qp ( n , e , t = "/" ) { let s , i = { } , r = "" , o = "" ; const a = e . indexOf ( "#" ) ; let c = e . indexOf ( "?" ) ; return a < c && a >= 0 && ( c = - 1 ) , c > - 1 && ( s = e . slice ( 0 , c ) , r = e . slice ( c + 1 , a > - 1 ? a : e . length ) , i = n ( r ) ) , a > - 1 && ( s = s || e . slice ( 0 , a ) , o = e . slice ( a , e . length ) ) , s = p3 ( s ? ? e , t ) , { fullPath : s + ( r && "?" ) + r + o , path : s , query : i , hash : Hl ( o ) } } function c3 ( n , e ) { const t = e . query ? n ( e . query ) : "" ; return e . path + ( t && "?" ) + t + ( e . hash || "" ) } function JE ( n , e ) { return ! e || ! n . toLowerCase ( ) . startsWith ( e . toLowerCase ( ) ) ? n : n . slice ( e . length ) || "/" } function d3 ( n , e , t ) { const s = e . matched . length - 1 , i = t . matched . length - 1 ; return s > - 1 && s === i && da ( e . matched [ s ] , t . matched [ i ] ) && MA ( e . params , t . params ) && n ( e . query ) === n ( t . query ) && e . hash === t . hash } function da ( n , e ) { return ( n . aliasOf || n ) === ( e . aliasOf || e ) } function MA ( n , e ) { if ( Object . keys ( n ) . length !== Object . keys ( e ) . length ) return ! 1 ; for ( const t in n ) if ( ! u3 ( n [ t ] , e [ t ] ) ) return ! 1 ; return ! 0 } function u3 ( n , e ) { return Hs ( n ) ? ev ( n , e ) : Hs ( e ) ? ev ( e , n ) : n === e } function ev ( n , e ) { return Hs ( e ) ? n . length === e . length && n . every ( ( t , s ) => t === e [ s ] ) : n . length === 1 && n [ 0 ] === e } function p3 ( n , e ) { if ( n . startsWith ( "/" ) ) return n ; if ( ! n ) return e ; const t = e . split ( "/" ) , s = n . split ( "/" ) , i = s [ s . length - 1 ] ; ( i === ".." || i === "." ) && s . push ( "" ) ; let r = t . length - 1 , o , a ; for ( o = 0 ; o < s . length ; o ++ ) if ( a = s [ o ] , a !== "." ) if ( a === ".." ) r > 1 && r -- ; else break ; return t . slice ( 0 , r ) . join ( "/" ) + "/" + s . slice ( o ) . join ( "/" ) } const Wi = { path : "/" , name : void 0 , params : { } , query : { } , hash : "" , fullPath : "/" , matched : [ ] , meta : { } , redirectedFrom : void 0 } ; var ql ; ( function ( n ) { n . pop = "pop" , n . push = "push" } ) ( ql || ( ql = { } ) ) ; var xl ; ( function ( n ) { n . back = "back" , n . forward = "forward" , n . unknown = "" } ) ( xl || ( xl = { } ) ) ; function f3 ( n ) { if ( ! n ) if ( qo ) { const e = document . querySelector ( "base" ) ; n = e && e . getAttribute ( "href" ) || "/" , n = n . replace ( /^\w+:\/\/[^\/]+/ , "" ) } else n = "/" ; return n [ 0 ] !== "/" && n [ 0 ] !== "#" && ( n = "/" + n ) , l3 ( n ) } const _3 = /^[^#]+#/ ; function m3 ( n , e ) { return n . replace ( _3 , "#" ) + e } function h3 ( n , e ) { const t = document . documentElement . getBoundingClientRect ( ) , s = n . getBoundingClientRect ( ) ; return { behavior : e . behavior , left : s . left - t . left - ( e . left || 0 ) , top : s . top - t . top - ( e . top || 0 ) } } const Xu = ( ) => ( { left : window . scrollX , top : window . scrollY } ) ; function g3 ( n ) { let e ; if ( "el" in n ) { const t = n . el , s = typeof t == "string" && t . startsWith ( "#" ) , i = typeof t == "string" ? s ? document . getElementById ( t . slice ( 1 ) ) : document . querySelector ( t ) : t ; if ( ! i ) return ; e = h3 ( i , n ) } else e = n ; "scrollBehavior" in document . documentElement . style ? window . scrollTo ( e ) : window . scrollTo ( e . left != null ? e . left : window . scrollX , e . top != null ? e . top : window . scrollY ) } function tv ( n , e ) { return ( history . state ? history . state . position - e : - 1 ) + n } const Jg = new Map ; function b3 ( n , e ) { Jg . set ( n , e ) } function y3 ( n ) { const e = Jg . get ( n ) ; return Jg . delete ( n ) , e } let E3 = ( ) => location . protocol + "//" + location . host ; function NA ( n , e ) { const { pathname : t , search : s , hash : i } = e , r = n . indexOf ( "#" ) ; if ( r > - 1 ) { let a = i . includes ( n . slice ( r ) ) ? n . slice ( r ) . length : 1 , c = i . slice ( a ) ; return c [ 0 ] !== "/" && ( c = "/" + c ) , JE ( c , "" ) } return JE ( t , n ) + s + i } function v3 ( n , e , t , s ) { let i = [ ] , r = [ ] , o = null ; const a = ( { state : m } ) => { const h = NA ( n , location ) , f = t . value , g = e . value ; let b = 0 ; if ( m ) { if ( t . value = h , e . value = m , o && o === f ) { o = null ; return } b = g ? m . position
2024-10-20 20:24:55 +00:00
c - 3 - 0.3 - 6 - 0.5 - 8.9 - 0.5 c - 21.7 , 0 - 42.2 , 8.5 - 57.5 , 23.8 l - 20.8 , 20.8 c - 6.7 , 6.7 - 6.7 , 17.6 , 0 , 24.3 l108 . 5 , 108.5 l - 132.4 , 132.4 \ r
c - 6.7 , 6.7 - 6.7 , 17.6 , 0 , 24.3 c3 . 3 , 3.3 , 7.7 , 5 , 12.1 , 5 s8 . 8 - 1.7 , 12.1 - 5 l132 . 5 - 132.5 l108 . 5 , 108.5 c3 . 3 , 3.3 , 7.7 , 5 , 12.1 , 5 s8 . 8 - 1.7 , 12.1 - 5 \ r
l20 . 8 - 20.8 c17 . 6 - 17.6 , 26.1 - 41.8 , 23.3 - 66.4 l - 7 - 63.5 l40 . 3 - 40.3 l16 . 2 , 16.2 c6 . 7 , 6.7 , 17.6 , 6.7 , 24.3 , 0 l72 . 6 - 72.6 c3 . 2 - 3.2 , 5 - 7.6 , 5 - 12.1 \ r
s - 1.8 - 8.9 - 5 - 12.1 L300 . 625 , 5.025 z M400 . 425 , 250.025 l - 16.2 - 16.3 c - 6.4 - 6.4 - 17.8 - 6.4 - 24.3 , 0 l - 58.2 , 58.3 c - 3.7 , 3.7 - 5.5 , 8.8 - 4.9 , 14 \ r
l7 . 9 , 71.6 c1 . 6 , 14.3 - 3.3 , 28.3 - 13.5 , 38.4 l - 8.7 , 8.7 l - 217.1 - 217.1 l8 . 7 - 8.6 c10 . 1 - 10.1 , 24.2 - 15 , 38.4 - 13.5 l71 . 7 , 7.9 \ r
2024-10-20 21:50:56 +00:00
c5 . 2 , 0.6 , 10.3 - 1.2 , 14 - 4.9 l58 . 2 - 58.2 c6 . 7 - 6.7 , 6.7 - 17.6 , 0 - 24.3 l - 16.3 - 16.3 l48 . 3 - 48.3 l160 . 3 , 160.3 L400 . 425 , 250.025 z ` })],-1)]),8,n4))],8,t4),z(o)])],2),i.isVisible?B("",!0):(T(),w("div",s4))],32)}const r4=st(J3,[["render",i4],["__scopeId","data-v-007ef110"]]),o4={class:"flex overflow-hidden flex-grow w-full"},a4={__name:"App",setup(n){return(e,t)=>(T(),w("div",{class:Ue([e.currentTheme,"flex flex-col h-screen font-sans background-color text-slate-950 dark:bg-bg-dark dark:text-slate-50 w-full overflow-hidden"])},[z(r4),l("div",o4,[z(Ct(LA),null,{default:Ie(({Component:s})=>[(T(),at(ck,null,[(T(),at(Gu(s)))],1024))]),_:1})])],2))}};var PA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function l4(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function s(){return this instanceof s?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(s){var i=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return n[s]}})}),t}var FA={exports:{}};(function(n,e){(function(s,i){n.exports=i()})(typeof self<"u"?self:PA,function(){return function(t){var s={};function i(r){if(s[r])return s[r].exports;var o=s[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=s,i.d=function(r,o,a){i.o(r,o)||Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:a})},i.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},i.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return i.d(o,"a",o),o},i.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},i.p="",i(i.s=0)}({"./dist/icons.json":function(t){t.exports={activity:'<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>',airplay:'<path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon>',"alert-circle":'<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line>',"alert-octagon":'<polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line>',"alert-triangle":'<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line>',"align-center":'<line x1="18" y1="10" x2="6" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="18" y1="18" x2="6" y2="18"></line>',"align-justify":'<line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line>',"align-left":'<line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line>',"align-right":'<line x1="21" y1="10" x2="7" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="7" y2="18"></line>',anchor:'<circle cx="12" cy="5" r="3"></circle><line x1="12" y1="22" x2="12" y2="8"></line><path d="M5 12H2a10 10 0 0 0 20 0h-3"></path>',aperture:'<circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line>',archive:'<polyline points="21
2024-09-29 19:46:45 +00:00
Copyright ( c ) 2016 Jed Watson .
Licensed under the MIT License ( MIT ) , see
http : //jedwatson.github.io/classnames
2024-10-20 21:50:56 +00:00
* /(function(){var a=function(){function c(){}c.prototype=Object.create(null);function d(y,E){for(var v=E.length,S=0;S<v;++S)g(y,E[S])}var u={}.hasOwnProperty;function _(y,E){y[E]=!0}function m(y,E){for(var v in E)u.call(E,v)&&(y[v]=!!E[v])}var h=/ \ s + / ; f u n c t i o n f ( y , E ) { f o r ( v a r v = E . s p l i t ( h ) , S = v . l e n g t h , R = 0 ; R < S ; + + R ) y [ v [ R ] ] = ! 0 } f u n c t i o n g ( y , E ) { i f ( E ) { v a r v = t y p e o f E ; v = = = " s t r i n g " ? f ( y , E ) : A r r a y . i s A r r a y ( E ) ? d ( y , E ) : v = = = " o b j e c t " ? m ( y , E ) : v = = = " n u m b e r " & & _ ( y , E ) } } f u n c t i o n b ( ) { f o r ( v a r y = a r g u m e n t s . l e n g t h , E = A r r a y ( y ) , v = 0 ; v < y ; v + + ) E [ v ] = a r g u m e n t s [ v ] ; v a r S = n e w c ; d ( S , E ) ; v a r R = [ ] ; f o r ( v a r C i n S ) S [ C ] & & R . p u s h ( C ) ; r e t u r n R . j o i n ( " " ) } r e t u r n b } ( ) ; t y p e o f t < " u " & & t . e x p o r t s ? t . e x p o r t s = a : ( r = [ ] , o = ( f u n c t i o n ( ) { r e t u r n a } ) . a p p l y ( s , r ) , o ! = = v o i d 0 & & ( t . e x p o r t s = o ) ) } ) ( ) } , " . / n o d e _ m o d u l e s / c o r e - j s / e s / a r r a y / f r o m . j s " : f u n c t i o n ( t , s , i ) { i ( " . / n o d e _ m o d u l e s / c o r e - j s / m o d u l e s / e s . s t r i n g . i t e r a t o r . j s " ) , i ( " . / n o d e _ m o d u l e s / c o r e - j s / m o d u l e s / e s . a r r a y . f r o m . j s " ) ; v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / p a t h . j s " ) ; t . e x p o r t s = r . A r r a y . f r o m } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a - f u n c t i o n . j s " : f u n c t i o n ( t , s ) { t . e x p o r t s = f u n c t i o n ( i ) { i f ( t y p e o f i ! = " f u n c t i o n " ) t h r o w T y p e E r r o r ( S t r i n g ( i ) + " i s n o t a f u n c t i o n " ) ; r e t u r n i } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a n - o b j e c t . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / i s - o b j e c t . j s " ) ; t . e x p o r t s = f u n c t i o n ( o ) { i f ( ! r ( o ) ) t h r o w T y p e E r r o r ( S t r i n g ( o ) + " i s n o t a n o b j e c t " ) ; r e t u r n o } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a r r a y - f r o m . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / b i n d - c o n t e x t . j s " ) , o = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - o b j e c t . j s " ) , a = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c a l l - w i t h - s a f e - i t e r a t i o n - c l o s i n g . j s " ) , c = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / i s - a r r a y - i t e r a t o r - m e t h o d . j s " ) , d = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - l e n g t h . j s " ) , u = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c r e a t e - p r o p e r t y . j s " ) , _ = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / g e t - i t e r a t o r - m e t h o d . j s " ) ; t . e x p o r t s = f u n c t i o n ( h ) { v a r f = o ( h ) , g = t y p e o f t h i s = = " f u n c t i o n " ? t h i s : A r r a y , b = a r g u m e n t s . l e n g t h , y = b > 1 ? a r g u m e n t s [ 1 ] : v o i d 0 , E = y ! = = v o i d 0 , v = 0 , S = _ ( f ) , R , C , A , I ; i f ( E & & ( y = r ( y , b > 2 ? a r g u m e n t s [ 2 ] : v o i d 0 , 2 ) ) , S ! = n u l l & & ! ( g = = A r r a y & & c ( S ) ) ) f o r ( I = S . c a l l ( f ) , C = n e w g ; ! ( A = I . n e x t ( ) ) . d o n e ; v + + ) u ( C , v , E ? a ( I , y , [ A . v a l u e , v ] , ! 0 ) : A . v a l u e ) ; e l s e f o r ( R = d ( f . l e n g t h ) , C = n e w g ( R ) ; R > v ; v + + ) u ( C , v , E ? y ( f [ v ] , v ) : f [ v ] ) ; r e t u r n C . l e n g t h = v , C } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a r r a y - i n c l u d e s . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - i n d e x e d - o b j e c t . j s " ) , o = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - l e n g t h . j s " ) , a = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / t o - a b s o l u t e - i n d e x . j s " ) ; t . e x p o r t s = f u n c t i o n ( c ) { r e t u r n f u n c t i o n ( d , u , _ ) { v a r m = r ( d ) , h = o ( m . l e n g t h ) , f = a ( _ , h ) , g ; i f ( c & & u ! = u ) { f o r ( ; h > f ; ) i f ( g = m [ f + + ] , g ! = g ) r e t u r n ! 0 } e l s e f o r ( ; h > f ; f + + ) i f ( ( c | | f i n m ) & & m [ f ] = = = u ) r e t u r n c | | f | | 0 ; r e t u r n ! c & & - 1 } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / b i n d - c o n t e x t . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a - f u n c t i o n . j s " ) ; t . e x p o r t s = f u n c t i o n ( o , a , c ) { i f ( r ( o ) , a = = = v o i d 0 ) r e t u r n o ; s w i t c h ( c ) { c a s e 0 : r e t u r n f u n c t i o n ( ) { r e t u r n o . c a l l ( a ) } ; c a s e 1 : r e t u r n f u n c t i o n ( d ) { r e t u r n o . c a l l ( a , d ) } ; c a s e 2 : r e t u r n f u n c t i o n ( d , u ) { r e t u r n o . c a l l ( a , d , u ) } ; c a s e 3 : r e t u r n f u n c t i o n ( d , u , _ ) { r e t u r n o . c a l l ( a , d , u , _ ) } } r e t u r n f u n c t i o n ( ) { r e t u r n o . a p p l y ( a , a r g u m e n t s ) } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c a l l - w i t h - s a f e - i t e r a t i o n - c l o s i n g . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / a n - o b j e c t . j s " ) ; t . e x p o r t s = f u n c t i o n ( o , a , c , d ) { t r y { r e t u r n d ? a ( r ( c ) [ 0 ] , c [ 1 ] ) : a ( c ) } c a t c h ( _ ) { v a r u = o . r e t u r n ; t h r o w u ! = = v o i d 0 & & r ( u . c a l l ( o ) ) , _ } } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c h e c k - c o r r e c t n e s s - o f - i t e r a t i o n . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / w e l l - k n o w n - s y m b o l . j s " ) , o = r ( " i t e r a t o r " ) , a = ! 1 ; t r y { v a r c = 0 , d = { n e x t : f u n c t i o n ( ) { r e t u r n { d o n e : ! ! c + + } } , r e t u r n : f u n c t i o n ( ) { a = ! 0 } } ; d [ o ] = f u n c t i o n ( ) { r e t u r n t h i s } , A r r a y . f r o m ( d , f u n c t i o n ( ) { t h r o w 2 } ) } c a t c h { } t . e x p o r t s = f u n c t i o n ( u , _ ) { i f ( ! _ & & ! a ) r e t u r n ! 1 ; v a r m = ! 1 ; t r y { v a r h = { } ; h [ o ] = f u n c t i o n ( ) { r e t u r n { n e x t : f u n c t i o n ( ) { r e t u r n { d o n e : m = ! 0 } } } } , u ( h ) } c a t c h { } r e t u r n m } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f - r a w . j s " : f u n c t i o n ( t , s ) { v a r i = { } . t o S t r i n g ; t . e x p o r t s = f u n c t i o n ( r ) { r e t u r n i . c a l l ( r ) . s l i c e ( 8 , - 1 ) } } , " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f . j s " : f u n c t i o n ( t , s , i ) { v a r r = i ( " . / n o d e _ m o d u l e s / c o r e - j s / i n t e r n a l s / c l a s s o f
` ,qZ="∄",YZ="∄", $ Z="𝔑 ",WZ="𝔫 ",KZ="≧̸",jZ="≱",QZ="≱",XZ="≧̸",ZZ="⩾̸",JZ="⩾̸",eJ="⋙̸",tJ="≵",nJ="≫⃒",sJ="≯",iJ="≯",rJ="≫̸",oJ="↮",aJ="⇎",lJ="⫲",cJ="∋",dJ="⋼",uJ="⋺",pJ="∋",fJ="Њ",_J="њ",mJ="↚",hJ="⇍",gJ="‥",bJ="≦̸",yJ="≰",EJ="↚",vJ="⇍",SJ="↮",TJ="⇎",xJ="≰",CJ="≦̸",wJ="⩽̸",RJ="⩽̸",AJ="≮",MJ="⋘̸",NJ="≴",OJ="≪⃒",IJ="≮",kJ="⋪",DJ="⋬",LJ="≪̸",PJ="∤",FJ=" ",UJ=" ",BJ="𝕟 ",GJ="ℕ ",VJ="⫬",zJ="¬",HJ="≢",qJ="≭",YJ="∦", $ J="∉",WJ="≠",KJ="≂̸",jJ="∄",QJ="≯",XJ="≱",ZJ="≧̸",JJ="≫̸",eee="≹",tee="⩾̸",nee="≵",see="≎̸",iee="≏̸",ree="∉",oee="⋵̸",aee="⋹̸",lee="∉",cee="⋷",dee="⋶",uee="⧏̸",pee="⋪",fee="⋬",_ee="≮",mee="≰",hee="≸",gee="≪̸",bee="⩽̸",yee="≴",Eee="⪢̸",vee="⪡̸",See="∌",Tee="∌",xee="⋾",Cee="⋽",wee="⊀",Ree="⪯̸",Aee="⋠",Mee="∌",Nee="⧐̸",Oee="⋫",Iee="⋭",kee="⊏̸",Dee="⋢",Lee="⊐̸",Pee="⋣",Fee="⊂⃒",Uee="⊈",Bee="⊁",Gee="⪰̸",Vee="⋡",zee="≿̸",Hee="⊃⃒",qee="⊉",Yee="≁", $ ee="≄",Wee="≇",Kee="≉",jee="∤",Qee="∦",Xee="∦",Zee="⫽⃥",Jee="∂̸",ete="⨔",tte="⊀",nte="⋠",ste="⊀",ite="⪯̸",rte="⪯̸",ote="⤳̸",ate="↛",lte="⇏",cte="↝̸",dte="↛",ute="⇏",pte="⋫",fte="⋭",_te="⊁",mte="⋡",hte="⪰̸",gte="𝒩 ",bte="𝓃 ",yte="∤",Ete="∦",vte="≁",Ste="≄",Tte="≄",xte="∤",Cte="∦",wte="⋢",Rte="⋣",Ate="⊄",Mte="⫅̸",Nte="⊈",Ote="⊂⃒",Ite="⊈",kte="⫅̸",Dte="⊁",Lte="⪰̸",Pte="⊅",Fte="⫆̸",Ute="⊉",Bte="⊃⃒",Gte="⊉",Vte="⫆̸",zte="≹",Hte="Ñ",qte="ñ",Yte="≸", $ te="⋪",Wte="⋬",Kte="⋫",jte="⋭",Qte="Ν ",Xte="ν ",Zte="#",Jte="№",ene=" ",tne="≍⃒",nne="⊬",sne="⊭",ine="⊮",rne="⊯",one="≥⃒",ane=">⃒",lne="⤄",cne="⧞",dne="⤂",une="≤⃒",pne="<⃒",fne="⊴⃒",_ne="⤃",mne="⊵⃒",hne="∼⃒",gne="⤣",bne="↖",yne="⇖",Ene="↖",vne="⤧",Sne="Ó",Tne="ó",xne="⊛",Cne="Ô",wne="ô",Rne="⊚",Ane="О ",Mne="о ",Nne="⊝",One="Ő",Ine="ő",kne="⨸",Dne="⊙",Lne="⦼",Pne="Œ",Fne="œ",Une="⦿",Bne="𝔒 ",Gne="𝔬 ",Vne="˛ ",zne="Ò",Hne="ò",qne="⧁",Yne="⦵", $ ne="Ω",Wne="∮",Kne="↺",jne="⦾",Qne="⦻",Xne="‾",Zne="⧀",Jne="Ō",ese="ō",tse="Ω",nse="ω",sse="Ο ",ise="ο ",rse="⦶",ose="⊖",ase="𝕆 ",lse="𝕠 ",cse="⦷",dse="“",use="‘ ",pse="⦹",fse="⊕",_se="↻",mse="⩔",hse="∨ ",gse="⩝",bse="ℴ ",yse="ℴ ",Ese="ª",vse="º",Sse="⊶",Tse="⩖",xse="⩗",Cse="⩛",wse="Ⓢ",Rse="𝒪 ",Ase="ℴ ",Mse="Ø",Nse="ø",Ose="⊘",Ise="Õ",kse="õ",Dse="⨶",Lse="⨷",Pse="⊗",Fse="Ö",Use="ö",Bse="⌽",Gse="‾",Vse="⏞",zse="⎴",Hse="⏜",qse="¶",Yse="∥", $ se="∥",Wse="⫳",Kse="⫽",jse="∂",Qse="∂",Xse="П",Zse="п",Jse="%",eie=".",tie="‰",nie="⊥",sie="‱",iie="𝔓 ",rie="𝔭 ",oie="Φ",aie="φ",lie="ϕ",cie="ℳ ",die="☎",uie="Π",pie="π",fie="⋔",_ie="ϖ",mie="ℏ",hie="ℎ ",gie="ℏ",bie="⨣",yie="⊞",Eie="⨢",vie="+",Sie="∔",Tie="⨥",xie="⩲",Cie="±",wie="±",Rie="⨦",Aie="⨧",Mie="±",Nie="ℌ ",Oie="⨕",Iie="𝕡 ",kie="ℙ ",Die="£",Lie="⪷",Pie="⪻",Fie="≺",Uie="≼",Bie="⪷",Gie="≺",Vie="≼",zie="≺",Hie="⪯",qie="≼",Yie="≾", $ ie="⪯",Wie="⪹",Kie="⪵",jie="⋨",Qie="⪯",Xie="⪳",Zie="≾",Jie="′ ",ere="″",tre="ℙ ",nre="⪹",sre="⪵",ire="⋨",rre="∏",ore="∏",are="⌮",lre="⌒",cre="⌓",dre="∝",ure="∝",pre="∷",fre="∝",_re="≾",mre="⊰",hre="𝒫 ",gre="𝓅 ",bre="Ψ",yre="ψ",Ere=" ",vre="𝔔 ",Sre="𝔮 ",Tre="⨌",xre="𝕢 ",Cre="ℚ ",wre="⁗",Rre="𝒬 ",Are="𝓆 ",Mre="ℍ ",Nre="⨖",Ore="?",Ire="≟",kre='"',Dre='"',Lre="⇛",Pre="∽̱",Fre="Ŕ",Ure="ŕ",Bre="√",Gre="⦳",Vre="⟩",zre="⟫",Hre="⦒",qre="⦥",Yre="⟩", $ re="»",Wre="⥵",Kre="⇥",jre="⤠",Qre="⤳",Xre="→",Zre="↠",Jre="⇒",eoe="⤞",toe="↪",noe="↬",soe="⥅",ioe="⥴",roe="⤖",ooe="↣",aoe="↝",loe="⤚",coe="⤜",doe="∶ ",uoe="ℚ ",poe="⤍",foe="⤏",_oe="⤐",moe="❳ ",hoe="}",goe="]",boe="⦌",yoe="⦎",Eo
` ," "],Hge=["{","}","|"," \\ ","^"," ` "].concat(zge),qge=[" '"].concat(Hge),Tv=["%","/","?",";","#"].concat(qge),xv=["/","?","#"],Yge=255,Cv=/^[+a-z0-9A-Z_-]{0,63}$/,$ge=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wv={javascript:!0,"javascript:":!0},Rv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Wge(n,e){if(n&&n instanceof tu)return n;var t=new tu;return t.parse(n,e),t}tu.prototype.parse=function(n,e){var t,s,i,r,o,a=n;if(a=a.trim(),!e&&n.split("#").length===1){var c=Vge.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}var d=Bge.exec(a);if(d&&(d=d[0],i=d.toLowerCase(),this.protocol=d,a=a.substr(d.length)),(e||d||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=a.substr(0,2)==="//",o&&!(d&&wv[d])&&(a=a.substr(2),this.slashes=!0)),!wv[d]&&(o||d&&!Rv[d])){var u=-1;for(t=0;t<xv.length;t++)r=a.indexOf(xv[t]),r!==-1&&(u===-1||r<u)&&(u=r);var _,m;for(u===-1?m=a.lastIndexOf("@"):m=a.lastIndexOf("@",u),m!==-1&&(_=a.slice(0,m),a=a.slice(m+1),this.auth=_),u=-1,t=0;t<Tv.length;t++)r=a.indexOf(Tv[t]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=a.length),a[u-1]===":"&&u--;var h=a.slice(0,u);a=a.slice(u),this.parseHost(h),this.hostname=this.hostname||"";var f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){var g=this.hostname.split(/\./);for(t=0,s=g.length;t<s;t++){var b=g[t];if(b&&!b.match(Cv)){for(var y="",E=0,v=b.length;E<v;E++)b.charCodeAt(E)>127?y+="x":y+=b[E];if(!y.match(Cv)){var S=g.slice(0,t),R=g.slice(t+1),C=b.match($ge);C&&(S.push(C[1]),R.unshift(C[2])),R.length&&(a=R.join(".")+a),this.hostname=S.join(".");break}}}}this.hostname.length>Yge&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var A=a.indexOf("#");A!==-1&&(this.hash=a.substr(A),a=a.slice(0,A));var I=a.indexOf("?");return I!==-1&&(this.search=a.substr(I),a=a.slice(0,I)),a&&(this.pathname=a),Rv[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this};tu.prototype.parseHost=function(n){var e=Gge.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};var Kge=Wge;Ba.encode=Lge;Ba.decode=Fge;Ba.format=Uge;Ba.parse=Kge;var kr={},tf,Av;function JA(){return Av||(Av=1,tf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),tf}var nf,Mv;function eM(){return Mv||(Mv=1,nf=/[\0-\x1F\x7F-\x9F]/),nf}var sf,Nv;function jge(){return Nv||(Nv=1,sf=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),sf}var rf,Ov;function tM(){return Ov||(Ov=1,rf=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),rf}var Iv;function Qge(){return Iv||(Iv=1,kr.Any=JA(),kr.Cc=eM(),kr.Cf=jge(),kr.P=v0,kr.Z=tM()),kr}(function(n){function e(O){return Object.prototype.toString.call(O)}function t(O){return e(O)==="[object String]"}var s=Object.prototype.hasOwnProperty;function i(O,H){return s.call(O,H)}function r(O){var H=Array.prototype.slice.call(arguments,1);return H.forEach(function(q){if(q){if(typeof q!="object")throw new TypeError(q+"must be object");Object.keys(q).forEach(function(L){O[L]=q[L]})}}),O}function o(O,H,q){return[].concat(O.slice(0,H),q,O.slice(H+1))}function a(O){return!(O>=55296&&O<=57343||O>=64976&&O<=65007||(O&65535)===65535||(O&65535)===65534||O>=0&&O<=8||O===11||O>=14&&O<=31||O>=127&&O<=159||O>1114111)}function c(O){if(O>65535){O-=65536;var H=55296+(O>>10),q=56320+(O&1023);return String.fromCharCode(H,q)}return String.fromCharCode(O)}var d=/\\([!"#$%&' ( ) * + , \ - . \ / : ; <= > ? @ [ \ \ \ ] ^ _ ` {|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,_=new RegExp(d.source+"|"+u.source,"gi"),m=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8})) $ /i,h=ZA;function f(O,H){var q;return i(h,H)?h[H]:H.charCodeAt(0)===35&&m.test(H)&&(q=H[1].toLowerCase()==="x"?parseInt(H.slice(2),16):parseInt(H.slice(1),10),a(q))?c(q):O}function g(O){return O.indexOf(" \\ ")<0?O:O.replace(d," $ 1")}function b(O){return O.indexOf(" \\ ")<0&&O.indexOf("&"
2024-10-20 20:24:55 +00:00
` };ui.fence=function(n,e,t,s,i){var r=n[e],o=r.info?nbe(r.info).trim():"",a="",c="",d,u,_,m,h;return o&&(_=o.split(/( \s +)/g),a=_[0],c=_.slice(2).join("")),t.highlight?d=t.highlight(r.content,a,c)||lo(r.content):d=lo(r.content),d.indexOf("<pre")===0?d+ `
` :o?(u=r.attrIndex("class"),m=r.attrs?r.attrs.slice():[],u<0?m.push(["class",t.langPrefix+a]):(m[u]=m[u].slice(),m[u][1]+=" "+t.langPrefix+a),h={attrs:m},"<pre><code"+i.renderAttrs(h)+">"+d+ ` < / c o d e > < / p r e >
2024-09-29 19:46:45 +00:00
` ):"<pre><code"+i.renderAttrs(r)+">"+d+ ` < / c o d e > < / p r e >
` };ui.image=function(n,e,t,s,i){var r=n[e];return r.attrs[r.attrIndex("alt")][1]=i.renderInlineAsText(r.children,t,s),i.renderToken(n,e,t)};ui.hardbreak=function(n,e,t){return t.xhtmlOut? ` < br / >
` : ` < br >
` };ui.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut? ` < br / >
` : ` < br >
` : `
2024-10-20 20:24:55 +00:00
` };ui.text=function(n,e){return lo(n[e].content)};ui.html_block=function(n,e){return n[e].content};ui.html_inline=function(n,e){return n[e].content};function Ga(){this.rules=tbe({},ui)}Ga.prototype.renderAttrs=function(e){var t,s,i;if(!e.attrs)return"";for(i="",t=0,s=e.attrs.length;t<s;t++)i+=" "+lo(e.attrs[t][0])+'="'+lo(e.attrs[t][1])+'"';return i};Ga.prototype.renderToken=function(e,t,s){var i,r="",o=!1,a=e[t];return a.hidden?"":(a.block&&a.nesting!==-1&&t&&e[t-1].hidden&&(r+= `
2024-09-29 19:46:45 +00:00
` ),r+=(a.nesting===-1?"</":"<")+a.tag,r+=this.renderAttrs(a),a.nesting===0&&s.xhtmlOut&&(r+=" /"),a.block&&(o=!0,a.nesting===1&&t+1<e.length&&(i=e[t+1],(i.type==="inline"||i.hidden||i.nesting===-1&&i.tag===a.tag)&&(o=!1))),r+=o? ` >
` :">",r)};Ga.prototype.renderInline=function(n,e,t){for(var s,i="",r=this.rules,o=0,a=n.length;o<a;o++)s=n[o].type,typeof r[s]<"u"?i+=r[s](n,o,e,t,this):i+=this.renderToken(n,o,e);return i};Ga.prototype.renderInlineAsText=function(n,e,t){for(var s="",i=0,r=n.length;i<r;i++)n[i].type==="text"?s+=n[i].content:n[i].type==="image"?s+=this.renderInlineAsText(n[i].children,e,t):n[i].type==="softbreak"&&(s+= `
2024-10-20 20:24:55 +00:00
` );return s};Ga.prototype.render=function(n,e,t){var s,i,r,o="",a=this.rules;for(s=0,i=n.length;s<i;s++)r=n[s].type,r==="inline"?o+=this.renderInline(n[s].children,e,t):typeof a[r]<"u"?o+=a[r](n,s,e,t,this):o+=this.renderToken(n,s,e,t);return o};var sbe=Ga;function $ s(){this.__rules__=[],this.__cache__=null} $ s.prototype.__find__=function(n){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===n)return e;return-1}; $ s.prototype.__compile__=function(){var n=this,e=[""];n.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(s){e.indexOf(s)<0&&e.push(s)})}),n.__cache__={},e.forEach(function(t){n.__cache__[t]=[],n.__rules__.forEach(function(s){s.enabled&&(t&&s.alt.indexOf(t)<0||n.__cache__[t].push(s.fn))})})}; $ s.prototype.at=function(n,e,t){var s=this.__find__(n),i=t||{};if(s===-1)throw new Error("Parser rule not found: "+n);this.__rules__[s].fn=e,this.__rules__[s].alt=i.alt||[],this.__cache__=null}; $ s.prototype.before=function(n,e,t,s){var i=this.__find__(n),r=s||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}; $ s.prototype.after=function(n,e,t,s){var i=this.__find__(n),r=s||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}; $ s.prototype.push=function(n,e,t){var s=t||{};this.__rules__.push({name:n,enabled:!0,fn:e,alt:s.alt||[]}),this.__cache__=null}; $ s.prototype.enable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(s){var i=this.__find__(s);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[i].enabled=!0,t.push(s)},this),this.__cache__=null,t}; $ s.prototype.enableOnly=function(n,e){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(n,e)}; $ s.prototype.disable=function(n,e){Array.isArray(n)||(n=[n]);var t=[];return n.forEach(function(s){var i=this.__find__(s);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[i].enabled=!1,t.push(s)},this),this.__cache__=null,t}; $ s.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};var S0= $ s,ibe=/ \r \n ?| \n /g,rbe=/ \0 /g,obe=function(e){var t;t=e.src.replace(ibe, `
2024-10-20 21:50:56 +00:00
` ),t=t.replace(rbe,"<22> "),e.src=t},abe=function(e){var t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},lbe=function(e){var t=e.tokens,s,i,r;for(i=0,r=t.length;i<r;i++)s=t[i],s.type==="inline"&&e.md.inline.parse(s.content,e.md,e.env,s.children)},cbe=kt.arrayReplaceAt;function dbe(n){return/^<a[> \s ]/i.test(n)}function ube(n){return/^< \/ a \s *>/i.test(n)}var pbe=function(e){var t,s,i,r,o,a,c,d,u,_,m,h,f,g,b,y,E=e.tokens,v;if(e.md.options.linkify){for(s=0,i=E.length;s<i;s++)if(!(E[s].type!=="inline"||!e.md.linkify.pretest(E[s].content)))for(r=E[s].children,f=0,t=r.length-1;t>=0;t--){if(a=r[t],a.type==="link_close"){for(t--;r[t].level!==a.level&&r[t].type!=="link_open";)t--;continue}if(a.type==="html_inline"&&(dbe(a.content)&&f>0&&f--,ube(a.content)&&f++),!(f>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(u=a.content,v=e.md.linkify.match(u),c=[],h=a.level,m=0,v.length>0&&v[0].index===0&&t>0&&r[t-1].type==="text_special"&&(v=v.slice(1)),d=0;d<v.length;d++)g=v[d].url,b=e.md.normalizeLink(g),e.md.validateLink(b)&&(y=v[d].text,v[d].schema?v[d].schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText("http://"+y).replace(/^http: \/ \/ /,""),_=v[d].index,_>m&&(o=new e.Token("text","",0),o.content=u.slice(m,_),o.level=h,c.push(o)),o=new e.Token("link_open","a",1),o.attrs=[["href",b]],o.level=h++,o.markup="linkify",o.info="auto",c.push(o),o=new e.Token("text","",0),o.content=y,o.level=h,c.push(o),o=new e.Token("link_close","a",-1),o.level=--h,o.markup="linkify",o.info="auto",c.push(o),m=v[d].lastIndex);m<u.length&&(o=new e.Token("text","",0),o.content=u.slice(m),o.level=h,c.push(o)),E[s].children=r=cbe(r,t,c)}}}},nM=/ \+ -| \. \. | \? \? \? \? |!!!!|,,|--/,fbe=/ \( (c|tm|r) \) /i,_be=/ \( (c|tm|r) \) /ig,mbe={c:"©",r:"®",tm:"™"};function hbe(n,e){return mbe[e.toLowerCase()]}function gbe(n){var e,t,s=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!s&&(t.content=t.content.replace(_be,hbe)),t.type==="link_open"&&t.info==="auto"&&s--,t.type==="link_close"&&t.info==="auto"&&s++}function bbe(n){var e,t,s=0;for(e=n.length-1;e>=0;e--)t=n[e],t.type==="text"&&!s&&nM.test(t.content)&&(t.content=t.content.replace(/ \+ -/g,"±").replace(/ \. {2,}/g,"…").replace(/([?!])…/g," $ 1..").replace(/([?!]){4,}/g," $ 1 $ 1 $ 1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]| $ )/mg," $ 1—").replace(/(^| \s )--(?= \s | $ )/mg," $ 1– ").replace(/(^|[^- \s ])--(?=[^- \s ]| $ )/mg," $ 1– ")),t.type==="link_open"&&t.info==="auto"&&s--,t.type==="link_close"&&t.info==="auto"&&s++}var ybe=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(fbe.test(e.tokens[t].content)&&gbe(e.tokens[t].children),nM.test(e.tokens[t].content)&&bbe(e.tokens[t].children))},Dv=kt.isWhiteSpace,Lv=kt.isPunctChar,Pv=kt.isMdAsciiPunct,Ebe=/['"]/,Fv=/['"]/g,Uv="’ ";function Lc(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function vbe(n,e){var t,s,i,r,o,a,c,d,u,_,m,h,f,g,b,y,E,v,S,R,C;for(S=[],t=0;t<n.length;t++){for(s=n[t],c=n[t].level,E=S.length-1;E>=0&&!(S[E].level<=c);E--);if(S.length=E+1,s.type==="text"){i=s.content,o=0,a=i.length;e:for(;o<a&&(Fv.lastIndex=o,r=Fv.exec(i),!!r);){if(b=y=!0,o=r.index+1,v=r[0]==="'",u=32,r.index-1>=0)u=i.charCodeAt(r.index-1);else for(E=t-1;E>=0&&!(n[E].type==="softbreak"||n[E].type==="hardbreak");E--)if(n[E].content){u=n[E].content.charCodeAt(n[E].content.length-1);break}if(_=32,o<a)_=i.charCodeAt(o);else for(E=t+1;E<n.length&&!(n[E].type==="softbreak"||n[E].type==="hardbreak");E++)if(n[E].content){_=n[E].content.charCodeAt(0);break}if(m=Pv(u)||Lv(String.fromCharCode(u)),h=Pv(_)||Lv(String.fromCharCode(_)),f=Dv(u),g=Dv(_),g?b=!1:h&&(f||m||(b=!1)),f?y=!1:m&&(g||h||(y=!1)),_===34&&r[0]==='"'&&u>=48&&u<=57&&(y=b=!1),b&&y&&(b=m,y=h),!b&&!y){v&&(s.content=Lc(s.content,r.index,Uv));continue}if(y){for(E=S.length-1;E>=0&&(d=S[E],!(S[E].level<c));E--)if(d.single===v&&S[E].level===c){d=S[E],v?(R=e.md.options.quotes[2],C=e.md.options.quotes[
` ,o.map=[t,e.line],!0},Nbe=function(e,t,s,i){var r,o,a,c,d,u,_,m=!1,h=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||h+3>f||(r=e.src.charCodeAt(h),r!==126&&r!==96)||(d=h,h=e.skipChars(h,r),o=h-d,o<3)||(_=e.src.slice(d,h),a=e.src.slice(h,f),r===96&&a.indexOf(String.fromCharCode(r))>=0))return!1;if(i)return!0;for(c=t;c++,!(c>=s||(h=d=e.bMarks[c]+e.tShift[c],f=e.eMarks[c],h<f&&e.sCount[c]<e.blkIndent));)if(e.src.charCodeAt(h)===r&&!(e.sCount[c]-e.blkIndent>=4)&&(h=e.skipChars(h,r),!(h-d<o)&&(h=e.skipSpaces(h),!(h<f)))){m=!0;break}return o=e.sCount[t],e.line=c+(m?1:0),u=e.push("fence","code",0),u.info=a,u.content=e.getLines(t+1,c,o,!0),u.markup=_,u.map=[t,e.line],!0},Obe=kt.isSpace,Ibe=function(e,t,s,i){var r,o,a,c,d,u,_,m,h,f,g,b,y,E,v,S,R,C,A,I,x=e.lineMax,M=e.bMarks[t]+e.tShift[t],G=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(M)!==62)return!1;if(i)return!0;for(f=[],g=[],E=[],v=[],C=e.md.block.ruler.getRules("blockquote"),y=e.parentType,e.parentType="blockquote",m=t;m<s&&(I=e.sCount[m]<e.blkIndent,M=e.bMarks[m]+e.tShift[m],G=e.eMarks[m],!(M>=G));m++){if(e.src.charCodeAt(M++)===62&&!I){for(c=e.sCount[m]+1,e.src.charCodeAt(M)===32?(M++,c++,r=!1,S=!0):e.src.charCodeAt(M)===9?(S=!0,(e.bsCount[m]+c)%4===3?(M++,c++,r=!1):r=!0):S=!1,h=c,f.push(e.bMarks[m]),e.bMarks[m]=M;M<G&&(o=e.src.charCodeAt(M),Obe(o));){o===9?h+=4-(h+e.bsCount[m]+(r?1:0))%4:h++;M++}u=M>=G,g.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(S?1:0),E.push(e.sCount[m]),e.sCount[m]=h-c,v.push(e.tShift[m]),e.tShift[m]=M-e.bMarks[m];continue}if(u)break;for(R=!1,a=0,d=C.length;a<d;a++)if(C[a](e,m,s,!0)){R=!0;break}if(R){e.lineMax=m,e.blkIndent!==0&&(f.push(e.bMarks[m]),g.push(e.bsCount[m]),v.push(e.tShift[m]),E.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}f.push(e.bMarks[m]),g.push(e.bsCount[m]),v.push(e.tShift[m]),E.push(e.sCount[m]),e.sCount[m]=-1}for(b=e.blkIndent,e.blkIndent=0,A=e.push("blockquote_open","blockquote",1),A.markup=">",A.map=_=[t,0],e.md.block.tokenize(e,t,m),A=e.push("blockquote_close","blockquote",-1),A.markup=">",e.lineMax=x,e.parentType=y,_[1]=e.line,a=0;a<v.length;a++)e.bMarks[a+t]=f[a],e.tShift[a+t]=v[a],e.sCount[a+t]=E[a],e.bsCount[a+t]=g[a];return e.blkIndent=b,!0},kbe=kt.isSpace,Dbe=function(e,t,s,i){var r,o,a,c,d=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(r=e.src.charCodeAt(d++),r!==42&&r!==45&&r!==95))return!1;for(o=1;d<u;){if(a=e.src.charCodeAt(d++),a!==r&&!kbe(a))return!1;a===r&&o++}return o<3?!1:(i||(e.line=t+1,c=e.push("hr","hr",0),c.map=[t,e.line],c.markup=Array(o+1).join(String.fromCharCode(r))),!0)},iM=kt.isSpace;function Gv(n,e){var t,s,i,r;return s=n.bMarks[e]+n.tShift[e],i=n.eMarks[e],t=n.src.charCodeAt(s++),t!==42&&t!==45&&t!==43||s<i&&(r=n.src.charCodeAt(s),!iM(r))?-1:s}function Vv(n,e){var t,s=n.bMarks[e]+n.tShift[e],i=s,r=n.eMarks[e];if(i+1>=r||(t=n.src.charCodeAt(i++),t<48||t>57))return-1;for(;;){if(i>=r)return-1;if(t=n.src.charCodeAt(i++),t>=48&&t<=57){if(i-s>=10)return-1;continue}if(t===41||t===46)break;return-1}return i<r&&(t=n.src.charCodeAt(i),!iM(t))?-1:i}function Lbe(n,e){var t,s,i=n.level+2;for(t=e+2,s=n.tokens.length-2;t<s;t++)n.tokens[t].level===i&&n.tokens[t].type==="paragraph_open"&&(n.tokens[t+2].hidden=!0,n.tokens[t].hidden=!0,t+=2)}var Pbe=function(e,t,s,i){var r,o,a,c,d,u,_,m,h,f,g,b,y,E,v,S,R,C,A,I,x,M,G,V,te,O,H,q=t,L=!1,Y=!0;if(e.sCount[q]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[q]-e.listIndent>=4&&e.sCount[q]<e.blkIndent)return!1;if(i&&e.parentType==="paragraph"&&e.sCount[q]>=e.blkIndent&&(L=!0),(M=Vv(e,q))>=0){if(_=!0,V=e.bMarks[q]+e.tShift[q],y=Number(e.src.slice(V,M-1)),L&&y!==1)return!1}else if((M=Gv(e,q))>=0)_=!1;else return!1;if(L&&e.skipSpaces(M)>=e.eMarks[q])return!1;if(i)return!0;for(b=e.src.charCodeAt(M-1),g=e.tokens.length,_?(H=e.push("ordered_list_open","ol",1),y!==1&&(H.attrs=[["start",y]])):H=e.push("bullet_list_open","ul",1),H.map=f=[q,0],H.markup=String.fromCharCode(b),G=!1,O=e.md.block.ruler.getRules("list"),R=e.parentType,e.parentType="list";q<s;){for(x=M,E=e.eMarks[q],u=v=e.sCount[q]+M-(e.bMarks[q]+e.tShift[q]);x<E;)
2024-09-29 19:46:45 +00:00
` })),s.tokens.splice(i+3+u.length+1,0,Object.assign(new s.Token("html_block","",0),{content:e.wrapper[1]+ `
2024-10-20 21:50:56 +00:00
` })))});function rS(n,e,t,s){var i=n,r=s;if(t&&Object.prototype.hasOwnProperty.call(e,i))throw new Error("User defined ` id ` attribute ` "+n+" ` is not unique. Please fix it in your Markdown to continue.");for(;Object.prototype.hasOwnProperty.call(e,i);)i=n+"-"+r,r+=1;return e[i]=!0,i}function $ o(n,e){e=Object.assign({}, $ o.defaults,e),n.core.ruler.push("anchor",function(t){for(var s,i={},r=t.tokens,o=Array.isArray(e.level)?(s=e.level,function(_){return s.includes(_)}):function(_){return function(m){return m>=_}}(e.level),a=0;a<r.length;a++){var c=r[a];if(c.type==="heading_open"&&o(Number(c.tag.substr(1)))){var d=e.getTokensText(r[a+1].children),u=c.attrGet("id");u=u==null?rS(e.slugify(d),i,!1,e.uniqueSlugStartIndex):rS(u,i,!0,e.uniqueSlugStartIndex),c.attrSet("id",u),e.tabIndex!==!1&&c.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(u,e,t,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==cb)&&e.renderPermalink(u,e,t,a),a=r.indexOf(c),e.callback&&e.callback(c,{slug:u,title:d})}}})}Object.assign(iS.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}), $ o.permalink={__proto__:null,legacy:cb,renderHref:yM,renderAttrs:EM,makePermalink:dc,linkInsideHeader:cp,ariaHidden:Gr,headerLink:vM,linkAfterHeader:iS}, $ o.defaults={level:1,slugify:function(n){return encodeURIComponent(String(n).trim().toLowerCase().replace(/ \s +/g,"-"))},uniqueSlugStartIndex:1,tabIndex:"-1",getTokensText:function(n){return n.filter(function(e){return["text","code_inline"].includes(e.type)}).map(function(e){return e.content}).join("")},permalink:!1,renderPermalink:cb,permalinkClass:Gr.defaults.class,permalinkSpace:Gr.defaults.space,permalinkSymbol:"¶",permalinkBefore:Gr.defaults.placement==="before",permalinkHref:Gr.defaults.renderHref,permalinkAttrs:Gr.defaults.renderAttrs}, $ o.default= $ o;function Bi(){this.__highest_alphabet__=0,this.__match_alphabets__={},this.__initial_state__=0,this.__accept_states__={},this.__transitions__={},this.__actions__={}}Bi.prototype.set_highest_alphabet=function(n){this.__highest_alphabet__=n};Bi.prototype.set_match_alphabets=function(n){this.__match_alphabets__=n};Bi.prototype.set_initial_state=function(n){this.__initial_state__=n};Bi.prototype.set_accept_states=function(n){for(var e=0;e<n.length;e++)this.__accept_states__[n[e]]=!0};Bi.prototype.set_transitions=function(n){this.__transitions__=n};Bi.prototype.set_actions=function(n){this.__actions__=n};Bi.prototype.update_transition=function(n,e){this.__transitions__[n]=Object.assign(this.__transitions__[n]||Object(),e)};Bi.prototype.execute=function(n,e){var t,s,i;for(t=this.__initial_state__,s=n;t&&s<e;s++){for(i=this.__highest_alphabet__;i>0&&!(t&i&&this.__match_alphabets__[i].call(this,s,t,i));i>>=4);if(this.__actions__(s,t,i),i===0)break;t=this.__transitions__[t][i]||0}return!!this.__accept_states__[t]};var Nqe=Bi,Oqe=Nqe,Iqe=function(e,t){var s={multiline:!1,rowspan:!1,headerless:!1,multibody:!0,autolabel:!0};t=e.utils.assign({},s,t||{});function i(u,_){var m=u.bMarks[_]+u.sCount[_],h=u.bMarks[_]+u.blkIndent,f=u.skipSpacesBack(u.eMarks[_],h),g=[],b,y,E=!1,v=!1,S=0;for(b=m;b<f;b++)switch(u.src.charCodeAt(b)){case 92:E=!0;break;case 96:y=u.skipChars(b,96)-1,y>b?(v||(S===0?S=y-b:S===y-b&&(S=0)),b=y):(v||!E&&!S)&&(v=!v),E=!1;break;case 124:!v&&!E&&g.push(b),E=!1;break;default:E=!1;break}return g.length===0||(g[0]>h&&g.unshift(h-1),g[g.length-1]<f-1&&g.push(f)),g}function r(u,_,m){var h={text:null,label:null},f=u.bMarks[m]+u.sCount[m],g=u.eMarks[m],b=/^ \[ (.+?) \] ( \[ ([^ \[ \] ]+) \] )? \s * $ /,y=u.src.slice(f,g).match(b);return y?_?!0:(h.text=y[1],!t.autolabel&&!y[2]||(h.label=y[2]||y[1],h.label=h.label.toLowerCase().replace(/ \W +/g,"")),h):!1}function o(u,_,m){var h={bounds:null,multiline:null},f=i(u,m),g,b,y;return f.length<2?!1:_?!0:(h.bounds=f,t.multiline&&(g=u.bMarks[m]+u.sCount[m],b=u.eMarks[m]-1,h.multiline=u.src.charCodeAt(b)===92,h.multiline&&(y=u.eMarks[m],u.eMarks[m]=u.skipSpacesBack(b,g),h.bounds=i(u,m),u.eMarks[m]=y)),h)}function a(u,_,m){var h={aligns:[],wraps:[]},f=i(u,m),g=/^:?(-+|=+):? \+ ? $ /,b,y,E;if(u.sCount[m]-u.bl
` ),u.md,u.env,[]),L.level=v.level+1,u.md.block.tokenize(L,v.map[0],L.lineMax),q=0;q<L.tokens.length;q++)u.tokens.push(L.tokens[q])}else y=u.push("inline","",0),y.content=G.trim(),y.map=v.map,y.level=v.level+1,y.children=[];y=u.push(M+"_close",M,-1)}u.push("tr_close","tr",-1),v.meta.grp&1&&(M=v.meta.type===256?"thead":"tbody",y=u.push(M+"_close",M,-1),x[1]=v.map[1])}return I[1]=Math.max(x[1],E.meta.sep.map[1],E.meta.cap?E.meta.cap.map[1]:-1),y=u.push("table_close","table",-1),u.line=I[1],!0}e.block.ruler.at("table",d,{alt:["paragraph","reference"]})};const kqe=wr(Iqe);var Dqe=function(e,t){t=t||{};function s(i){for(var r=1,o=1,a=i.tokens.length;o<a-1;++o){var c=i.tokens[o];if(c.type==="inline"&&!(!c.children||c.children.length!==1&&c.children.length!==3)&&!(c.children.length===1&&c.children[0].type!=="image")&&!(c.children.length===3&&(c.children[0].type!=="link_open"||c.children[1].type!=="image"||c.children[2].type!=="link_close"))&&!(o!==0&&i.tokens[o-1].type!=="paragraph_open")&&!(o!==a-1&&i.tokens[o+1].type!=="paragraph_close")){var d=i.tokens[o-1];d.type="figure_open",d.tag="figure",i.tokens[o+1].type="figure_close",i.tokens[o+1].tag="figure",t.dataType==!0&&i.tokens[o-1].attrPush(["data-type","image"]);var u;if(t.link==!0&&c.children.length===1&&(u=c.children[0],c.children.unshift(new i.Token("link_open","a",1)),c.children[0].attrPush(["href",u.attrGet("src")]),c.children.push(new i.Token("link_close","a",-1))),u=c.children.length===1?c.children[0]:c.children[1],t.figcaption==!0&&u.children&&u.children.length&&(c.children.push(new i.Token("figcaption_open","figcaption",1)),c.children.splice(c.children.length,0,...u.children),c.children.push(new i.Token("figcaption_close","figcaption",-1)),u.children.length=0),t.copyAttrs&&u.attrs){const _=t.copyAttrs===!0?"":t.copyAttrs;d.attrs=u.attrs.filter(([m,h])=>m.match(_))}t.tabindex==!0&&(i.tokens[o-1].attrPush(["tabindex",r]),r++),t.lazyLoading==!0&&u.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",s)};const Lqe=wr(Dqe),Pqe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Rr={};Rr.getAttrs=function(n,e,t){const s=/[^ \t \n \f />"'=]/,i=" ",r="=",o=".",a="#",c=[];let d="",u="",_=!0,m=!1;for(let h=e+t.leftDelimiter.length;h<n.length;h++){if(n.slice(h,h+t.rightDelimiter.length)===t.rightDelimiter){d!==""&&c.push([d,u]);break}const f=n.charAt(h);if(f===r&&_){_=!1;continue}if(f===o&&d===""){n.charAt(h+1)===o?(d="css-module",h+=1):d="class",_=!1;continue}if(f===a&&d===""){d="id",_=!1;continue}if(f==='"'&&u===""&&!m){m=!0;continue}if(f==='"'&&m){m=!1;continue}if(f===i&&!m){if(d==="")continue;c.push([d,u]),d="",u="",_=!0;continue}if(!(_&&f.search(s)===-1)){if(_){d+=f;continue}u+=f}}if(t.allowedAttributes&&t.allowedAttributes.length){const h=t.allowedAttributes;return c.filter(function(f){const g=f[0];function b(y){return g===y||y instanceof RegExp&&y.test(g)}return h.some(b)})}return c};Rr.addAttrs=function(n,e){for(let t=0,s=n.length;t<s;++t){const i=n[t][0];i==="class"?e.attrJoin("class",n[t][1]):i==="css-module"?e.attrJoin("css-module",n[t][1]):e.attrPush(n[t])}return e};Rr.hasDelimiters=function(n,e){if(!n)throw new Error('Parameter ` where ` not passed. Should be "start", "end" or "only".');return function(t){const s=e.leftDelimiter.length+1+e.rightDelimiter.length;if(!t||typeof t!="string"||t.length<s)return!1;function i(u){const _=u.charAt(e.leftDelimiter.length)===".",m=u.charAt(e.leftDelimiter.length)==="#";return _||m?u.length>=s+1:u.length>=s}let r,o,a,c;const d=s-e.rightDelimiter.length;switch(n){case"start":a=t.slice(0,e.leftDelimiter.length),r=a===e.leftDelimiter?0:-1,o=r===-1?-1:t.indexOf(e.rightDelimiter,d),c=t.charAt(o+e.rightDelimiter.length),c&&e.rightDelimiter.indexOf(c)!==-1&&(o=-1);break;case"end":r=t.lastIndexOf(e.leftDelimiter),o=r===-1?-1:t.indexOf(e.rightDelimiter,r+d),o=o===t.length-e.rightDelimiter.length?o:-1;break;case"only":a=t.slice(0,e.leftDelimiter.length),r=a===e.leftDelimiter?0:-1,a=t.slice(t.length-e.rightDelimiter.length),o=a===e.rightDelimiter?t.length-e.rightDelimiter.
{ . a } softbreak then curly in start ` ,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:xt.hasDelimiters("only",n)}]}],transform:(t,s,i)=>{const r=t[s].children[i],o=xt.getAttrs(r.content,0,n);let a=s+1;for(;t[a+1]&&t[a+1].nesting===-1;)a++;const c=xt.getMatchingOpeningToken(t,a);xt.addAttrs(o,c),t[s].children=t[s].children.slice(0,-2)}},{name:"horizontal rule",tests:[{shift:0,type:"paragraph_open"},{shift:1,type:"inline",children:t=>t.length===1,content:t=>t.match(e)!==null},{shift:2,type:"paragraph_close"}],transform:(t,s)=>{const i=t[s];i.type="hr",i.tag="hr",i.nesting=0;const r=t[s+1].content,o=r.lastIndexOf(n.leftDelimiter),a=xt.getAttrs(r,o,n);xt.addAttrs(a,i),i.markup=r,t.splice(s+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:xt.hasDelimiters("end",n),type:t=>t!=="code_inline"&&t!=="math_inline"}]}],transform:(t,s,i)=>{const r=t[s].children[i],o=r.content,a=xt.getAttrs(o,o.lastIndexOf(n.leftDelimiter),n);let c=s+1;do if(t[c]&&t[c].nesting===-1)break;while(c++<t.length);const d=xt.getMatchingOpeningToken(t,c);xt.addAttrs(a,d);const u=o.slice(0,o.lastIndexOf(n.leftDelimiter));r.content=oS(u)!==" "?u:u.slice(0,-1)}}]};function oS(n){return n.slice(-1)[0]}const zqe=Vqe,Hqe={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var qqe=function(e,t){let s=Object.assign({},Hqe);s=Object.assign(s,t);const i=zqe(s);function r(o){const a=o.tokens;for(let c=0;c<a.length;c++)for(let d=0;d<i.length;d++){const u=i[d];let _=null;u.tests.every(h=>{const f=ub(a,c,h);return f.j!==null&&(_=f.j),f.match})&&(u.transform(a,c,_),(u.name==="inline attributes"||u.name==="inline nesting 0")&&d--)}}e.core.ruler.before("linkify","curly_attributes",r)};function ub(n,e,t){const s={match:!1,j:null},i=t.shift!==void 0?e+t.shift:t.position;if(t.shift!==void 0&&i<0)return s;const r=Wqe(n,i);if(r===void 0)return s;for(const o of Object.keys(t))if(!(o==="shift"||o==="position")){if(r[o]===void 0)return s;if(o==="children"&&Yqe(t.children)){if(r.children.length===0)return s;let a;const c=t.children,d=r.children;if(c.every(u=>u.position!==void 0)){if(a=c.every(u=>ub(d,u.position,u).match),a){const u=Kqe(c).position;s.j=u>=0?u:d.length+u}}else for(let u=0;u<d.length;u++)if(a=c.every(_=>ub(d,u,_).match),a){s.j=u;break}if(a===!1)return s;continue}switch(typeof t[o]){case"boolean":case"number":case"string":if(r[o]!==t[o])return s;break;case"function":if(!t[o](r[o]))return s;break;case"object":if( $ qe(t[o])){if(t[o].every(c=>c(r[o]))===!1)return s;break}default:throw new Error( ` Unknown type of pattern test ( key : $ { o } ) . Test should be of type boolean , number , string , function or array of functions . ` )}}return s.match=!0,s}function Yqe(n){return Array.isArray(n)&&n.length&&n.every(e=>typeof e=="object")}function $ qe(n){return Array.isArray(n)&&n.length&&n.every(e=>typeof e=="function")}function Wqe(n,e){return e>=0?n[e]:n[n.length+e]}function Kqe(n){return n.slice(-1)[0]||{}}const jqe=wr(qqe);function SM(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],s=typeof t;(s==="object"||s==="function")&&!Object.isFrozen(t)&&SM(t)}),n}let aS=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function TM(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pr(n,...e){const t=Object.create(null);for(const s in n)t[s]=n[s];return e.forEach(function(s){for(const i in s)t[i]=s[i]}),t}const Qqe="</span>",lS=n=>!!n.scope,Xqe=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[ ` $ { e } $ { t . shift ( ) } ` ,...t.map((s,i)=> ` $ { s } $ { "_" . repeat ( i + 1 ) } ` )].join(" ")}return ` $ { e } $ { n } ` };class Zqe{constructor(e,t){this.buffer="",this.classPrefix=t.classPref
https : //github.com/highlightjs/highlight.js/issues/2277`),ye=L,oe=Y),se===void 0&&(se=!0);const xe={code:oe,language:ye};H("before:highlight",xe);const le=xe.result?xe.result:_(xe.language,xe.code,se);return le.code=xe.code,H("after:highlight",le),le}function _(L,Y,se,oe){const ye=Object.create(null);function xe(j,ie){return j.keywords[ie]}function le(){if(!ae.keywords){Re.addText(ge);return}let j=0;ae.keywordPatternRe.lastIndex=0;let ie=ae.keywordPatternRe.exec(ge),Ce="";for(;ie;){Ce+=ge.substring(j,ie.index);const we=ce.case_insensitive?ie[0].toLowerCase():ie[0],ke=xe(ae,we);if(ke){const[We,lt]=ke;if(Re.addText(Ce),Ce="",ye[we]=(ye[we]||0)+1,ye[we]<=VYe&&(D+=lt),We.startsWith("_"))Ce+=ie[0];else{const Pe=ce.classNameAliases[We]||We;Le(ie[0],Pe)}}else Ce+=ie[0];j=ae.keywordPatternRe.lastIndex,ie=ae.keywordPatternRe.exec(ge)}Ce+=ge.substring(j),Re.addText(Ce)}function ve(){if(ge==="")return;let j=null;if(typeof ae.subLanguage=="string"){if(!e[ae.subLanguage]){Re.addText(ge);return}j=_(ae.subLanguage,ge,!0,Me[ae.subLanguage]),Me[ae.subLanguage]=j._top}else j=h(ge,ae.subLanguage.length?ae.subLanguage:null);ae.relevance>0&&(D+=j.relevance),Re.__addSublanguage(j._emitter,j.language)}function Oe(){ae.subLanguage!=null?ve():le(),ge=""}function Le(j,ie){j!==""&&(Re.startScope(ie),Re.addText(j),Re.endScope())}function Q(j,ie){let Ce=1;const we=ie.length-1;for(;Ce<=we;){if(!j._emit[Ce]){Ce++;continue}const ke=ce.classNameAliases[j[Ce]]||j[Ce],We=ie[Ce];ke?Le(We,ke):(ge=We,le(),ge=""),Ce++}}function fe(j,ie){return j.scope&&typeof j.scope=="string"&&Re.openNode(ce.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(Le(ge,ce.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),ge=""):j.beginScope._multi&&(Q(j.beginScope,ie),ge="")),ae=Object.create(j,{parent:{value:ae}}),ae}function _e(j,ie,Ce){let we=sYe(j.endRe,Ce);if(we){if(j["on:end"]){const ke=new aS(j);j["on:end"](ie,ke),ke.isMatchIgnored&&(we=!1)}if(we){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return _e(j.parent,ie,Ce)}function Ae(j){return ae.matcher.regexIndex===0?(ge+=j[0],1):(me=!0,0)}function Fe(j){const ie=j[0],Ce=j.rule,we=new aS(Ce),ke=[Ce.__beforeBegin,Ce["on:begin"]];for(const We of ke)if(We&&(We(j,we),we.isMatchIgnored))return Ae(ie);return Ce.skip?ge+=ie:(Ce.excludeBegin&&(ge+=ie),Oe(),!Ce.returnBegin&&!Ce.excludeBegin&&(ge=ie)),fe(Ce,j),Ce.returnBegin?0:ie.length}function ne(j){const ie=j[0],Ce=Y.substring(j.index),we=_e(ae,j,Ce);if(!we)return fS;const ke=ae;ae.endScope&&ae.endScope._wrap?(Oe(),Le(ie,ae.endScope._wrap)):ae.endScope&&ae.endScope._multi?(Oe(),Q(ae.endScope,j)):ke.skip?ge+=ie:(ke.returnEnd||ke.excludeEnd||(ge+=ie),Oe(),ke.excludeEnd&&(ge=ie));do ae.scope&&Re.closeNode(),!ae.skip&&!ae.subLanguage&&(D+=ae.relevance),ae=ae.parent;while(ae!==we.parent);return we.starts&&fe(we.starts,j),ke.returnEnd?0:ie.length}function U(){const j=[];for(let ie=ae;ie!==ce;ie=ie.parent)ie.scope&&j.unshift(ie.scope);j.forEach(ie=>Re.openNode(ie))}let P={};function J(j,ie){const Ce=ie&&ie[0];if(ge+=j,Ce==null)return Oe(),0;if(P.type==="begin"&&ie.type==="end"&&P.index===ie.index&&Ce===""){if(ge+=Y.slice(ie.index,ie.index+1),!i){const we=new Error(`0 width match regex (${L})`);throw we.languageName=L,we.badRule=P.rule,we}return 1}if(P=ie,ie.type==="begin")return Fe(ie);if(ie.type==="illegal"&&!se){const we=new Error('Illegal lexeme "'+Ce+'" for mode "'+(ae.scope||"<unnamed>")+'"');throw we.mode=ae,we}else if(ie.type==="end"){const we=ne(ie);if(we!==fS)return we}if(ie.type==="illegal"&&Ce==="")return 1;if(K>1e5&&K>ie.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=Ce,Ce.length}const ce=x(L);if(!ce)throw Jr(r.replace("{}",L)),new Error('Unknown language: "'+L+'"');const pe=FYe(ce);let he="",ae=oe||pe;const Me={},Re=new a.__emitter(a);U();let ge="",D=0,N=0,K=0,me=!1;try{if(ce.__emitTokens)ce.__emitTokens(Y,Re);else{for(ae.matcher.considerAll();;){K++,me?me=!1:ae.matcher.considerAll(),ae.matcher.lastIndex=N;const j=ae.matcher.exec(Y);if(!j)break;const ie=Y.substring(N,j.index)
` },f]}}return tm=i,tm}var nm,J1;function AWe(){if(J1)return nm;J1=1;function n(e){const t="[a-zA-Z_][ \\ w.]*",s="< \\ ?(lasso(script)?|=)",i=" \\ ]| \\ ?>",r={ $ pattern:t+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},o=e.COMMENT("<!--","-->",{relevance:0}),a={className:"meta",begin:" \\ [noprocess \\ ]",starts:{end:" \\ [/noprocess \\ ]",returnEnd:!0,contains:[o]}},c={className:"meta",begin:" \\ [/noprocess|"+s},d={className:"symbol",begin:"'"+t+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN) \\ b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:" ` ",end:" ` "},{variants:[{begin:"[# $ ]"+t},{begin:"#",end:" \\ d+",illegal:" \\ W"}]},{className:"type",begin:":: \\ s*",end:t,illegal:" \\ W"},{className:"params",variants:[{begin:"-(?!infinity)"+t,relevance:0},{begin:"( \\ . \\ . \\ .)"}]},{begin:/(->| \. ) \s */,relevance:0,contains:[d]},{className:"class",beginKeywords:"define",returnEnd:!0,end:" \\ (|=>",contains:[e.inherit(e.TITLE_MODE,{begin:t+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:r,contains:[{className:"meta",begin:i,relevance:0,starts:{end:" \\ [|"+s,returnEnd:!0,relevance:0,contains:[o]}},a,c,{className:"meta",begin:" \\ [no_square_brackets",starts:{end:" \\ [/no_square_brackets \\ ]",keywords:r,contains:[{className:"meta",begin:i,relevance:0,starts:{end:" \\ [noprocess \\ ]|"+s,returnEnd:!0,contains:[o]}},a,c].concat(u)}},{className:"meta",begin:" \\ [",relevance:0},{className:"meta",begin:"^#!",end:"lasso9 $ ",relevance:10}].concat(u)}}return nm=n,nm}var sm,eT;function MWe(){if(eT)return sm;eT=1;function n(e){const s=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(G=>G+"(?![a-zA-Z@:_])")),i=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-
] ` ,f={scope:"string",variants:[u,d,_,m]},g={scope:"number",variants:[{begin:" \\ b0[bB][01]+(?:_[01]+)* \\ b"},{begin:" \\ b0[oO][0-7]+(?:_[0-7]+)* \\ b"},{begin:" \\ b0[xX][ \\ da-fA-F]+(?:_[ \\ da-fA-F]+)* \\ b"},{begin:"(?: \\ b \\ d+(?:_ \\ d+)*( \\ .(?: \\ d+(?:_ \\ d+)*))?| \\ B \\ . \\ d+)(?:[eE][+-]? \\ d+)?"}],relevance:0},b=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:y,literal:(O=>{const H=[];return O.forEach(q=>{H.push(q),q.toLowerCase()===q?H.push(q.toUpperCase()):H.push(q.toLowerCase())}),H})(b),built_in:E},R=O=>O.map(H=>H.replace(/ \| \d + $ /,"")),C={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",R(E).join(" \\ b|")," \\ b)"),r],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(i," \\ b(?! \\ ()"),I={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class \b )/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class \b )/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class \b )/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},M={relevance:0,begin:/ \( /,end:/ \) /,keywords:S,contains:[x,o,I,e.C_BLOCK_COMMENT_MODE,f,g,C]},G={relevance:0,match:[/ \b /,t.concat("(?!fn \\ b|function \\ b|",R(y).join(" \\ b|"),"|",R(E).join(" \\ b|")," \\ b)"),i,t.concat(h,"*"),t.lookahead(/(?= \( )/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(G);const V=[x,I,e.C_BLOCK_COMMENT_MODE,f,g,C],te={begin:t.concat(/# \[ \s */,r),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/ \[ /,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...V]},...V,{
2024-10-20 20:24:55 +00:00
] * ; ` ,relevance:0},{begin:"[vp][0-9]+"}]}}return mh=n,mh}var hh,fx;function zKe(){if(fx)return hh;fx=1;function n(e){const t="[a-z][a-zA-Z0-9_]*",s={className:"string",begin:" \\ $ .{1}"},i={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:" \\ b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,i,s,{begin:" \\ |[ ]*"+t+"([ ]+"+t+")*[ ]* \\ |",returnBegin:!0,end:/ \| /,illegal:/ \S /,contains:[{begin:"( \\ |[ ]*)?"+t}]},{begin:"# \\ (",end:" \\ )",contains:[e.APOS_STRING_MODE,s,e.C_NUMBER_MODE,i]}]}}return hh=n,hh}var gh,_x;function HKe(){if(_x)return gh;_x=1;function n(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{ $ pattern:"[a-z_] \\ w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/ \/ \/ |>>/,contains:[{className:"literal",begin:/ \[ ( \| \| )? \] | \( \) /,relevance:0},e.COMMENT(" \\ ( \\ *"," \\ * \\ )",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[ \\ w']*"},{className:"type",begin:" ` [ A - Z ] [ \ \ w ']*"},{className:"type",begin:"\\b[A-Z][\\w' ] * ",relevance:0},{begin:" [ a - z _ ] \ \ w * '[\\w' ] * "},e.inherit(e.APOS_STRING_MODE,{className:" string ",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:" number ",begin:" \ \ b ( 0 [ xX ] [ a - fA - F0 - 9_ ] + [ Lln ] ? | 0 [ oO ] [ 0 - 7_ ] + [ Lln ] ? | 0 [ bB ] [ 01_ ] + [ Lln ] ? | [ 0 - 9 ] [ 0 - 9_ ] * ( [ Lln ] | ( \ \ . [ 0 - 9_ ] * ) ? ( [ eE ] [ - + ] ? [ 0 - 9_ ] + ) ? ) ? ) ",relevance:0},{begin:/[-=]>/}]}}return gh=n,gh}var bh,mx;function qKe(){if(mx)return bh;mx=1;function n(e){const t={className:" variable ",begin:/\b_+[a-zA-Z]\w*/},s={className:" title ",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},i={className:" string ",variants:[{begin:'" ',end:' "',contains:[{begin:'" "',relevance:0}]},{begin:" '",end:"' ",contains:[{begin:" '' ",relevance:0}]}]},r=[" break "," breakWith "," breakOut "," breakTo "," case "," catch "," continue "," continueWith "," default "," do "," else "," exit "," exitWith "," for "," forEach "," from "," if "," local "," private "," switch "," step "," then "," throw "," to "," try "," waitUntil "," while "," with "],o=[" blufor "," civilian "," configNull "," controlNull "," displayNull "," diaryRecordNull "," east "," endl "," false "," grpNull "," independent "," lineBreak "," locationNull "," nil "," objNull "," opfor "," pi "," resistance "," scriptNull "," sideAmbientLife "," sideEmpty "," sideEnemy "," sideFriendly "," sideLogic "," sideUnknown "," taskNull "," teamMemberNull "," true "," west "],a=[" abs "," accTime "," acos "," action "," actionIDs "," actionKeys "," actionKeysEx "," actionKeysImages "," actionKeysNames "," actionKeysNamesArray "," actionName "," actionParams "," activateAddons "," activatedAddons "," activateKey "," activeTitleEffectParams "," add3DENConnection "," add3DENEventHandler "," add3DENLayer "," addAction "," addBackpack "," addBackpackCargo "," addBackpackCargoGlobal "," addBackpackGlobal "," addBinocularItem "," addCamShake "," addCuratorAddons "," addCuratorCameraArea "," addCuratorEditableObjects "," addCuratorEditingArea "," addCuratorPoints "," addEditorObject "," addEventHandler "," addForce "," addForceGeneratorRTD "," addGoggles "," addGroupIcon "," addHandgunItem "," addHeadgear "," addItem "," addItemCargo "," addItemCargoGlobal "," addItemPool "," addItemToBackpack "," addItemToUniform "," addItemToVest "," addLiveStats "," addMagazine "," addMagazineAmmoCargo "," addMagazineCargo "," addMagazineCargoGlobal "," addMagazineGlobal "," addMagazinePool "," addMagazines "," addMagazineTurret "," addMenu "," addMenuItem "," addMissionEventHandler "," addMPEventHandler "," addMusicEventHandler "," addonFiles "," addOwnedMine "," addPlayerScores "," addPrimaryWeaponItem "," addPublicVariableEventHandler "," addRating "," addResources "," addScore "," addScoreSide "," addSecondaryWeaponItem "," addSwitchableUnit "," addTeamMember "," addToRemainsCollector "," addTorque "," addUniform "," addUserActionEventHandler "," a
2024-09-29 19:46:45 +00:00
] * ? "'`},{begin:`" [ ^ \ r
2024-10-20 20:24:55 +00:00
"]*" ` }]},{className:"built_in",variants:[{begin:" \\ b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?= \\ ()"}]},e.COMMENT("^[ ]* \\ *.* $ ",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return vh=n,vh}var Sh,yx;function KKe(){if(yx)return Sh;yx=1;function n(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{ $ pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/ \\ * \\ *!"," \\ */"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:" \\ d+",illegal:" \\ W"}]}]}}return Sh=n,Sh}var Th,Ex;function jKe(){if(Ex)return Th;Ex=1;const n=d=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:d.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4})) \b /},FUNCTION_DISPATCH:{className:"built_in",begin:/[ \w -]+(?= \( )/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/ \[ /,end:/ \] /,illegal:" $ ",contains:[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:d.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],s=[...e,...t],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","i
2024-09-29 19:46:45 +00:00
( multipart ) ? ` ,end: ` \ \ ]
2024-10-20 21:50:56 +00:00
` },{className:"string",begin:" \\ d{4}- \\ d{2}- \\ d{2}( \\ s+) \\ d{2}: \\ d{2}: \\ d{2}. \\ d+Z"},{className:"string",begin:"( \\ +|-) \\ d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?) \\ s+(test)?"},{begin:"^progress(:?)( \\ s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return xh=n,xh}var Ch,Sx;function XKe(){if(Sx)return Ch;Sx=1;function n(I){return I?typeof I=="string"?I:I.source:null}function e(I){return t("(?=",I,")")}function t(...I){return I.map(M=>n(M)).join("")}function s(I){const x=I[I.length-1];return typeof x=="object"&&x.constructor===Object?(I.splice(I.length-1,1),x):{}}function i(...I){return"("+(s(I).capture?"":"?:")+I.map(G=>n(G)).join("|")+")"}const r=I=>t(/ \b /,I,/ \w $ /.test(I)?/ \b /:/ \B /),o=["Protocol","Type"].map(r),a=["init","self"].map(r),c=["Any","Self"],d=["actor","any","associatedtype","async","await",/as \? /,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate \( set \) /,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init \? /,/init!/,"inout",/internal \( set \) /,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open \( set \) /,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private \( set \) /,"private","protocol",/public \( set \) /,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try \? /,/try!/,"try","typealias",/unowned \( safe \) /,/unowned \( unsafe \) /,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],_=["assignment","associativity","higherThan","left","lowerThan","none","right"],m=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],h=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=i(/[/= \- +!*%<>&|^~?]/,/[ \u 00A1- \u 00A7]/,/[ \u 00A9 \u 00AB]/,/[ \u 00AC \u 00AE]/,/[ \u 00B0 \u 00B1]/,/[ \u 00B6 \u 00BB \u 00BF \u 00D7 \u 00F7]/,/[ \u 2016- \u 2017]/,/[ \u 2020- \u 2027]/,/[ \u 2030- \u 203E]/,/[ \u 2041- \u 2053]/,/[ \u 2055- \u 205E]/,/[ \u 2190- \u 23FF]/,/[ \u 2500- \u 2775]/,/[ \u 2794- \u 2BFF]/,/[ \u 2E00- \u 2E7F]/,/[ \u 3001- \u 3003]/,/[ \u 3008- \u 3020]/,/[ \u 3030]/),g=i(f,/[ \u 0300- \u 036F]/,/[ \u 1DC0- \u 1DFF]/,/[ \u 20D0- \u 20FF]/,/[ \u FE00- \u FE0F]/,/[ \u FE20- \u FE2F]/),b=t(f,g,"*"),y=i(/[a-zA-Z_]/,/[ \u 00A8 \u 00AA \u 00AD \u 00AF \u 00B2- \u 00B5 \u 00B7- \u 00BA]/,/[ \u 00BC- \u 00BE \u 00C0- \u 00D6 \u 00D8- \u 00F6 \u 00F8- \u 00FF]/,/[ \u 0100- \u 02FF \u 0370- \u 167F \u 1681- \u 180D \u 180F- \u 1DBF]/,/[ \u 1E00- \u 1FFF]/,/[ \u 200B- \u 200D \u 202A- \u 202E \u 203F- \u 2040 \u 2054 \u 2060- \u 206F]/,/[ \u 2070- \u 20CF \u 2100- \u 218F \u 2460- \u 24FF \u 2776- \u 2793]/,/[ \u 2C00- \u 2DFF \u 2E80- \u 2FFF]/,/[ \u 3004- \u 3007 \u 3021- \u 302F \u 3031- \u 303F \u 3040- \u D7FF]/,/[ \u F900- \u FD3D \u FD40- \u FDCF \u FDF0- \u FE1F \u FE30- \u FE44]/,/[ \u FE47- \u FEFE \u FF00- \u FFFD]/),E=i(y,/ \d /,/[ \u 0300- \u 036F \u 1DC0- \u 1DFF \u 20D0- \u 20FF \u FE20- \u FE2F]/),v=t(y,E,"*"),S=t(/[A-Z]/,E,"*"),R=["attached","autoclosure",t(/convention \( /,i("swift","block","c"),/ \) /),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc \( /,v,/ \) /),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplica
` ),s=t.length.toString().length,i=t.map((d,u)=>(u+1).toString().padStart(s," ")),r=document.createElement("div");r.classList.add("line-numbers"),r.innerHTML=i.join("<br>");const o=document.createElement("div");o.classList.add("code-container");const a=document.createElement("pre"),c=document.createElement("code");return c.classList.add("code-content"),c.innerHTML=co.highlight(e,{language:n,ignoreIllegals:!0}).value,a.appendChild(c),o.appendChild(r),o.appendChild(a),o.outerHTML}},methods:{copyCode(){this.isCopied=!0,console.log("Copying code");const n=document.createElement("textarea");n.value=this.code,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),De(()=>{Ge.replace()})},executeCode(){this.isExecuting=!0;const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id?this.discussion_id:0,message_id:this.message_id?this.message_id:0,language:this.language});console.log(n),fetch( ` $ { this . host } / execute _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>(this.isExecuting=!1,e.json())).then(e=>{console.log(e),this.executionOutput=e.output}).catch(e=>{this.isExecuting=!1,console.error("Fetch error:",e)})},executeCode_in_new_tab(){this.isExecuting=!0;const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id,message_id:this.message_id,language:this.language});console.log(n),fetch( ` $ { this . host } / execute _code _in _new _tab ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>(this.isExecuting=!1,e.json())).then(e=>{console.log(e),this.executionOutput=e.output}).catch(e=>{this.isExecuting=!1,console.error("Fetch error:",e)})},openFolderVsCode(){const n=JSON.stringify({client_id:this.client_id,code:this.code,discussion_id:this.discussion_id,message_id:this.message_id});console.log(n),fetch( ` $ { this . host } / open _discussion _folder _in _vs _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})},openVsCode(){const n=JSON.stringify({client_id:this.client_id,discussion_id:typeof this.discussion_id=="string"?parseInt(this.discussion_id):this.discussion_id,message_id:this.message_id,code:this.code});console.log(n),fetch( ` $ { this . host } / open _code _in _vs _code ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})},openFolder(){const n=JSON.stringify({client_id:this.client_id,discussion_id:this.discussion_id});console.log(n),fetch( ` $ { this . host } / open _discussion _folder ` ,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})}}},Tje={class:"bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},xje={class:"hljs p-1 rounded-md break-all grid grid-cols-1"},Cje={class:"code-container"},wje=["innerHTML"],Rje={class:"flex flex-row bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},Aje={class:"text-2xl mr-2"},Mje=["title"],Nje={key:0,class:"text-2xl"},Oje={key:1,class:"hljs mt-0 p-1 rounded-md break-all grid grid-cols-1"},Ije={class:"container h-[200px] overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},kje=["innerHTML"];function Dje(n,e,t,s,i,r){return T(),w("div",Tje,[l("pre",xje,[e[9]||(e[9]=Ze(" ")),l("div",Cje,[e[7]||(e[7]=Ze( `
2024-10-20 20:24:55 +00:00
` )),l("div",{class:"code-content overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:r.highlightedCode,contenteditable:"true",onInput:e[0]||(e[0]=(...o)=>n.updateCode&&n.updateCode(...o))},null,40,wje),e[8]||(e[8]=Ze( `
2024-09-29 19:46:45 +00:00
` ))]),e[10]||(e[10]=Ze( `
2024-10-20 21:50:56 +00:00
` ))]),l("div",Rje,[l("span",Aje, $ (t.language.trim()),1),l("button",{onClick:e[1]||(e[1]=(...o)=>r.copyCode&&r.copyCode(...o)),title:i.isCopied?"Copied!":"Copy code",class:Ue([i.isCopied?"bg-green-500":"","px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"])},e[11]||(e[11]=[l("i",{"data-feather":"copy"},null,-1)]),10,Mje),["function","python","sh","shell","bash","cmd","powershell","latex","mermaid","graphviz","dot","javascript","html","html5","svg"].includes(t.language)?(T(),w("button",{key:0,ref:"btn_code_exec",onClick:e[2]||(e[2]=(...o)=>r.executeCode&&r.executeCode(...o)),title:"execute",class:Ue(["px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200",i.isExecuting?"bg-green-500":""])},e[12]||(e[12]=[l("i",{"data-feather":"play-circle"},null,-1)]),2)):B("",!0),["airplay","mermaid","graphviz","dot","javascript","html","html5","svg","css"].includes(t.language.trim())?(T(),w("button",{key:1,ref:"btn_code_exec_in_new_tab",onClick:e[3]||(e[3]=(...o)=>r.executeCode_in_new_tab&&r.executeCode_in_new_tab(...o)),title:"execute",class:Ue(["px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200",i.isExecuting?"bg-green-500":""])},e[13]||(e[13]=[l("i",{"data-feather":"airplay"},null,-1)]),2)):B("",!0),l("button",{onClick:e[4]||(e[4]=(...o)=>r.openFolder&&r.openFolder(...o)),title:"open code project folder",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[14]||(e[14]=[l("i",{"data-feather":"folder"},null,-1)])),["python","latex","html"].includes(t.language.trim())?(T(),w("button",{key:2,onClick:e[5]||(e[5]=(...o)=>r.openFolderVsCode&&r.openFolderVsCode(...o)),title:"open code project folder in vscode",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[15]||(e[15]=[l("img",{src:Eje,width:"25",height:"25"},null,-1)]))):B("",!0),["python","latex","html"].includes(t.language.trim())?(T(),w("button",{key:3,onClick:e[6]||(e[6]=(...o)=>r.openVsCode&&r.openVsCode(...o)),title:"open code in vscode",class:"px-2 py-1 mr-2 mb-2 text-left text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white transition-colors duration-200"},e[16]||(e[16]=[l("img",{src:vje,width:"25",height:"25"},null,-1)]))):B("",!0)]),i.executionOutput?(T(),w("span",Nje,"Execution output")):B("",!0),i.executionOutput?(T(),w("pre",Oje,[e[19]||(e[19]=Ze(" ")),l("div",Ije,[e[17]||(e[17]=Ze( `
2024-10-20 20:24:55 +00:00
` )),l("div",{ref:"execution_output",class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:i.executionOutput},null,8,kje),e[18]||(e[18]=Ze( `
2024-09-29 19:46:45 +00:00
` ))]),e[20]||(e[20]=Ze( `
2024-10-20 21:50:56 +00:00
` ))])):B("",!0)])}const Lje=st(Sje,[["render",Dje]]);var DM={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(PA,function(){function t(a,c){var d=a.pos;if(a.src.charCodeAt(d)!==92)return!1;var u=a.src.slice(++d).match(/^(?: \\ \[ | \\ \( |begin \{ ([^}]*) \} )/);if(!u)return!1;d+=u[0].length;var _,m,h;u[0]===" \\ ["?(_="display_math",m=" \\ \\ ]"):u[0]===" \\ ("?(_="inline_math",m=" \\ \\ )"):u[1]&&(_="math",m=" \\ end{"+u[1]+"}",h=!0);var f=a.src.indexOf(m,d);if(f===-1)return!1;var g=f+m.length;if(!c){var b=a.push(_,"",0);b.content=h?a.src.slice(a.pos,g):a.src.slice(d,f)}return a.pos=g,!0}function s(a,c){var d=a.pos;if(a.src.charCodeAt(d)!==36)return!1;var u=" $ ",_=a.src.charCodeAt(++d);if(_===36){if(u=" $ $ ",a.src.charCodeAt(++d)===36)return!1}else if(_===32||_===9||_===10)return!1;var m=a.src.indexOf(u,d);if(m===-1||a.src.charCodeAt(m-1)===92)return!1;var h=m+u.length;if(u.length===1){var f=a.src.charCodeAt(m-1);if(f===32||f===9||f===10)return!1;var g=a.src.charCodeAt(h);if(g>=48&&g<58)return!1}if(!c){var b=a.push(u.length===1?"inline_math":"display_math","",0);b.content=a.src.slice(d,m)}return a.pos=h,!0}function i(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/ \u 00a0/g," ")}function r(a,c){return Object.keys(c).reduce(function(d,u){return d[u]===void 0&&(d[u]=c[u]),d},a)}var o={math:"Math",inline_math:"InlineMath",display_math:"DisplayMath"};return function(a){var c={beforeMath:"",afterMath:"",beforeInlineMath:" \\ (",afterInlineMath:" \\ )",beforeDisplayMath:" \\ [",afterDisplayMath:" \\ ]"};return a=r(a||{},c),function(d){d.inline.ruler.before("escape","math",t),d.inline.ruler.push("texMath",s),Object.keys(o).forEach(function(u){var _=a["before"+o[u]],m=a["after"+o[u]];d.renderer.rules[u]=function(h,f){return _+i(h[f].content)+m}})}}})})(DM);var Pje=DM.exports;const Fje=wr(Pje);function Uje(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Bje={name:"MarkdownRenderer",props:{host:{type:String,required:!1,default:"http://localhost:9600"},client_id:{type:String,required:!0},markdownText:{type:String,required:!0},discussion_id:{type:[String,Number],default:"0",required:!1},message_id:{value:"0",type:[String,Number],required:!1}},components:{CodeBlock:Lje},setup(n){const e=new xye({html:!0,highlight:(r,o)=>{const a=o&&co.getLanguage(o)?o:"plaintext";return co.highlight(a,r).value},renderInline:!0,breaks:!0}).use(Aqe).use( $ o).use(Lqe,{figcaption:!0}).use(jqe).use(kqe,{enableRowspan:!0,enableColspan:!0,enableGridTables:!0,enableGridTablesExtra:!0,enableTableIndentation:!0,tableCellPadding:" ",tableCellJoiner:"|",multilineCellStartMarker:"|>",multilineCellEndMarker:"<|",multilineCellPadding:" ",multilineCellJoiner: `
2024-10-20 22:07:51 +00:00
` }).use(Fje({inlineMath:[[" $ "," $ "],[" \\ ("," \\ )"]],blockMath:[[" $ $ "," $ $ "],[" \\ ["," \\ ]"]]})),t=ot([]),s=()=>{if(n.markdownText){let r=e.parse(n.markdownText,{}),o=[];t.value=[];for(let a=0;a<r.length;a++)r[a].type!=="fence"?o.push(r[a]):(o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[]),t.value.push({type:"code",language:Uje(r[a].info),code:r[a].content}));o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[])}else t.value=[];De(()=>{Ge.replace()})},i=(r,o)=>{t.value[r].code=o};return Tn(()=>n.markdownText,s),di(()=>{s(),De(()=>{window.MathJax&&window.MathJax.typesetPromise()})}),{markdownItems:t,updateCode:i}}},Gje={class:"break-all container w-full"},Vje={ref:"mdRender",class:"markdown-content"},zje=["innerHTML"];function Hje(n,e,t,s,i,r){const o=et("code-block");return T(),w("div",Gje,[l("div",Vje,[(T(!0),w(Be,null,Xe(s.markdownItems,(a,c)=>(T(),w("div",{key:c},[a.type==="code"?(T(),at(o,{key:0,host:t.host,language:a.language,code:a.code,discussion_id:t.discussion_id,message_id:t.message_id,client_id:t.client_id,onUpdateCode:d=>s.updateCode(c,d)},null,8,["host","language","code","discussion_id","message_id","client_id","onUpdateCode"])):(T(),w("div",{key:1,innerHTML:a.html},null,8,zje))]))),128))],512)])}const up=st(Bje,[["render",Hje]]),qje={props:{value:String,inputType:{type:String,default:"text",validator:n=>["text","email","password","file","path","integer","float"].includes(n)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(n){console.log("Changing value to ",n),this.inputValue=n}},mounted(){De(()=>{Ge.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(n){this.inputValue=n.target.value,this. $ emit("input",n.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(n){if(this.inputType==="integer"){const e=n.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",n.target.value),this. $ emit("input",n.target.value)},async pasteFromClipboard(){try{const n=await navigator.clipboard.readText();this.handleClipboardData(n)}catch(n){console.error("Failed to read from clipboard:",n)}},handlePaste(n){const e=n.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(n){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(n)?n:"";break;case"password":this.inputValue=n;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(n);break;case"float":this.inputValue=this.parseFloat(n);break;default:this.inputValue=n;break}},isValidEmail(n){return/^[^ \s @]+@[^ \s @]+ \. [^ \s @]+ $ /.test(n)},parseInteger(n){const e=parseInt(n);return isNaN(e)?"":e},parseFloat(n){const e=parseFloat(n);return isNaN(e)?"":e},openFileInput(){this. $ refs.fileInput.click()},handleFileInputChange(n){const e=n.target.files[0];e&&(this.inputValue=e.name)}}},Yje={class:"flex items-center space-x-2"}, $ je=["value","type","placeholder"],Wje=["value","min","max"],Kje=["accept"];function jje(n,e,t,s,i,r){return T(),w("div",Yje,[n.useSlider?(T(),w("input",{key:1,type:"range",value:parseInt(i.inputValue),min:n.minSliderValue,max:n.maxSliderValue,onInput:e[2]||(e[2]=(...o)=>r.handleSliderInput&&r.handleSliderInput(...o)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,Wje)):(T(),w("input",{key:0,value:i.inputValue,type:t.inputType,placeholder:i.placeholderText,onInput:e[0]||(e[0]=(...o)=>r.handleInput&&r.handleInput(...o)),onPaste:e[1]||(e[1]=(...o)=>r.handlePaste&&r.handlePaste(...o)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:borde
2024-09-29 19:46:45 +00:00
< div class = "bg-white p-6 rounded-md shadow-md w-80" >
< h2 class = "text-lg font-semibold mb-3" > $ { n } < / h 2 >
< textarea id = "replacementInput" class = "w-full h-32 border rounded p-2 mb-3" > $ { e } < / t e x t a r e a >
< div class = "flex justify-end" >
< button id = "cancelButton" class = "mr-2 px-4 py-2 border rounded" > Cancel < / b u t t o n >
< button id = "okButton" class = "px-4 py-2 bg-blue-500 text-white rounded" > OK < / b u t t o n >
< / d i v >
< / d i v >
` :r.innerHTML= `
< div class = "bg-white p-6 rounded-md shadow-md w-80" >
< h2 class = "text-lg font-semibold mb-3" > $ { n } < / h 2 >
< select id = "options_selector" class = "form-control w-full h-25 border rounded p-2 mb-3" >
$ { t . map ( c => ` <option value=" ${ c } "> ${ c } </option> ` ) }
< / s e l e c t >
< div class = "flex justify-end" >
< button id = "cancelButton" class = "mr-2 px-4 py-2 border rounded" > Cancel < / b u t t o n >
< button id = "okButton" class = "px-4 py-2 bg-blue-500 text-white rounded" > OK < / b u t t o n >
< / d i v >
< / d i v >
2024-10-20 21:50:56 +00:00
` ,document.body.appendChild(r);const o=r.querySelector("#cancelButton"),a=r.querySelector("#okButton");o.addEventListener("click",()=>{document.body.removeChild(r),s(null)}),a.addEventListener("click",()=>{if(t.length===0){const d=r.querySelector("#replacementInput").value.trim();document.body.removeChild(r),s(d)}else{const d=r.querySelector("#options_selector").value.trim();document.body.removeChild(r),s(d)}})})}function MXe(n,e){console.log(n);let t={},s=/@<([^>]+)>@/g,i=[],r;for(;(r=s.exec(n))!==null;)i.push("@<"+r[1]+">@");console.log("matches"),console.log(i),i=[...new Set(i)];async function o(c){console.log(c);let d=c.toLowerCase().substring(2,c.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([b,y])=>{console.log( ` Key : $ { b } , Value : $ { y } ` );function E(R){return R.replace(/[.*+?^ ${ } ()|[ \] \\ ]/g," \\ $ &")}const v=E(b),S=new RegExp(v,"g");d=d.replace(S,y)});let _=d.split(":"),m=_[0],h=_[1]||"",f=[];_.length>2&&(f=_.slice(1));let g=await Jx(m,h,f);g!==null&&(t[c]=g)}else{let u=await Jx(d);u!==null&&(t[c]=u)}}let a=Promise.resolve();i.forEach(c=>{a=a.then(()=>o(c)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(t).forEach(([c,d])=>{console.log( ` Key : $ { c } , Value : $ { d } ` );function u(h){return h.replace(/[.*+?^ ${ } ()|[ \] \\ ]/g," \\ $ &")}const _=u(c),m=new RegExp(_,"g");n=n.replace(m,d)}),e(n)})}const NXe={name:"PlayGroundView",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},showSettings:!1,pending:!1,is_recording:!1,is_deaf_transcribing:!1,cpp_block:GM,html5_block:VM,LaTeX_block:zM,javascript_block:UM,json_block:BM,code_block:PM,python_block:FM,bash_block:HM,tokenize_icon:cQe,deaf_off:uQe,deaf_on:dQe,rec_off:fQe,rec_on:pQe,loading_icon:qM,isSynthesizingVoice:!1,audio_url:null,mdRenderHeight:300,selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,namedTokens:[],text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:ac,MarkdownRenderer:up,ClipBoardTextInput:L0,TokensHilighter:nQe,ChatBarButton:LM,Card:pp,ToolbarButton:P0,DropdownMenu:eN},mounted(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,thi
2024-09-29 19:46:45 +00:00
` ?(this.text=this.text.slice(0,e)+" ` ` ` "+n+" \ n \ n ` ` ` \n "+this.text.slice(e),e=e+4+n.length):(this.text=this.text.slice(0,e)+" \n ` ` ` "+n+" \ n \ n ` ` ` \n "+this.text.slice(e),e=e+3+n.length):speechSynthesis==0||this.text[e-1]== `
` ?(this.text=this.text.slice(0,e)+" ` ` ` " + n + `
` +this.text.slice(e,t)+" \n ` ` ` \ n "+this.text.slice(t),e=e+4+n.length):(this.text=this.text.slice(0,e)+" \ n ` ` ` "+n+ `
2024-10-20 20:24:55 +00:00
` +this.text.slice(e,t)+" \n ` ` ` \ n "+this.text.slice(t),e=e+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=e.value.substring(0,t),r=e.value.substring(s),o=i+" "+r;this.text=o,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4}),n.preventDefault()},mdTextarea_changed(){console.log(" mdTextarea _changed "),this.cursorPosition=this.$refs.mdTextarea.selectionStart},mdTextarea_clicked(){console.log(`mdTextarea_clicked: ${this.$refs.mdTextarea.selectionStart}`),this.cursorPosition=this.$refs.mdTextarea.selectionStart},setModel(){this.selecting_model=!0,Z.post(" / update _setting ",{client_id:this.$store.state.client_id,setting_name:" model _name ",setting_value:this.selectedModel}).then(n=>{console.log(n),n.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(n=>{this.$refs.toast.showToast(`Error ${n}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){console.log(" READING ... "),this.isSynthesizingVoice=!0;let n=this.$refs.mdTextarea.selectionStart,e=this.$refs.mdTextarea.selectionEnd,t=this.text;n!=e&&(t=t.slice(n,e)),Z.post(" . / text2Wave ",{client_id:this.$store.state.client_id,text:t}).then(s=>{console.log(s.data.url);let i=s.data.url;this.audio_url=i,this.isSynthesizingVoice=!1,De(()=>{Ge.replace()})}).catch(s=>{this.$refs.toast.showToast(`Error: ${s}`,4,!1),this.isSynthesizingVoice=!1,De(()=>{Ge.replace()})})},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log(" voice on "),this.isSpeaking=!0;const e=200;this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this.$store.state.config.audio_out_voice)[0]);const t=i=>{let r=this.text.substring(i,i+e);const o=[" . "," ! "," ? " , `
2024-10-20 22:07:51 +00:00
` ];let a=-1;return o.forEach(c=>{const d=r.lastIndexOf(c);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+i+1},s=()=>{const i=t(n),r=this.text.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n<this.text.length-2?setTimeout(()=>{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",i))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this. $ refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@<generation_placeholder>@");if(n<0){this. $ refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),Ye.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await Z.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log( ` cursor position : $ { this . getCursorPosition ( ) } ` ),console.log( ` pretext : $ { this . pre _text } ` ),console.log( ` post _text : $ { this . post _text } ` ),console.log( ` prompt : $ { n } ` ),Ye.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ye.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=MXe(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={client_id:this. $ store.state.client_id,name:n,content:this.text},Z.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this. $ refs.toast.showToast( ` Error : $ { e } ` ,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)})},startRecording(){this.pending=!0,this.is_recording?Z.post("/stop_recording",{client_id:this. $ store.state.client_id}).then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data,console.log("text"),console.log(this.text),console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)}):Z.post("/start_recording",{client_id:this. $ store.state.client_id}).then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this. $ refs.toast.showToast( ` Error : $ { n } ` ,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?Z.get("/stop_recording").then(n=>{this.is_deaf_tran
2024-10-17 11:28:01 +00:00
` ).map(i=>{const r=i.match(/^ \s +/);if(r===null)return i;const[o]=r;return o.length>=s.length?i.slice(s.length):i}).join( `
2024-10-18 23:54:04 +00:00
` )}class ou{constructor(e){qt(this,"options");qt(this,"rules");qt(this,"lexer");this.options=e||yo}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(/^(?: {1,4}| {0,3} \t )/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:sl(s, `
2024-10-20 20:24:55 +00:00
` )}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],i=AZe(s,t[3]||"");return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation," $ 1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(/# $ /.test(s)){const i=sl(s,"#");(this.options.pedantic||!i||/ $ /.test(i))&&(s=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:sl(t[0], `
2024-10-18 23:54:04 +00:00
` )}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=sl(t[0], `
2024-10-17 11:28:01 +00:00
` ).split( `
` ),i="",r="";const o=[];for(;s.length>0;){let a=!1;const c=[];let d;for(d=0;d<s.length;d++)if(/^ {0,3}>/.test(s[d]))c.push(s[d]),a=!0;else if(!a)c.push(s[d]);else break;s=s.slice(d);const u=c.join( `
` ),_=u.replace(/ \n {0,3}((?:=+|-+) *)(?= \n | $ )/g, `
$1 ` ).replace(/^ {0,3}>[ \t ]?/gm,"");i=i? ` $ { i }
$ { u } ` :u,r=r? ` $ { r }
2024-10-20 20:24:55 +00:00
$ { _ } ` :_;const m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,o,!0),this.lexer.state.top=m,s.length===0)break;const h=o[o.length-1];if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const f=h,g=f.raw+ `
2024-10-17 11:28:01 +00:00
` +s.join( `
2024-10-20 20:24:55 +00:00
` ),b=this.blockquote(g);o[o.length-1]=b,i=i.substring(0,i.length-f.raw.length)+b.raw,r=r.substring(0,r.length-f.text.length)+b.text;break}else if((h==null?void 0:h.type)==="list"){const f=h,g=f.raw+ `
2024-10-17 11:28:01 +00:00
` +s.join( `
2024-10-20 20:24:55 +00:00
` ),b=this.list(g);o[o.length-1]=b,i=i.substring(0,i.length-h.raw.length)+b.raw,r=r.substring(0,r.length-f.raw.length)+b.raw,s=g.substring(o[o.length-1].raw.length).split( `
2024-10-17 11:28:01 +00:00
` );continue}}return{type:"blockquote",raw:i,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const i=s.length>1,r={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i? ` \ \ d { 1 , 9 } \ \ $ { s . slice ( - 1 ) } ` : ` \ \ $ { s } ` ,this.options.pedantic&&(s=i?s:"[*+-]");const o=new RegExp( ` ^ ( { 0 , 3 } $ { s } ) ( ( ? : [ ] [ ^ \ \ n ] * ) ? ( ? : \ \ n | $ ) ) ` );let a=!1;for(;e;){let c=!1,d="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let _=t[2].split( `
2024-10-20 20:24:55 +00:00
` ,1)[0].replace(/^ \t +/,y=>" ".repeat(3*y.length)),m=e.split( `
` ,1)[0],h=!_.trim(),f=0;if(this.options.pedantic?(f=2,u=_.trimStart()):h?f=t[1].length+1:(f=t[2].search(/[^ ]/),f=f>4?1:f,u=_.slice(f),f+=t[1].length),h&&/^[ \t ]* $ /.test(m)&&(d+=m+ `
` ,e=e.substring(m.length+1),c=!0),!c){const y=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , f - 1 ) } } ( ? : [ * + - ] | \ \ d { 1 , 9 } [ . ) ] ) ( ( ? : [ ] [ ^ \ \ n ] * ) ? ( ? : \ \ n | $ ) ) ` ),E=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , f - 1 ) } } ( ( ? : - * ) { 3 , } | ( ? : _ * ) { 3 , } | ( ? : \ \ * * ) { 3 , } ) ( ? : \ \ n + | $ ) ` ),v=new RegExp( ` ^ { 0 , $ { Math . min ( 3 , f - 1 ) } } ( ? : \ ` \` \` |~~~) ` ) , S = new RegExp ( ` ^ {0, ${ Math . min ( 3 , f - 1 ) } }# ` ) , R = new RegExp ( ` ^ {0, ${ Math . min ( 3 , f - 1 ) } }<[a-z].*> ` , "i" ) ; for ( ; e ; ) { const C = e . split ( `
` ,1)[0];let A;if(m=C,this.options.pedantic?(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),A=m):A=m.replace(/ \t /g," "),v.test(m)||S.test(m)||R.test(m)||y.test(m)||E.test(m))break;if(A.search(/[^ ]/)>=f||!m.trim())u+= `
` +A.slice(f);else{if(h||_.replace(/ \t /g," ").search(/[^ ]/)>=4||v.test(_)||S.test(_)||E.test(_))break;u+= `
` +m}!h&&!m.trim()&&(h=!0),d+=C+ `
` ,e=e.substring(C.length+1),_=A.slice(f)}}r.loose||(a?r.loose=!0:/ \n [ \t ]* \n [ \t ]* $ /.test(d)&&(a=!0));let g=null,b;this.options.gfm&&(g=/^ \[ [ xX] \] /.exec(u),g&&(b=g[0]!=="[ ] ",u=u.replace(/^ \[ [ xX] \] +/,""))),r.items.push({type:"list_item",raw:d,task:!!g,checked:b,loose:!1,text:u,tokens:[]}),r.raw+=d}r.items[r.items.length-1].raw=r.items[r.items.length-1].raw.trimEnd(),r.items[r.items.length-1].text=r.items[r.items.length-1].text.trimEnd(),r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const d=r.items[c].tokens.filter(_=>_.type==="space"),u=d.length>0&&d.some(_=>/ \n .* \n /.test(_.raw));r.loose=u}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(/ \s +/g," "),i=t[2]?t[2].replace(/^<(.*)> $ /," $ 1").replace(this.rules.inline.anyPunctuation," $ 1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation," $ 1"):t[3];return{type:"def",tag:s,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const s=nC(t[1]),i=t[2].replace(/^ \| | \| * $ /g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/ \n [ \t ]* $ /,"").split( `
2024-10-18 23:54:04 +00:00
` ):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===i.length){for(const a of i)/^ *-+: * $ /.test(a)?o.align.push("right"):/^ *:-+: * $ /.test(a)?o.align.push("center"):/^ *:-+ * $ /.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<s.length;a++)o.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:o.align[a]});for(const a of r)o.rows.push(nC(a,o.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[d]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)=== `
2024-10-20 21:50:56 +00:00
` ?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:ns(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^< \/ a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)( \s |>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^< \/ (pre|code|kbd|script)( \s |>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/> $ /.test(s))return;const o=sl(s.slice(0,-1)," \\ ");if((s.length-o.length)%2===0)return}else{const o=RZe(t[2],"()");if(o>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const o=/^([^'"]*[^ \s ]) \s +(['"])(.*) \2 /.exec(i);o&&(i=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/> $ /.test(s)?i=i.slice(1):i=i.slice(1,-1)),sC(t,{href:i&&i.replace(this.rules.inline.anyPunctuation," $ 1"),title:r&&r.replace(this.rules.inline.anyPunctuation," $ 1")},t[0],this.lexer)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const i=(s[2]||s[1]).replace(/ \s +/g," "),r=t[i.toLowerCase()];if(!r){const o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return sC(s,r,s[0],this.lexer)}}emStrong(e,t,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&s.match(/[ \p {L} \p {N}]/u))return;if(!(i[1]||i[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const o=[...i[0]].length-1;let a,c,d=o,u=0;const _=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(_.lastIndex=0,t=t.slice(-1*e.length+o);(i=_.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){d+=c;continue}else if((i[5]||i[6])&&o%3&&!((o+c)%3)){u+=c;continue}if(d-=c,d>0)continue;c=Math.min(c,c+d+u);const m=[...i[0]][0].length,h=e.slice(0,o+i.index+m+c);if(Math.min(o,c)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(/ \n /g," ");const i=/[^ ]/.test(s),r=/^ /.test(s)&&/ $ /.test(s);return i&&r&&(s=s.substring(1,s.length-1)),s=ns(s,!0),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,i;return t[2]==="@"?(s=ns(t[1]),i="mailto:"+s):(s=ns(t[1]),i=s),{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let i,r;if(t[2]==="@")i=ns(t[0]),r="mailto:"+i;else{let o;do o=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(o!==t[0]);i=ns(t[0]),t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let s;return this.lexer.state.inRawBlock?s=t[0]:s=ns(t[0]),{type:"text",raw:t[0],text:s}}}}const MZe=/^(?:[ \t ]*(?: \n | $ ))+/,NZe=/^((?: {4}| {0,3} \t )[^ \n ]+(?: \n (?:[ \t ]*(?: \n | $ ))*)?)+/,OZe=/^ {0,3}( ` { 3 , } ( ? = [ ^ ` \n ]*(?: \n | $ ))|~{3,})([^ \n ]*)(?: \n | $ )(?:|([ \s \S ]*?)(?: \n | $ ))(?: {0,3} \1 [~ ` ] * * ( ? = \ n | $ ) | $ ) / , fc = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/ , IZe = / ^ { 0 , 3 } ( # { 1 , 6 } ) ( ? = \ s | $
] ` ).replace("lheading",rN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},aN=/^ \\ ([!"# $ %&'()*+, \- ./:;<=>?@ \[ \] \\ ^_ ` { | } ~ ] ) / , GZe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/ , lN = /^( {2,}|\\)\n(?!\s*$)/ , VZe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/ , _c = "\\p{P}\\p{S}" , zZe = zt ( /^((?![*_])[\spunctuation])/ , "u" ) . replace ( /punctuation/g , _c ) . getRegex ( ) , HZe = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g , qZe = zt ( /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/ , "u" ) . replace ( /punct/g , _c ) . getRegex ( ) , YZe = zt ( "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])" , "gu" ) . replace ( /punct/g , _c ) . getRegex ( ) , $Ze = zt ( "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])" , "gu" ) . replace ( /punct/g , _c ) . getRegex ( ) , WZe = zt ( /\\([punct])/ , "gu" ) . replace ( /punct/g , _c ) . getRegex ( ) , KZe = zt ( /^<(scheme:[^\s\x00-\x1f<>]*|email)>/ ) . replace ( "scheme" , /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/ ) . replace ( "email" , /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/ ) . getRegex ( ) , jZe = zt ( W0 ) . replace ( "(?:-->|$)" , "-->" ) . getRegex ( ) , QZe = zt ( "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>" ) . replace ( "comment" , jZe ) . replace ( "attribute" , /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/ ) . getRegex ( ) , au = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/ , XZe = zt ( /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/ ) . replace ( "label" , au ) . replace ( "href" , /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/ ) . replace ( "title" , /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/ ) . getRegex ( ) , cN = zt ( /^!?\[(label)\]\[(ref)\]/ ) . replace ( "label" , au ) . replace ( "ref" , $0 ) . getRegex ( ) , dN = zt ( /^!?\[(ref)\](?:\[\])?/ ) . replace ( "ref" , $0 ) . getRegex ( ) , ZZe = zt ( "reflink|nolink(?!\\()" , "g" ) . replace ( "reflink" , cN ) . replace ( "nolink" , dN ) . getRegex ( ) , j0 = { _backpedal : Al , anyPunctuation : WZe , autolink : KZe , blockSkip : HZe , br : lN , code : GZe , del : Al , emStrongLDelim : qZe , emStrongRDelimAst : YZe , emStrongRDelimUnd : $Ze , escape : aN , link : XZe , nolink : dN , punctuation : zZe , reflink : cN , reflinkSearch : ZZe , tag : QZe , text : VZe , url : Al } , JZe = { ... j0 , link : zt ( /^!?\[(label)\]\((.*?)\)/ ) . replace ( "label" , au ) . getRegex ( ) , reflink : zt ( /^!?\[(label)\]\s*\[([^\]]*)\]/ ) . replace ( "label" , au ) . getRegex ( ) } , _b = { ... j0 , escape : zt ( aN ) . replace ( "])" , "~|])" ) . getRegex ( ) , url : zt ( /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/ , "i" ) . replace ( "email" , /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/ ) . getRegex ( ) , _backpedal : /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/ , del : /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/ , text : /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ } , eJe = { ... _b , br : zt ( lN ) . replace ( "{2,}" , "*" ) . getRegex ( ) , text : zt ( _b . text ) . replace ( "\\b_" , "\\b_| {2,}\\n" ) . replace ( /\{2,\}/g , "*" ) . getRegex ( ) } , Gc = { normal : K0 , gfm : UZe , pedantic : BZe } , il = { normal : j0 , gfm : _b , breaks : eJe , pedantic : JZe } ; class ys { constructor ( e ) { qt ( this , "tokens" ) ; qt ( this , "options" ) ; qt ( this , "state" ) ; qt ( this , "tokenizer" ) ; qt ( this , "inlineQueue" ) ; this . tokens = [ ] , this . tokens . links = Object . create ( null ) , this . options = e || yo , this . options . tokenizer = this . options . tokenizer || new ou , this . tokenizer = this . options . tokenizer , this . tokenizer . options = this . options , this . tokenizer . lexer = this , this . inlineQueue = [ ] , this . state = { inLink : ! 1 , inRawBlock : ! 1 , top : ! 0 } ; const t = { block : Gc . normal , inline : il . normal } ; this . options . pedantic ? ( t . block = Gc
2024-10-17 11:28:01 +00:00
` ),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.options.pedantic&&(e=e.replace(/ \t /g," ").replace(/^ + $ /gm,""));let i,r,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+= `
` :t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+= `
` +i.raw,r.text+= `
` +i.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+= `
` +i.raw,r.text+= `
` +i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const c=e.slice(1);let d;this.options.extensions.startBlock.forEach(u=>{d=u.call({lexer:this},c),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){r=t[t.length-1],s&&(r==null?void 0:r.type)==="paragraph"?(r.raw+= `
` +i.raw,r.text+= `
` +i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+= `
` +i.raw,r.text+= `
2024-10-20 20:24:55 +00:00
` +i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s,i,r,o=e,a,c,d;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(d=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(s=u.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,o,d)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const _=e.slice(1);let m;this.options.extensions.startInline.forEach(h=>{m=h.call({lexer:this},_),typeof m=="number"&&m>=0&&(u=Math.min(u,m))}),u<1/0&&u>=0&&(r=e.substring(0,u+1))}if(s=this.tokenizer.inlineText(r)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(d=s.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class lu{constructor(e){qt(this,"options");qt(this,"parser");this.options=e||yo}space(e){return""}code({text:e,lang:t,escaped:s}){var o;const i=(o=(t||"").match(/^ \S */))==null?void 0:o[0],r=e.replace(/ \n $ /,"")+ `
2024-10-17 11:28:01 +00:00
` ;return i?'<pre><code class="language-'+ns(i)+'">'+(s?r:ns(r,!0))+ ` < / c o d e > < / p r e >
` :"<pre><code>"+(s?r:ns(r,!0))+ ` < / c o d e > < / p r e >
` }blockquote({tokens:e}){return ` < blockquote >
$ { this . parser . parse ( e ) } < / b l o c k q u o t e >
` }html({text:e}){return e}heading({tokens:e,depth:t}){return ` < h$ { t } > $ { this . parser . parseInline ( e ) } < / h $ { t } >
` }hr(e){return ` < hr >
` }list(e){const t=e.ordered,s=e.start;let i="";for(let a=0;a<e.items.length;a++){const c=e.items[a];i+=this.listitem(c)}const r=t?"ol":"ul",o=t&&s!==1?' start="'+s+'"':"";return"<"+r+o+ ` >
` +i+"</"+r+ ` >
` }listitem(e){let t="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" "}):t+=s+" "}return t+=this.parser.parse(e.tokens,!!e.loose), ` < li > $ { t } < / l i >
` }checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return ` < p > $ { this . parser . parseInline ( e ) } < / p >
` }table(e){let t="",s="";for(let r=0;r<e.header.length;r++)s+=this.tablecell(e.header[r]);t+=this.tablerow({text:s});let i="";for(let r=0;r<e.rows.length;r++){const o=e.rows[r];s="";for(let a=0;a<o.length;a++)s+=this.tablecell(o[a]);i+=this.tablerow({text:s})}return i&&(i= ` < tbody > $ { i } < / t b o d y > ` ) , ` < t a b l e >
< thead >
` +t+ ` < / t h e a d >
` +i+ ` < / t a b l e >
` }tablerow({text:e}){return ` < tr >
$ { e } < / t r >
` }tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align? ` < $ { s } align = "${e.align}" > ` : ` < $ { s } > ` )+t+ ` < / $ { s } >
2024-10-20 20:24:55 +00:00
` }strong({tokens:e}){return ` < strong > $ { this . parser . parseInline ( e ) } < / s t r o n g > ` } e m ( { t o k e n s : e } ) { r e t u r n ` < e m > $ { t h i s . p a r s e r . p a r s e I n l i n e ( e ) } < / e m > ` } c o d e s p a n ( { t e x t : e } ) { r e t u r n ` < c o d e > $ { e } < / c o d e > ` } b r ( e ) { r e t u r n " < b r > " } d e l ( { t o k e n s : e } ) { r e t u r n ` < d e l > $ { t h i s . p a r s e r . p a r s e I n l i n e ( e ) } < / d e l > ` } l i n k ( { h r e f : e , t i t l e : t , t o k e n s : s } ) { c o n s t i = t h i s . p a r s e r . p a r s e I n l i n e ( s ) , r = t C ( e ) ; i f ( r = = = n u l l ) r e t u r n i ; e = r ; l e t o = ' < a h r e f = " ' + e + ' " ' ; r e t u r n t & & ( o + = ' t i t l e = " ' + t + ' " ' ) , o + = " > " + i + " < / a > " , o } i m a g e ( { h r e f : e , t i t l e : t , t e x t : s } ) { c o n s t i = t C ( e ) ; i f ( i = = = n u l l ) r e t u r n s ; e = i ; l e t r = ` < i m g s r c = " $ { e } " a l t = " $ { s } " ` ; r e t u r n t & & ( r + = ` t i t l e = " $ { t } " ` ) , r + = " > " , r } t e x t ( e ) { r e t u r n " t o k e n s " i n e & & e . t o k e n s ? t h i s . p a r s e r . p a r s e I n l i n e ( e . t o k e n s ) : e . t e x t } } c l a s s Q 0 { s t r o n g ( { t e x t : e } ) { r e t u r n e } e m ( { t e x t : e } ) { r e t u r n e } c o d e s p a n ( { t e x t : e } ) { r e t u r n e } d e l ( { t e x t : e } ) { r e t u r n e } h t m l ( { t e x t : e } ) { r e t u r n e } t e x t ( { t e x t : e } ) { r e t u r n e } l i n k ( { t e x t : e } ) { r e t u r n " " + e } i m a g e ( { t e x t : e } ) { r e t u r n " " + e } b r ( ) { r e t u r n " " } } c l a s s E s { c o n s t r u c t o r ( e ) { q t ( t h i s , " o p t i o n s " ) ; q t ( t h i s , " r e n d e r e r " ) ; q t ( t h i s , " t e x t R e n d e r e r " ) ; t h i s . o p t i o n s = e | | y o , t h i s . o p t i o n s . r e n d e r e r = t h i s . o p t i o n s . r e n d e r e r | | n e w l u , t h i s . r e n d e r e r = t h i s . o p t i o n s . r e n d e r e r , t h i s . r e n d e r e r . o p t i o n s = t h i s . o p t i o n s , t h i s . r e n d e r e r . p a r s e r = t h i s , t h i s . t e x t R e n d e r e r = n e w Q 0 } s t a t i c p a r s e ( e , t ) { r e t u r n n e w E s ( t ) . p a r s e ( e ) } s t a t i c p a r s e I n l i n e ( e , t ) { r e t u r n n e w E s ( t ) . p a r s e I n l i n e ( e ) } p a r s e ( e , t = ! 0 ) { l e t s = " " ; f o r ( l e t i = 0 ; i < e . l e n g t h ; i + + ) { c o n s t r = e [ i ] ; i f ( t h i s . o p t i o n s . e x t e n s i o n s & & t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s & & t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s [ r . t y p e ] ) { c o n s t a = r , c = t h i s . o p t i o n s . e x t e n s i o n s . r e n d e r e r s [ a . t y p e ] . c a l l ( { p a r s e r : t h i s } , a ) ; i f ( c ! = = ! 1 | | ! [ " s p a c e " , " h r " , " h e a d i n g " , " c o d e " , " t a b l e " , " b l o c k q u o t e " , " l i s t " , " h t m l " , " p a r a g r a p h " , " t e x t " ] . i n c l u d e s ( a . t y p e ) ) { s + = c | | " " ; c o n t i n u e } } c o n s t o = r ; s w i t c h ( o . t y p e ) { c a s e " s p a c e " : { s + = t h i s . r e n d e r e r . s p a c e ( o ) ; c o n t i n u e } c a s e " h r " : { s + = t h i s . r e n d e r e r . h r ( o ) ; c o n t i n u e } c a s e " h e a d i n g " : { s + = t h i s . r e n d e r e r . h e a d i n g ( o ) ; c o n t i n u e } c a s e " c o d e " : { s + = t h i s . r e n d e r e r . c o d e ( o ) ; c o n t i n u e } c a s e " t a b l e " : { s + = t h i s . r e n d e r e r . t a b l e ( o ) ; c o n t i n u e } c a s e " b l o c k q u o t e " : { s + = t h i s . r e n d e r e r . b l o c k q u o t e ( o ) ; c o n t i n u e } c a s e " l i s t " : { s + = t h i s . r e n d e r e r . l i s t ( o ) ; c o n t i n u e } c a s e " h t m l " : { s + = t h i s . r e n d e r e r . h t m l ( o ) ; c o n t i n u e } c a s e " p a r a g r a p h " : { s + = t h i s . r e n d e r e r . p a r a g r a p h ( o ) ; c o n t i n u e } c a s e " t e x t " : { l e t a = o , c = t h i s . r e n d e r e r . t e x t ( a ) ; f o r ( ; i + 1 < e . l e n g t h & & e [ i + 1 ] . t y p e = = = " t e x t " ; ) a = e [ + + i ] , c + = `
2024-10-20 21:50:56 +00:00
` +this.renderer.text(a);t?s+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c}]}):s+=c;continue}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,t){t=t||this.renderer;let s="";for(let i=0;i<e.length;i++){const r=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}const o=r;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}}class Ml{constructor(e){qt(this,"options");qt(this,"block");this.options=e||yo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ys.lex:ys.lexInline}provideParser(){return this.block?Es.parse:Es.parseInline}}qt(Ml,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class tJe{constructor(...e){qt(this,"defaults",q0());qt(this,"options",this.setOptions);qt(this,"parse",this.parseMarkdown(!0));qt(this,"parseInline",this.parseMarkdown(!1));qt(this,"Parser",Es);qt(this,"Renderer",lu);qt(this,"TextRenderer",Q0);qt(this,"Lexer",ys);qt(this,"Tokenizer",ou);qt(this,"Hooks",Ml);this.use(...e)}walkTokens(e,t){var i,r;let s=[];for(const o of e)switch(s=s.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const c of a.header)s=s.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const d of c)s=s.concat(this.walkTokens(d.tokens,t));break}case"list":{const a=o;s=s.concat(this.walkTokens(a.items,t));break}default:{const a=o;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const d=a[c].flat(1/0);s=s.concat(this.walkTokens(d,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let c=r.renderer.apply(this,a);return c===!1&&(c=o.apply(this,a)),c}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),s.renderer){const r=this.defaults.renderer||new lu(this.defaults);for(const o in s.renderer){if(!(o in r))throw new Error( ` renderer '${o}' does not exist ` );if(["options","parser"].includes(o))continue;const a=o,c=s.renderer[a],d=r[a];r[a]=(...u)=>{let _=c.apply(r,u);return _===!1&&(_=d.apply(r,u)),_||""}}i.renderer=r}if(s.tokenizer){const r=this.defaults.tokenizer||new ou(this.defaults);for(const o in s.tokenizer){if(!(o in r))throw new Error( ` tokenizer '${o}' does not exist ` );if(["options","rules","lexer"].includes(o))continue;const a=o,c=s.tokenizer[a],d=r[a];r[a]=(...u)=>{let _=c.apply(r,u);return _===!1&&(_=d.apply(r,u)),_}}i.tokenizer=r}if(s.hooks){const r=this.defaults.hooks||new Ml;for(const o in s.hooks){if(!(o in r))throw new Error( ` hook ' $
Please report this to https : //github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+ns(s.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}}}const po=new tJe;function Pt(n,e){return po.parse(n,e)}Pt.options=Pt.setOptions=function(n){return po.setOptions(n),Pt.defaults=po.defaults,tN(Pt.defaults),Pt};Pt.getDefaults=q0;Pt.defaults=yo;Pt.use=function(...n){return po.use(...n),Pt.defaults=po.defaults,tN(Pt.defaults),Pt};Pt.walkTokens=function(n,e){return po.walkTokens(n,e)};Pt.parseInline=po.parseInline;Pt.Parser=Es;Pt.parser=Es.parse;Pt.Renderer=lu;Pt.TextRenderer=Q0;Pt.Lexer=ys;Pt.lexer=ys.lex;Pt.Tokenizer=ou;Pt.Hooks=Ml;Pt.parse=Pt;Pt.options;Pt.setOptions;Pt.use;Pt.walkTokens;Pt.parseInline;Es.parse;ys.lex;const nJe={name:"HelpView",data(){return{helpSections:[]}},methods:{toggleSection(n){this.helpSections[n].isOpen=!this.helpSections[n].isOpen},async loadMarkdownFile(n){try{const t=await(await fetch(`/help/${n}`)).text();return Pt(t)}catch(e){return console.error("Error loading markdown file:",e),"Error loading help content."}},async loadHelpSections(){const n=[{title:"About LoLLMs",file:"lollms-context.md"},{title:"Getting Started",file:"getting-started.md"},{title:"Uploading Files",file:"uploading-files.md"},{title:"Sending Images",file:"sending-images.md"},{title:"Using Code Interpreter",file:"code-interpreter.md"},{title:"Internet Search",file:"internet-search.md"}];for(const e of n){const t=await this.loadMarkdownFile(e.file);this.helpSections.push({title:e.title,content:t,isOpen:!1})}}},mounted(){this.loadHelpSections()}},sJe={class:"help-view background-color p-6 w-full"},iJe={class:"big-card w-full"},rJe={class:"help-sections-container"},oJe={class:"help-sections space-y-4"},aJe=["onClick"],lJe={class:"toggle-icon"},cJe={key:0,class:"help-content mt-4"},dJe=["innerHTML"];function uJe(n,e,t,s,i,r){return T(),w("div",sJe,[l("div",iJe,[e[0]||(e[0]=l("h1",{class:"text-4xl md:text-5xl font-bold text-gray-800 dark:text-gray-100 mb-6"},"LoLLMs Help",-1)),l("div",rJe,[l("div",oJe,[(T(!0),w(Be,null,Xe(i.helpSections,(o,a)=>(T(),w("div",{key:a,class:"help-section message"},[l("h2",{onClick:c=>r.toggleSection(a),class:"menu-item cursor-pointer flex justify-between items-center"},[Ze($(o.title)+" ",1),l("span",lJe,$(o.isOpen?"▼":"▶"),1)],8,aJe),o.isOpen?(T(),w("div",cJe,[l("div",{innerHTML:o.content,class:"prose dark:prose-invert"},null,8,dJe)])):B("",!0)]))),128))])])])])}const pJe=st(nJe,[["render",uJe],["__scopeId","data-v-8c1798f3"]]);function si(n,e=!0,t=1){const s=e?1e3:1024;if(Math.abs(n)<s)return n+" B";const i=e?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let r=-1;const o=10**t;do n/=s,++r;while(Math.round(Math.abs(n)*o)/o>=s&&r<i.length-1);return n.toFixed(t)+" "+i[r]}const Ls="/assets/logo-CA_sh1Fo.png",fJe={props:{title:{type:String,required:!1,value:"menu"},icon:{type:String,required:!1,value:"feather:menu"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(n){const e=this.$refs.menu,t=this.$refs.menuButton;e&&!e.contains(n.target)&&!t.contains(n.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),De(()=>{Ge.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClien
2024-09-29 19:46:45 +00:00
` ,this.configFile.start_user_header_id_template="!@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="!@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="lollms_simplified"?(console.log("Using lollms template"),this.configFile.start_header_id_template="@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="bare"?(console.log("Using lollms template"),this.configFile.start_header_id_template="",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
2024-10-20 20:24:55 +00:00
` ,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"?(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="[INST]",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="[/INST]",this.configFile.start_ai_header_id_template="[INST]",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="[/INST]",this.settingsChanged=!0):e==="deepseek"&&(console.log("Using deepseek template"),this.configFile.start_header_id_template="",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template= `
` ,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0)},install_model(){},reinstallDiffusersService(){Z.post("/install_diffusers",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeDiffusersService(){Z.post("install_diffusers",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallXTTSService(){Z.post("install_xtts",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallWhisperService(){Z.post("install_whisper",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallSDService(){Z.post("/install_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){Z.post("upgrade_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},startSDService(){Z.post("start_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},showSD(){Z.post("show_sd",{client_id:this. $ store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){Z.post("install_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){Z.post("upgrade_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){Z.post("start_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){Z.post("show_comfyui",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Z.post("install_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Z.post("start_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Z.post("start_ollama",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Z.post("install_petals",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Z.post("install_ollama",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Z.post("install_vllm",{client_id:this. $ store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Z.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10<this.models_zoo.length?this.models_zoo_initialLoadCount+=10:this.models_zoo_initialLoadCount=this.models_zoo.length},async modelsZooToggleCollapse(){this.mzc_collapsed=!this.mzc_collapsed,De(()=>{Ge.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this. $ store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this. $ store.state.sort_type=n,this.updateModelsZoo(),console.log( ` Selected sorting : $ { n } ` ),console.log( ` models : $ { this . models _zoo } ` )},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(console.log("voice synthesis"),this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_u
2024-09-29 19:46:45 +00:00
` +e.model.name+ `
2024-10-01 21:21:12 +00:00
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")}}else Ye.off("install_progress",s),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",i.error),this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +e.model.name+ `
2024-10-20 20:24:55 +00:00
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage");console.log("Here")};Ye.on("install_progress",s),Ye.emit("install_model",{path:t,name:e.model.name,variant_name:this.selected_variant.name,type:e.model.type}),console.log("Started installation, please wait")},resetLogo(){this.configFile.app_custom_logo="",this.settingsChanged=!0},resetAvatar(){this.configFile.user_avatar="",this.settingsChanged=!0},uploadLogo(n){const e=n.target.files[0],t=new FormData;t.append("logo",e),console.log("Uploading logo"),Z.post("/upload_logo",t).then(s=>{console.log("Logo uploaded successfully"),this. $ store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.app_custom_logo=i,this. $ store.state.config.app_custom_logo=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},uploadAvatar(n){const e=n.target.files[0],t=new FormData;t.append("avatar",e),console.log("Uploading avatar"),Z.post("/upload_avatar",t).then(s=>{console.log("Avatar uploaded successfully"),this. $ store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.user_avatar=i,this. $ store.state.config.user_avatar=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},async update_software(){console.log("Posting");const n=await this.api_post_req("update_software");console.log("Posting done"),n.status?this. $ store.state.toast.showToast("Success!",4,!0):this. $ store.state.toast.showToast("Failure!",4,!1)},async restart_software(){console.log("Posting");const n=await this.api_post_req("restart_program");console.log("Posting done"),n.status?this. $ store.state.toast.showToast("Success!",4,!0):this. $ store.state.toast.showToast("Failure!",4,!1)},on_loading_text(n){console.log("Loading text",n),this.loading_text=n},async load_everything(){for(this.isLoading=!0,De(()=>{Ge.replace()});this.isReady===!1;)await new Promise(n=>setTimeout(n,100));this.refresh(),console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category"),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this. $ store.state.personalities.filter(n=>n.category===this.configFile.personality_category),this.modelsFiltered=[],this.updateModelsZoo(),this.isLoading=!1,this.isMounted=!0,console.log("READY Stuff")},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(n){if(console.log("received something"),n.status==="progress"){if(this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(console.log("model entry",t),t.installing=!0,t.progress=n.progress,console.log( ` Progress = $ { n . progress } ` ),n.progress>=100?(t.installing=!1,t.isInstalled=!0):(t.installing=!0,t.isInstalled=!0))}}else if(n.status==="succeeded"){if(console.log("Received succeeded"),this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];n.progress>=100&&(t.installing=!1,t.isInstalled=!0)}if(console.log("Installed successfully"),this. $ refs.modelZoo){const e=this. $ refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!0)}this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +model_object.name+ `
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")}else if(n.status==="failed"&&(console.log("Install failed"),this. $ refs.modelZoo)){const e=this. $ refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!1),console.error("Installation failed:",n.error),this. $ store.state.toast.showToast( ` Model :
` +model_object.name+ `
2024-10-01 21:21:12 +00:00
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this. $ refs.addmodeldialog.showDialog("").then(()=>{console.log(this. $ refs.addmodeldialog.model_path);const n=this. $ refs.addmodeldialog.model_path;Ye.emit("install_model",{path:n,type:this.models_zoo[0].type},e=>{console.log("Model installation successful:",e)}),console.log(this. $ refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(n){this.servers_conf_collapsed=n,this.mainconf_collapsed=n,this.bec_collapsed=n,this.mzc_collapsed=n,this.pzc_collapsed=n,this.bzc_collapsed=n,this.pc_collapsed=n,this.mc_collapsed=n,this.sc_collapsed=n,this.mzdc_collapsed=n},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(n=>{this.persCatgArr=n,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(n=>{this.persArr=n,this.persArr.sort(),console.log( ` Listed personalities :
2024-09-29 19:46:45 +00:00
$ { n } ` )})},fetchHardwareInfos(){this. $ store.dispatch("refreshDiskUsage"),this. $ store.dispatch("refreshRamUsage")},async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this. $ store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this. $ store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this. $ store.state.toast.showToast( ` Selected personality :
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
2024-10-20 20:24:55 +00:00
` +n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);De(()=>{Ge.replace()})}},onModelSelected(n){if(this.isLoading){this. $ store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this. $ store.state.toast.showToast( ` Selected model :
` +n.name,4,!0),De(()=>{Ge.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this. $ store.commit("setIsModelOk",t)})):(this. $ store.state.toast.showToast( ` Couldn ' t select model :
` +n.name,4,!1),De(()=>{Ge.replace()})),this.settingsChanged=!0,this.isModelSelected=!0}):this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +n.model.name+ `
2024-10-20 20:24:55 +00:00
is not installed ` ,4,!1),De(()=>{Ge.replace()}))},onCopy(n){let e;n.model.isCustomModel?e= ` Model name : $ { n . name }
2024-09-29 19:46:45 +00:00
File size : $ { n . fileSize }
Manually downloaded model ` :e= ` Model name : $ { n . name }
File size : $ { n . fileSize }
Download : $ { "https://huggingface.co/" + n . quantizer + "/" + n . name }
License : $ { n . license }
Owner : $ { n . quantizer }
Website : $ { "https://huggingface.co/" + n . quantizer }
2024-10-01 21:21:12 +00:00
Description : $ { n . description } ` ,this. $ store.state.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(n){this. $ store.state.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText(n.model.name)},onCopyPersonalityName(n){this. $ store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async onCopyToCustom(n){await Z.post("/copy_to_custom_personas",{client_id:this. $ store.state.client_id,category:n.personality.category,name:n.personality.name})},async handleOpenFolder(n){await Z.post("/open_personality_folder",{client_id:this. $ store.state.client_id,personality_folder:n.personality.category/n.personality.folder})},onCancelInstall(){const n=this.addModel;console.log("cancel install",n),this.modelDownlaodInProgress=!1,this.addModel={},Ye.emit("cancel_install",{model_name:n.model_name,binding_folder:n.binding_folder,model_url:n.model_url,patreon:n.patreon?n.patreon:"None"}),this. $ store.state.toast.showToast("Model installation aborted",4,!1)},onInstall(n){this.variant_choices=n.model.variants,this.currenModelToInstall=n,console.log("variant_choices"),console.log(this.variant_choices),console.log(n),this.variantSelectionDialogVisible=!0},onCreateReference(){Z.post("/add_reference_to_local_model",{path:this.reference_path}).then(n=>{n.status?(this. $ store.state.toast.showToast("Reference created",4,!0),this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoofalse})):this. $ store.state.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this. $ store.state.toast.showToast("Link is empty",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ye.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +this.addModel.model_name+ `
2024-10-01 21:21:12 +00:00
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage"))):(Ye.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +this.addModel.model_name+ `
2024-10-01 21:21:12 +00:00
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};Ye.on("install_progress",e),Ye.emit("install_model",{path:n,type:this.models_zoo[0].type}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this. $ store.state.toast.showToast("No files to upload",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ye.off("progress",e),console.log("Installed successfully"),this.addModel={},this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +this.addModel.model_name+ `
2024-10-01 21:21:12 +00:00
installed ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage"))):(Ye.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +this.addModel.model_name+ `
2024-10-01 21:21:12 +00:00
failed to install ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};Ye.on("progress",e),console.log("Started installation, please wait")},setFileList(n){this.uploadData=n.target.files,console.log("set file list",this.uploadData)},onUninstall(n){this. $ store.state.yesNoDialog.askQuestion( ` Are you sure you want to delete this model ?
[ ` +n.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const t=s=>{console.log("uninstalling res",s),s.status?(console.log("uninstalling success",s),n.uninstalling=!1,Ye.off("install_progress",t),this.showProgress=!1,this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoo=!1}),this.modelsFiltered=this.models_zoo,this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +n.model.name+ `
2024-10-01 21:21:12 +00:00
was uninstalled ! ` ,4,!0),this. $ store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",s),n.uninstalling=!1,this.showProgress=!1,Ye.off("uninstall_progress",t),console.error("Uninstallation failed:",s.error),this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +n.model.name+ `
2024-10-01 21:21:12 +00:00
failed to uninstall ! ` ,4,!1),this. $ store.dispatch("refreshDiskUsage"))};Ye.on("uninstall_progress",t),this.selected_variant!=null?Ye.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name+"/resolve/main/"+this.selected_variant.name,type:n.model.type}):Ye.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,type:n.model.type})}})},onBindingSelected(n){if(console.log("Binding selected"),!n.binding.installed){this. $ store.state.toast.showToast( ` Binding is not installed :
2024-09-29 19:46:45 +00:00
` +n.binding.name,4,!1);return}this.mzc_collapsed=!0,this.configFile.binding_name!=n.binding.folder&&(this.update_binding(n.binding.folder),this.binding_changed=!0),this.api_get_req("get_model_status").then(e=>{this. $ store.commit("setIsModelOk",e)})},onInstallBinding(n){this.configFile.binding_name!=n.binding.folder?(this.isLoading=!0,n.disclaimer&&this. $ store.state.yesNoDialog.askQuestion(n.disclaimer,"Proceed","Cancel"),Z.post("/install_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("install_binding",e),e.data.status?(this. $ store.state.toast.showToast("Binding installed successfully!",4,!0),this. $ store.state.messageBox.showMessage( ` It is advised to reboot the application after installing a binding .
Page will refresh in 5 s . ` ),setTimeout(()=>{window.location.href="/"},5e3)):this. $ store.state.toast.showToast("Could not reinstall binding",4,!1),this.isLoading=!1,e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall binding
` +e.message,4,!1),{status:!1}))):this.update_binding(n.binding.folder)},onUnInstallBinding(n){this.isLoading=!0,Z.post("/unInstall_binding",{name:n.binding.folder}).then(e=>{if(e){if(this.isLoading=!1,console.log("unInstall_binding",e),e.data.status){const t=this.bindingsZoo.findIndex(i=>i.folder==n.binding.folder),s=this.bindingsZoo[t];s?s.installed=!0:s.installed=!1,this.settingsChanged=!0,this.binding_changed=!0,this. $ store.state.toast.showToast("Binding uninstalled successfully!",4,!0)}else this. $ store.state.toast.showToast("Could not uninstall binding",4,!1);return e.data}this.isLoading=!1,n.isInstalled=False}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not uninstall binding
` +e.message,4,!1),{status:!1}))},onReinstallBinding(n){this.isLoading=!0,Z.post("/reinstall_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_binding",e),e.data.status?(this. $ store.state.toast.showToast("Binding reinstalled successfully!",4,!0),this. $ store.state.messageBox.showMessage("It is advised to reboot the application after installing a binding")):this. $ store.state.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall binding
` +e.message,4,!1),{status:!1}))},onSettingsBinding(n){try{this.isLoading=!0,Z.get("/get_active_binding_settings").then(e=>{console.log(e),this.isLoading=!1,e&&(console.log("binding setting",e),e.data&&Object.keys(e.data).length>0?this. $ store.state.universalForm.showForm(e.data,"Binding settings - "+n.binding.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_binding_settings",{client_id:this. $ store.state.client_id,settings:t},{headers:this.posts_headers}).then(s=>{s&&s.data?(console.log("binding set with new settings",s.data),this. $ store.state.toast.showToast("Binding settings updated successfully!",4,!0),Z.post("/update_binding_settings",{client_id:this. $ store.state.client_id}).then(i=>{this. $ store.state.toast.showToast("Binding settings committed successfully!",4,!0),window.location.href="/"})):(this. $ store.state.toast.showToast( ` Did not get binding settings responses .
` +s,4,!1),this.isLoading=!1)})}catch(s){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
Endpoint error : ` +s.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+e.message,4,!1)}},onReloadBinding(n){console.log("Reloading binding"),this.isLoading=!0,Z.post("/reload_binding",{name:n.binding.folder},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reload_binding",e),e.data.status?this. $ store.state.toast.showToast("Binding reloaded successfully!",4,!0):this. $ store.state.toast.showToast("Could not reload binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reload binding
` +e.message,4,!1),{status:!1}))},onSettingsPersonality(n){try{this.isLoading=!0,Z.get("/get_active_personality_settings").then(e=>{this.isLoading=!1,e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this. $ store.state.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this. $ store.state.toast.showToast("Personality settings updated successfully!",4,!0)):(this. $ store.state.toast.showToast( ` Did not get Personality settings responses .
` +s,4,!1),this.isLoading=!1)})}catch(s){this. $ store.state.toast.showToast( ` Did not get Personality settings responses .
Endpoint error : ` +s.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_category(n,e){this.personality_category=n,e()},refresh(){console.log("Refreshing"),this. $ store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(n=>{console.log("cats",n),this.persCatgArr=n,this.personalitiesFiltered=this. $ store.state.personalities.filter(e=>e.category===this.personality_category),this.personalitiesFiltered.sort()})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(n,e,t){this.isLoading=!0;const s={client_id:this. $ store.state.client_id,setting_name:n,setting_value:e};console.log("Updating setting",n,":",e);let i=await Z.post("/update_setting",s,{headers:this.posts_headers});if(i)return this.isLoading=!1,console.log("update_setting",i),i.status?this. $ store.state.toast.showToast( ` Setting updated successfully .
` ,4,!0):this. $ store.state.toast.showToast( ` Setting update failed .
2024-10-20 20:24:55 +00:00
Please view the console for more details . ` ,4,!1),t!==void 0&&t(i),i.data;this.isLoading=!1},async refreshModelsZoo(){this.models_zoo=[],console.log("refreshing models"),this.is_loading_zoo=!0,await this. $ store.dispatch("refreshModelsZoo"),console.log("ModelsZoo refreshed"),await this. $ store.dispatch("refreshModels"),console.log("Models refreshed"),this.updateModelsZoo(),console.log("Models updated"),this.is_loading_zoo=!1},async updateModelsZoo(){let n=this. $ store.state.modelsZoo;if(n.length!=0){console.log( ` REFRESHING models using sorting $ { this . sort _type } ` ),n.length>1?(this.sort_type==0?(n.sort((e,t)=>{const s=new Date(e.last_commit_time);return new Date(t.last_commit_time)-s}),console.log("Sorted")):this.sort_type==1?n.sort((e,t)=>t.rank-e.rank):this.sort_type==2?n.sort((e,t)=>e.name.localeCompare(t.name)):this.sort_type==3&&n.sort((e,t)=>e.name.localeCompare(t.name)),console.log("Sorted")):console.log("No sorting needed"),n.forEach(e=>{e.name==this. $ store.state.config.model_name?e.selected=!0:e.selected=!1}),console.log("Selected models");for(let e=0;e<this. $ store.state.modelsArr.length;e++){const t=this. $ store.state.modelsArr[e];let s=n.findIndex(i=>i.name==t);if(s==-1)for(let i=0;i<n.length;i++){let r=n[i].variants;if(r!=null&&(s=r.findIndex(o=>o.name==t),s!=-1)){s=i,console.log( ` Found $ { t } at index $ { s } ` );break}}if(s==-1){let i={};i.name=t,i.icon=this.imgBinding,i.isCustomModel=!0,i.isInstalled=!0,n.push(i)}else n[s].isInstalled=!0}console.log("Determined models"),n.sort((e,t)=>e.isInstalled&&!t.isInstalled?-1:!e.isInstalled&&t.isInstalled?1:0),console.log("Done"),this.models_zoo=this. $ store.state.modelsZoo}},update_binding(n){this.isLoading=!0,this. $ store.state.modelsZoo=[],this.configFile.model_name=null,this. $ store.state.config.model_name=null,console.log("updating binding_name"),this.update_setting("binding_name",n,async e=>{console.log("updated binding_name"),await this. $ store.dispatch("refreshConfig"),this.models_zoo=[],this.mzc_collapsed=!0;const t=this.bindingsZoo.findIndex(i=>i.folder==n),s=this.bindingsZoo[t];s?s.installed=!0:s.installed=!1,this.settingsChanged=!0,this.isLoading=!1,De(()=>{Ge.replace()}),console.log("updating model"),this.update_model(null).then(()=>{}),De(()=>{Ge.replace()})}),De(()=>{Ge.replace()})},async update_model(n){n||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",n);return this.isLoading=!1,De(()=>{Ge.replace()}),e},async cancelConfiguration(){await this. $ store.dispatch("refreshConfig"),this.settingsChanged=!1},applyConfiguration(){this.isLoading=!0,Z.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this.configFile},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),De(()=>{Ge.replace()})})},save_configuration(){this.showConfirmation=!1,Z.post("/save_settings",{},{headers:this.posts_headers}).then(n=>{if(n)return n.status||this. $ store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this. $ store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},reset_configuration(){this. $ store.state.yesNoDialog.askQuestion( ` Are you sure ?
2024-09-29 19:46:45 +00:00
This will delete all your configurations and get back to default configuration . ` ).then(n=>{n&&Z.post("/reset_settings",{},{headers:this.posts_headers}).then(e=>{if(e)return e.status?this. $ store.state.messageBox.showMessage("Settings have been reset correctly"):this. $ store.state.messageBox.showMessage("Couldn't reset settings!"),e.data}).catch(e=>(console.log(e.message,"reset_configuration"),this. $ store.state.messageBox.showMessage("Couldn't reset settings!"),{status:!1}))})},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - settings");return}},async api_post_req(n){try{const e=await Z.post("/"+n,{client_id:this. $ store.state.client_id});if(e)return e.data}catch(e){console.log(e.message,"api_post_req - settings");return}},closeToast(){this.showToast=!1},async getPersonalitiesArr(){this.isLoading=!0,this. $ store.state.personalities=[];const n=await this.api_get_req("get_all_personalities"),e=this. $ store.state.config;console.log("recovering all_personalities");const t=Object.keys(n);for(let s=0;s<t.length;s++){const i=t[s],o=n[i].map(a=>{const c=e.personalities.includes(i+"/"+a.folder);let d={};return d=a,d.category=i,d.language="",d.full_path=i+"/"+a.folder,d.isMounted=c,d});this. $ store.state.personalities.length==0?this. $ store.state.personalities=o:this. $ store.state.personalities=this. $ store.state.personalities.concat(o)}this. $ store.state.personalities.sort((s,i)=>s.name.localeCompare(i.name)),this.personalitiesFiltered=this. $ store.state.personalities.filter(s=>s.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),console.log("per filtered",this.personalitiesFiltered),this.isLoading=!1},async filterPersonalities(){if(!this.searchPersonality){this.personalitiesFiltered=this. $ store.state.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),this.searchPersonalityInProgress=!1;return}const n=this.searchPersonality.toLowerCase(),e=this. $ store.state.personalities.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.full_path&&t.full_path.toLowerCase().includes(n))return t});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this. $ store.state.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterModels(){const n=this.searchModel.toLowerCase();this.is_loading_zoo=!0,console.log("filtering models"),console.log(this.models_zoo);const e=this.models_zoo.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.category&&t.category.toLowerCase().includes(n))return t});this.is_loading_zoo=!1,e.length>0?this.modelsFiltered=e:this.modelsFiltered=[],this.searchModelInProgress=!1},computedFileSize(n){return si(n)},async mount_personality(n){if(!n)return{status:!1,error:"no personality - mount_personality"};try{const e={client_id:this. $ store.state.client_id,language:n.language?n.language:"",category:n.category?n.category:"",folder:n.folder?n.folder:""},t=await Z.post("/mount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await Z.post("/unmount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};let e=n.language==null?n.full_path:n.full_path+":"+n.language;console.log("pth",e);const t=this.configFile.personalities.findIndex(i=>i===e),s={client_id:this. $ store.state.client_id,id:t};try{const i=await Z.post("/select_personality",s,{headers:this.posts_headers});if(i)return this.
` +n.personality.name,4,!0),this. $ store.dispatch("refreshMountedPersonalities")):(n.isMounted=!1,this. $ store.state.toast.showToast( ` Could not mount personality
Error : ` +e.error+ `
Response :
` +e,4,!1)),this.isLoading=!1},async unmountAll(){await Z.post("/unmount_all_personalities",{client_id:this. $ store.state.client_id},{headers:this.posts_headers}),this. $ store.dispatch("refreshMountedPersonalities"),this. $ store.dispatch("refreshConfig"),this. $ store.state.toast.showToast("All personas unmounted",4,!0)},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0);const t=this. $ store.state.personalities.findIndex(a=>a.full_path==n.full_path),s=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),i=this. $ refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this. $ store.state.personalities[t]),this. $ store.state.personalities[t].isMounted=!1,s>-1&&(this.personalitiesFiltered[s].isMounted=!1),i>-1&&(this. $ refs.personalitiesZoo[i].isMounted=!1),this. $ store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +r.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1);this.isLoading=!1},editPersonality(n){n=n.personality,Z.post("/get_personality_config",{client_id:this. $ store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this. $ store.state.currentPersonConfig=t.config,this. $ store.state.showPersonalityEditor=!0,this. $ store.state.personality_editor.showPanel(),this. $ store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},copyToCustom(n){n=n.personality,Z.post("/copy_to_custom_personas",{category:n.category,name:n.folder}).then(e=>{e.status?(this. $ store.state.messageBox.showMessage( ` Personality copied to the custom personalities folder :
Now it ' s up to you to modify it , enhance it , and maybe even share it .
Feel free to add your name as an author , but please remember to keep the original creator ' s name as well .
You have the freedom to give , sell , or keep the personas you create for yourself .
The possibilities are endless , they are now yours to mold and customize as you see fit . ` ),this. $ store.dispatch("refreshPersonalitiesZoo")):this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
Verify that the personality is not already copied there . ` ,4,!1)}).catch(e=>{this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
` ,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),Z.post("/reinstall_personality",{client_id:this. $ store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this. $ store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this. $ store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall personality
2024-10-08 20:05:25 +00:00
` +e.message,4,!1),{status:!1}))},personalityImgPlacehodler(n){n.target.src=Us},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){this.filterModels()}},async mounted(){console.log("Getting voices"),this.getVoices(),console.log("Constructing"),this.load_everything(),this.getSeviceVoices();try{console.log("Loading input devices list");const n=await Z.get("/get_snd_input_devices");this.snd_input_devices=n.data.device_names,this.snd_input_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list input devices")}try{console.log("Loading output devices list");const n=await Z.get("/get_snd_output_devices");this.snd_output_devices=n.data.device_names,this.snd_output_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list output devices")}try{if(console.log("Getting comfyui models"),this.configFile.activate_lollms_tti_server&&this.configFile.active_tti_service=="comfyui"){const n=await Z.get("/list_comfyui_models");n.data.status&&(this.comfyui_models=n.data.models)}}catch{console.log("Couldin't list output devices")}this.fetchElevenLabsVoices()},activated(){},computed:{full_template:{get(){return(this.configFile.start_header_id_template+this.configFile.system_message_template+this.configFile.end_header_id_template+" system message"+this.configFile.separator_template+this.configFile.start_user_header_id_template+"user name"+this.configFile.end_user_header_id_template+" User prompt"+this.configFile.separator_template+this.configFile.end_user_message_id_template+this.configFile.separator_template+this.configFile.start_ai_header_id_template+"ai personality"+this.configFile.end_ai_header_id_template+"ai response"+this.configFile.end_ai_message_id_template).replace( `
2024-10-20 22:07:51 +00:00
` ,"<br>")}},rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return Ls;try{return this. $ refs.bindingZoo[this. $ refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)]. $ refs.imgElement.src}catch{return Ls}}},imgModel:{get(){try{let n=this. $ store.state.modelsZoo.findIndex(e=>e.name==this. $ store.state.selectedModel);return n>=0?(console.log( ` model avatar : $ { this . $store . state . modelsZoo [ n ] . icon } ` ),this. $ store.state.modelsZoo[n].icon):Ls}catch{console.log("error")}if(!this.isMounted)return Ls;try{return this. $ refs.bindingZoo[this. $ refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)]. $ refs.imgElement.src}catch{return Ls}}},isReady:{get(){return this. $ store.state.ready}},audio_out_voice:{get(){return this. $ store.state.config.audio_out_voice},set(n){this. $ store.state.config.audio_out_voice=n}},openaiWhisperModels(){return["whisper-1"]},whisperModels(){return["tiny.en","tiny","base.en","base","small.en","small","medium.en","medium","large-v1","large-v2","large-v3","large"]},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this. $ store.state.config},set(n){this. $ store.commit("setConfig",n)}},userName:{get(){return this. $ store.state.config.user_name},set(n){this. $ store.state.config.user_name=n}},user_avatar:{get(){return this. $ store.state.config.user_avatar!=""?"/user_infos/"+this. $ store.state.config.user_avatar:Us},set(n){this. $ store.state.config.user_avatar=n}},hardware_mode:{get(){return this. $ store.state.config.hardware_mode},set(n){this. $ store.state.config.hardware_mode=n}},auto_update:{get(){return this. $ store.state.co
2024-09-29 19:46:45 +00:00
If you are using windows , this uses wsl which requires you to have it installed or at least activated .
If You are using windows , this will install wsl so you need to activate it .
2024-10-20 21:50:56 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 0 6 ] | | ( e [ 7 0 6 ] = [ l ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 0 8 ] | | ( e [ 7 0 8 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " o l l a m a _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l O l l a m a s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , j o t , [ l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 8 3 ] | | ( e [ 3 8 3 ] = ( . . . f ) = > r . r e i n s t a l l O L L A M A S e r v i c e & & r . r e i n s t a l l O L L A M A S e r v i c e ( . . . f ) ) } , " i n s t a l l o l l a m a s e r v i c e " ) , l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 8 4 ] | | ( e [ 3 8 4 ] = ( . . . f ) = > r . s t a r t o l l a m a S e r v i c e & & r . s t a r t o l l a m a S e r v i c e ( . . . f ) ) } , " s t a r t o l l a m a s e r v i c e " ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 0 9 ] | | ( e [ 7 0 9 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " o l l a m a _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " o l l a m a b a s e u r l : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , Q o t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " o l l a m a _ b a s e _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 8 5 ] | | ( e [ 3 8 5 ] = f = > r . c o n f i g F i l e . o l l a m a _ b a s e _ u r l = f ) , o n C h a n g e : e [ 3 8 6 ] | | ( e [ 3 8 6 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . o l l a m a _ b a s e _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) , z ( a , { t i t l e : " v L L M s e r v i c e " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : I e ( ( ) = > [ l ( " t a b l e " , X o t , [ l ( " t r " , n u l l , [ e [ 7 1 1 ] | | ( e [ 7 1 1 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " e n a b l e _ v l l m _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " E n a b l e v L L M s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , Z o t , [ k ( l ( " i n p u t " , { t y p e : " c h e c k b o x " , i d : " e n a b l e _ v l l m _ s e r v i c e " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 8 7 ] | | ( e [ 3 8 7 ] = f = > r . c o n f i g F i l e . e n a b l e _ v l l m _ s e r v i c e = f ) , o n C h a n g e : e [ 3 8 8 ] | | ( e [ 3 8 8 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ q e , r . c o n f i g F i l e . e n a b l e _ v l l m _ s e r v i c e ] ] ) ] ) ] ) , l ( " t d " , n u l l , [ l ( " d i v " , { c l a s s : " h o v e r : t e x t - s e c o n d a r y d u r a t i o n - 7 5 a c t i v e : s c a l e - 9 0 p e e r - c h e c k e d : t e x t - p r i m a r y " , o n C l i c k : e [ 3 8 9 ] | | ( e [ 3 8 9 ] = f = > t h i s . $ s t o r e . s t a t e . m e s s a g e B o x . s h o w M e s s a g e ( ` A c t i v a t e s v l l m s e r v i c e . T h e s e r v i c e w i l l b e a u t o m a t i c a l l y l o a d e d a t s t a r t u p a l o w i n g y o u t o u s e t h e e l f b i n d i n g .
2024-09-29 19:46:45 +00:00
If you are using windows , this uses wsl which requires you to have it installed or at least activated .
If You are using windows , this will install wsl so you need to activate it .
2024-10-20 21:50:56 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 1 0 ] | | ( e [ 7 1 0 ] = [ l ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 2 ] | | ( e [ 7 1 2 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l v L L M s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , J o t , [ l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 9 0 ] | | ( e [ 3 9 0 ] = ( . . . f ) = > r . r e i n s t a l l v L L M S e r v i c e & & r . r e i n s t a l l v L L M S e r v i c e ( . . . f ) ) } , " i n s t a l l v L L M s e r v i c e " ) , l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 3 9 1 ] | | ( e [ 3 9 1 ] = ( . . . f ) = > r . s t a r t v L L M S e r v i c e & & r . s t a r t v L L M S e r v i c e ( . . . f ) ) } , " s t a r t v l l m s e r v i c e " ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 3 ] | | ( e [ 7 1 3 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m b a s e u r l : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , e a t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " v l l m _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 2 ] | | ( e [ 3 9 2 ] = f = > r . c o n f i g F i l e . v l l m _ u r l = f ) , o n C h a n g e : e [ 3 9 3 ] | | ( e [ 3 9 3 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . v l l m _ u r l ] ] ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 5 ] | | ( e [ 7 1 5 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " g p u m e m o r y u t i l i z a t i o n : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , t a t , [ l ( " d i v " , n a t , [ e [ 7 1 4 ] | | ( e [ 7 1 4 ] = l ( " p " , { c l a s s : " a b s o l u t e l e f t - 0 m t - 6 " } , [ l ( " l a b e l " , { f o r : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , c l a s s : " t e x t - s m f o n t - m e d i u m " } , " v l l m g p u m e m o r y u t i l i z a t i o n : " ) ] , - 1 ) ) , l ( " p " , s a t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " t e m p - v a l " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 4 ] | | ( e [ 3 9 4 ] = f = > r . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n = f ) , o n C h a n g e : e [ 3 9 5 ] | | ( e [ 3 9 5 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 2 w - 1 6 t e x t - r i g h t p - 2 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d - l g b g - g r a y - 5 0 s m : t e x t - x s f o c u s : r i n g - b l u e - 5 0 0 f o c u s : b o r d e r - b l u e - 5 0 0 d a r k : b g - g r a y - 7 0 0 d a r k : b o r d e r - g r a y - 6 0 0 d a r k : p l a c e h o l d e r - g r a y - 4 0 0 d a r k : f o c u s : r i n g - b l u e - 5 0 0 d a r k : f o c u s : b o r d e r - b l u e - 5 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n ] ] ) ] ) ] ) , k ( l ( " i n p u t " , { i d : " v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n " , o n C h a n g e : e [ 3 9 6 ] | | ( e [ 3 9 6 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , t y p e : " r a n g e " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 7 ] | | ( e [ 3 9 7 ] = f = > r . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n = f ) , m i n : " 0 . 1 0 " , m a x : " 1 " , s t e p : " 0 . 0 1 " , c l a s s : " f l e x - n o n e h - 2 m t - 1 4 m b - 2 w - f u l l b g - g r a y - 2 0 0 r o u n d e d - l g a p p e a r a n c e - n o n e c u r s o r - p o i n t e r d a r k : b g - g r a y - 7 0 0 f o c u s : r i n g - b l u e - 5 0 0 f o c u s : b o r d e r - b l u e - 5 0 0 d a r k : b o r d e r - g r a y - 6 0 0 d a r k : p l a c e h o l d e r - g r a y - 4 0 0 d a r k : f o c u s : r i n g - b l u e - 5 0 0 d a r k : f o c u s : b o r d e r - b l u e - 5 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . v l l m _ g p u _ m e m o r y _ u t i l i z a t i o n ] ] ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 6 ] | | ( e [ 7 1 6 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ m a x _ n u m _ s e q s " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m m a x n u m s e q s : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , i a t , [ k ( l ( " i n p u t " , { t y p e : " n u m b e r " , i d : " v l l m _ m a x _ n u m _ s e q s " , m i n : " 6 4 " , m a x : " 2 0 4 8 " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 3 9 8 ] | | ( e [ 3 9 8 ] = f = > r . c o n f i g F i l e . v l l m _ m a x _ n u m _ s e q s = f ) , o n C h a n g e : e [ 3 9 9 ] | | ( e [ 3 9 9 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . v l l m _ m a x _ n u m _ s e q s ] ] ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 7 ] | | ( e [ 7 1 7 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ m a x _ m o d e l _ l e n " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " m a x m o d e l l e n : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , r a t , [ k ( l ( " i n p u t " , { t y p e : " n u m b e r " , i d : " v l l m _ m a x _ m o d e l _ l e n " , m i n : " 2 0 4 8 " , m a x : " 1 0 0 0 0 0 0 " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 0 0 ] | | ( e [ 4 0 0 ] = f = > r . c o n f i g F i l e . v l l m _ m a x _ m o d e l _ l e n = f ) , o n C h a n g e : e [ 4 0 1 ] | | ( e [ 4 0 1 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . v l l m _ m a x _ m o d e l _ l e n ] ] ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 1 8 ] | | ( e [ 7 1 8 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " v l l m _ m o d e l _ p a t h " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " v l l m m o
2024-09-29 19:46:45 +00:00
If You are using windows , this will install wsl so you need to activate it .
2024-10-20 22:07:51 +00:00
< a href = 'https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/m-p/2701207' target = '_blank' > Here is how you can do that < / a > ` ) ) } , e [ 7 1 9 ] | | ( e [ 7 1 9 ] = [ l ( " i " , { " d a t a - f e a t h e r " : " h e l p - c i r c l e " , c l a s s : " w - 5 h - 5 " } , n u l l , - 1 ) ] ) ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 2 1 ] | | ( e [ 7 2 1 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " p e t a l s _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " I n s t a l l P e t a l s s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , c a t , [ l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 4 0 7 ] | | ( e [ 4 0 7 ] = ( . . . f ) = > r . r e i n s t a l l P e t a l s S e r v i c e & & r . r e i n s t a l l P e t a l s S e r v i c e ( . . . f ) ) } , " i n s t a l l p e t a l s s e r v i c e " ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 2 2 ] | | ( e [ 7 2 2 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " p e t a l s _ b a s e _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " p e t a l s b a s e u r l : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , d a t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " p e t a l s _ b a s e _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 0 8 ] | | ( e [ 4 0 8 ] = f = > r . c o n f i g F i l e . p e t a l s _ b a s e _ u r l = f ) , o n C h a n g e : e [ 4 0 9 ] | | ( e [ 4 0 9 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . p e t a l s _ b a s e _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) ] ) , _ : 1 } ) , z ( a , { t i t l e : " T T V s e t t i n g s " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : I e ( ( ) = > [ l ( " t a b l e " , u a t , [ l ( " t r " , n u l l , [ e [ 7 2 3 ] | | ( e [ 7 2 3 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " l u m a l a b s _ k e y " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " L u m a l a b s k e y : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , p a t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " l u m a l a b s _ k e y " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 0 ] | | ( e [ 4 1 0 ] = f = > r . c o n f i g F i l e . l u m a l a b s _ k e y = f ) , o n C h a n g e : e [ 4 1 1 ] | | ( e [ 4 1 1 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . l u m a l a b s _ k e y ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) , z ( a , { t i t l e : " M i s c " , i s _ s h r u n k : ! 0 , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : I e ( ( ) = > [ z ( a , { t i t l e : " E l a s t i c s e a r c h S e r v i c e ( u n d e r c o n s t r u c t i o n ) " , i s _ s u b c a r d : ! 0 , c l a s s : " p b - 2 m - 2 " } , { d e f a u l t : I e ( ( ) = > [ l ( " t a b l e " , f a t , [ l ( " t r " , n u l l , [ e [ 7 2 4 ] | | ( e [ 7 2 4 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " e l a s t i c _ s e a r c h _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " E n a b l e e l a s t i c s e a r c h s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , _ a t , [ k ( l ( " i n p u t " , { t y p e : " c h e c k b o x " , i d : " e l a s t i c _ s e a r c h _ s e r v i c e " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 2 ] | | ( e [ 4 1 2 ] = f = > r . c o n f i g F i l e . e l a s t i c _ s e a r c h _ s e r v i c e = f ) , o n C h a n g e : e [ 4 1 3 ] | | ( e [ 4 1 3 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ q e , r . c o n f i g F i l e . e l a s t i c _ s e a r c h _ s e r v i c e ] ] ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 2 5 ] | | ( e [ 7 2 5 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " i n s t a l l _ e l a s t i c _ s e a r c h _ s e r v i c e " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " R e i n s t a l l E l a s t i c S e a r c h s e r v i c e : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , m a t , [ l ( " b u t t o n " , { c l a s s : " h o v e r : t e x t - p r i m a r y b g - g r e e n - 2 0 0 r o u n d e d - l g p - 4 m - 4 w - f u l l t e x t - c e n t e r i t e m s - c e n t e r " , o n C l i c k : e [ 4 1 4 ] | | ( e [ 4 1 4 ] = ( . . . f ) = > r . r e i n s t a l l E l a s t i c S e a r c h S e r v i c e & & r . r e i n s t a l l E l a s t i c S e a r c h S e r v i c e ( . . . f ) ) } , " i n s t a l l E l a s t i c S e a r c h s e r v i c e " ) ] ) ] ) ] ) , l ( " t r " , n u l l , [ e [ 7 2 6 ] | | ( e [ 7 2 6 ] = l ( " t d " , { s t y l e : { " m i n - w i d t h " : " 2 0 0 p x " } } , [ l ( " l a b e l " , { f o r : " e l a s t i c _ s e a r c h _ u r l " , c l a s s : " t e x t - s m f o n t - b o l d " , s t y l e : { " m a r g i n - r i g h t " : " 1 r e m " } } , " e l a s t i c s e a r c h b a s e u r l : " ) ] , - 1 ) ) , l ( " t d " , n u l l , [ l ( " d i v " , h a t , [ k ( l ( " i n p u t " , { t y p e : " t e x t " , i d : " e l a s t i c _ s e a r c h _ u r l " , r e q u i r e d : " " , " o n U p d a t e : m o d e l V a l u e " : e [ 4 1 5 ] | | ( e [ 4 1 5 ] = f = > r . c o n f i g F i l e . e l a s t i c _ s e a r c h _ u r l = f ) , o n C h a n g e : e [ 4 1 6 ] | | ( e [ 4 1 6 ] = f = > i . s e t t i n g s C h a n g e d = ! 0 ) , c l a s s : " m t - 1 p x - 2 p y - 1 b o r d e r b o r d e r - g r a y - 3 0 0 r o u n d e d d a r k : b g - g r a y - 6 0 0 " } , n u l l , 5 4 4 ) , [ [ u e , r . c o n f i g F i l e . e l a s t i c _ s e a r c h _ u r l ] ] ) ] ) ] ) ] ) ] ) ] ) , _ : 1 } ) ] ) , _ : 1 } ) ] , 2 ) ] ) , l ( " d i v " , g a t , [ l ( " d i v " , b a t , [ l ( " b u t t o n " , { o n C l i c k : e [ 4 1 7 ] | | ( e [ 4 1 7 ] = W ( f = > i . b z c _ c o l l a p s e d = ! i . b z c _ c o l l a p s e d , [ " s t o p " ] ) ) , c l a s s : " t e x t - 2 x l h o v e r : t e x t - p r i m a r y p - 2 - m - 2 w - f u l l t e x t - l e f t f l e x f l e x - r o w i t e m s - c e n t e r " } , [ k ( l ( " d i v " , n u l l , e [ 7 2 7 ] | | ( e [ 7 2 7 ] = [ l ( " i " , { " d a t a - f e a t h e r " : " c h e v r o n - r i g h t " } , n u l l , - 1 ) ] ) , 5 1 2 ) , [ [ h t , i . b z c _ c o l l a p s e d ] ] ) , k ( l ( " d i v " , n u l l , e [ 7 2 8 ] | | ( e [ 7 2 8 ] = [ l ( " i " , { " d a t a - f e a t h e r " : " c h e v r o n - d o w n " } , n u l l , - 1 ) ] ) , 5 1 2 ) , [ [ h t , ! i . b z c _ c o l l a p s e d ] ] ) , e [ 7 3 0 ] | | ( e [ 7 3 0 ] = l ( " p
2024-09-29 19:46:45 +00:00
` ).map(u=>u.trim()===""?u:i?u.startsWith(" ")?u.substring(4):u:" "+u),a=e.value.substring(0,t),c=e.value.substring(s),d=a+o.join( `
` )+c;this.message.content=d,this. $ nextTick(()=>{e.selectionStart=t,e.selectionEnd=s+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this. $ refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Z.post("./text2wav",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let s of this.message.metadata)Object.prototype.hasOwnProperty.call(s,"audio_url")&&(s.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this. $ emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this. $ store.state.config.active_tts_service!="browser"&&this. $ store.state.config.active_tts_service!="None")this.isSpeaking?(this.isSpeaking=!0,Z.post("./stop",{text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSpeaking=!1})):(this.isSpeaking=!0,Z.post("./text2Audio",{client_id:this. $ store.state.client_id,text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this. $ store.state.toast.showToast( ` Error : $ { n } ` ,4,!1),this.isSpeaking=!1}));else{if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this. $ store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this. $ store.state.config.audio_out_voice)[0]);const t=i=>{let r=this.message.content.substring(i,i+e);const o=[".","!","?", `
` ];let a=-1;return o.forEach(c=>{const d=r.lastIndexOf(c);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+i+1},s=()=>{if(this.message.status_message=="Done"||this.message.content.includes(".")||this.message.content.includes("?")||this.message.content.includes("!")){const i=t(n),r=this.message.content.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n<this.message.content.length-2?setTimeout(()=>{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",i))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};console.log("Speaking chunk"),s()}},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this. $ refs.mdTextarea.selectionStart,t=this. $ refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]== `
` ?(this.message.content=this.message.content.slice(0,e)+" ` ` ` "+n+" \ n \ n ` ` ` \n "+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+" \n ` ` ` "+n+" \ n \ n ` ` ` \n "+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]== `
` ?(this.message.content=this.message.content.slice(0,e)+" ` ` ` " + n + `
` +this.message.content.slice(e,t)+" \n ` ` ` \ n "+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+" \ n ` ` ` "+n+ `
2024-10-20 22:07:51 +00:00
` +this.message.content.slice(e,t)+" \n ` ` ` \ n "+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit(" copy ",this)},deleteMsg(){this.$emit(" delete ",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit(" rankUp ",this.message.id)},rankDown(){this.$emit(" rankDown ",this.message.id)},updateMessage(){this.$emit(" updateMessage ",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit(" resendMessage ",this.message.id,this.message.content,n)},continueMessage(){this.$emit(" continueMessage ",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Odt+this.avatar:(console.log(" No avatar found "),Us)},defaultImg(n){n.target.src=Us},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?" just now ":s<20?s+" seconds ago ":s<40?" half a minute ago ":s<60?" less than a minute ago ":s<=90?" one minute ago ":s<=3540?Math.round(s/60)+" minutes ago ":s<=5400?" 1 hour ago ":s<=86400?Math.round(s/3600)+" hours ago ":s<=129600?" 1 day ago ":s<604800?Math.round(s/86400)+" days ago ":s<=777600?" 1 week ago ":n},prettyDate(n){let e=new Date((n||" ").replace(/-/g," / ").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&" just now "||t<120&&" 1 minute ago "||t<3600&&Math.floor(t/60)+" minutes ago "||t<7200&&" 1 hour ago "||t<86400&&Math.floor(t/3600)+" hours ago ")||s==1&&" Yesterday "||s<7&&s+" days ago "||s<31&&Math.ceil(s/7)+" weeks ago "},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)}," message . content ":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())}," message . ui ":function(n){console.log(" ui changed to ",n),this.ui_componentKey++},showConfirmation(){De(()=>{Ge.replace()})},deleteMsgMode(){De(()=>{Ge.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty(" open ")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,De(()=>{Ge.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c=" 0 "+c),c}return o(s)+" h : "+o(i)+" m : "+o(r)+" s "},warmup_duration(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log(" Computing the warmup duration , ",n," - > ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,i,r;[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c=" 0 "+c),c}return o(s)+" h : "+o(i)+" m : "+o(r)+" s "},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const r=Math.floor(i/1e3),o=t/r;return Math.round(o)+" t / s "}}},kdt={class:" relative w - full group rounded - lg m - 2 shadow - lg message hover : border - primary dark : hover : border - primary hover : border - solid hover : border - 2 border - 2 border - transparent flex flex - col flex - grow flex - wrap overflow - visible p - 4 pb - 2 "},Ddt={class:" flex flex - row gap - 2 "},Ldt={class:" flex - shrink - 0 "},Pdt={class:" group / avatar "},Fdt=[" src "," data - popover - target "],Udt={class:" flex flex - col w - full flex - grow - 0 "},Bdt={class:" flex fle
2024-09-29 19:46:45 +00:00
` +s,4,!1)})}catch(s){this. $ refs.toast.showToast( ` Did not get Personality settings responses .
2024-10-20 21:50:56 +00:00
Endpoint error : ` +s.message,4,!1)}}):this. $ refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this. $ refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(De(()=>{Ge.replace()});this. $ store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=hp}}},jpt={class:"relative group/item"},Qpt=["src","alt"],Xpt={class:"absolute -bottom-4 left-0 w-full flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-1"},Zpt={class:"text-xs font-bold"};function Jpt(n,e,t,s,i,r){const o=et("UniversalForm");return T(),w(Be,null,[l("div",jpt,[l("button",{onClick:e[1]||(e[1]=W((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["prevent"])),class:"w-10 h-10 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none"},[l("img",{src:i.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),alt:r.mountedPers.name,class:Ue(["w-full h-full object-cover",{"border-2 border-secondary":n.isActive}])},null,42,Qpt)]),l("div",Xpt,[l("button",{onClick:e[2]||(e[2]=W(a=>r.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},e[5]||(e[5]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),l("button",{onClick:e[3]||(e[3]=W(a=>r.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none ml-1",title:"Talk"},e[6]||(e[6]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)])),l("button",{onClick:e[4]||(e[4]=W((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["prevent"])),class:"p-1 bg-gray-500 rounded-full text-white hover:bg-gray-600 focus:outline-none ml-1",title:"Show more"},[l("span",Zpt,"+"+ $ (r.mountedPersArr.length-1),1)])])]),z(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const eft=st(Kpt,[["render",Jpt]]),tft="/";Z.defaults.baseURL="/";const nft={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:Z0,Toast:ac,UniversalForm:mc},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:tft,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this. $ store.state.config},set(n){this. $ store.commit("setConfig",n)}},personalities:{get(){return this. $ store.state.personalities},set(n){this. $ store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this. $ store.state.mountedPersArr},set(n){this. $ store.commit("setMountedPers",n)}}},methods:{async onCopyToCustom(n){await Z.post("/copy_to_custom_personas",{client_id:this. $ store.state.client_id,category:n.personality.category,name:n.personality.name})},onCopyPersonalityName(n){this. $ store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){con
2024-10-18 23:54:04 +00:00
` +e.message,4,!1),{status:!1}))},editPersonality(n){n=n.personality,Z.post("/get_personality_config",{client_id:this. $ store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this. $ store.state.currentPersonConfig=t.config,this. $ store.state.showPersonalityEditor=!0,this. $ store.state.personality_editor.showPanel(),this. $ store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},onPersonalityMounted(n){this.mountPersonality(n)},onPersonalityUnMounted(n){this.unmountPersonality(n)},onPersonalityRemount(n){this.reMountPersonality(n)},async handleOpenFolder(n){const e={client_id:this. $ store.state.client_id,personality_folder:n.personality.category+"/"+n.personality.folder};console.log(e),await Z.post("/open_personality_folder",e)},async handleOnTalk(n){if(Ge.replace(),console.log("ppa",n),n){if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this. $ refs.toast.showToast( ` Selected personality :
` +n.name,4,!0))}else this.onPersonalityMounted(n);this.onTalk(n)}},async onPersonalitySelected(n){if(Ge.replace(),console.log("Selected personality : ",JSON.stringify(n.personality)),n){if(n.selected){this. $ refs.toast.showToast("Personality already selected",4,!0);return}if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this. $ refs.toast.showToast( ` Selected personality :
2024-09-29 19:46:45 +00:00
` +n.name,4,!0))}else this.onPersonalityMounted(n)}},onSettingsPersonality(n){try{Z.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this. $ refs.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this. $ refs.toast.showToast("Personality settings updated successfully!",4,!0)):this. $ refs.toast.showToast( ` Did not get Personality settings responses .
` +s,4,!1)})}catch(s){this. $ refs.toast.showToast( ` Did not get Personality settings responses .
Endpoint error : ` +s.message,4,!1)}}):this. $ refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this. $ refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async mount_personality(n){if(!n)return{status:!1,error:"no personality - mount_personality"};try{const e={category:n.category,folder:n.folder,language:n.language},t=await Z.post("/mount_personality",e);if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async remount_personality(n){if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this. $ store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await Z.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await Z.post("/unmount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async select_personality(n){if(!n||!n.personality)return{status:!1,error:"no personality - select_personality"};let e=-1;if(console.log("Personality full path : ",n.full_path),console.log("Personality language : ",n.personality.language),n.personality.language!=null&&n.personality.language!=null?(console.log("Mounting a localized version of personality"),console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),console.log("Personality to select: ",n.full_path+":"+n.personality.language),e=this.configFile.personalities.findIndex(t=>t===n.full_path+":"+n.personality.language)):(console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),e=this.configFile.personalities.findIndex(t=>t===n.full_path)),e>-1){console.log("Selecting personality with id:",JSON.stringify(e));const t={client_id:this. $ store.state.client_id,id:e};try{const s=await Z.post("/select_personality",t);if(s)return this. $ store.dispatch("refreshConfig").then(()=>{console.log("recovered config",this.configFile.active_personality_id),this. $ store.dispatch("refreshPersonalitiesZoo").then(()=>{this. $ store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s,"select_personality - settings");return}}else return console.log("Personality id is wrong"),this. $ refs.toast.showToast("Personality id is wrong!",4,!1),{status:!1,error:"Personality id is wrong"}},async mountPersonality(n){if(console.log("mount pers",n),!n)return;if(this.configFile.personalities.includes(n.personality.full_path)){this. $ refs.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(n.personality);console.log("mount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this. $ refs.toast.showToast("Personality mounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this. $ refs.toast.showToast( ` Selected personality :
` +n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this. $ refs.toast.showToast( ` Could not mount personality
Error : ` +e.error,4,!1))},async reMountPersonality(n){if(console.log("remount pers",n),!n)return;if(!this.configFile.personalities.includes(n.personality.full_path)){this. $ refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(n.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this. $ refs.toast.showToast("Personality remounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this. $ refs.toast.showToast( ` Selected personality :
` +n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this. $ refs.toast.showToast( ` Could not mount personality
2024-10-18 23:54:04 +00:00
Error : ` +e.error,4,!1))},async unmountPersonality(n){if(!n)return;console.log( ` Unmounting $ { JSON . stringify ( n . personality ) } ` );const e=await this.unmount_personality(n.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const t=this.configFile.personalities[this.configFile.active_personality_id],s=this.personalities.findIndex(a=>a.full_path==t),i=this. $ refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path),r=this.personalities[s];r.isMounted=!1,r.selected=!0,this. $ refs.personalitiesZoo[i].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&Ge.replace(),this. $ refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this. $ refs.toast.showToast( ` Could not unmount personality
2024-10-20 21:50:56 +00:00
Error : ` +e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;e<this.configFile.personalities.length;e++){const t=this.configFile.personalities[e],s=this.personalities.findIndex(r=>r.full_path==t),i=this.personalities[s];if(i)console.log("adding from config"),n.push(i);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;e<this.discussionPersonalities.length;e++){const t=this.discussionPersonalities[e];console.log("discussionPersonalities - per",t);const s=this.mountedPersArr.findIndex(i=>i.full_path==t);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const i=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[i];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},sft={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},ift={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},rft={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},oft={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function aft(n,e,t,s,i,r){const o=et("personality-entry"),a=et("Toast"),c=et("UniversalForm");return T(),w("div",sft,[i.isLoading?(T(),w("div",ift,e[1]||(e[1]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))):B("",!0),l("div",null,[r.mountedPersArr.length>0?(T(),w("div",{key:0,class:Ue(i.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[l("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=W((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},e[2]||(e[2]=[l("i",{"data-feather":"chevron-down"},null,-1)])),l("label",rft," Mounted Personalities: ("+ $ (r.mountedPersArr.length)+") ",1),l("div",oft,[z(ri,{name:"bounce"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(this. $ store.state.mountedPersArr,(d,u)=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+u+"-"+d.name,personali
` +s.error,4,!1),this.loading=!1,Ye.off("file_received")}),Ye.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){De(()=>{Ge.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this. $ el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},dft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"};function uft(n,e,t,s,i,r){const o=et("InteractiveMenu");return i.loading?(T(),w("div",dft,e[0]||(e[0]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):(T(),at(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const pft=st(cft,[["render",uft],["__scopeId","data-v-1a32c141"]]),fft="data:image/svg+xml,%3csvg%20aria-hidden='true'%20class='w-6%20h-6%20animate-spin%20fill-secondary'%20viewBox='0%200%20100%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M100%2050.5908C100%2078.2051%2077.6142%20100.591%2050%20100.591C22.3858%20100.591%200%2078.2051%200%2050.5908C0%2022.9766%2022.3858%200.59082%2050%200.59082C77.6142%200.59082%20100%2022.9766%20100%2050.5908ZM9.08144%2050.5908C9.08144%2073.1895%2027.4013%2091.5094%2050%2091.5094C72.5987%2091.5094%2090.9186%2073.1895%2090.9186%2050.5908C90.9186%2027.9921%2072.5987%209.67226%2050%209.67226C27.4013%209.67226%209.08144%2027.9921%209.08144%2050.5908Z'%20fill='currentColor'%20/%3e%3cpath%20d='M93.9676%2039.0409C96.393%2038.4038%2097.8624%2035.9116%2097.0079%2033.5539C95.2932%2028.8227%2092.871%2024.3692%2089.8167%2020.348C85.8452%2015.1192%2080.8826%2010.7238%2075.2124%207.41289C69.5422%204.10194%2063.2754%201.94025%2056.7698%201.05124C51.7666%200.367541%2046.6976%200.446843%2041.7345%201.27873C39.2613%201.69328%2037.813%204.19778%2038.4501%206.62326C39.0873%209.04874%2041.5694%2010.4717%2044.0505%2010.1071C47.8511%209.54855%2051.7191%209.52689%2055.5402%2010.0491C60.8642%2010.7766%2065.9928%2012.5457%2070.6331%2015.2552C75.2735%2017.9648%2079.3347%2021.5619%2082.5849%2025.841C84.9175%2028.9121%2086.7997%2032.2913%2088.1811%2035.8758C89.083%2038.2158%2091.5421%2039.6781%2093.9676%2039.0409Z'%20fill='currentFill'%20/%3e%3c/svg%3e";console.log("modelImgPlaceholder:",Ls);const _ft="/",mft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:mc,MountedPersonalities:eft,MountedPersonali
2024-09-29 19:46:45 +00:00
` +t,4,!1),this.isLoading=!1)})}catch(t){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
Endpoint error : ` +t.message,4,!1),this.isLoading=!1}}):(this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async remount_personality(n){if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this. $ store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await Z.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this. $ store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmountPersonality(n){if(console.log("Unmounting personality:",n),!n)return;const e=await this.unmount_personality(n.personality||n);if(console.log(e),e.status){this. $ store.state.config.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0),this. $ store.dispatch("refreshMountedPersonalities");const t=this. $ store.state.mountedPersArr[this. $ store.state.mountedPersArr.length-1];console.log(t,this. $ store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +t.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await Z.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async showBindingHoveredIn(n){this.bindingHoveredIndex=n},async showBindingHoveredOut(){this.bindingHoveredIndex=null},async showModelHoveredIn(n){this.modelHoveredIndex=n},async showModelHoveredOut(){this.modelHoveredIndex=null},async showPersonalityHoveredIn(n){this.personalityHoveredIndex=n},async showPersonalityHoveredOut(){this.personalityHoveredIndex=null},async onPersonalitySelected(n){if(n){if(n.selected){this. $ store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.language===null?n.full_path:n.full_path+":"+n.language;if(console.log("pers_path",e),console.log("this. $ store.state.config.personalities",this. $ store.state.config.personalities),this. $ store.state.config.personalities.includes(e)){const t=await this.select_personality(n);await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshBindings"),await this. $ store.dispatch("refreshModelsZoo"),await this. $ store.dispatch("refreshModels"),await this. $ store.dispatch("refreshMountedPersonalities"),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("fetchLanguages"),await this. $ store.dispatch("fetchLanguage"),await this. $ store.dispatch("fetchisRTOn"),console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this. $ store.state.toast.showToast( ` Selected personality :
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
2024-10-20 22:07:51 +00:00
` +n.name,4,!1)}else console.log("mounting pers");this. $ emit("personalitySelected"),De(()=>{Ge.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const t=this. $ store.state.config.personalities.findIndex(i=>i===e),s={client_id:this. $ store.state.client_id,id:t};try{const i=await Z.post("/select_personality",s);if(i)return this. $ store.dispatch("refreshConfig").then(()=>{this. $ store.dispatch("refreshPersonalitiesZoo").then(()=>{this. $ store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},emitloaded(){this. $ emit("loaded")},showModels(n){n.preventDefault();const e=this. $ refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this. $ store.state.messageBox.showBlockingMessage("Loading binding"),Z.post("/update_setting",{client_id:this. $ store.state.client_id,setting_name:"binding_name",setting_value:n.name}).then(async e=>{this. $ store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshBindings"),await this. $ store.dispatch("refreshModelsZoo"),await this. $ store.dispatch("refreshModels"),this. $ store.state.toast.showToast( ` Binding changed to $ { this . currentBinding . name } ` ,4,!0),this.selecting_binding=!1}).catch(e=>{this. $ store.state.messageBox.hideMessage(),this. $ store.state.toast.showToast( ` Error $ { e } ` ,4,!0),this.selecting_binding=!1})},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this. $ store.state.messageBox.showBlockingMessage("Loading model"),Z.post("/update_setting",{client_id:this. $ store.state.client_id,setting_name:"model_name",setting_value:n.name}).then(async e=>{this. $ store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this. $ store.dispatch("refreshConfig"),await this. $ store.dispatch("refreshModels"),this. $ store.state.toast.showToast( ` Model changed to $ { this . currentModel . name } ` ,4,!0),this.selecting_model=!1}).catch(e=>{this. $ store.state.messageBox.hideMessage(),this. $ store.state.toast.showToast( ` Error $ { e } ` ,4,!0),this.selecting_model=!1})},download_files(){Z.get("/download_files")},remove_file(n){Z.get("/remove_discussion_file",{client_id:this. $ store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){Z.post("/clear_discussion_files_list",{client_id:this. $ store.state.client_id}).then(n=>{console.log(n),n.data.state?(this. $ store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this. $ store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let i=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,c=i+a.byteLength>=n.size;Ye.emit("send_file_chunk",{filename:n.name,chunk:a,offset:i,isLastChunk:c,chunkIndex:r}),i+=a.byteLength,r++,c?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this. $ store.state.toast.showToast("File uploaded successfully",4,!0),e()):o()};function o(){const a=n.slice(i,i+s);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this. $ emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this. $ emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),Ye.emit("start_bidirectional_audio_stream"),De(()=>{Ge.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),Ye.emit("stop_bidirectional_audio_stream"),De(()=>{Ge.replace()})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||wi
2024-09-29 19:46:45 +00:00
< ! DOCTYPE html >
< html lang = "en" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > Default Render Panel < / t i t l e >
< style >
body , html {
margin : 0 ;
padding : 0 ;
height : 100 % ;
font - family : Arial , sans - serif ;
background - color : # f0f0f0 ;
}
. container {
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : center ;
height : 100 % ;
padding : 20 px ;
box - sizing : border - box ;
}
. message {
text - align : center ;
padding : 30 px ;
background - color : white ;
border - radius : 12 px ;
box - shadow : 0 4 px 20 px rgba ( 0 , 0 , 0 , 0.1 ) ;
max - width : 600 px ;
width : 100 % ;
}
h1 {
color : # 2 c3e50 ;
margin - bottom : 20 px ;
font - size : 28 px ;
}
p {
color : # 34495 e ;
margin : 0 0 15 px ;
line - height : 1.6 ;
}
. highlight {
color : # e74c3c ;
font - weight : bold ;
}
< / s t y l e >
< / h e a d >
< body >
< div class = "container" >
< div class = "message" >
< h1 > Welcome to the Interactive Render Panel < / h 1 >
< p > This space is designed to bring your ideas to life ! Currently , it ' s empty because no HTML has been generated yet . < / p >
< p > To see something amazing here , try asking the AI to < span class = "highlight" > create a specific web component or application < / s p a n > . F o r e x a m p l e : < / p >
< p > "Create a responsive image gallery" or "Build a simple todo list app" < / p >
< p > Once you request a web component , the AI will generate the necessary HTML , CSS , and JavaScript , and it will be rendered right here in this panel ! < / p >
< / d i v >
< / d i v >
< / b o d y >
< / h t m l >
2024-10-20 21:50:56 +00:00
` ,memory_icon:Emt,active_skills:vmt,inactive_skills:Smt,skillsRegistry:Tmt,robot:xmt,posts_headers:{accept:"application/json","Content-Type":"application/json"},host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CONTENT:1,MSG_TYPE_CONTENT_INVISIBLE_TO_AI:2,MSG_TYPE_CONTENT_INVISIBLE_TO_USER:3},operationTypes:{MSG_OPERATION_TYPE_ADD_CHUNK:0,MSG_OPERATION_TYPE_SET_CONTENT:1,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:2,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_USER:3,MSG_OPERATION_TYPE_EXCEPTION:4,MSG_OPERATION_TYPE_WARNING:5,MSG_OPERATION_TYPE_INFO:6,MSG_OPERATION_TYPE_STEP:7,MSG_OPERATION_TYPE_STEP_START:8,MSG_OPERATION_TYPE_STEP_PROGRESS:9,MSG_OPERATION_TYPE_STEP_END_SUCCESS:10,MSG_OPERATION_TYPE_STEP_END_FAILURE:11,MSG_OPERATION_TYPE_JSON_INFOS:12,MSG_OPERATION_TYPE_REF:13,MSG_OPERATION_TYPE_CODE:14,MSG_OPERATION_TYPE_UI:15,MSG_OPERATION_TYPE_NEW_MESSAGE:16,MSG_OPERATION_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,isOpen:!1,discussion_id:0}},methods:{handleShortcut(n){n.ctrlKey&&n.key==="d"&&(n.preventDefault(),n.stopPropagation(),this.createNewDiscussion())},toggleMenu(){this.isMenuVisible=!this.isMenuVisible,this.isMenuVisible&&(this.isinfosMenuVisible=!1),De(()=>{Ge.replace()})},showMenu(){this.isMenuVisible=!0,this.isinfosMenuVisible=!1,De(()=>{Ge.replace()})},hideMenu(){this.isMenuVisible=!1,De(()=>{Ge.replace()})},toggleInfosMenu(){this.isinfosMenuVisible=!this.isinfosMenuVisible,this.isinfosMenuVisible&&(this.isMenuVisible=!1),De(()=>{Ge.replace()})},adjustMenuPosition(){const n=this. $ refs.languageMenu;if(n){const e=n.getBoundingClientRect(),t=window.innerWidth;e.right>t?(n.style.left="auto",n.style.right="0"):(n.style.left="0",n.style.right="auto")}},addCustomLanguage(){this.customLanguage.trim()!==""&&(this.selectLanguage(this.customLanguage),this.customLanguage="")},async selectLanguage(n){await this. $ store.dispatch("changeLanguage",n),this.toggleLanguageMenu(),this.language=n},async deleteLanguage(n){await this. $ store.dispatch("deleteLanguage",n),this.toggleLanguageMenu(),this.language=n},toggleLanguageMenu(){console.log("Toggling language ",this.isLanguageMenuVisible),this.isLanguageMenuVisible=!this.isLanguageMenuVisible},restartProgram(n){n.preventDefault(),this. $ store.state.api_post_req("restart_program",this. $ store.state.client_id),this.rebooting_audio.play(),this. $ store.state.toast.showToast("Rebooting the app. Please wait...",410,!1),console.log("this. $ store.state.api_get_req",this. $ store.state.api_get_req),setTimeout(()=>{window.close()},2e3)},applyConfiguration(){this.isLoading=!0,console.log(this. $ store.state.config),Z.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this. $ store.state.config},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),De(()=>{Ge.replace()})})},fun_mode_on(){console.log("Turning on fun mode"),this. $ store.state.config.fun_mode=!0,this.applyConfiguration()},fun_mode_off(){console.log("Turning off fun mode"),this. $ store.state.config.fun_mode=!1,this.applyConfiguration()},showNews(){this. $ store.state.news.show()},themeCheck(){if(this.userTheme=="dark"||!this.userTheme&&this.systemTheme){document.documentElement.classList.add("dark"),this.moonIcon.classList.add("display-none"),De(()=>{Wh(()=>Promise.resolve({}),__vite__mapDeps([0]))});return}De(()=>{Wh(()=>Promise.resolve({}),__vite__mapDeps([1]))}),this.sunIcon.classList.add("display-none")},themeSwitch(){if(document.documentEle
2024-09-29 19:46:45 +00:00
$ { this . lastMessageHtml }
2024-10-16 00:33:26 +00:00
` ),e.close()}},async triggerRobotAction(){this.rightPanelCollapsed=!this.rightPanelCollapsed,this.rightPanelCollapsed||(this. $ store.commit("setleftPanelCollapsed",!1),this. $ nextTick(()=>{this.extractHtml()})),console.log(this.rightPanelCollapsed)},add_webpage(){console.log("addWebLink received"),this. $ refs.web_url_input_box.showPanel()},addWebpage(){Z.post("/add_webpage",{client_id:this.client_id,url:this. $ refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Z.get("/get_active_binding_settings").then(n=>{if(this.isLoading=!1,n)if(n.data&&Object.keys(n.data).length>0){const e=this. $ store.state.bindingsZoo.find(t=>t.name==this.state.config.binding_name);this. $ store.state.universalForm.showForm(n.data,"Binding settings - "+e.binding.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_binding_settings",{client_id:this. $ store.state.client_id,settings:t}).then(s=>{s&&s.data?(console.log("binding set with new settings",s.data),this. $ store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this. $ store.state.toast.showToast( ` Did not get binding settings responses .
2024-09-29 19:46:45 +00:00
` +s,4,!1),this.isLoading=!1)})}catch(s){this. $ store.state.toast.showToast( ` Did not get binding settings responses .
2024-10-20 20:24:55 +00:00
Endpoint error : ` +s.message,4,!1),this.isLoading=!1}})}else this. $ store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1})}catch(n){this.isLoading=!1,this. $ store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogRemoved(n){console.log("Deleted:",n)},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){this.database_selectorDialogVisible=!1;const e={client_id:this.client_id,name:typeof n=="string"?n:n.name};if(console.log("data:"),console.log(e),(await Z.post("/select_database",e,{headers:this.posts_headers})).status){console.log("Selected database"),this. $ store.state.config=await Z.post("/get_config",{client_id:this.client_id}),console.log("new config loaded :",this. $ store.state.config);let s=await Z.get("/list_databases").data;console.log("New list of database: ",s),this. $ store.state.databases=s,console.log("New list of database: ",this. $ store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await Z.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this. $ store.state.config.activate_skills_lib=!this. $ store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this. $ refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const n=await Z.post("/apply_settings",{client_id:this. $ store.state.client_id,config:this. $ store.state.config});this.loading=!1,n.data.status?this. $ store.state.toast.showToast("Configuration changed successfully.",4,!0):this. $ store.state.toast.showToast("Configuration change failed.",4,!1),De(()=>{Ge.replace()})},save_configuration(){this.showConfirmation=!1,Z.post("/save_settings",{}).then(n=>{if(n)return n.status?this. $ store.state.toast.showToast("Settings saved!",4,!0):this. $ store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this. $ store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this. $ store.state.toast.showToast(n,e,t)},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await Z.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),Ye.on("discussion",t=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(s=>s.message_type==this.msgTypes.MSG_TYPE_CONTENT||s.message_type==this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI),this.discussionArr.forEach(s=>{s.status_message="Done"}),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Ye.off("discussion"),this.extractHtml()}),Ye.emit("load_discussion",{id:n}))},recoverFiles(){console.log("Recovering files"),Z.post("/get_discussion_files_list",{client_id:this. $ store.state.client_id}).then(n=>{this. $ refs.chatBox.filesList=n.data.files,this. $ refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log( ` Files recovered : $ { this . $refs . chatBox . filesList } ` )})},new_discussion(n){try{this.loading=!0,Ye.on("discussion_created",e=>{Ye.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(i=>i.id==e.id),s=this.list[t];this.selectDiscussion(s),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),De(()=>{const i=document.getElementById("dis-"+e.id);this.scrollToElement(i),console.log("Scrolling tp
2024-09-29 19:46:45 +00:00
Personality : $ { n . message . personality } ` );let i="";n.created_at_parsed&&(i= `
Created : $ { n . created _at _parsed } ` );let r="";n.message.model&&(r= ` Model : $ { n . message . model } ` );let o="";n.message.seed&&(o= ` Seed : $ { n . message . seed } ` );let a="";n.time_spent&&(a= `
Time spent : $ { n . time _spent } ` );let c="";c= ` $ { t } $ { r } $ { o } $ { a } ` .trim();const d= ` $ { n . message . sender } $ { s } $ { i }
$ { e }
2024-10-20 20:24:55 +00:00
$ { c } ` ;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);this. $ store.state.toast.showToast("Copied to clipboard successfully",4,!0),De(()=>{Ge.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this. $ store.state.toast.showToast( ` Could not parse JSON .
2024-09-29 19:46:45 +00:00
` +e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const s=new FileReader;s.onload=i=>e(this.parseJsonObj(i.target.result)),s.onerror=i=>t(i),s.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+i+"."+r+o+a)+".md";this.loading=!0;const u=await this.export_multiple_discussions(n,"markdown");u?(this.saveMarkdowntoFile(u,d),this. $ store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this. $ store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async exportDiscussions(){},async exportDiscussionsAsJson(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+i+"."+r+o+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(n,"json");u?(this.saveJSONtoFile(u,d),this. $ store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this. $ store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussionsBundle(n){},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this. $ store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this. $ store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this. $ store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this. $ store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this. $ store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this. $ store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this. $ refs.chatBox.fileList=this. $ refs.chatBox.fileList.concat(n)}catch(e){this. $ store.state.toast.showToast( ` Failed to set filelist in chatbox
2024-10-20 22:07:51 +00:00
` +e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this. $ store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this. $ store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this. $ store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){console.log("Created discussions view");const e=(await Z.get("/get_versionID")).data.versionId;Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this. $ store.commit("updateVersionId",e),window.location.reload(!0)),this. $ nextTick(()=>{Ge.replace()}),console.log("Connected to socket io");try{this. $ store.state.loading_infos="Getting version",this. $ store.state.loading_progress=30,await this. $ store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this. $ store.state.loading_infos="Loading Configuration";Ye.id===void 0;)await new Promise(t=>setTimeout(t,100));this. $ store.state.client_id=Ye.id,console.log(this. $ store.state.client_id),await this. $ store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Loading Database",this. $ store.state.loading_progress=20,await this. $ store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting Bindings list",this. $ store.state.loading_progress=40,await this. $ store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting personalities zoo",this. $ store.state.loading_progress=70,await this. $ store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting mounted personalities",this. $ store.state.loading_progress=80,await this. $ store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting models zoo",this. $ store.state.loading_progress=90,await this. $ store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this. $ store.state.loading_infos="Getting active models",this. $ store.state.loading_progress=100,await this. $ store.dispatch("refreshModels"),await this. $ store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this. $ store.dispatch("fetchLanguages"),await this. $ store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this. $ store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this. $ store.state.isConnected=!0,this. $ store.state.client_id=Ye.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this. $ store.state.ready=!0,Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.update_message),Ye.on("close_message",this.finalMsgEvent),Ye.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(r=>r.id==t.discussion_id),i=this.list[s];i.title=t.title}),Ye.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ye.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection
2024-09-29 19:46:45 +00:00
* @ license
* Copyright 2010 - 2023 Three . js Authors
* SPDX - License - Identifier : MIT
2024-10-20 21:50:56 +00:00
* / c o n s t p y = " 1 5 9 " , B h t = 0 , c C = 1 , G h t = 2 , k N = 1 , V h t = 2 , C i = 3 , F i = 0 , X n = 1 , J s = 2 , h r = 0 , i a = 1 , d C = 2 , u C = 3 , p C = 4 , z h t = 5 , Y r = 1 0 0 , H h t = 1 0 1 , q h t = 1 0 2 , f C = 1 0 3 , _ C = 1 0 4 , Y h t = 2 0 0 , $ h t = 2 0 1 , W h t = 2 0 2 , K h t = 2 0 3 , g b = 2 0 4 , b b = 2 0 5 , j h t = 2 0 6 , Q h t = 2 0 7 , X h t = 2 0 8 , Z h t = 2 0 9 , J h t = 2 1 0 , e g t = 2 1 1 , t g t = 2 1 2 , n g t = 2 1 3 , s g t = 2 1 4 , i g t = 0 , r g t = 1 , o g t = 2 , y u = 3 , a g t = 4 , l g t = 5 , c g t = 6 , d g t = 7 , f y = 0 , u g t = 1 , p g t = 2 , g r = 0 , f g t = 1 , _ g t = 2 , m g t = 3 , h g t = 4 , g g t = 5 , m C = " a t t a c h e d " , b g t = " d e t a c h e d " , D N = 3 0 0 , b a = 3 0 1 , y a = 3 0 2 , y b = 3 0 3 , E b = 3 0 4 , g p = 3 0 6 , E a = 1 e 3 , m s = 1 0 0 1 , E u = 1 0 0 2 , g n = 1 0 0 3 , v b = 1 0 0 4 , F d = 1 0 0 5 , $ n = 1 0 0 6 , L N = 1 0 0 7 , f o = 1 0 0 8 , b r = 1 0 0 9 , y g t = 1 0 1 0 , E g t = 1 0 1 1 , _ y = 1 0 1 2 , P N = 1 0 1 3 , f r = 1 0 1 4 , M i = 1 0 1 5 , Q l = 1 0 1 6 , F N = 1 0 1 7 , U N = 1 0 1 8 , t o = 1 0 2 0 , v g t = 1 0 2 1 , h s = 1 0 2 3 , S g t = 1 0 2 4 , T g t = 1 0 2 5 , n o = 1 0 2 6 , v a = 1 0 2 7 , x g t = 1 0 2 8 , B N = 1 0 2 9 , C g t = 1 0 3 0 , G N = 1 0 3 1 , V N = 1 0 3 3 , K h = 3 3 7 7 6 , j h = 3 3 7 7 7 , Q h = 3 3 7 7 8 , X h = 3 3 7 7 9 , h C = 3 5 8 4 0 , g C = 3 5 8 4 1 , b C = 3 5 8 4 2 , y C = 3 5 8 4 3 , z N = 3 6 1 9 6 , E C = 3 7 4 9 2 , v C = 3 7 4 9 6 , S C = 3 7 8 0 8 , T C = 3 7 8 0 9 , x C = 3 7 8 1 0 , C C = 3 7 8 1 1 , w C = 3 7 8 1 2 , R C = 3 7 8 1 3 , A C = 3 7 8 1 4 , M C = 3 7 8 1 5 , N C = 3 7 8 1 6 , O C = 3 7 8 1 7 , I C = 3 7 8 1 8 , k C = 3 7 8 1 9 , D C = 3 7 8 2 0 , L C = 3 7 8 2 1 , Z h = 3 6 4 9 2 , P C = 3 6 4 9 4 , F C = 3 6 4 9 5 , w g t = 3 6 2 8 3 , U C = 3 6 2 8 4 , B C = 3 6 2 8 5 , G C = 3 6 2 8 6 , X l = 2 3 0 0 , S a = 2 3 0 1 , J h = 2 3 0 2 , V C = 2 4 0 0 , z C = 2 4 0 1 , H C = 2 4 0 2 , R g t = 2 5 0 0 , A g t = 0 , H N = 1 , S b = 2 , q N = 3 e 3 , s o = 3 0 0 1 , M g t = 3 2 0 0 , N g t = 3 2 0 1 , m y = 0 , O g t = 1 , g s = " " , n n = " s r g b " , C n = " s r g b - l i n e a r " , h y = " d i s p l a y - p 3 " , b p = " d i s p l a y - p 3 - l i n e a r " , v u = " l i n e a r " , j t = " s r g b " , S u = " r e c 7 0 9 " , T u = " p 3 " , w o = 7 6 8 0 , q C = 5 1 9 , I g t = 5 1 2 , k g t = 5 1 3 , D g t = 5 1 4 , Y N = 5 1 5 , L g t = 5 1 6 , P g t = 5 1 7 , F g t = 5 1 8 , U g t = 5 1 9 , T b = 3 5 0 4 4 , Y C = " 3 0 0 e s " , x b = 1 0 3 5 , N i = 2 e 3 , x u = 2 0 0 1 ; c l a s s z a { a d d E v e n t L i s t e n e r ( e , t ) { t h i s . _ l i s t e n e r s = = = v o i d 0 & & ( t h i s . _ l i s t e n e r s = { } ) ; c o n s t s = t h i s . _ l i s t e n e r s ; s [ e ] = = = v o i d 0 & & ( s [ e ] = [ ] ) , s [ e ] . i n d e x O f ( t ) = = = - 1 & & s [ e ] . p u s h ( t ) } h a s E v e n t L i s t e n e r ( e , t ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ! 1 ; c o n s t s = t h i s . _ l i s t e n e r s ; r e t u r n s [ e ] ! = = v o i d 0 & & s [ e ] . i n d e x O f ( t ) ! = = - 1 } r e m o v e E v e n t L i s t e n e r ( e , t ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ; c o n s t i = t h i s . _ l i s t e n e r s [ e ] ; i f ( i ! = = v o i d 0 ) { c o n s t r = i . i n d e x O f ( t ) ; r ! = = - 1 & & i . s p l i c e ( r , 1 ) } } d i s p a t c h E v e n t ( e ) { i f ( t h i s . _ l i s t e n e r s = = = v o i d 0 ) r e t u r n ; c o n s t s = t h i s . _ l i s t e n e r s [ e . t y p e ] ; i f ( s ! = = v o i d 0 ) { e . t a r g e t = t h i s ; c o n s t i = s . s l i c e ( 0 ) ; f o r ( l e t r = 0 , o = i . l e n g t h ; r < o ; r + + ) i [ r ] . c a l l ( t h i s , e ) ; e . t a r g e t = n u l l } } } c o n s t A n = [ " 0 0 " , " 0 1 " , " 0 2 " , " 0 3 " , " 0 4 " , " 0 5 " , " 0 6 " , " 0 7 " , " 0 8 " , " 0 9 " , " 0 a " , " 0 b " , " 0 c " , " 0 d " , " 0 e " , " 0 f " , " 1 0 " , " 1 1 " , " 1 2 " , " 1 3 " , " 1 4 " , " 1 5 " , " 1 6 " , " 1 7 " , " 1 8 " , " 1 9 " , " 1 a " , " 1 b " , " 1 c " , " 1 d " , " 1 e " , " 1 f " , " 2 0 " , " 2 1 " , " 2 2 " , " 2 3 " , " 2 4 " , " 2 5 " , " 2 6 " , " 2 7 " , " 2 8 " , " 2 9 " , " 2 a " , " 2 b " , " 2 c " , " 2 d " , " 2 e " , " 2 f " , " 3 0 " , " 3 1 " , " 3 2 " , " 3 3 " , " 3 4 " , " 3 5 " , " 3 6 " , " 3 7 " , " 3 8 " , " 3 9 " , " 3 a " , " 3 b " , " 3 c " , " 3 d " , " 3 e " , " 3 f " , " 4 0 " , " 4 1 " , " 4 2 " , " 4 3 " , " 4 4 " , " 4 5 " , " 4 6 " , " 4 7 " , " 4 8 " , " 4 9 " , " 4 a " , " 4 b " , " 4 c " , " 4 d " , " 4 e " , " 4 f " , " 5 0 " , " 5 1 " , " 5 2 " , " 5 3 " , " 5 4 " , " 5 5 " , " 5 6 " , " 5 7 " , " 5 8 " , " 5 9 " , " 5 a " , " 5 b " , " 5 c " , " 5 d " , " 5 e " , " 5 f " , " 6 0 " , " 6 1 " , " 6 2 " , " 6 3 " , " 6 4 " , " 6 5 " , " 6 6 " , " 6 7 " , " 6 8 " , " 6 9 " , " 6 a " , " 6 b " , " 6 c " , " 6 d " , " 6 e " , " 6 f " , " 7 0 " , " 7 1 " , " 7 2 " , " 7 3 " , " 7 4 " , " 7 5 " , " 7 6 " , " 7 7 " , " 7 8 " , " 7 9 " , " 7 a " , " 7 b " , " 7 c " , " 7 d " , " 7 e " , " 7 f " , " 8 0 " , " 8 1 " , " 8 2 " , " 8 3 " , " 8 4 " , " 8 5 " , " 8 6 " , " 8 7 " , " 8 8 " , " 8 9 " , " 8 a " , " 8 b " , " 8 c " , " 8 d " , " 8 e " , " 8 f " , " 9 0 " , " 9 1 " , " 9 2 " , " 9 3 " , " 9 4 " , " 9 5 " , " 9 6 " , " 9 7 " , " 9 8 " , " 9 9 " , " 9 a " , " 9 b " , " 9 c " , " 9 d " , " 9 e " , " 9 f " , " a 0 " , " a 1 " , " a 2 " , " a 3 " , " a 4 " , " a 5 " , " a 6 " , " a 7 " , " a 8 " , " a 9 " , " a a " , " a b " , " a c " , " a d " , " a e " , " a f " , " b 0 " , " b 1 " , " b 2 " , " b 3 " , " b 4 " , " b 5 " , " b 6 " , " b 7 " , " b 8 " , " b 9 " , " b a " , " b b " , " b c " , " b d " , " b e " , " b f " , " c 0 " , " c 1 " , " c 2 " , " c 3 " , " c 4 " , " c 5 " , " c 6 " , " c 7 " , " c 8 " , " c 9 " , " c a " , " c b " , " c c " , " c d " , " c e " , " c f " , " d 0 " , " d 1 " , " d 2 " , " d 3 " , " d 4 " , " d 5 " , " d 6 " , " d 7 " , " d 8 " , " d 9 " , " d a " , " d b " , " d c " , " d d " , " d e " , " d f " , " e 0 " , " e 1 " , " e 2 " , " e 3 " , " e 4 " , " e 5 " , " e 6 " , " e 7 " , " e 8 " , " e 9 " , " e a " , " e b " , " e c " , " e d " , " e e " , " e f " , " f 0 " , " f 1 " , " f 2 " , " f 3 " , " f 4 " , " f 5 " , " f 6 " , " f 7 " , " f 8 " , " f 9 " , " f a " , " f b " , " f c " , " f d " , " f e " , " f f " ] ; l e t $ C = 1 2 3 4 5 6 7 ; c o n s t O l = M a t h . P I / 1 8 0 , T a = 1 8 0 / M a t h . P I ; f u n c t i o n B s ( ) { c o n s t n = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , e = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , t = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 , s = M a t h . r a n d o m ( ) * 4 2 9 4 9 6 7 2 9 5 | 0 ; r e t u r n ( A n [ n & 2 5 5 ] + A n [ n > > 8 & 2 5 5 ] + A n [ n > > 1 6 & 2 5 5 ] + A n [ n > > 2 4 & 2 5 5 ] + " - " + A n [ e & 2 5 5 ] + A n [ e > > 8 & 2 5 5 ] + " - " + A n [ e > > 1 6 & 1 5 | 6 4 ] + A n [ e > > 2 4 & 2 5 5 ] + " - " + A n [ t & 6 3 | 1 2 8 ] + A n [ t > > 8 & 2 5 5 ] + " - " + A n [ t > > 1 6 & 2 5 5 ] + A n [ t > > 2 4 & 2 5 5 ] + A n [ s & 2 5 5 ] + A n [ s > > 8 & 2 5 5 ] + A n [ s > > 1 6 & 2 5 5 ] + A n [ s > > 2 4 & 2 5 5 ] ) . t o L o w e r C a s e ( ) } f u n c t i o n O n ( n , e , t ) { r e t u r n M a t h . m a x ( e , M a t h . m i n ( t , n ) ) } f u n c t i o n g y ( n , e ) { r e t u r n ( n % e + e ) % e } f u n c t i o n B g t ( n , e , t , s , i ) { r e t u r n s + ( n - e ) * ( i - s ) / ( t - e ) } f u n c t i o n G g t ( n , e , t ) { r e t u r n n ! = = e ? ( t - n ) / ( e - n ) : 0 } f u n c t i o n I l ( n , e , t ) { r e t u r n ( 1 - t ) * n + t * e } f u n c t i o n V g t ( n , e , t , s ) { r e t u r n I l ( n , e , 1 - M a t h . e x p ( - t * s ) ) } f u n c t i o n z g t ( n , e = 1 ) { r e t u r n e - M a t h . a b s ( g y ( n , e * 2 ) - e ) } f u n c t i o n H g t ( n , e , t ) { r e t u r n n < = e ? 0 : n > = t ? 1 : ( n = ( n - e ) / ( t - e ) , n * n * ( 3 - 2 * n ) ) } f u n c t i o n q g t ( n , e , t ) { r e t u r n
2024-09-29 19:46:45 +00:00
gl _Position = projectionMatrix * modelViewMatrix * vec4 ( position , 1.0 ) ;
2024-10-20 21:50:56 +00:00
} ` ,Ebt= ` void main ( ) {
2024-09-29 19:46:45 +00:00
gl _FragColor = vec4 ( 1.0 , 0.0 , 0.0 , 1.0 ) ;
2024-10-20 21:50:56 +00:00
} ` ;class mo extends Gs{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=ybt,this.fragmentShader=Ebt,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=xa(e.uniforms),this.uniformsGroups=gbt(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const s={};for(const i in this.extensions)this.extensions[i]===!0&&(s[i]=!0);return Object.keys(s).length>0&&(t.extensions=s),t}}class tO extends Jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Tt,this.projectionMatrix=new Tt,this.projectionMatrixInverse=new Tt,this.coordinateSystem=Ni}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Gn extends tO{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ta*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ol*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ta*2*Math.atan(Math.tan(Ol*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,s,i,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Ol*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,r=-
2024-09-29 19:46:45 +00:00
varying vec3 vWorldDirection ;
vec3 transformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( matrix * vec4 ( dir , 0.0 ) ) . xyz ) ;
}
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
}
` ,fragmentShader: `
uniform sampler2D tEquirect ;
varying vec3 vWorldDirection ;
# include < common >
void main ( ) {
vec3 direction = normalize ( vWorldDirection ) ;
vec2 sampleUV = equirectUv ( direction ) ;
gl _FragColor = texture2D ( tEquirect , sampleUV ) ;
}
2024-10-20 21:50:56 +00:00
` },i=new yr(5,5,5),r=new mo({name:"CubemapFromEquirect",uniforms:xa(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:Xn,blending:hr});r.uniforms.tEquirect.value=t;const o=new Vn(i,r),a=t.minFilter;return t.minFilter===fo&&(t.minFilter= $ n),new vbt(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,s,i){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,s,i);e.setRenderTarget(r)}}const hg=new re,Tbt=new re,xbt=new St;class Vr{constructor(e=new re(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,i){return this.normal.set(e,t,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const i=hg.subVectors(s,t).cross(Tbt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(hg),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(s,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||xbt.getNormalMatrix(e),i=this.coplanarPoint(hg).applyMatrix4(e),r=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Fr=new fi,ud=new re;class by{constructor(e=new Vr,t=new Vr,s=new Vr,i=new Vr,r=new Vr,o=new Vr){this.planes=[e,t,s,i,r,o]}set(e,t,s,i,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(s),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=Ni){const s=this.planes,i=e.elements,r=i[0],o=i[1],a=i[2],c=i[3],d=i[4],u=i[5],_=i[6],m=i[7],h=i[8],f=i[9],g=i[10],b=i[11],y=i[12],E=i[13],v=i[14],S=i[15];if(s[0].setComponents(c-r,m-d,b-h,S-y).normalize(),s[1].setComponents(c+r,m+d,b+h,S+y).normalize(),s[2].setComponents(c+o,m+u,b+f,S+E).normalize(),s[3].setComponents(c-o,m-u,b-f,S-E).normalize(),s[4].setComponents(c-a,m-_,b-g,S-v).normalize(),t===Ni)s[5].setComponents(c+a,m+_,b+g,S+v).normalize();else if(t===xu)s[5].setComponents(a,_,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Fr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Fr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fr)}intersectsSprite(e){return Fr.center.set(0,0,0),Fr.radius=.7071067811865476,Fr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fr)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(s)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let s=0;s<6;s++){const i=t[s];if(ud.x=i.normal.x>0?e.max.x:e.min.x,ud.y=i.normal.y>0?e.max.y:e.min.y,ud.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(ud)<0)return!1}ret
2024-09-29 19:46:45 +00:00
if ( diffuseColor . a < getAlphaHashThreshold ( vPosition ) ) discard ;
2024-10-20 21:50:56 +00:00
# endif ` ,Rbt= ` # ifdef USE _ALPHAHASH
2024-09-29 19:46:45 +00:00
const float ALPHA _HASH _SCALE = 0.05 ;
float hash2D ( vec2 value ) {
return fract ( 1.0 e4 * sin ( 17.0 * value . x + 0.1 * value . y ) * ( 0.1 + abs ( sin ( 13.0 * value . y + value . x ) ) ) ) ;
}
float hash3D ( vec3 value ) {
return hash2D ( vec2 ( hash2D ( value . xy ) , value . z ) ) ;
}
float getAlphaHashThreshold ( vec3 position ) {
float maxDeriv = max (
length ( dFdx ( position . xyz ) ) ,
length ( dFdy ( position . xyz ) )
) ;
float pixScale = 1.0 / ( ALPHA _HASH _SCALE * maxDeriv ) ;
vec2 pixScales = vec2 (
exp2 ( floor ( log2 ( pixScale ) ) ) ,
exp2 ( ceil ( log2 ( pixScale ) ) )
) ;
vec2 alpha = vec2 (
hash3D ( floor ( pixScales . x * position . xyz ) ) ,
hash3D ( floor ( pixScales . y * position . xyz ) )
) ;
float lerpFactor = fract ( log2 ( pixScale ) ) ;
float x = ( 1.0 - lerpFactor ) * alpha . x + lerpFactor * alpha . y ;
float a = min ( lerpFactor , 1.0 - lerpFactor ) ;
vec3 cases = vec3 (
x * x / ( 2.0 * a * ( 1.0 - a ) ) ,
( x - 0.5 * a ) / ( 1.0 - a ) ,
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
) ;
float threshold = ( x < ( 1.0 - a ) )
? ( ( x < a ) ? cases . x : cases . y )
: cases . z ;
return clamp ( threshold , 1.0 e - 6 , 1.0 ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,Abt= ` # ifdef USE _ALPHAMAP
2024-10-18 23:54:04 +00:00
diffuseColor . a *= texture2D ( alphaMap , vAlphaMapUv ) . g ;
2024-10-20 21:50:56 +00:00
# endif ` ,Mbt= ` # ifdef USE _ALPHAMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D alphaMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,Nbt= ` # ifdef USE _ALPHATEST
2024-10-18 23:54:04 +00:00
if ( diffuseColor . a < alphaTest ) discard ;
2024-10-20 21:50:56 +00:00
# endif ` ,Obt= ` # ifdef USE _ALPHATEST
2024-09-29 19:46:45 +00:00
uniform float alphaTest ;
2024-10-20 21:50:56 +00:00
# endif ` ,Ibt= ` # ifdef USE _AOMAP
2024-09-29 19:46:45 +00:00
float ambientOcclusion = ( texture2D ( aoMap , vAoMapUv ) . r - 1.0 ) * aoMapIntensity + 1.0 ;
reflectedLight . indirectDiffuse *= ambientOcclusion ;
# if defined ( USE _CLEARCOAT )
clearcoatSpecularIndirect *= ambientOcclusion ;
# endif
# if defined ( USE _SHEEN )
sheenSpecularIndirect *= ambientOcclusion ;
# endif
# if defined ( USE _ENVMAP ) && defined ( STANDARD )
float dotNV = saturate ( dot ( geometryNormal , geometryViewDir ) ) ;
reflectedLight . indirectSpecular *= computeSpecularOcclusion ( dotNV , ambientOcclusion , material . roughness ) ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,kbt= ` # ifdef USE _AOMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D aoMap ;
uniform float aoMapIntensity ;
2024-10-20 21:50:56 +00:00
# endif ` ,Dbt= ` # ifdef USE _BATCHING
2024-09-29 19:46:45 +00:00
attribute float batchId ;
uniform highp sampler2D batchingTexture ;
mat4 getBatchingMatrix ( const in float i ) {
int size = textureSize ( batchingTexture , 0 ) . x ;
int j = int ( i ) * 4 ;
int x = j % size ;
int y = j / size ;
vec4 v1 = texelFetch ( batchingTexture , ivec2 ( x , y ) , 0 ) ;
vec4 v2 = texelFetch ( batchingTexture , ivec2 ( x + 1 , y ) , 0 ) ;
vec4 v3 = texelFetch ( batchingTexture , ivec2 ( x + 2 , y ) , 0 ) ;
vec4 v4 = texelFetch ( batchingTexture , ivec2 ( x + 3 , y ) , 0 ) ;
return mat4 ( v1 , v2 , v3 , v4 ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,Lbt= ` # ifdef USE _BATCHING
2024-09-29 19:46:45 +00:00
mat4 batchingMatrix = getBatchingMatrix ( batchId ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,Pbt= ` vec3 transformed = vec3 ( position ) ;
2024-09-29 19:46:45 +00:00
# ifdef USE _ALPHAHASH
vPosition = vec3 ( position ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,Fbt= ` vec3 objectNormal = vec3 ( normal ) ;
2024-09-29 19:46:45 +00:00
# ifdef USE _TANGENT
vec3 objectTangent = vec3 ( tangent . xyz ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,Ubt= ` float G _BlinnPhong _Implicit ( ) {
2024-09-29 19:46:45 +00:00
return 0.25 ;
}
float D _BlinnPhong ( const in float shininess , const in float dotNH ) {
return RECIPROCAL _PI * ( shininess * 0.5 + 1.0 ) * pow ( dotNH , shininess ) ;
}
vec3 BRDF _BlinnPhong ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in vec3 specularColor , const in float shininess ) {
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( specularColor , 1.0 , dotVH ) ;
float G = G _BlinnPhong _Implicit ( ) ;
float D = D _BlinnPhong ( shininess , dotNH ) ;
return F * ( G * D ) ;
2024-10-20 21:50:56 +00:00
} // validated`,Bbt=`#ifdef USE_IRIDESCENCE
2024-09-29 19:46:45 +00:00
const mat3 XYZ _TO _REC709 = mat3 (
3.2404542 , - 0.9692660 , 0.0556434 ,
- 1.5371385 , 1.8760108 , - 0.2040259 ,
- 0.4985314 , 0.0415560 , 1.0572252
) ;
vec3 Fresnel0ToIor ( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt ( fresnel0 ) ;
return ( vec3 ( 1.0 ) + sqrtF0 ) / ( vec3 ( 1.0 ) - sqrtF0 ) ;
}
vec3 IorToFresnel0 ( vec3 transmittedIor , float incidentIor ) {
return pow2 ( ( transmittedIor - vec3 ( incidentIor ) ) / ( transmittedIor + vec3 ( incidentIor ) ) ) ;
}
float IorToFresnel0 ( float transmittedIor , float incidentIor ) {
return pow2 ( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ) ) ;
}
vec3 evalSensitivity ( float OPD , vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0 e - 9 ;
vec3 val = vec3 ( 5.4856 e - 13 , 4.4201 e - 13 , 5.2481 e - 13 ) ;
vec3 pos = vec3 ( 1.6810 e + 06 , 1.7953 e + 06 , 2.2084 e + 06 ) ;
vec3 var = vec3 ( 4.3278 e + 09 , 9.3046 e + 09 , 6.6121 e + 09 ) ;
vec3 xyz = val * sqrt ( 2.0 * PI * var ) * cos ( pos * phase + shift ) * exp ( - pow2 ( phase ) * var ) ;
xyz . x += 9.7470 e - 14 * sqrt ( 2.0 * PI * 4.5282 e + 09 ) * cos ( 2.2399 e + 06 * phase + shift [ 0 ] ) * exp ( - 4.5282 e + 09 * pow2 ( phase ) ) ;
xyz /= 1.0685 e - 7 ;
vec3 rgb = XYZ _TO _REC709 * xyz ;
return rgb ;
}
vec3 evalIridescence ( float outsideIOR , float eta2 , float cosTheta1 , float thinFilmThickness , vec3 baseF0 ) {
vec3 I ;
float iridescenceIOR = mix ( outsideIOR , eta2 , smoothstep ( 0.0 , 0.03 , thinFilmThickness ) ) ;
float sinTheta2Sq = pow2 ( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2 ( cosTheta1 ) ) ;
float cosTheta2Sq = 1.0 - sinTheta2Sq ;
if ( cosTheta2Sq < 0.0 ) {
return vec3 ( 1.0 ) ;
}
float cosTheta2 = sqrt ( cosTheta2Sq ) ;
float R0 = IorToFresnel0 ( iridescenceIOR , outsideIOR ) ;
float R12 = F _Schlick ( R0 , 1.0 , cosTheta1 ) ;
float T121 = 1.0 - R12 ;
float phi12 = 0.0 ;
if ( iridescenceIOR < outsideIOR ) phi12 = PI ;
float phi21 = PI - phi12 ;
vec3 baseIOR = Fresnel0ToIor ( clamp ( baseF0 , 0.0 , 0.9999 ) ) ; vec3 R1 = IorToFresnel0 ( baseIOR , iridescenceIOR ) ;
vec3 R23 = F _Schlick ( R1 , 1.0 , cosTheta2 ) ;
vec3 phi23 = vec3 ( 0.0 ) ;
if ( baseIOR [ 0 ] < iridescenceIOR ) phi23 [ 0 ] = PI ;
if ( baseIOR [ 1 ] < iridescenceIOR ) phi23 [ 1 ] = PI ;
if ( baseIOR [ 2 ] < iridescenceIOR ) phi23 [ 2 ] = PI ;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2 ;
vec3 phi = vec3 ( phi21 ) + phi23 ;
vec3 R123 = clamp ( R12 * R23 , 1e-5 , 0.9999 ) ;
vec3 r123 = sqrt ( R123 ) ;
vec3 Rs = pow2 ( T121 ) * R23 / ( vec3 ( 1.0 ) - R123 ) ;
vec3 C0 = R12 + Rs ;
I = C0 ;
vec3 Cm = Rs - T121 ;
for ( int m = 1 ; m <= 2 ; ++ m ) {
Cm *= r123 ;
vec3 Sm = 2.0 * evalSensitivity ( float ( m ) * OPD , float ( m ) * phi ) ;
I += Cm * Sm ;
}
return max ( I , vec3 ( 0.0 ) ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,Gbt= ` # ifdef USE _BUMPMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D bumpMap ;
uniform float bumpScale ;
vec2 dHdxy _fwd ( ) {
vec2 dSTdx = dFdx ( vBumpMapUv ) ;
vec2 dSTdy = dFdy ( vBumpMapUv ) ;
float Hll = bumpScale * texture2D ( bumpMap , vBumpMapUv ) . x ;
float dBx = bumpScale * texture2D ( bumpMap , vBumpMapUv + dSTdx ) . x - Hll ;
float dBy = bumpScale * texture2D ( bumpMap , vBumpMapUv + dSTdy ) . x - Hll ;
return vec2 ( dBx , dBy ) ;
}
vec3 perturbNormalArb ( vec3 surf _pos , vec3 surf _norm , vec2 dHdxy , float faceDirection ) {
vec3 vSigmaX = normalize ( dFdx ( surf _pos . xyz ) ) ;
vec3 vSigmaY = normalize ( dFdy ( surf _pos . xyz ) ) ;
vec3 vN = surf _norm ;
vec3 R1 = cross ( vSigmaY , vN ) ;
vec3 R2 = cross ( vN , vSigmaX ) ;
float fDet = dot ( vSigmaX , R1 ) * faceDirection ;
vec3 vGrad = sign ( fDet ) * ( dHdxy . x * R1 + dHdxy . y * R2 ) ;
return normalize ( abs ( fDet ) * surf _norm - vGrad ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,Vbt= ` # if NUM _CLIPPING _PLANES > 0
2024-09-29 19:46:45 +00:00
vec4 plane ;
# pragma unroll _loop _start
for ( int i = 0 ; i < UNION _CLIPPING _PLANES ; i ++ ) {
plane = clippingPlanes [ i ] ;
if ( dot ( vClipPosition , plane . xyz ) > plane . w ) discard ;
}
# pragma unroll _loop _end
# if UNION _CLIPPING _PLANES < NUM _CLIPPING _PLANES
bool clipped = true ;
# pragma unroll _loop _start
for ( int i = UNION _CLIPPING _PLANES ; i < NUM _CLIPPING _PLANES ; i ++ ) {
plane = clippingPlanes [ i ] ;
clipped = ( dot ( vClipPosition , plane . xyz ) > plane . w ) && clipped ;
}
# pragma unroll _loop _end
if ( clipped ) discard ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,zbt= ` # if NUM _CLIPPING _PLANES > 0
2024-10-16 20:01:01 +00:00
varying vec3 vClipPosition ;
2024-10-18 23:54:04 +00:00
uniform vec4 clippingPlanes [ NUM _CLIPPING _PLANES ] ;
2024-10-20 21:50:56 +00:00
# endif ` ,Hbt= ` # if NUM _CLIPPING _PLANES > 0
2024-10-18 23:54:04 +00:00
varying vec3 vClipPosition ;
2024-10-20 21:50:56 +00:00
# endif ` ,qbt= ` # if NUM _CLIPPING _PLANES > 0
2024-09-29 19:46:45 +00:00
vClipPosition = - mvPosition . xyz ;
2024-10-20 21:50:56 +00:00
# endif ` ,Ybt= ` # if defined ( USE _COLOR _ALPHA )
2024-09-29 19:46:45 +00:00
diffuseColor *= vColor ;
# elif defined ( USE _COLOR )
diffuseColor . rgb *= vColor ;
2024-10-20 21:50:56 +00:00
# endif ` , $ bt= ` # if defined ( USE _COLOR _ALPHA )
2024-09-29 19:46:45 +00:00
varying vec4 vColor ;
# elif defined ( USE _COLOR )
varying vec3 vColor ;
2024-10-20 21:50:56 +00:00
# endif ` ,Wbt= ` # if defined ( USE _COLOR _ALPHA )
2024-09-29 19:46:45 +00:00
varying vec4 vColor ;
# elif defined ( USE _COLOR ) || defined ( USE _INSTANCING _COLOR )
varying vec3 vColor ;
2024-10-20 21:50:56 +00:00
# endif ` ,Kbt= ` # if defined ( USE _COLOR _ALPHA )
2024-09-29 19:46:45 +00:00
vColor = vec4 ( 1.0 ) ;
# elif defined ( USE _COLOR ) || defined ( USE _INSTANCING _COLOR )
vColor = vec3 ( 1.0 ) ;
# endif
# ifdef USE _COLOR
vColor *= color ;
# endif
# ifdef USE _INSTANCING _COLOR
vColor . xyz *= instanceColor . xyz ;
2024-10-20 21:50:56 +00:00
# endif ` ,jbt= ` # define PI 3.141592653589793
2024-09-29 19:46:45 +00:00
# define PI2 6.283185307179586
# define PI _HALF 1.5707963267948966
# define RECIPROCAL _PI 0.3183098861837907
# define RECIPROCAL _PI2 0.15915494309189535
# define EPSILON 1e-6
# ifndef saturate
# define saturate ( a ) clamp ( a , 0.0 , 1.0 )
# endif
# define whiteComplement ( a ) ( 1.0 - saturate ( a ) )
float pow2 ( const in float x ) { return x * x ; }
vec3 pow2 ( const in vec3 x ) { return x * x ; }
float pow3 ( const in float x ) { return x * x * x ; }
float pow4 ( const in float x ) { float x2 = x * x ; return x2 * x2 ; }
float max3 ( const in vec3 v ) { return max ( max ( v . x , v . y ) , v . z ) ; }
float average ( const in vec3 v ) { return dot ( v , vec3 ( 0.3333333 ) ) ; }
highp float rand ( const in vec2 uv ) {
const highp float a = 12.9898 , b = 78.233 , c = 43758.5453 ;
highp float dt = dot ( uv . xy , vec2 ( a , b ) ) , sn = mod ( dt , PI ) ;
return fract ( sin ( sn ) * c ) ;
}
# ifdef HIGH _PRECISION
float precisionSafeLength ( vec3 v ) { return length ( v ) ; }
# else
float precisionSafeLength ( vec3 v ) {
float maxComponent = max3 ( abs ( v ) ) ;
return length ( v / maxComponent ) * maxComponent ;
}
# endif
struct IncidentLight {
vec3 color ;
vec3 direction ;
bool visible ;
} ;
struct ReflectedLight {
vec3 directDiffuse ;
vec3 directSpecular ;
vec3 indirectDiffuse ;
vec3 indirectSpecular ;
} ;
# ifdef USE _ALPHAHASH
varying vec3 vPosition ;
# endif
vec3 transformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( matrix * vec4 ( dir , 0.0 ) ) . xyz ) ;
}
vec3 inverseTransformDirection ( in vec3 dir , in mat4 matrix ) {
return normalize ( ( vec4 ( dir , 0.0 ) * matrix ) . xyz ) ;
}
mat3 transposeMat3 ( const in mat3 m ) {
mat3 tmp ;
tmp [ 0 ] = vec3 ( m [ 0 ] . x , m [ 1 ] . x , m [ 2 ] . x ) ;
tmp [ 1 ] = vec3 ( m [ 0 ] . y , m [ 1 ] . y , m [ 2 ] . y ) ;
tmp [ 2 ] = vec3 ( m [ 0 ] . z , m [ 1 ] . z , m [ 2 ] . z ) ;
return tmp ;
}
float luminance ( const in vec3 rgb ) {
const vec3 weights = vec3 ( 0.2126729 , 0.7151522 , 0.0721750 ) ;
return dot ( weights , rgb ) ;
}
bool isPerspectiveMatrix ( mat4 m ) {
return m [ 2 ] [ 3 ] == - 1.0 ;
}
vec2 equirectUv ( in vec3 dir ) {
float u = atan ( dir . z , dir . x ) * RECIPROCAL _PI2 + 0.5 ;
float v = asin ( clamp ( dir . y , - 1.0 , 1.0 ) ) * RECIPROCAL _PI + 0.5 ;
return vec2 ( u , v ) ;
}
vec3 BRDF _Lambert ( const in vec3 diffuseColor ) {
return RECIPROCAL _PI * diffuseColor ;
}
vec3 F _Schlick ( const in vec3 f0 , const in float f90 , const in float dotVH ) {
float fresnel = exp2 ( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ) ;
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ) ;
}
float F _Schlick ( const in float f0 , const in float f90 , const in float dotVH ) {
float fresnel = exp2 ( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ) ;
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ) ;
2024-10-20 21:50:56 +00:00
} // validated`,Qbt=`#ifdef ENVMAP_TYPE_CUBE_UV
2024-09-29 19:46:45 +00:00
# define cubeUV _minMipLevel 4.0
# define cubeUV _minTileSize 16.0
float getFace ( vec3 direction ) {
vec3 absDirection = abs ( direction ) ;
float face = - 1.0 ;
if ( absDirection . x > absDirection . z ) {
if ( absDirection . x > absDirection . y )
face = direction . x > 0.0 ? 0.0 : 3.0 ;
else
face = direction . y > 0.0 ? 1.0 : 4.0 ;
} else {
if ( absDirection . z > absDirection . y )
face = direction . z > 0.0 ? 2.0 : 5.0 ;
else
face = direction . y > 0.0 ? 1.0 : 4.0 ;
}
return face ;
}
vec2 getUV ( vec3 direction , float face ) {
vec2 uv ;
if ( face == 0.0 ) {
uv = vec2 ( direction . z , direction . y ) / abs ( direction . x ) ;
} else if ( face == 1.0 ) {
uv = vec2 ( - direction . x , - direction . z ) / abs ( direction . y ) ;
} else if ( face == 2.0 ) {
uv = vec2 ( - direction . x , direction . y ) / abs ( direction . z ) ;
} else if ( face == 3.0 ) {
uv = vec2 ( - direction . z , direction . y ) / abs ( direction . x ) ;
} else if ( face == 4.0 ) {
uv = vec2 ( - direction . x , direction . z ) / abs ( direction . y ) ;
} else {
uv = vec2 ( direction . x , direction . y ) / abs ( direction . z ) ;
}
return 0.5 * ( uv + 1.0 ) ;
}
vec3 bilinearCubeUV ( sampler2D envMap , vec3 direction , float mipInt ) {
float face = getFace ( direction ) ;
float filterInt = max ( cubeUV _minMipLevel - mipInt , 0.0 ) ;
mipInt = max ( mipInt , cubeUV _minMipLevel ) ;
float faceSize = exp2 ( mipInt ) ;
highp vec2 uv = getUV ( direction , face ) * ( faceSize - 2.0 ) + 1.0 ;
if ( face > 2.0 ) {
uv . y += faceSize ;
face -= 3.0 ;
}
uv . x += face * faceSize ;
uv . x += filterInt * 3.0 * cubeUV _minTileSize ;
uv . y += 4.0 * ( exp2 ( CUBEUV _MAX _MIP ) - faceSize ) ;
uv . x *= CUBEUV _TEXEL _WIDTH ;
uv . y *= CUBEUV _TEXEL _HEIGHT ;
# ifdef texture2DGradEXT
return texture2DGradEXT ( envMap , uv , vec2 ( 0.0 ) , vec2 ( 0.0 ) ) . rgb ;
# else
return texture2D ( envMap , uv ) . rgb ;
# endif
}
# define cubeUV _r0 1.0
# define cubeUV _v0 0.339
# define cubeUV _m0 - 2.0
# define cubeUV _r1 0.8
# define cubeUV _v1 0.276
# define cubeUV _m1 - 1.0
# define cubeUV _r4 0.4
# define cubeUV _v4 0.046
# define cubeUV _m4 2.0
# define cubeUV _r5 0.305
# define cubeUV _v5 0.016
# define cubeUV _m5 3.0
# define cubeUV _r6 0.21
# define cubeUV _v6 0.0038
# define cubeUV _m6 4.0
float roughnessToMip ( float roughness ) {
float mip = 0.0 ;
if ( roughness >= cubeUV _r1 ) {
mip = ( cubeUV _r0 - roughness ) * ( cubeUV _m1 - cubeUV _m0 ) / ( cubeUV _r0 - cubeUV _r1 ) + cubeUV _m0 ;
} else if ( roughness >= cubeUV _r4 ) {
mip = ( cubeUV _r1 - roughness ) * ( cubeUV _m4 - cubeUV _m1 ) / ( cubeUV _r1 - cubeUV _r4 ) + cubeUV _m1 ;
} else if ( roughness >= cubeUV _r5 ) {
mip = ( cubeUV _r4 - roughness ) * ( cubeUV _m5 - cubeUV _m4 ) / ( cubeUV _r4 - cubeUV _r5 ) + cubeUV _m4 ;
} else if ( roughness >= cubeUV _r6 ) {
mip = ( cubeUV _r5 - roughness ) * ( cubeUV _m6 - cubeUV _m5 ) / ( cubeUV _r5 - cubeUV _r6 ) + cubeUV _m5 ;
} else {
mip = - 2.0 * log2 ( 1.16 * roughness ) ; }
return mip ;
}
vec4 textureCubeUV ( sampler2D envMap , vec3 sampleDir , float roughness ) {
float mip = clamp ( roughnessToMip ( roughness ) , cubeUV _m0 , CUBEUV _MAX _MIP ) ;
float mipF = fract ( mip ) ;
float mipInt = floor ( mip ) ;
vec3 color0 = bilinearCubeUV ( envMap , sampleDir , mipInt ) ;
if ( mipF == 0.0 ) {
return vec4 ( color0 , 1.0 ) ;
} else {
vec3 color1 = bilinearCubeUV ( envMap , sampleDir , mipInt + 1.0 ) ;
return vec4 ( mix ( color0 , color1 , mipF ) , 1.0 ) ;
}
}
2024-10-20 21:50:56 +00:00
# endif ` ,Xbt= ` vec3 transformedNormal = objectNormal ;
2024-09-29 19:46:45 +00:00
# ifdef USE _TANGENT
vec3 transformedTangent = objectTangent ;
# endif
# ifdef USE _BATCHING
mat3 bm = mat3 ( batchingMatrix ) ;
transformedNormal /= vec3 ( dot ( bm [ 0 ] , bm [ 0 ] ) , dot ( bm [ 1 ] , bm [ 1 ] ) , dot ( bm [ 2 ] , bm [ 2 ] ) ) ;
transformedNormal = bm * transformedNormal ;
# ifdef USE _TANGENT
transformedTangent = bm * transformedTangent ;
# endif
# endif
# ifdef USE _INSTANCING
mat3 im = mat3 ( instanceMatrix ) ;
transformedNormal /= vec3 ( dot ( im [ 0 ] , im [ 0 ] ) , dot ( im [ 1 ] , im [ 1 ] ) , dot ( im [ 2 ] , im [ 2 ] ) ) ;
transformedNormal = im * transformedNormal ;
# ifdef USE _TANGENT
transformedTangent = im * transformedTangent ;
# endif
# endif
transformedNormal = normalMatrix * transformedNormal ;
# ifdef FLIP _SIDED
transformedNormal = - transformedNormal ;
# endif
# ifdef USE _TANGENT
transformedTangent = ( modelViewMatrix * vec4 ( transformedTangent , 0.0 ) ) . xyz ;
# ifdef FLIP _SIDED
transformedTangent = - transformedTangent ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,Zbt= ` # ifdef USE _DISPLACEMENTMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D displacementMap ;
uniform float displacementScale ;
uniform float displacementBias ;
2024-10-20 21:50:56 +00:00
# endif ` ,Jbt= ` # ifdef USE _DISPLACEMENTMAP
2024-09-29 19:46:45 +00:00
transformed += normalize ( objectNormal ) * ( texture2D ( displacementMap , vDisplacementMapUv ) . x * displacementScale + displacementBias ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,e0t= ` # ifdef USE _EMISSIVEMAP
2024-09-29 19:46:45 +00:00
vec4 emissiveColor = texture2D ( emissiveMap , vEmissiveMapUv ) ;
totalEmissiveRadiance *= emissiveColor . rgb ;
2024-10-20 21:50:56 +00:00
# endif ` ,t0t= ` # ifdef USE _EMISSIVEMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D emissiveMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,n0t="gl_FragColor = linearToOutputTexel( gl_FragColor );",s0t= `
2024-09-29 19:46:45 +00:00
const mat3 LINEAR _SRGB _TO _LINEAR _DISPLAY _P3 = mat3 (
vec3 ( 0.8224621 , 0.177538 , 0.0 ) ,
vec3 ( 0.0331941 , 0.9668058 , 0.0 ) ,
vec3 ( 0.0170827 , 0.0723974 , 0.9105199 )
) ;
const mat3 LINEAR _DISPLAY _P3 _TO _LINEAR _SRGB = mat3 (
vec3 ( 1.2249401 , - 0.2249404 , 0.0 ) ,
vec3 ( - 0.0420569 , 1.0420571 , 0.0 ) ,
vec3 ( - 0.0196376 , - 0.0786361 , 1.0982735 )
) ;
vec4 LinearSRGBToLinearDisplayP3 ( in vec4 value ) {
return vec4 ( value . rgb * LINEAR _SRGB _TO _LINEAR _DISPLAY _P3 , value . a ) ;
}
vec4 LinearDisplayP3ToLinearSRGB ( in vec4 value ) {
return vec4 ( value . rgb * LINEAR _DISPLAY _P3 _TO _LINEAR _SRGB , value . a ) ;
}
vec4 LinearTransferOETF ( in vec4 value ) {
return value ;
}
vec4 sRGBTransferOETF ( in vec4 value ) {
return vec4 ( mix ( pow ( value . rgb , vec3 ( 0.41666 ) ) * 1.055 - vec3 ( 0.055 ) , value . rgb * 12.92 , vec3 ( lessThanEqual ( value . rgb , vec3 ( 0.0031308 ) ) ) ) , value . a ) ;
}
vec4 LinearToLinear ( in vec4 value ) {
return value ;
}
vec4 LinearTosRGB ( in vec4 value ) {
return sRGBTransferOETF ( value ) ;
2024-10-20 21:50:56 +00:00
} ` ,i0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
# ifdef ENV _WORLDPOS
vec3 cameraToFrag ;
if ( isOrthographic ) {
cameraToFrag = normalize ( vec3 ( - viewMatrix [ 0 ] [ 2 ] , - viewMatrix [ 1 ] [ 2 ] , - viewMatrix [ 2 ] [ 2 ] ) ) ;
} else {
cameraToFrag = normalize ( vWorldPosition - cameraPosition ) ;
}
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
# ifdef ENVMAP _MODE _REFLECTION
vec3 reflectVec = reflect ( cameraToFrag , worldNormal ) ;
# else
vec3 reflectVec = refract ( cameraToFrag , worldNormal , refractionRatio ) ;
# endif
# else
vec3 reflectVec = vReflect ;
# endif
# ifdef ENVMAP _TYPE _CUBE
vec4 envColor = textureCube ( envMap , vec3 ( flipEnvMap * reflectVec . x , reflectVec . yz ) ) ;
# else
vec4 envColor = vec4 ( 0.0 ) ;
# endif
# ifdef ENVMAP _BLENDING _MULTIPLY
outgoingLight = mix ( outgoingLight , outgoingLight * envColor . xyz , specularStrength * reflectivity ) ;
# elif defined ( ENVMAP _BLENDING _MIX )
outgoingLight = mix ( outgoingLight , envColor . xyz , specularStrength * reflectivity ) ;
# elif defined ( ENVMAP _BLENDING _ADD )
outgoingLight += envColor . xyz * specularStrength * reflectivity ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,r0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
uniform float envMapIntensity ;
uniform float flipEnvMap ;
# ifdef ENVMAP _TYPE _CUBE
uniform samplerCube envMap ;
# else
uniform sampler2D envMap ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,o0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
uniform float reflectivity ;
# if defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP ) || defined ( PHONG ) || defined ( LAMBERT )
# define ENV _WORLDPOS
# endif
# ifdef ENV _WORLDPOS
varying vec3 vWorldPosition ;
uniform float refractionRatio ;
# else
varying vec3 vReflect ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,a0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
# if defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP ) || defined ( PHONG ) || defined ( LAMBERT )
# define ENV _WORLDPOS
# endif
# ifdef ENV _WORLDPOS
varying vec3 vWorldPosition ;
# else
varying vec3 vReflect ;
uniform float refractionRatio ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,l0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
# ifdef ENV _WORLDPOS
vWorldPosition = worldPosition . xyz ;
# else
vec3 cameraToVertex ;
if ( isOrthographic ) {
cameraToVertex = normalize ( vec3 ( - viewMatrix [ 0 ] [ 2 ] , - viewMatrix [ 1 ] [ 2 ] , - viewMatrix [ 2 ] [ 2 ] ) ) ;
} else {
cameraToVertex = normalize ( worldPosition . xyz - cameraPosition ) ;
}
vec3 worldNormal = inverseTransformDirection ( transformedNormal , viewMatrix ) ;
# ifdef ENVMAP _MODE _REFLECTION
vReflect = reflect ( cameraToVertex , worldNormal ) ;
# else
vReflect = refract ( cameraToVertex , worldNormal , refractionRatio ) ;
# endif
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,c0t= ` # ifdef USE _FOG
2024-10-18 23:54:04 +00:00
vFogDepth = - mvPosition . z ;
2024-10-20 21:50:56 +00:00
# endif ` ,d0t= ` # ifdef USE _FOG
2024-10-18 23:54:04 +00:00
varying float vFogDepth ;
2024-10-20 21:50:56 +00:00
# endif ` ,u0t= ` # ifdef USE _FOG
2024-09-29 19:46:45 +00:00
# ifdef FOG _EXP2
float fogFactor = 1.0 - exp ( - fogDensity * fogDensity * vFogDepth * vFogDepth ) ;
# else
float fogFactor = smoothstep ( fogNear , fogFar , vFogDepth ) ;
# endif
gl _FragColor . rgb = mix ( gl _FragColor . rgb , fogColor , fogFactor ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,p0t= ` # ifdef USE _FOG
2024-09-29 19:46:45 +00:00
uniform vec3 fogColor ;
varying float vFogDepth ;
# ifdef FOG _EXP2
uniform float fogDensity ;
# else
uniform float fogNear ;
uniform float fogFar ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,f0t= ` # ifdef USE _GRADIENTMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D gradientMap ;
# endif
vec3 getGradientIrradiance ( vec3 normal , vec3 lightDirection ) {
float dotNL = dot ( normal , lightDirection ) ;
vec2 coord = vec2 ( dotNL * 0.5 + 0.5 , 0.0 ) ;
# ifdef USE _GRADIENTMAP
return vec3 ( texture2D ( gradientMap , coord ) . r ) ;
# else
vec2 fw = fwidth ( coord ) * 0.5 ;
return mix ( vec3 ( 0.7 ) , vec3 ( 1.0 ) , smoothstep ( 0.7 - fw . x , 0.7 + fw . x , coord . x ) ) ;
# endif
2024-10-20 21:50:56 +00:00
} ` ,_0t= ` # ifdef USE _LIGHTMAP
2024-09-29 19:46:45 +00:00
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
vec3 lightMapIrradiance = lightMapTexel . rgb * lightMapIntensity ;
reflectedLight . indirectDiffuse += lightMapIrradiance ;
2024-10-20 21:50:56 +00:00
# endif ` ,m0t= ` # ifdef USE _LIGHTMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D lightMap ;
uniform float lightMapIntensity ;
2024-10-20 21:50:56 +00:00
# endif ` ,h0t= ` LambertMaterial material ;
2024-09-29 19:46:45 +00:00
material . diffuseColor = diffuseColor . rgb ;
2024-10-20 21:50:56 +00:00
material . specularStrength = specularStrength ; ` ,g0t= ` varying vec3 vViewPosition ;
2024-09-29 19:46:45 +00:00
struct LambertMaterial {
vec3 diffuseColor ;
float specularStrength ;
} ;
void RE _Direct _Lambert ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in LambertMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Lambert ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in LambertMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _Lambert
2024-10-20 21:50:56 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _Lambert ` ,b0t= ` uniform bool receiveShadow ;
2024-09-29 19:46:45 +00:00
uniform vec3 ambientLightColor ;
# if defined ( USE _LIGHT _PROBES )
uniform vec3 lightProbe [ 9 ] ;
# endif
vec3 shGetIrradianceAt ( in vec3 normal , in vec3 shCoefficients [ 9 ] ) {
float x = normal . x , y = normal . y , z = normal . z ;
vec3 result = shCoefficients [ 0 ] * 0.886227 ;
result += shCoefficients [ 1 ] * 2.0 * 0.511664 * y ;
result += shCoefficients [ 2 ] * 2.0 * 0.511664 * z ;
result += shCoefficients [ 3 ] * 2.0 * 0.511664 * x ;
result += shCoefficients [ 4 ] * 2.0 * 0.429043 * x * y ;
result += shCoefficients [ 5 ] * 2.0 * 0.429043 * y * z ;
result += shCoefficients [ 6 ] * ( 0.743125 * z * z - 0.247708 ) ;
result += shCoefficients [ 7 ] * 2.0 * 0.429043 * x * z ;
result += shCoefficients [ 8 ] * 0.429043 * ( x * x - y * y ) ;
return result ;
}
vec3 getLightProbeIrradiance ( const in vec3 lightProbe [ 9 ] , const in vec3 normal ) {
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
vec3 irradiance = shGetIrradianceAt ( worldNormal , lightProbe ) ;
return irradiance ;
}
vec3 getAmbientLightIrradiance ( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor ;
return irradiance ;
}
float getDistanceAttenuation ( const in float lightDistance , const in float cutoffDistance , const in float decayExponent ) {
# if defined ( LEGACY _LIGHTS )
if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow ( saturate ( - lightDistance / cutoffDistance + 1.0 ) , decayExponent ) ;
}
return 1.0 ;
# else
float distanceFalloff = 1.0 / max ( pow ( lightDistance , decayExponent ) , 0.01 ) ;
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2 ( saturate ( 1.0 - pow4 ( lightDistance / cutoffDistance ) ) ) ;
}
return distanceFalloff ;
# endif
}
float getSpotAttenuation ( const in float coneCosine , const in float penumbraCosine , const in float angleCosine ) {
return smoothstep ( coneCosine , penumbraCosine , angleCosine ) ;
}
# if NUM _DIR _LIGHTS > 0
struct DirectionalLight {
vec3 direction ;
vec3 color ;
} ;
uniform DirectionalLight directionalLights [ NUM _DIR _LIGHTS ] ;
void getDirectionalLightInfo ( const in DirectionalLight directionalLight , out IncidentLight light ) {
light . color = directionalLight . color ;
light . direction = directionalLight . direction ;
light . visible = true ;
}
# endif
# if NUM _POINT _LIGHTS > 0
struct PointLight {
vec3 position ;
vec3 color ;
float distance ;
float decay ;
} ;
uniform PointLight pointLights [ NUM _POINT _LIGHTS ] ;
void getPointLightInfo ( const in PointLight pointLight , const in vec3 geometryPosition , out IncidentLight light ) {
vec3 lVector = pointLight . position - geometryPosition ;
light . direction = normalize ( lVector ) ;
float lightDistance = length ( lVector ) ;
light . color = pointLight . color ;
light . color *= getDistanceAttenuation ( lightDistance , pointLight . distance , pointLight . decay ) ;
light . visible = ( light . color != vec3 ( 0.0 ) ) ;
}
# endif
# if NUM _SPOT _LIGHTS > 0
struct SpotLight {
vec3 position ;
vec3 direction ;
vec3 color ;
float distance ;
float decay ;
float coneCos ;
float penumbraCos ;
} ;
uniform SpotLight spotLights [ NUM _SPOT _LIGHTS ] ;
void getSpotLightInfo ( const in SpotLight spotLight , const in vec3 geometryPosition , out IncidentLight light ) {
vec3 lVector = spotLight . position - geometryPosition ;
light . direction = normalize ( lVector ) ;
float angleCos = dot ( light . direction , spotLight . direction ) ;
float spotAttenuation = getSpotAttenuation ( spotLight . coneCos , spotLight . penumbraCos , angleCos ) ;
if ( spotAttenuation > 0.0 ) {
float lightDistance = length ( lVector ) ;
light . color = spotLight . color * spotAttenuation ;
light . color *= getDistanceAttenuation ( lightDistance , spotLight . distance , spotLight . decay ) ;
light . visible = ( light . color != vec3 ( 0.0 ) ) ;
} else {
light . color = vec3 ( 0.0 ) ;
light . visible = false ;
}
}
# endif
# if NUM _RECT _AREA _LIGHTS > 0
struct RectAreaLight {
vec3 color ;
vec3 position ;
vec3 halfWidth ;
vec3 halfHeight ;
} ;
uniform sampler2D ltc _1 ; uniform sampler2D ltc _2 ;
uniform RectAreaLight rectAreaLights [ NUM _RECT _AREA _LIGHTS ] ;
# endif
# if NUM _HEMI _LIGHTS > 0
struct HemisphereLight {
vec3 direction ;
vec3 skyColor ;
vec3 groundColor ;
} ;
uniform HemisphereLight hemisphereLights [ NUM _HEMI _LIGHTS ] ;
vec3 getHemisphereLightIrradiance ( const in HemisphereLight hemiLight , const in vec3 normal ) {
float dotNL = dot ( normal , hemiLight . direction ) ;
float hemiDiffuseWeight = 0.5 * dotNL + 0.5 ;
vec3 irradiance = mix ( hemiLight . groundColor , hemiLight . skyColor , hemiDiffuseWeight ) ;
return irradiance ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,y0t= ` # ifdef USE _ENVMAP
2024-09-29 19:46:45 +00:00
vec3 getIBLIrradiance ( const in vec3 normal ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 worldNormal = inverseTransformDirection ( normal , viewMatrix ) ;
vec4 envMapColor = textureCubeUV ( envMap , worldNormal , 1.0 ) ;
return PI * envMapColor . rgb * envMapIntensity ;
# else
return vec3 ( 0.0 ) ;
# endif
}
vec3 getIBLRadiance ( const in vec3 viewDir , const in vec3 normal , const in float roughness ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 reflectVec = reflect ( - viewDir , normal ) ;
reflectVec = normalize ( mix ( reflectVec , normal , roughness * roughness ) ) ;
reflectVec = inverseTransformDirection ( reflectVec , viewMatrix ) ;
vec4 envMapColor = textureCubeUV ( envMap , reflectVec , roughness ) ;
return envMapColor . rgb * envMapIntensity ;
# else
return vec3 ( 0.0 ) ;
# endif
}
# ifdef USE _ANISOTROPY
vec3 getIBLAnisotropyRadiance ( const in vec3 viewDir , const in vec3 normal , const in float roughness , const in vec3 bitangent , const in float anisotropy ) {
# ifdef ENVMAP _TYPE _CUBE _UV
vec3 bentNormal = cross ( bitangent , viewDir ) ;
bentNormal = normalize ( cross ( bentNormal , bitangent ) ) ;
bentNormal = normalize ( mix ( bentNormal , normal , pow2 ( pow2 ( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ) ;
return getIBLRadiance ( viewDir , bentNormal , roughness ) ;
# else
return vec3 ( 0.0 ) ;
# endif
}
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,E0t= ` ToonMaterial material ;
material . diffuseColor = diffuseColor . rgb ; ` ,v0t= ` varying vec3 vViewPosition ;
2024-09-29 19:46:45 +00:00
struct ToonMaterial {
vec3 diffuseColor ;
} ;
void RE _Direct _Toon ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in ToonMaterial material , inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance ( geometryNormal , directLight . direction ) * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Toon ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in ToonMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _Toon
2024-10-20 21:50:56 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _Toon ` ,S0t= ` BlinnPhongMaterial material ;
2024-09-29 19:46:45 +00:00
material . diffuseColor = diffuseColor . rgb ;
material . specularColor = specular ;
material . specularShininess = shininess ;
2024-10-20 21:50:56 +00:00
material . specularStrength = specularStrength ; ` ,T0t= ` varying vec3 vViewPosition ;
2024-09-29 19:46:45 +00:00
struct BlinnPhongMaterial {
vec3 diffuseColor ;
vec3 specularColor ;
float specularShininess ;
float specularStrength ;
} ;
void RE _Direct _BlinnPhong ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in BlinnPhongMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
reflectedLight . directSpecular += irradiance * BRDF _BlinnPhong ( directLight . direction , geometryViewDir , geometryNormal , material . specularColor , material . specularShininess ) * material . specularStrength ;
}
void RE _IndirectDiffuse _BlinnPhong ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in BlinnPhongMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
# define RE _Direct RE _Direct _BlinnPhong
2024-10-20 21:50:56 +00:00
# define RE _IndirectDiffuse RE _IndirectDiffuse _BlinnPhong ` ,x0t= ` PhysicalMaterial material ;
2024-09-29 19:46:45 +00:00
material . diffuseColor = diffuseColor . rgb * ( 1.0 - metalnessFactor ) ;
vec3 dxy = max ( abs ( dFdx ( nonPerturbedNormal ) ) , abs ( dFdy ( nonPerturbedNormal ) ) ) ;
float geometryRoughness = max ( max ( dxy . x , dxy . y ) , dxy . z ) ;
material . roughness = max ( roughnessFactor , 0.0525 ) ; material . roughness += geometryRoughness ;
material . roughness = min ( material . roughness , 1.0 ) ;
# ifdef IOR
material . ior = ior ;
# ifdef USE _SPECULAR
float specularIntensityFactor = specularIntensity ;
vec3 specularColorFactor = specularColor ;
# ifdef USE _SPECULAR _COLORMAP
specularColorFactor *= texture2D ( specularColorMap , vSpecularColorMapUv ) . rgb ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
specularIntensityFactor *= texture2D ( specularIntensityMap , vSpecularIntensityMapUv ) . a ;
# endif
material . specularF90 = mix ( specularIntensityFactor , 1.0 , metalnessFactor ) ;
# else
float specularIntensityFactor = 1.0 ;
vec3 specularColorFactor = vec3 ( 1.0 ) ;
material . specularF90 = 1.0 ;
# endif
material . specularColor = mix ( min ( pow2 ( ( material . ior - 1.0 ) / ( material . ior + 1.0 ) ) * specularColorFactor , vec3 ( 1.0 ) ) * specularIntensityFactor , diffuseColor . rgb , metalnessFactor ) ;
# else
material . specularColor = mix ( vec3 ( 0.04 ) , diffuseColor . rgb , metalnessFactor ) ;
material . specularF90 = 1.0 ;
# endif
# ifdef USE _CLEARCOAT
material . clearcoat = clearcoat ;
material . clearcoatRoughness = clearcoatRoughness ;
material . clearcoatF0 = vec3 ( 0.04 ) ;
material . clearcoatF90 = 1.0 ;
# ifdef USE _CLEARCOATMAP
material . clearcoat *= texture2D ( clearcoatMap , vClearcoatMapUv ) . x ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
material . clearcoatRoughness *= texture2D ( clearcoatRoughnessMap , vClearcoatRoughnessMapUv ) . y ;
# endif
material . clearcoat = saturate ( material . clearcoat ) ; material . clearcoatRoughness = max ( material . clearcoatRoughness , 0.0525 ) ;
material . clearcoatRoughness += geometryRoughness ;
material . clearcoatRoughness = min ( material . clearcoatRoughness , 1.0 ) ;
# endif
# ifdef USE _IRIDESCENCE
material . iridescence = iridescence ;
material . iridescenceIOR = iridescenceIOR ;
# ifdef USE _IRIDESCENCEMAP
material . iridescence *= texture2D ( iridescenceMap , vIridescenceMapUv ) . r ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
material . iridescenceThickness = ( iridescenceThicknessMaximum - iridescenceThicknessMinimum ) * texture2D ( iridescenceThicknessMap , vIridescenceThicknessMapUv ) . g + iridescenceThicknessMinimum ;
# else
material . iridescenceThickness = iridescenceThicknessMaximum ;
# endif
# endif
# ifdef USE _SHEEN
material . sheenColor = sheenColor ;
# ifdef USE _SHEEN _COLORMAP
material . sheenColor *= texture2D ( sheenColorMap , vSheenColorMapUv ) . rgb ;
# endif
material . sheenRoughness = clamp ( sheenRoughness , 0.07 , 1.0 ) ;
# ifdef USE _SHEEN _ROUGHNESSMAP
material . sheenRoughness *= texture2D ( sheenRoughnessMap , vSheenRoughnessMapUv ) . a ;
# endif
# endif
# ifdef USE _ANISOTROPY
# ifdef USE _ANISOTROPYMAP
mat2 anisotropyMat = mat2 ( anisotropyVector . x , anisotropyVector . y , - anisotropyVector . y , anisotropyVector . x ) ;
vec3 anisotropyPolar = texture2D ( anisotropyMap , vAnisotropyMapUv ) . rgb ;
vec2 anisotropyV = anisotropyMat * normalize ( 2.0 * anisotropyPolar . rg - vec2 ( 1.0 ) ) * anisotropyPolar . b ;
# else
vec2 anisotropyV = anisotropyVector ;
# endif
material . anisotropy = length ( anisotropyV ) ;
if ( material . anisotropy == 0.0 ) {
anisotropyV = vec2 ( 1.0 , 0.0 ) ;
} else {
anisotropyV /= material . anisotropy ;
material . anisotropy = saturate ( material . anisotropy ) ;
}
material . alphaT = mix ( pow2 ( material . roughness ) , 1.0 , pow2 ( material . anisotropy ) ) ;
material . anisotropyT = tbn [ 0 ] * anisotropyV . x + tbn [ 1 ] * anisotropyV . y ;
material . anisotropyB = tbn [ 1 ] * anisotropyV . x - tbn [ 0 ] * anisotropyV . y ;
2024-10-20 21:50:56 +00:00
# endif ` ,C0t= ` struct PhysicalMaterial {
2024-09-29 19:46:45 +00:00
vec3 diffuseColor ;
float roughness ;
vec3 specularColor ;
float specularF90 ;
# ifdef USE _CLEARCOAT
float clearcoat ;
float clearcoatRoughness ;
vec3 clearcoatF0 ;
float clearcoatF90 ;
# endif
# ifdef USE _IRIDESCENCE
float iridescence ;
float iridescenceIOR ;
float iridescenceThickness ;
vec3 iridescenceFresnel ;
vec3 iridescenceF0 ;
# endif
# ifdef USE _SHEEN
vec3 sheenColor ;
float sheenRoughness ;
# endif
# ifdef IOR
float ior ;
# endif
# ifdef USE _TRANSMISSION
float transmission ;
float transmissionAlpha ;
float thickness ;
float attenuationDistance ;
vec3 attenuationColor ;
# endif
# ifdef USE _ANISOTROPY
float anisotropy ;
float alphaT ;
vec3 anisotropyT ;
vec3 anisotropyB ;
# endif
} ;
vec3 clearcoatSpecularDirect = vec3 ( 0.0 ) ;
vec3 clearcoatSpecularIndirect = vec3 ( 0.0 ) ;
vec3 sheenSpecularDirect = vec3 ( 0.0 ) ;
vec3 sheenSpecularIndirect = vec3 ( 0.0 ) ;
vec3 Schlick _to _F0 ( const in vec3 f , const in float f90 , const in float dotVH ) {
float x = clamp ( 1.0 - dotVH , 0.0 , 1.0 ) ;
float x2 = x * x ;
float x5 = clamp ( x * x2 * x2 , 0.0 , 0.9999 ) ;
return ( f - vec3 ( f90 ) * x5 ) / ( 1.0 - x5 ) ;
}
float V _GGX _SmithCorrelated ( const in float alpha , const in float dotNL , const in float dotNV ) {
float a2 = pow2 ( alpha ) ;
float gv = dotNL * sqrt ( a2 + ( 1.0 - a2 ) * pow2 ( dotNV ) ) ;
float gl = dotNV * sqrt ( a2 + ( 1.0 - a2 ) * pow2 ( dotNL ) ) ;
return 0.5 / max ( gv + gl , EPSILON ) ;
}
float D _GGX ( const in float alpha , const in float dotNH ) {
float a2 = pow2 ( alpha ) ;
float denom = pow2 ( dotNH ) * ( a2 - 1.0 ) + 1.0 ;
return RECIPROCAL _PI * a2 / pow2 ( denom ) ;
}
# ifdef USE _ANISOTROPY
float V _GGX _SmithCorrelated _Anisotropic ( const in float alphaT , const in float alphaB , const in float dotTV , const in float dotBV , const in float dotTL , const in float dotBL , const in float dotNV , const in float dotNL ) {
float gv = dotNL * length ( vec3 ( alphaT * dotTV , alphaB * dotBV , dotNV ) ) ;
float gl = dotNV * length ( vec3 ( alphaT * dotTL , alphaB * dotBL , dotNL ) ) ;
float v = 0.5 / ( gv + gl ) ;
return saturate ( v ) ;
}
float D _GGX _Anisotropic ( const in float alphaT , const in float alphaB , const in float dotNH , const in float dotTH , const in float dotBH ) {
float a2 = alphaT * alphaB ;
highp vec3 v = vec3 ( alphaB * dotTH , alphaT * dotBH , a2 * dotNH ) ;
highp float v2 = dot ( v , v ) ;
float w2 = a2 / v2 ;
return RECIPROCAL _PI * a2 * pow2 ( w2 ) ;
}
# endif
# ifdef USE _CLEARCOAT
vec3 BRDF _GGX _Clearcoat ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in PhysicalMaterial material ) {
vec3 f0 = material . clearcoatF0 ;
float f90 = material . clearcoatF90 ;
float roughness = material . clearcoatRoughness ;
float alpha = pow2 ( roughness ) ;
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( f0 , f90 , dotVH ) ;
float V = V _GGX _SmithCorrelated ( alpha , dotNL , dotNV ) ;
float D = D _GGX ( alpha , dotNH ) ;
return F * ( V * D ) ;
}
# endif
vec3 BRDF _GGX ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , const in PhysicalMaterial material ) {
vec3 f0 = material . specularColor ;
float f90 = material . specularF90 ;
float roughness = material . roughness ;
float alpha = pow2 ( roughness ) ;
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float dotVH = saturate ( dot ( viewDir , halfDir ) ) ;
vec3 F = F _Schlick ( f0 , f90 , dotVH ) ;
# ifdef USE _IRIDESCENCE
F = mix ( F , material . iridescenceFresnel , material . iridescence ) ;
# endif
# ifdef USE _ANISOTROPY
float dotTL = dot ( material . anisotropyT , lightDir ) ;
float dotTV = dot ( material . anisotropyT , viewDir ) ;
float dotTH = dot ( material . anisotropyT , halfDir ) ;
float dotBL = dot ( material . anisotropyB , lightDir ) ;
float dotBV = dot ( material . anisotropyB , viewDir ) ;
float dotBH = dot ( material . anisotropyB , halfDir ) ;
float V = V _GGX _SmithCorrelated _Anisotropic ( material . alphaT , alpha , dotTV , dotBV , dotTL , dotBL , dotNV , dotNL ) ;
float D = D _GGX _Anisotropic ( material . alphaT , alpha , dotNH , dotTH , dotBH ) ;
# else
float V = V _GGX _SmithCorrelated ( alpha , dotNL , dotNV ) ;
float D = D _GGX ( alpha , dotNH ) ;
# endif
return F * ( V * D ) ;
}
vec2 LTC _Uv ( const in vec3 N , const in vec3 V , const in float roughness ) {
const float LUT _SIZE = 64.0 ;
const float LUT _SCALE = ( LUT _SIZE - 1.0 ) / LUT _SIZE ;
const float LUT _BIAS = 0.5 / LUT _SIZE ;
float dotNV = saturate ( dot ( N , V ) ) ;
vec2 uv = vec2 ( roughness , sqrt ( 1.0 - dotNV ) ) ;
uv = uv * LUT _SCALE + LUT _BIAS ;
return uv ;
}
float LTC _ClippedSphereFormFactor ( const in vec3 f ) {
float l = length ( f ) ;
return max ( ( l * l + f . z ) / ( l + 1.0 ) , 0.0 ) ;
}
vec3 LTC _EdgeVectorFormFactor ( const in vec3 v1 , const in vec3 v2 ) {
float x = dot ( v1 , v2 ) ;
float y = abs ( x ) ;
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y ;
float b = 3.4175940 + ( 4.1616724 + y ) * y ;
float v = a / b ;
float theta _sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt ( max ( 1.0 - x * x , 1e-7 ) ) - v ;
return cross ( v1 , v2 ) * theta _sintheta ;
}
vec3 LTC _Evaluate ( const in vec3 N , const in vec3 V , const in vec3 P , const in mat3 mInv , const in vec3 rectCoords [ 4 ] ) {
vec3 v1 = rectCoords [ 1 ] - rectCoords [ 0 ] ;
vec3 v2 = rectCoords [ 3 ] - rectCoords [ 0 ] ;
vec3 lightNormal = cross ( v1 , v2 ) ;
if ( dot ( lightNormal , P - rectCoords [ 0 ] ) < 0.0 ) return vec3 ( 0.0 ) ;
vec3 T1 , T2 ;
T1 = normalize ( V - N * dot ( V , N ) ) ;
T2 = - cross ( N , T1 ) ;
mat3 mat = mInv * transposeMat3 ( mat3 ( T1 , T2 , N ) ) ;
vec3 coords [ 4 ] ;
coords [ 0 ] = mat * ( rectCoords [ 0 ] - P ) ;
coords [ 1 ] = mat * ( rectCoords [ 1 ] - P ) ;
coords [ 2 ] = mat * ( rectCoords [ 2 ] - P ) ;
coords [ 3 ] = mat * ( rectCoords [ 3 ] - P ) ;
coords [ 0 ] = normalize ( coords [ 0 ] ) ;
coords [ 1 ] = normalize ( coords [ 1 ] ) ;
coords [ 2 ] = normalize ( coords [ 2 ] ) ;
coords [ 3 ] = normalize ( coords [ 3 ] ) ;
vec3 vectorFormFactor = vec3 ( 0.0 ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 0 ] , coords [ 1 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 1 ] , coords [ 2 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 2 ] , coords [ 3 ] ) ;
vectorFormFactor += LTC _EdgeVectorFormFactor ( coords [ 3 ] , coords [ 0 ] ) ;
float result = LTC _ClippedSphereFormFactor ( vectorFormFactor ) ;
return vec3 ( result ) ;
}
# if defined ( USE _SHEEN )
float D _Charlie ( float roughness , float dotNH ) {
float alpha = pow2 ( roughness ) ;
float invAlpha = 1.0 / alpha ;
float cos2h = dotNH * dotNH ;
float sin2h = max ( 1.0 - cos2h , 0.0078125 ) ;
return ( 2.0 + invAlpha ) * pow ( sin2h , invAlpha * 0.5 ) / ( 2.0 * PI ) ;
}
float V _Neubelt ( float dotNV , float dotNL ) {
return saturate ( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ) ;
}
vec3 BRDF _Sheen ( const in vec3 lightDir , const in vec3 viewDir , const in vec3 normal , vec3 sheenColor , const in float sheenRoughness ) {
vec3 halfDir = normalize ( lightDir + viewDir ) ;
float dotNL = saturate ( dot ( normal , lightDir ) ) ;
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float dotNH = saturate ( dot ( normal , halfDir ) ) ;
float D = D _Charlie ( sheenRoughness , dotNH ) ;
float V = V _Neubelt ( dotNV , dotNL ) ;
return sheenColor * ( D * V ) ;
}
# endif
float IBLSheenBRDF ( const in vec3 normal , const in vec3 viewDir , const in float roughness ) {
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
float r2 = roughness * roughness ;
float a = roughness < 0.25 ? - 339.2 * r2 + 161.4 * roughness - 25.9 : - 8.48 * r2 + 14.3 * roughness - 9.95 ;
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72 ;
float DG = exp ( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ) ;
return saturate ( DG * RECIPROCAL _PI ) ;
}
vec2 DFGApprox ( const in vec3 normal , const in vec3 viewDir , const in float roughness ) {
float dotNV = saturate ( dot ( normal , viewDir ) ) ;
const vec4 c0 = vec4 ( - 1 , - 0.0275 , - 0.572 , 0.022 ) ;
const vec4 c1 = vec4 ( 1 , 0.0425 , 1.04 , - 0.04 ) ;
vec4 r = roughness * c0 + c1 ;
float a004 = min ( r . x * r . x , exp2 ( - 9.28 * dotNV ) ) * r . x + r . y ;
vec2 fab = vec2 ( - 1.04 , 1.04 ) * a004 + r . zw ;
return fab ;
}
vec3 EnvironmentBRDF ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float roughness ) {
vec2 fab = DFGApprox ( normal , viewDir , roughness ) ;
return specularColor * fab . x + specularF90 * fab . y ;
}
# ifdef USE _IRIDESCENCE
void computeMultiscatteringIridescence ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float iridescence , const in vec3 iridescenceF0 , const in float roughness , inout vec3 singleScatter , inout vec3 multiScatter ) {
# else
void computeMultiscattering ( const in vec3 normal , const in vec3 viewDir , const in vec3 specularColor , const in float specularF90 , const in float roughness , inout vec3 singleScatter , inout vec3 multiScatter ) {
# endif
vec2 fab = DFGApprox ( normal , viewDir , roughness ) ;
# ifdef USE _IRIDESCENCE
vec3 Fr = mix ( specularColor , iridescenceF0 , iridescence ) ;
# else
vec3 Fr = specularColor ;
# endif
vec3 FssEss = Fr * fab . x + specularF90 * fab . y ;
float Ess = fab . x + fab . y ;
float Ems = 1.0 - Ess ;
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619 ; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ) ;
singleScatter += FssEss ;
multiScatter += Fms * Ems ;
}
# if NUM _RECT _AREA _LIGHTS > 0
void RE _Direct _RectArea _Physical ( const in RectAreaLight rectAreaLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
vec3 normal = geometryNormal ;
vec3 viewDir = geometryViewDir ;
vec3 position = geometryPosition ;
vec3 lightPos = rectAreaLight . position ;
vec3 halfWidth = rectAreaLight . halfWidth ;
vec3 halfHeight = rectAreaLight . halfHeight ;
vec3 lightColor = rectAreaLight . color ;
float roughness = material . roughness ;
vec3 rectCoords [ 4 ] ;
rectCoords [ 0 ] = lightPos + halfWidth - halfHeight ; rectCoords [ 1 ] = lightPos - halfWidth - halfHeight ;
rectCoords [ 2 ] = lightPos - halfWidth + halfHeight ;
rectCoords [ 3 ] = lightPos + halfWidth + halfHeight ;
vec2 uv = LTC _Uv ( normal , viewDir , roughness ) ;
vec4 t1 = texture2D ( ltc _1 , uv ) ;
vec4 t2 = texture2D ( ltc _2 , uv ) ;
mat3 mInv = mat3 (
vec3 ( t1 . x , 0 , t1 . y ) ,
vec3 ( 0 , 1 , 0 ) ,
vec3 ( t1 . z , 0 , t1 . w )
) ;
vec3 fresnel = ( material . specularColor * t2 . x + ( vec3 ( 1.0 ) - material . specularColor ) * t2 . y ) ;
reflectedLight . directSpecular += lightColor * fresnel * LTC _Evaluate ( normal , viewDir , position , mInv , rectCoords ) ;
reflectedLight . directDiffuse += lightColor * material . diffuseColor * LTC _Evaluate ( normal , viewDir , position , mat3 ( 1.0 ) , rectCoords ) ;
}
# endif
void RE _Direct _Physical ( const in IncidentLight directLight , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
float dotNL = saturate ( dot ( geometryNormal , directLight . direction ) ) ;
vec3 irradiance = dotNL * directLight . color ;
# ifdef USE _CLEARCOAT
float dotNLcc = saturate ( dot ( geometryClearcoatNormal , directLight . direction ) ) ;
vec3 ccIrradiance = dotNLcc * directLight . color ;
clearcoatSpecularDirect += ccIrradiance * BRDF _GGX _Clearcoat ( directLight . direction , geometryViewDir , geometryClearcoatNormal , material ) ;
# endif
# ifdef USE _SHEEN
sheenSpecularDirect += irradiance * BRDF _Sheen ( directLight . direction , geometryViewDir , geometryNormal , material . sheenColor , material . sheenRoughness ) ;
# endif
reflectedLight . directSpecular += irradiance * BRDF _GGX ( directLight . direction , geometryViewDir , geometryNormal , material ) ;
reflectedLight . directDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectDiffuse _Physical ( const in vec3 irradiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
reflectedLight . indirectDiffuse += irradiance * BRDF _Lambert ( material . diffuseColor ) ;
}
void RE _IndirectSpecular _Physical ( const in vec3 radiance , const in vec3 irradiance , const in vec3 clearcoatRadiance , const in vec3 geometryPosition , const in vec3 geometryNormal , const in vec3 geometryViewDir , const in vec3 geometryClearcoatNormal , const in PhysicalMaterial material , inout ReflectedLight reflectedLight ) {
# ifdef USE _CLEARCOAT
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF ( geometryClearcoatNormal , geometryViewDir , material . clearcoatF0 , material . clearcoatF90 , material . clearcoatRoughness ) ;
# endif
# ifdef USE _SHEEN
sheenSpecularIndirect += irradiance * material . sheenColor * IBLSheenBRDF ( geometryNormal , geometryViewDir , material . sheenRoughness ) ;
# endif
vec3 singleScattering = vec3 ( 0.0 ) ;
vec3 multiScattering = vec3 ( 0.0 ) ;
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL _PI ;
# ifdef USE _IRIDESCENCE
computeMultiscatteringIridescence ( geometryNormal , geometryViewDir , material . specularColor , material . specularF90 , material . iridescence , material . iridescenceFresnel , material . roughness , singleScattering , multiScattering ) ;
# else
computeMultiscattering ( geometryNormal , geometryViewDir , material . specularColor , material . specularF90 , material . roughness , singleScattering , multiScattering ) ;
# endif
vec3 totalScattering = singleScattering + multiScattering ;
vec3 diffuse = material . diffuseColor * ( 1.0 - max ( max ( totalScattering . r , totalScattering . g ) , totalScattering . b ) ) ;
reflectedLight . indirectSpecular += radiance * singleScattering ;
reflectedLight . indirectSpecular += multiScattering * cosineWeightedIrradiance ;
reflectedLight . indirectDiffuse += diffuse * cosineWeightedIrradiance ;
}
# define RE _Direct RE _Direct _Physical
# define RE _Direct _RectArea RE _Direct _RectArea _Physical
# define RE _IndirectDiffuse RE _IndirectDiffuse _Physical
# define RE _IndirectSpecular RE _IndirectSpecular _Physical
float computeSpecularOcclusion ( const in float dotNV , const in float ambientOcclusion , const in float roughness ) {
return saturate ( pow ( dotNV + ambientOcclusion , exp2 ( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ) ;
2024-10-20 21:50:56 +00:00
} ` ,w0t= `
2024-09-29 19:46:45 +00:00
vec3 geometryPosition = - vViewPosition ;
vec3 geometryNormal = normal ;
vec3 geometryViewDir = ( isOrthographic ) ? vec3 ( 0 , 0 , 1 ) : normalize ( vViewPosition ) ;
vec3 geometryClearcoatNormal = vec3 ( 0.0 ) ;
# ifdef USE _CLEARCOAT
geometryClearcoatNormal = clearcoatNormal ;
# endif
# ifdef USE _IRIDESCENCE
float dotNVi = saturate ( dot ( normal , geometryViewDir ) ) ;
if ( material . iridescenceThickness == 0.0 ) {
material . iridescence = 0.0 ;
} else {
material . iridescence = saturate ( material . iridescence ) ;
}
if ( material . iridescence > 0.0 ) {
material . iridescenceFresnel = evalIridescence ( 1.0 , material . iridescenceIOR , dotNVi , material . iridescenceThickness , material . specularColor ) ;
material . iridescenceF0 = Schlick _to _F0 ( material . iridescenceFresnel , 1.0 , dotNVi ) ;
}
# endif
IncidentLight directLight ;
# if ( NUM _POINT _LIGHTS > 0 ) && defined ( RE _Direct )
PointLight pointLight ;
# if defined ( USE _SHADOWMAP ) && NUM _POINT _LIGHT _SHADOWS > 0
PointLightShadow pointLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHTS ; i ++ ) {
pointLight = pointLights [ i ] ;
getPointLightInfo ( pointLight , geometryPosition , directLight ) ;
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _POINT _LIGHT _SHADOWS )
pointLightShadow = pointLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getPointShadow ( pointShadowMap [ i ] , pointLightShadow . shadowMapSize , pointLightShadow . shadowBias , pointLightShadow . shadowRadius , vPointShadowCoord [ i ] , pointLightShadow . shadowCameraNear , pointLightShadow . shadowCameraFar ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _SPOT _LIGHTS > 0 ) && defined ( RE _Direct )
SpotLight spotLight ;
vec4 spotColor ;
vec3 spotLightCoord ;
bool inSpotLightMap ;
# if defined ( USE _SHADOWMAP ) && NUM _SPOT _LIGHT _SHADOWS > 0
SpotLightShadow spotLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHTS ; i ++ ) {
spotLight = spotLights [ i ] ;
getSpotLightInfo ( spotLight , geometryPosition , directLight ) ;
# if ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS _WITH _MAPS )
# define SPOT _LIGHT _MAP _INDEX UNROLLED _LOOP _INDEX
# elif ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
# define SPOT _LIGHT _MAP _INDEX NUM _SPOT _LIGHT _MAPS
# else
# define SPOT _LIGHT _MAP _INDEX ( UNROLLED _LOOP _INDEX - NUM _SPOT _LIGHT _SHADOWS + NUM _SPOT _LIGHT _SHADOWS _WITH _MAPS )
# endif
# if ( SPOT _LIGHT _MAP _INDEX < NUM _SPOT _LIGHT _MAPS )
spotLightCoord = vSpotLightCoord [ i ] . xyz / vSpotLightCoord [ i ] . w ;
inSpotLightMap = all ( lessThan ( abs ( spotLightCoord * 2. - 1. ) , vec3 ( 1.0 ) ) ) ;
spotColor = texture2D ( spotLightMap [ SPOT _LIGHT _MAP _INDEX ] , spotLightCoord . xy ) ;
directLight . color = inSpotLightMap ? directLight . color * spotColor . rgb : directLight . color ;
# endif
# undef SPOT _LIGHT _MAP _INDEX
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
spotLightShadow = spotLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getShadow ( spotShadowMap [ i ] , spotLightShadow . shadowMapSize , spotLightShadow . shadowBias , spotLightShadow . shadowRadius , vSpotLightCoord [ i ] ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _DIR _LIGHTS > 0 ) && defined ( RE _Direct )
DirectionalLight directionalLight ;
# if defined ( USE _SHADOWMAP ) && NUM _DIR _LIGHT _SHADOWS > 0
DirectionalLightShadow directionalLightShadow ;
# endif
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHTS ; i ++ ) {
directionalLight = directionalLights [ i ] ;
getDirectionalLightInfo ( directionalLight , directLight ) ;
# if defined ( USE _SHADOWMAP ) && ( UNROLLED _LOOP _INDEX < NUM _DIR _LIGHT _SHADOWS )
directionalLightShadow = directionalLightShadows [ i ] ;
directLight . color *= ( directLight . visible && receiveShadow ) ? getShadow ( directionalShadowMap [ i ] , directionalLightShadow . shadowMapSize , directionalLightShadow . shadowBias , directionalLightShadow . shadowRadius , vDirectionalShadowCoord [ i ] ) : 1.0 ;
# endif
RE _Direct ( directLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if ( NUM _RECT _AREA _LIGHTS > 0 ) && defined ( RE _Direct _RectArea )
RectAreaLight rectAreaLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _RECT _AREA _LIGHTS ; i ++ ) {
rectAreaLight = rectAreaLights [ i ] ;
RE _Direct _RectArea ( rectAreaLight , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
}
# pragma unroll _loop _end
# endif
# if defined ( RE _IndirectDiffuse )
vec3 iblIrradiance = vec3 ( 0.0 ) ;
vec3 irradiance = getAmbientLightIrradiance ( ambientLightColor ) ;
# if defined ( USE _LIGHT _PROBES )
irradiance += getLightProbeIrradiance ( lightProbe , geometryNormal ) ;
# endif
# if ( NUM _HEMI _LIGHTS > 0 )
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _HEMI _LIGHTS ; i ++ ) {
irradiance += getHemisphereLightIrradiance ( hemisphereLights [ i ] , geometryNormal ) ;
}
# pragma unroll _loop _end
# endif
# endif
# if defined ( RE _IndirectSpecular )
vec3 radiance = vec3 ( 0.0 ) ;
vec3 clearcoatRadiance = vec3 ( 0.0 ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,R0t= ` # if defined ( RE _IndirectDiffuse )
2024-09-29 19:46:45 +00:00
# ifdef USE _LIGHTMAP
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
vec3 lightMapIrradiance = lightMapTexel . rgb * lightMapIntensity ;
irradiance += lightMapIrradiance ;
# endif
# if defined ( USE _ENVMAP ) && defined ( STANDARD ) && defined ( ENVMAP _TYPE _CUBE _UV )
iblIrradiance += getIBLIrradiance ( geometryNormal ) ;
# endif
# endif
# if defined ( USE _ENVMAP ) && defined ( RE _IndirectSpecular )
# ifdef USE _ANISOTROPY
radiance += getIBLAnisotropyRadiance ( geometryViewDir , geometryNormal , material . roughness , material . anisotropyB , material . anisotropy ) ;
# else
radiance += getIBLRadiance ( geometryViewDir , geometryNormal , material . roughness ) ;
# endif
# ifdef USE _CLEARCOAT
clearcoatRadiance += getIBLRadiance ( geometryViewDir , geometryClearcoatNormal , material . clearcoatRoughness ) ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,A0t= ` # if defined ( RE _IndirectDiffuse )
2024-09-29 19:46:45 +00:00
RE _IndirectDiffuse ( irradiance , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
# endif
# if defined ( RE _IndirectSpecular )
RE _IndirectSpecular ( radiance , iblIrradiance , clearcoatRadiance , geometryPosition , geometryNormal , geometryViewDir , geometryClearcoatNormal , material , reflectedLight ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,M0t= ` # if defined ( USE _LOGDEPTHBUF ) && defined ( USE _LOGDEPTHBUF _EXT )
2024-10-18 23:54:04 +00:00
gl _FragDepthEXT = vIsPerspective == 0.0 ? gl _FragCoord . z : log2 ( vFragDepth ) * logDepthBufFC * 0.5 ;
2024-10-20 21:50:56 +00:00
# endif ` ,N0t= ` # if defined ( USE _LOGDEPTHBUF ) && defined ( USE _LOGDEPTHBUF _EXT )
2024-09-29 19:46:45 +00:00
uniform float logDepthBufFC ;
varying float vFragDepth ;
varying float vIsPerspective ;
2024-10-20 21:50:56 +00:00
# endif ` ,O0t= ` # ifdef USE _LOGDEPTHBUF
2024-09-29 19:46:45 +00:00
# ifdef USE _LOGDEPTHBUF _EXT
varying float vFragDepth ;
varying float vIsPerspective ;
# else
uniform float logDepthBufFC ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,I0t= ` # ifdef USE _LOGDEPTHBUF
2024-09-29 19:46:45 +00:00
# ifdef USE _LOGDEPTHBUF _EXT
vFragDepth = 1.0 + gl _Position . w ;
vIsPerspective = float ( isPerspectiveMatrix ( projectionMatrix ) ) ;
# else
if ( isPerspectiveMatrix ( projectionMatrix ) ) {
gl _Position . z = log2 ( max ( EPSILON , gl _Position . w + 1.0 ) ) * logDepthBufFC - 1.0 ;
gl _Position . z *= gl _Position . w ;
}
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,k0t= ` # ifdef USE _MAP
2024-09-29 19:46:45 +00:00
vec4 sampledDiffuseColor = texture2D ( map , vMapUv ) ;
# ifdef DECODE _VIDEO _TEXTURE
sampledDiffuseColor = vec4 ( mix ( pow ( sampledDiffuseColor . rgb * 0.9478672986 + vec3 ( 0.0521327014 ) , vec3 ( 2.4 ) ) , sampledDiffuseColor . rgb * 0.0773993808 , vec3 ( lessThanEqual ( sampledDiffuseColor . rgb , vec3 ( 0.04045 ) ) ) ) , sampledDiffuseColor . w ) ;
# endif
diffuseColor *= sampledDiffuseColor ;
2024-10-20 21:50:56 +00:00
# endif ` ,D0t= ` # ifdef USE _MAP
2024-09-29 19:46:45 +00:00
uniform sampler2D map ;
2024-10-20 21:50:56 +00:00
# endif ` ,L0t= ` # if defined ( USE _MAP ) || defined ( USE _ALPHAMAP )
2024-09-29 19:46:45 +00:00
# if defined ( USE _POINTS _UV )
vec2 uv = vUv ;
# else
vec2 uv = ( uvTransform * vec3 ( gl _PointCoord . x , 1.0 - gl _PointCoord . y , 1 ) ) . xy ;
# endif
# endif
# ifdef USE _MAP
diffuseColor *= texture2D ( map , uv ) ;
# endif
# ifdef USE _ALPHAMAP
diffuseColor . a *= texture2D ( alphaMap , uv ) . g ;
2024-10-20 21:50:56 +00:00
# endif ` ,P0t= ` # if defined ( USE _POINTS _UV )
2024-09-29 19:46:45 +00:00
varying vec2 vUv ;
# else
# if defined ( USE _MAP ) || defined ( USE _ALPHAMAP )
uniform mat3 uvTransform ;
# endif
# endif
# ifdef USE _MAP
uniform sampler2D map ;
# endif
# ifdef USE _ALPHAMAP
uniform sampler2D alphaMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,F0t= ` float metalnessFactor = metalness ;
2024-09-29 19:46:45 +00:00
# ifdef USE _METALNESSMAP
vec4 texelMetalness = texture2D ( metalnessMap , vMetalnessMapUv ) ;
metalnessFactor *= texelMetalness . b ;
2024-10-20 21:50:56 +00:00
# endif ` ,U0t= ` # ifdef USE _METALNESSMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D metalnessMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,B0t= ` # if defined ( USE _MORPHCOLORS ) && defined ( MORPHTARGETS _TEXTURE )
2024-09-29 19:46:45 +00:00
vColor *= morphTargetBaseInfluence ;
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
# if defined ( USE _COLOR _ALPHA )
if ( morphTargetInfluences [ i ] != 0.0 ) vColor += getMorph ( gl _VertexID , i , 2 ) * morphTargetInfluences [ i ] ;
# elif defined ( USE _COLOR )
if ( morphTargetInfluences [ i ] != 0.0 ) vColor += getMorph ( gl _VertexID , i , 2 ) . rgb * morphTargetInfluences [ i ] ;
# endif
}
2024-10-20 21:50:56 +00:00
# endif ` ,G0t= ` # ifdef USE _MORPHNORMALS
2024-09-29 19:46:45 +00:00
objectNormal *= morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
if ( morphTargetInfluences [ i ] != 0.0 ) objectNormal += getMorph ( gl _VertexID , i , 1 ) . xyz * morphTargetInfluences [ i ] ;
}
# else
objectNormal += morphNormal0 * morphTargetInfluences [ 0 ] ;
objectNormal += morphNormal1 * morphTargetInfluences [ 1 ] ;
objectNormal += morphNormal2 * morphTargetInfluences [ 2 ] ;
objectNormal += morphNormal3 * morphTargetInfluences [ 3 ] ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,V0t= ` # ifdef USE _MORPHTARGETS
2024-09-29 19:46:45 +00:00
uniform float morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
uniform float morphTargetInfluences [ MORPHTARGETS _COUNT ] ;
uniform sampler2DArray morphTargetsTexture ;
uniform ivec2 morphTargetsTextureSize ;
vec4 getMorph ( const in int vertexIndex , const in int morphTargetIndex , const in int offset ) {
int texelIndex = vertexIndex * MORPHTARGETS _TEXTURE _STRIDE + offset ;
int y = texelIndex / morphTargetsTextureSize . x ;
int x = texelIndex - y * morphTargetsTextureSize . x ;
ivec3 morphUV = ivec3 ( x , y , morphTargetIndex ) ;
return texelFetch ( morphTargetsTexture , morphUV , 0 ) ;
}
# else
# ifndef USE _MORPHNORMALS
uniform float morphTargetInfluences [ 8 ] ;
# else
uniform float morphTargetInfluences [ 4 ] ;
# endif
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,z0t= ` # ifdef USE _MORPHTARGETS
2024-09-29 19:46:45 +00:00
transformed *= morphTargetBaseInfluence ;
# ifdef MORPHTARGETS _TEXTURE
for ( int i = 0 ; i < MORPHTARGETS _COUNT ; i ++ ) {
if ( morphTargetInfluences [ i ] != 0.0 ) transformed += getMorph ( gl _VertexID , i , 0 ) . xyz * morphTargetInfluences [ i ] ;
}
# else
transformed += morphTarget0 * morphTargetInfluences [ 0 ] ;
transformed += morphTarget1 * morphTargetInfluences [ 1 ] ;
transformed += morphTarget2 * morphTargetInfluences [ 2 ] ;
transformed += morphTarget3 * morphTargetInfluences [ 3 ] ;
# ifndef USE _MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences [ 4 ] ;
transformed += morphTarget5 * morphTargetInfluences [ 5 ] ;
transformed += morphTarget6 * morphTargetInfluences [ 6 ] ;
transformed += morphTarget7 * morphTargetInfluences [ 7 ] ;
# endif
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,H0t= ` float faceDirection = gl _FrontFacing ? 1.0 : - 1.0 ;
2024-09-29 19:46:45 +00:00
# ifdef FLAT _SHADED
vec3 fdx = dFdx ( vViewPosition ) ;
vec3 fdy = dFdy ( vViewPosition ) ;
vec3 normal = normalize ( cross ( fdx , fdy ) ) ;
# else
vec3 normal = normalize ( vNormal ) ;
# ifdef DOUBLE _SIDED
normal *= faceDirection ;
# endif
# endif
# if defined ( USE _NORMALMAP _TANGENTSPACE ) || defined ( USE _CLEARCOAT _NORMALMAP ) || defined ( USE _ANISOTROPY )
# ifdef USE _TANGENT
mat3 tbn = mat3 ( normalize ( vTangent ) , normalize ( vBitangent ) , normal ) ;
# else
mat3 tbn = getTangentFrame ( - vViewPosition , normal ,
# if defined ( USE _NORMALMAP )
vNormalMapUv
# elif defined ( USE _CLEARCOAT _NORMALMAP )
vClearcoatNormalMapUv
# else
vUv
# endif
) ;
# endif
# if defined ( DOUBLE _SIDED ) && ! defined ( FLAT _SHADED )
tbn [ 0 ] *= faceDirection ;
tbn [ 1 ] *= faceDirection ;
# endif
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
# ifdef USE _TANGENT
mat3 tbn2 = mat3 ( normalize ( vTangent ) , normalize ( vBitangent ) , normal ) ;
# else
mat3 tbn2 = getTangentFrame ( - vViewPosition , normal , vClearcoatNormalMapUv ) ;
# endif
# if defined ( DOUBLE _SIDED ) && ! defined ( FLAT _SHADED )
tbn2 [ 0 ] *= faceDirection ;
tbn2 [ 1 ] *= faceDirection ;
# endif
# endif
2024-10-20 21:50:56 +00:00
vec3 nonPerturbedNormal = normal ; ` ,q0t= ` # ifdef USE _NORMALMAP _OBJECTSPACE
2024-09-29 19:46:45 +00:00
normal = texture2D ( normalMap , vNormalMapUv ) . xyz * 2.0 - 1.0 ;
# ifdef FLIP _SIDED
normal = - normal ;
# endif
# ifdef DOUBLE _SIDED
normal = normal * faceDirection ;
# endif
normal = normalize ( normalMatrix * normal ) ;
# elif defined ( USE _NORMALMAP _TANGENTSPACE )
vec3 mapN = texture2D ( normalMap , vNormalMapUv ) . xyz * 2.0 - 1.0 ;
mapN . xy *= normalScale ;
normal = normalize ( tbn * mapN ) ;
# elif defined ( USE _BUMPMAP )
normal = perturbNormalArb ( - vViewPosition , normal , dHdxy _fwd ( ) , faceDirection ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,Y0t= ` # ifndef FLAT _SHADED
2024-09-29 19:46:45 +00:00
varying vec3 vNormal ;
# ifdef USE _TANGENT
varying vec3 vTangent ;
varying vec3 vBitangent ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` , $ 0t= ` # ifndef FLAT _SHADED
2024-09-29 19:46:45 +00:00
varying vec3 vNormal ;
# ifdef USE _TANGENT
varying vec3 vTangent ;
varying vec3 vBitangent ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,W0t= ` # ifndef FLAT _SHADED
2024-09-29 19:46:45 +00:00
vNormal = normalize ( transformedNormal ) ;
# ifdef USE _TANGENT
vTangent = normalize ( transformedTangent ) ;
vBitangent = normalize ( cross ( vNormal , vTangent ) * tangent . w ) ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,K0t= ` # ifdef USE _NORMALMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D normalMap ;
uniform vec2 normalScale ;
# endif
# ifdef USE _NORMALMAP _OBJECTSPACE
uniform mat3 normalMatrix ;
# endif
# if ! defined ( USE _TANGENT ) && ( defined ( USE _NORMALMAP _TANGENTSPACE ) || defined ( USE _CLEARCOAT _NORMALMAP ) || defined ( USE _ANISOTROPY ) )
mat3 getTangentFrame ( vec3 eye _pos , vec3 surf _norm , vec2 uv ) {
vec3 q0 = dFdx ( eye _pos . xyz ) ;
vec3 q1 = dFdy ( eye _pos . xyz ) ;
vec2 st0 = dFdx ( uv . st ) ;
vec2 st1 = dFdy ( uv . st ) ;
vec3 N = surf _norm ;
vec3 q1perp = cross ( q1 , N ) ;
vec3 q0perp = cross ( N , q0 ) ;
vec3 T = q1perp * st0 . x + q0perp * st1 . x ;
vec3 B = q1perp * st0 . y + q0perp * st1 . y ;
float det = max ( dot ( T , T ) , dot ( B , B ) ) ;
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt ( det ) ;
return mat3 ( T * scale , B * scale , N ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,j0t= ` # ifdef USE _CLEARCOAT
2024-09-29 19:46:45 +00:00
vec3 clearcoatNormal = nonPerturbedNormal ;
2024-10-20 21:50:56 +00:00
# endif ` ,Q0t= ` # ifdef USE _CLEARCOAT _NORMALMAP
2024-09-29 19:46:45 +00:00
vec3 clearcoatMapN = texture2D ( clearcoatNormalMap , vClearcoatNormalMapUv ) . xyz * 2.0 - 1.0 ;
clearcoatMapN . xy *= clearcoatNormalScale ;
clearcoatNormal = normalize ( tbn2 * clearcoatMapN ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,X0t= ` # ifdef USE _CLEARCOATMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D clearcoatMap ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
uniform sampler2D clearcoatNormalMap ;
uniform vec2 clearcoatNormalScale ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,Z0t= ` # ifdef USE _IRIDESCENCEMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D iridescenceMap ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
uniform sampler2D iridescenceThicknessMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,J0t= ` # ifdef OPAQUE
2024-09-29 19:46:45 +00:00
diffuseColor . a = 1.0 ;
# endif
# ifdef USE _TRANSMISSION
diffuseColor . a *= material . transmissionAlpha ;
# endif
2024-10-20 21:50:56 +00:00
gl _FragColor = vec4 ( outgoingLight , diffuseColor . a ) ; ` ,eyt= ` vec3 packNormalToRGB ( const in vec3 normal ) {
2024-09-29 19:46:45 +00:00
return normalize ( normal ) * 0.5 + 0.5 ;
}
vec3 unpackRGBToNormal ( const in vec3 rgb ) {
return 2.0 * rgb . xyz - 1.0 ;
}
const float PackUpscale = 256. / 255. ; const float UnpackDownscale = 255. / 256. ;
const vec3 PackFactors = vec3 ( 256. * 256. * 256. , 256. * 256. , 256. ) ;
const vec4 UnpackFactors = UnpackDownscale / vec4 ( PackFactors , 1. ) ;
const float ShiftRight8 = 1. / 256. ;
vec4 packDepthToRGBA ( const in float v ) {
vec4 r = vec4 ( fract ( v * PackFactors ) , v ) ;
r . yzw -= r . xyz * ShiftRight8 ; return r * PackUpscale ;
}
float unpackRGBAToDepth ( const in vec4 v ) {
return dot ( v , UnpackFactors ) ;
}
vec2 packDepthToRG ( in highp float v ) {
return packDepthToRGBA ( v ) . yx ;
}
float unpackRGToDepth ( const in highp vec2 v ) {
return unpackRGBAToDepth ( vec4 ( v . xy , 0.0 , 0.0 ) ) ;
}
vec4 pack2HalfToRGBA ( vec2 v ) {
vec4 r = vec4 ( v . x , fract ( v . x * 255.0 ) , v . y , fract ( v . y * 255.0 ) ) ;
return vec4 ( r . x - r . y / 255.0 , r . y , r . z - r . w / 255.0 , r . w ) ;
}
vec2 unpackRGBATo2Half ( vec4 v ) {
return vec2 ( v . x + ( v . y / 255.0 ) , v . z + ( v . w / 255.0 ) ) ;
}
float viewZToOrthographicDepth ( const in float viewZ , const in float near , const in float far ) {
return ( viewZ + near ) / ( near - far ) ;
}
float orthographicDepthToViewZ ( const in float depth , const in float near , const in float far ) {
return depth * ( near - far ) - near ;
}
float viewZToPerspectiveDepth ( const in float viewZ , const in float near , const in float far ) {
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ) ;
}
float perspectiveDepthToViewZ ( const in float depth , const in float near , const in float far ) {
return ( near * far ) / ( ( far - near ) * depth - far ) ;
2024-10-20 21:50:56 +00:00
} ` ,tyt= ` # ifdef PREMULTIPLIED _ALPHA
2024-09-29 19:46:45 +00:00
gl _FragColor . rgb *= gl _FragColor . a ;
2024-10-20 21:50:56 +00:00
# endif ` ,nyt= ` vec4 mvPosition = vec4 ( transformed , 1.0 ) ;
2024-09-29 19:46:45 +00:00
# ifdef USE _BATCHING
mvPosition = batchingMatrix * mvPosition ;
# endif
# ifdef USE _INSTANCING
mvPosition = instanceMatrix * mvPosition ;
# endif
mvPosition = modelViewMatrix * mvPosition ;
2024-10-20 21:50:56 +00:00
gl _Position = projectionMatrix * mvPosition ; ` ,syt= ` # ifdef DITHERING
2024-09-29 19:46:45 +00:00
gl _FragColor . rgb = dithering ( gl _FragColor . rgb ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,iyt= ` # ifdef DITHERING
2024-09-29 19:46:45 +00:00
vec3 dithering ( vec3 color ) {
float grid _position = rand ( gl _FragCoord . xy ) ;
vec3 dither _shift _RGB = vec3 ( 0.25 / 255.0 , - 0.25 / 255.0 , 0.25 / 255.0 ) ;
dither _shift _RGB = mix ( 2.0 * dither _shift _RGB , - 2.0 * dither _shift _RGB , grid _position ) ;
return color + dither _shift _RGB ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,ryt= ` float roughnessFactor = roughness ;
2024-09-29 19:46:45 +00:00
# ifdef USE _ROUGHNESSMAP
vec4 texelRoughness = texture2D ( roughnessMap , vRoughnessMapUv ) ;
roughnessFactor *= texelRoughness . g ;
2024-10-20 21:50:56 +00:00
# endif ` ,oyt= ` # ifdef USE _ROUGHNESSMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D roughnessMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,ayt= ` # if NUM _SPOT _LIGHT _COORDS > 0
2024-09-29 19:46:45 +00:00
varying vec4 vSpotLightCoord [ NUM _SPOT _LIGHT _COORDS ] ;
# endif
# if NUM _SPOT _LIGHT _MAPS > 0
uniform sampler2D spotLightMap [ NUM _SPOT _LIGHT _MAPS ] ;
# endif
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
uniform sampler2D directionalShadowMap [ NUM _DIR _LIGHT _SHADOWS ] ;
varying vec4 vDirectionalShadowCoord [ NUM _DIR _LIGHT _SHADOWS ] ;
struct DirectionalLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform DirectionalLightShadow directionalLightShadows [ NUM _DIR _LIGHT _SHADOWS ] ;
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
uniform sampler2D spotShadowMap [ NUM _SPOT _LIGHT _SHADOWS ] ;
struct SpotLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform SpotLightShadow spotLightShadows [ NUM _SPOT _LIGHT _SHADOWS ] ;
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
uniform sampler2D pointShadowMap [ NUM _POINT _LIGHT _SHADOWS ] ;
varying vec4 vPointShadowCoord [ NUM _POINT _LIGHT _SHADOWS ] ;
struct PointLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
float shadowCameraNear ;
float shadowCameraFar ;
} ;
uniform PointLightShadow pointLightShadows [ NUM _POINT _LIGHT _SHADOWS ] ;
# endif
float texture2DCompare ( sampler2D depths , vec2 uv , float compare ) {
return step ( compare , unpackRGBAToDepth ( texture2D ( depths , uv ) ) ) ;
}
vec2 texture2DDistribution ( sampler2D shadow , vec2 uv ) {
return unpackRGBATo2Half ( texture2D ( shadow , uv ) ) ;
}
float VSMShadow ( sampler2D shadow , vec2 uv , float compare ) {
float occlusion = 1.0 ;
vec2 distribution = texture2DDistribution ( shadow , uv ) ;
float hard _shadow = step ( compare , distribution . x ) ;
if ( hard _shadow != 1.0 ) {
float distance = compare - distribution . x ;
float variance = max ( 0.00000 , distribution . y * distribution . y ) ;
float softness _probability = variance / ( variance + distance * distance ) ; softness _probability = clamp ( ( softness _probability - 0.3 ) / ( 0.95 - 0.3 ) , 0.0 , 1.0 ) ; occlusion = clamp ( max ( hard _shadow , softness _probability ) , 0.0 , 1.0 ) ;
}
return occlusion ;
}
float getShadow ( sampler2D shadowMap , vec2 shadowMapSize , float shadowBias , float shadowRadius , vec4 shadowCoord ) {
float shadow = 1.0 ;
shadowCoord . xyz /= shadowCoord . w ;
shadowCoord . z += shadowBias ;
bool inFrustum = shadowCoord . x >= 0.0 && shadowCoord . x <= 1.0 && shadowCoord . y >= 0.0 && shadowCoord . y <= 1.0 ;
bool frustumTest = inFrustum && shadowCoord . z <= 1.0 ;
if ( frustumTest ) {
# if defined ( SHADOWMAP _TYPE _PCF )
vec2 texelSize = vec2 ( 1.0 ) / shadowMapSize ;
float dx0 = - texelSize . x * shadowRadius ;
float dy0 = - texelSize . y * shadowRadius ;
float dx1 = + texelSize . x * shadowRadius ;
float dy1 = + texelSize . y * shadowRadius ;
float dx2 = dx0 / 2.0 ;
float dy2 = dy0 / 2.0 ;
float dx3 = dx1 / 2.0 ;
float dy3 = dy1 / 2.0 ;
shadow = (
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , dy0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , dy2 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx2 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx3 , dy3 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx0 , dy1 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( 0.0 , dy1 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , shadowCoord . xy + vec2 ( dx1 , dy1 ) , shadowCoord . z )
) * ( 1.0 / 17.0 ) ;
# elif defined ( SHADOWMAP _TYPE _PCF _SOFT )
vec2 texelSize = vec2 ( 1.0 ) / shadowMapSize ;
float dx = texelSize . x ;
float dy = texelSize . y ;
vec2 uv = shadowCoord . xy ;
vec2 f = fract ( uv * shadowMapSize + 0.5 ) ;
uv -= f * texelSize ;
shadow = (
texture2DCompare ( shadowMap , uv , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + vec2 ( dx , 0.0 ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , dy ) , shadowCoord . z ) +
texture2DCompare ( shadowMap , uv + texelSize , shadowCoord . z ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , 0.0 ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , 0.0 ) , shadowCoord . z ) ,
f . x ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , dy ) , shadowCoord . z ) ,
f . x ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 0.0 , 2.0 * dy ) , shadowCoord . z ) ,
f . y ) +
mix ( texture2DCompare ( shadowMap , uv + vec2 ( dx , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( dx , 2.0 * dy ) , shadowCoord . z ) ,
f . y ) +
mix ( mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , - dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , - dy ) , shadowCoord . z ) ,
f . x ) ,
mix ( texture2DCompare ( shadowMap , uv + vec2 ( - dx , 2.0 * dy ) , shadowCoord . z ) ,
texture2DCompare ( shadowMap , uv + vec2 ( 2.0 * dx , 2.0 * dy ) , shadowCoord . z ) ,
f . x ) ,
f . y )
) * ( 1.0 / 9.0 ) ;
# elif defined ( SHADOWMAP _TYPE _VSM )
shadow = VSMShadow ( shadowMap , shadowCoord . xy , shadowCoord . z ) ;
# else
shadow = texture2DCompare ( shadowMap , shadowCoord . xy , shadowCoord . z ) ;
# endif
}
return shadow ;
}
vec2 cubeToUV ( vec3 v , float texelSizeY ) {
vec3 absV = abs ( v ) ;
float scaleToCube = 1.0 / max ( absV . x , max ( absV . y , absV . z ) ) ;
absV *= scaleToCube ;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ) ;
vec2 planar = v . xy ;
float almostATexel = 1.5 * texelSizeY ;
float almostOne = 1.0 - almostATexel ;
if ( absV . z >= almostOne ) {
if ( v . z > 0.0 )
planar . x = 4.0 - v . x ;
} else if ( absV . x >= almostOne ) {
float signX = sign ( v . x ) ;
planar . x = v . z * signX + 2.0 * signX ;
} else if ( absV . y >= almostOne ) {
float signY = sign ( v . y ) ;
planar . x = v . x + 2.0 * signY + 2.0 ;
planar . y = v . z * signY - 2.0 ;
}
return vec2 ( 0.125 , 0.25 ) * planar + vec2 ( 0.375 , 0.75 ) ;
}
float getPointShadow ( sampler2D shadowMap , vec2 shadowMapSize , float shadowBias , float shadowRadius , vec4 shadowCoord , float shadowCameraNear , float shadowCameraFar ) {
vec2 texelSize = vec2 ( 1.0 ) / ( shadowMapSize * vec2 ( 4.0 , 2.0 ) ) ;
vec3 lightToPosition = shadowCoord . xyz ;
float dp = ( length ( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ) ; dp += shadowBias ;
vec3 bd3D = normalize ( lightToPosition ) ;
# if defined ( SHADOWMAP _TYPE _PCF ) || defined ( SHADOWMAP _TYPE _PCF _SOFT ) || defined ( SHADOWMAP _TYPE _VSM )
vec2 offset = vec2 ( - 1 , 1 ) * shadowRadius * texelSize . y ;
return (
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xyy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yyy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xyx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yyx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xxy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yxy , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . xxx , texelSize . y ) , dp ) +
texture2DCompare ( shadowMap , cubeToUV ( bd3D + offset . yxx , texelSize . y ) , dp )
) * ( 1.0 / 9.0 ) ;
# else
return texture2DCompare ( shadowMap , cubeToUV ( bd3D , texelSize . y ) , dp ) ;
# endif
}
2024-10-20 21:50:56 +00:00
# endif ` ,lyt= ` # if NUM _SPOT _LIGHT _COORDS > 0
2024-09-29 19:46:45 +00:00
uniform mat4 spotLightMatrix [ NUM _SPOT _LIGHT _COORDS ] ;
varying vec4 vSpotLightCoord [ NUM _SPOT _LIGHT _COORDS ] ;
# endif
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
uniform mat4 directionalShadowMatrix [ NUM _DIR _LIGHT _SHADOWS ] ;
varying vec4 vDirectionalShadowCoord [ NUM _DIR _LIGHT _SHADOWS ] ;
struct DirectionalLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform DirectionalLightShadow directionalLightShadows [ NUM _DIR _LIGHT _SHADOWS ] ;
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
struct SpotLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
} ;
uniform SpotLightShadow spotLightShadows [ NUM _SPOT _LIGHT _SHADOWS ] ;
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
uniform mat4 pointShadowMatrix [ NUM _POINT _LIGHT _SHADOWS ] ;
varying vec4 vPointShadowCoord [ NUM _POINT _LIGHT _SHADOWS ] ;
struct PointLightShadow {
float shadowBias ;
float shadowNormalBias ;
float shadowRadius ;
vec2 shadowMapSize ;
float shadowCameraNear ;
float shadowCameraFar ;
} ;
uniform PointLightShadow pointLightShadows [ NUM _POINT _LIGHT _SHADOWS ] ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,cyt= ` # if ( defined ( USE _SHADOWMAP ) && ( NUM _DIR _LIGHT _SHADOWS > 0 || NUM _POINT _LIGHT _SHADOWS > 0 ) ) || ( NUM _SPOT _LIGHT _COORDS > 0 )
2024-09-29 19:46:45 +00:00
vec3 shadowWorldNormal = inverseTransformDirection ( transformedNormal , viewMatrix ) ;
vec4 shadowWorldPosition ;
# endif
# if defined ( USE _SHADOWMAP )
# if NUM _DIR _LIGHT _SHADOWS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHT _SHADOWS ; i ++ ) {
shadowWorldPosition = worldPosition + vec4 ( shadowWorldNormal * directionalLightShadows [ i ] . shadowNormalBias , 0 ) ;
vDirectionalShadowCoord [ i ] = directionalShadowMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHT _SHADOWS ; i ++ ) {
shadowWorldPosition = worldPosition + vec4 ( shadowWorldNormal * pointLightShadows [ i ] . shadowNormalBias , 0 ) ;
vPointShadowCoord [ i ] = pointShadowMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
# endif
# endif
# if NUM _SPOT _LIGHT _COORDS > 0
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHT _COORDS ; i ++ ) {
shadowWorldPosition = worldPosition ;
# if ( defined ( USE _SHADOWMAP ) && UNROLLED _LOOP _INDEX < NUM _SPOT _LIGHT _SHADOWS )
shadowWorldPosition . xyz += shadowWorldNormal * spotLightShadows [ i ] . shadowNormalBias ;
# endif
vSpotLightCoord [ i ] = spotLightMatrix [ i ] * shadowWorldPosition ;
}
# pragma unroll _loop _end
2024-10-20 21:50:56 +00:00
# endif ` ,dyt= ` float getShadowMask ( ) {
2024-09-29 19:46:45 +00:00
float shadow = 1.0 ;
# ifdef USE _SHADOWMAP
# if NUM _DIR _LIGHT _SHADOWS > 0
DirectionalLightShadow directionalLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _DIR _LIGHT _SHADOWS ; i ++ ) {
directionalLight = directionalLightShadows [ i ] ;
shadow *= receiveShadow ? getShadow ( directionalShadowMap [ i ] , directionalLight . shadowMapSize , directionalLight . shadowBias , directionalLight . shadowRadius , vDirectionalShadowCoord [ i ] ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# if NUM _SPOT _LIGHT _SHADOWS > 0
SpotLightShadow spotLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _SPOT _LIGHT _SHADOWS ; i ++ ) {
spotLight = spotLightShadows [ i ] ;
shadow *= receiveShadow ? getShadow ( spotShadowMap [ i ] , spotLight . shadowMapSize , spotLight . shadowBias , spotLight . shadowRadius , vSpotLightCoord [ i ] ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# if NUM _POINT _LIGHT _SHADOWS > 0
PointLightShadow pointLight ;
# pragma unroll _loop _start
for ( int i = 0 ; i < NUM _POINT _LIGHT _SHADOWS ; i ++ ) {
pointLight = pointLightShadows [ i ] ;
shadow *= receiveShadow ? getPointShadow ( pointShadowMap [ i ] , pointLight . shadowMapSize , pointLight . shadowBias , pointLight . shadowRadius , vPointShadowCoord [ i ] , pointLight . shadowCameraNear , pointLight . shadowCameraFar ) : 1.0 ;
}
# pragma unroll _loop _end
# endif
# endif
return shadow ;
2024-10-20 21:50:56 +00:00
} ` ,uyt= ` # ifdef USE _SKINNING
2024-09-29 19:46:45 +00:00
mat4 boneMatX = getBoneMatrix ( skinIndex . x ) ;
mat4 boneMatY = getBoneMatrix ( skinIndex . y ) ;
mat4 boneMatZ = getBoneMatrix ( skinIndex . z ) ;
mat4 boneMatW = getBoneMatrix ( skinIndex . w ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,pyt= ` # ifdef USE _SKINNING
2024-09-29 19:46:45 +00:00
uniform mat4 bindMatrix ;
uniform mat4 bindMatrixInverse ;
uniform highp sampler2D boneTexture ;
mat4 getBoneMatrix ( const in float i ) {
int size = textureSize ( boneTexture , 0 ) . x ;
int j = int ( i ) * 4 ;
int x = j % size ;
int y = j / size ;
vec4 v1 = texelFetch ( boneTexture , ivec2 ( x , y ) , 0 ) ;
vec4 v2 = texelFetch ( boneTexture , ivec2 ( x + 1 , y ) , 0 ) ;
vec4 v3 = texelFetch ( boneTexture , ivec2 ( x + 2 , y ) , 0 ) ;
vec4 v4 = texelFetch ( boneTexture , ivec2 ( x + 3 , y ) , 0 ) ;
return mat4 ( v1 , v2 , v3 , v4 ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,fyt= ` # ifdef USE _SKINNING
2024-09-29 19:46:45 +00:00
vec4 skinVertex = bindMatrix * vec4 ( transformed , 1.0 ) ;
vec4 skinned = vec4 ( 0.0 ) ;
skinned += boneMatX * skinVertex * skinWeight . x ;
skinned += boneMatY * skinVertex * skinWeight . y ;
skinned += boneMatZ * skinVertex * skinWeight . z ;
skinned += boneMatW * skinVertex * skinWeight . w ;
transformed = ( bindMatrixInverse * skinned ) . xyz ;
2024-10-20 21:50:56 +00:00
# endif ` ,_yt= ` # ifdef USE _SKINNING
2024-09-29 19:46:45 +00:00
mat4 skinMatrix = mat4 ( 0.0 ) ;
skinMatrix += skinWeight . x * boneMatX ;
skinMatrix += skinWeight . y * boneMatY ;
skinMatrix += skinWeight . z * boneMatZ ;
skinMatrix += skinWeight . w * boneMatW ;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix ;
objectNormal = vec4 ( skinMatrix * vec4 ( objectNormal , 0.0 ) ) . xyz ;
# ifdef USE _TANGENT
objectTangent = vec4 ( skinMatrix * vec4 ( objectTangent , 0.0 ) ) . xyz ;
# endif
2024-10-20 21:50:56 +00:00
# endif ` ,myt= ` float specularStrength ;
2024-09-29 19:46:45 +00:00
# ifdef USE _SPECULARMAP
vec4 texelSpecular = texture2D ( specularMap , vSpecularMapUv ) ;
specularStrength = texelSpecular . r ;
# else
specularStrength = 1.0 ;
2024-10-20 21:50:56 +00:00
# endif ` ,hyt= ` # ifdef USE _SPECULARMAP
2024-09-29 19:46:45 +00:00
uniform sampler2D specularMap ;
2024-10-20 21:50:56 +00:00
# endif ` ,gyt= ` # if defined ( TONE _MAPPING )
2024-09-29 19:46:45 +00:00
gl _FragColor . rgb = toneMapping ( gl _FragColor . rgb ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,byt= ` # ifndef saturate
2024-09-29 19:46:45 +00:00
# define saturate ( a ) clamp ( a , 0.0 , 1.0 )
# endif
uniform float toneMappingExposure ;
vec3 LinearToneMapping ( vec3 color ) {
return saturate ( toneMappingExposure * color ) ;
}
vec3 ReinhardToneMapping ( vec3 color ) {
color *= toneMappingExposure ;
return saturate ( color / ( vec3 ( 1.0 ) + color ) ) ;
}
vec3 OptimizedCineonToneMapping ( vec3 color ) {
color *= toneMappingExposure ;
color = max ( vec3 ( 0.0 ) , color - 0.004 ) ;
return pow ( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ) , vec3 ( 2.2 ) ) ;
}
vec3 RRTAndODTFit ( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537 ;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081 ;
return a / b ;
}
vec3 ACESFilmicToneMapping ( vec3 color ) {
const mat3 ACESInputMat = mat3 (
vec3 ( 0.59719 , 0.07600 , 0.02840 ) , vec3 ( 0.35458 , 0.90834 , 0.13383 ) ,
vec3 ( 0.04823 , 0.01566 , 0.83777 )
) ;
const mat3 ACESOutputMat = mat3 (
vec3 ( 1.60475 , - 0.10208 , - 0.00327 ) , vec3 ( - 0.53108 , 1.10813 , - 0.07276 ) ,
vec3 ( - 0.07367 , - 0.00605 , 1.07602 )
) ;
color *= toneMappingExposure / 0.6 ;
color = ACESInputMat * color ;
color = RRTAndODTFit ( color ) ;
color = ACESOutputMat * color ;
return saturate ( color ) ;
}
2024-10-20 21:50:56 +00:00
vec3 CustomToneMapping ( vec3 color ) { return color ; } ` ,yyt= ` # ifdef USE _TRANSMISSION
2024-09-29 19:46:45 +00:00
material . transmission = transmission ;
material . transmissionAlpha = 1.0 ;
material . thickness = thickness ;
material . attenuationDistance = attenuationDistance ;
material . attenuationColor = attenuationColor ;
# ifdef USE _TRANSMISSIONMAP
material . transmission *= texture2D ( transmissionMap , vTransmissionMapUv ) . r ;
# endif
# ifdef USE _THICKNESSMAP
material . thickness *= texture2D ( thicknessMap , vThicknessMapUv ) . g ;
# endif
vec3 pos = vWorldPosition ;
vec3 v = normalize ( cameraPosition - pos ) ;
vec3 n = inverseTransformDirection ( normal , viewMatrix ) ;
vec4 transmitted = getIBLVolumeRefraction (
n , v , material . roughness , material . diffuseColor , material . specularColor , material . specularF90 ,
pos , modelMatrix , viewMatrix , projectionMatrix , material . ior , material . thickness ,
material . attenuationColor , material . attenuationDistance ) ;
material . transmissionAlpha = mix ( material . transmissionAlpha , transmitted . a , material . transmission ) ;
totalDiffuse = mix ( totalDiffuse , transmitted . rgb , material . transmission ) ;
2024-10-20 21:50:56 +00:00
# endif ` ,Eyt= ` # ifdef USE _TRANSMISSION
2024-09-29 19:46:45 +00:00
uniform float transmission ;
uniform float thickness ;
uniform float attenuationDistance ;
uniform vec3 attenuationColor ;
# ifdef USE _TRANSMISSIONMAP
uniform sampler2D transmissionMap ;
# endif
# ifdef USE _THICKNESSMAP
uniform sampler2D thicknessMap ;
# endif
uniform vec2 transmissionSamplerSize ;
uniform sampler2D transmissionSamplerMap ;
uniform mat4 modelMatrix ;
uniform mat4 projectionMatrix ;
varying vec3 vWorldPosition ;
float w0 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ) ;
}
float w1 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ) ;
}
float w2 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ) ;
}
float w3 ( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * a ) ;
}
float g0 ( float a ) {
return w0 ( a ) + w1 ( a ) ;
}
float g1 ( float a ) {
return w2 ( a ) + w3 ( a ) ;
}
float h0 ( float a ) {
return - 1.0 + w1 ( a ) / ( w0 ( a ) + w1 ( a ) ) ;
}
float h1 ( float a ) {
return 1.0 + w3 ( a ) / ( w2 ( a ) + w3 ( a ) ) ;
}
vec4 bicubic ( sampler2D tex , vec2 uv , vec4 texelSize , float lod ) {
uv = uv * texelSize . zw + 0.5 ;
vec2 iuv = floor ( uv ) ;
vec2 fuv = fract ( uv ) ;
float g0x = g0 ( fuv . x ) ;
float g1x = g1 ( fuv . x ) ;
float h0x = h0 ( fuv . x ) ;
float h1x = h1 ( fuv . x ) ;
float h0y = h0 ( fuv . y ) ;
float h1y = h1 ( fuv . y ) ;
vec2 p0 = ( vec2 ( iuv . x + h0x , iuv . y + h0y ) - 0.5 ) * texelSize . xy ;
vec2 p1 = ( vec2 ( iuv . x + h1x , iuv . y + h0y ) - 0.5 ) * texelSize . xy ;
vec2 p2 = ( vec2 ( iuv . x + h0x , iuv . y + h1y ) - 0.5 ) * texelSize . xy ;
vec2 p3 = ( vec2 ( iuv . x + h1x , iuv . y + h1y ) - 0.5 ) * texelSize . xy ;
return g0 ( fuv . y ) * ( g0x * textureLod ( tex , p0 , lod ) + g1x * textureLod ( tex , p1 , lod ) ) +
g1 ( fuv . y ) * ( g0x * textureLod ( tex , p2 , lod ) + g1x * textureLod ( tex , p3 , lod ) ) ;
}
vec4 textureBicubic ( sampler2D sampler , vec2 uv , float lod ) {
vec2 fLodSize = vec2 ( textureSize ( sampler , int ( lod ) ) ) ;
vec2 cLodSize = vec2 ( textureSize ( sampler , int ( lod + 1.0 ) ) ) ;
vec2 fLodSizeInv = 1.0 / fLodSize ;
vec2 cLodSizeInv = 1.0 / cLodSize ;
vec4 fSample = bicubic ( sampler , uv , vec4 ( fLodSizeInv , fLodSize ) , floor ( lod ) ) ;
vec4 cSample = bicubic ( sampler , uv , vec4 ( cLodSizeInv , cLodSize ) , ceil ( lod ) ) ;
return mix ( fSample , cSample , fract ( lod ) ) ;
}
vec3 getVolumeTransmissionRay ( const in vec3 n , const in vec3 v , const in float thickness , const in float ior , const in mat4 modelMatrix ) {
vec3 refractionVector = refract ( - v , normalize ( n ) , 1.0 / ior ) ;
vec3 modelScale ;
modelScale . x = length ( vec3 ( modelMatrix [ 0 ] . xyz ) ) ;
modelScale . y = length ( vec3 ( modelMatrix [ 1 ] . xyz ) ) ;
modelScale . z = length ( vec3 ( modelMatrix [ 2 ] . xyz ) ) ;
return normalize ( refractionVector ) * thickness * modelScale ;
}
float applyIorToRoughness ( const in float roughness , const in float ior ) {
return roughness * clamp ( ior * 2.0 - 2.0 , 0.0 , 1.0 ) ;
}
vec4 getTransmissionSample ( const in vec2 fragCoord , const in float roughness , const in float ior ) {
float lod = log2 ( transmissionSamplerSize . x ) * applyIorToRoughness ( roughness , ior ) ;
return textureBicubic ( transmissionSamplerMap , fragCoord . xy , lod ) ;
}
vec3 volumeAttenuation ( const in float transmissionDistance , const in vec3 attenuationColor , const in float attenuationDistance ) {
if ( isinf ( attenuationDistance ) ) {
return vec3 ( 1.0 ) ;
} else {
vec3 attenuationCoefficient = - log ( attenuationColor ) / attenuationDistance ;
vec3 transmittance = exp ( - attenuationCoefficient * transmissionDistance ) ; return transmittance ;
}
}
vec4 getIBLVolumeRefraction ( const in vec3 n , const in vec3 v , const in float roughness , const in vec3 diffuseColor ,
const in vec3 specularColor , const in float specularF90 , const in vec3 position , const in mat4 modelMatrix ,
const in mat4 viewMatrix , const in mat4 projMatrix , const in float ior , const in float thickness ,
const in vec3 attenuationColor , const in float attenuationDistance ) {
vec3 transmissionRay = getVolumeTransmissionRay ( n , v , thickness , ior , modelMatrix ) ;
vec3 refractedRayExit = position + transmissionRay ;
vec4 ndcPos = projMatrix * viewMatrix * vec4 ( refractedRayExit , 1.0 ) ;
vec2 refractionCoords = ndcPos . xy / ndcPos . w ;
refractionCoords += 1.0 ;
refractionCoords /= 2.0 ;
vec4 transmittedLight = getTransmissionSample ( refractionCoords , roughness , ior ) ;
vec3 transmittance = diffuseColor * volumeAttenuation ( length ( transmissionRay ) , attenuationColor , attenuationDistance ) ;
vec3 attenuatedColor = transmittance * transmittedLight . rgb ;
vec3 F = EnvironmentBRDF ( n , v , specularColor , specularF90 , roughness ) ;
float transmittanceFactor = ( transmittance . r + transmittance . g + transmittance . b ) / 3.0 ;
return vec4 ( ( 1.0 - F ) * attenuatedColor , 1.0 - ( 1.0 - transmittedLight . a ) * transmittanceFactor ) ;
}
2024-10-20 21:50:56 +00:00
# endif ` ,vyt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-09-29 19:46:45 +00:00
varying vec2 vUv ;
# endif
# ifdef USE _MAP
varying vec2 vMapUv ;
# endif
# ifdef USE _ALPHAMAP
varying vec2 vAlphaMapUv ;
# endif
# ifdef USE _LIGHTMAP
varying vec2 vLightMapUv ;
# endif
# ifdef USE _AOMAP
varying vec2 vAoMapUv ;
# endif
# ifdef USE _BUMPMAP
varying vec2 vBumpMapUv ;
# endif
# ifdef USE _NORMALMAP
varying vec2 vNormalMapUv ;
# endif
# ifdef USE _EMISSIVEMAP
varying vec2 vEmissiveMapUv ;
# endif
# ifdef USE _METALNESSMAP
varying vec2 vMetalnessMapUv ;
# endif
# ifdef USE _ROUGHNESSMAP
varying vec2 vRoughnessMapUv ;
# endif
# ifdef USE _ANISOTROPYMAP
varying vec2 vAnisotropyMapUv ;
# endif
# ifdef USE _CLEARCOATMAP
varying vec2 vClearcoatMapUv ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
varying vec2 vClearcoatNormalMapUv ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
varying vec2 vClearcoatRoughnessMapUv ;
# endif
# ifdef USE _IRIDESCENCEMAP
varying vec2 vIridescenceMapUv ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
varying vec2 vIridescenceThicknessMapUv ;
# endif
# ifdef USE _SHEEN _COLORMAP
varying vec2 vSheenColorMapUv ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
varying vec2 vSheenRoughnessMapUv ;
# endif
# ifdef USE _SPECULARMAP
varying vec2 vSpecularMapUv ;
# endif
# ifdef USE _SPECULAR _COLORMAP
varying vec2 vSpecularColorMapUv ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
varying vec2 vSpecularIntensityMapUv ;
# endif
# ifdef USE _TRANSMISSIONMAP
uniform mat3 transmissionMapTransform ;
varying vec2 vTransmissionMapUv ;
# endif
# ifdef USE _THICKNESSMAP
uniform mat3 thicknessMapTransform ;
varying vec2 vThicknessMapUv ;
2024-10-20 21:50:56 +00:00
# endif ` ,Syt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-09-29 19:46:45 +00:00
varying vec2 vUv ;
# endif
# ifdef USE _MAP
uniform mat3 mapTransform ;
varying vec2 vMapUv ;
# endif
# ifdef USE _ALPHAMAP
uniform mat3 alphaMapTransform ;
varying vec2 vAlphaMapUv ;
# endif
# ifdef USE _LIGHTMAP
uniform mat3 lightMapTransform ;
varying vec2 vLightMapUv ;
# endif
# ifdef USE _AOMAP
uniform mat3 aoMapTransform ;
varying vec2 vAoMapUv ;
# endif
# ifdef USE _BUMPMAP
uniform mat3 bumpMapTransform ;
varying vec2 vBumpMapUv ;
# endif
# ifdef USE _NORMALMAP
uniform mat3 normalMapTransform ;
varying vec2 vNormalMapUv ;
# endif
# ifdef USE _DISPLACEMENTMAP
uniform mat3 displacementMapTransform ;
varying vec2 vDisplacementMapUv ;
# endif
# ifdef USE _EMISSIVEMAP
uniform mat3 emissiveMapTransform ;
varying vec2 vEmissiveMapUv ;
# endif
# ifdef USE _METALNESSMAP
uniform mat3 metalnessMapTransform ;
varying vec2 vMetalnessMapUv ;
# endif
# ifdef USE _ROUGHNESSMAP
uniform mat3 roughnessMapTransform ;
varying vec2 vRoughnessMapUv ;
# endif
# ifdef USE _ANISOTROPYMAP
uniform mat3 anisotropyMapTransform ;
varying vec2 vAnisotropyMapUv ;
# endif
# ifdef USE _CLEARCOATMAP
uniform mat3 clearcoatMapTransform ;
varying vec2 vClearcoatMapUv ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
uniform mat3 clearcoatNormalMapTransform ;
varying vec2 vClearcoatNormalMapUv ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
uniform mat3 clearcoatRoughnessMapTransform ;
varying vec2 vClearcoatRoughnessMapUv ;
# endif
# ifdef USE _SHEEN _COLORMAP
uniform mat3 sheenColorMapTransform ;
varying vec2 vSheenColorMapUv ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
uniform mat3 sheenRoughnessMapTransform ;
varying vec2 vSheenRoughnessMapUv ;
# endif
# ifdef USE _IRIDESCENCEMAP
uniform mat3 iridescenceMapTransform ;
varying vec2 vIridescenceMapUv ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
uniform mat3 iridescenceThicknessMapTransform ;
varying vec2 vIridescenceThicknessMapUv ;
# endif
# ifdef USE _SPECULARMAP
uniform mat3 specularMapTransform ;
varying vec2 vSpecularMapUv ;
# endif
# ifdef USE _SPECULAR _COLORMAP
uniform mat3 specularColorMapTransform ;
varying vec2 vSpecularColorMapUv ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
uniform mat3 specularIntensityMapTransform ;
varying vec2 vSpecularIntensityMapUv ;
# endif
# ifdef USE _TRANSMISSIONMAP
uniform mat3 transmissionMapTransform ;
varying vec2 vTransmissionMapUv ;
# endif
# ifdef USE _THICKNESSMAP
uniform mat3 thicknessMapTransform ;
varying vec2 vThicknessMapUv ;
2024-10-20 21:50:56 +00:00
# endif ` ,Tyt= ` # if defined ( USE _UV ) || defined ( USE _ANISOTROPY )
2024-09-29 19:46:45 +00:00
vUv = vec3 ( uv , 1 ) . xy ;
# endif
# ifdef USE _MAP
vMapUv = ( mapTransform * vec3 ( MAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ALPHAMAP
vAlphaMapUv = ( alphaMapTransform * vec3 ( ALPHAMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _LIGHTMAP
vLightMapUv = ( lightMapTransform * vec3 ( LIGHTMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _AOMAP
vAoMapUv = ( aoMapTransform * vec3 ( AOMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _BUMPMAP
vBumpMapUv = ( bumpMapTransform * vec3 ( BUMPMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _NORMALMAP
vNormalMapUv = ( normalMapTransform * vec3 ( NORMALMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _DISPLACEMENTMAP
vDisplacementMapUv = ( displacementMapTransform * vec3 ( DISPLACEMENTMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _EMISSIVEMAP
vEmissiveMapUv = ( emissiveMapTransform * vec3 ( EMISSIVEMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _METALNESSMAP
vMetalnessMapUv = ( metalnessMapTransform * vec3 ( METALNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ROUGHNESSMAP
vRoughnessMapUv = ( roughnessMapTransform * vec3 ( ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _ANISOTROPYMAP
vAnisotropyMapUv = ( anisotropyMapTransform * vec3 ( ANISOTROPYMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOATMAP
vClearcoatMapUv = ( clearcoatMapTransform * vec3 ( CLEARCOATMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOAT _NORMALMAP
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3 ( CLEARCOAT _NORMALMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _CLEARCOAT _ROUGHNESSMAP
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3 ( CLEARCOAT _ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _IRIDESCENCEMAP
vIridescenceMapUv = ( iridescenceMapTransform * vec3 ( IRIDESCENCEMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _IRIDESCENCE _THICKNESSMAP
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3 ( IRIDESCENCE _THICKNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SHEEN _COLORMAP
vSheenColorMapUv = ( sheenColorMapTransform * vec3 ( SHEEN _COLORMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3 ( SHEEN _ROUGHNESSMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULARMAP
vSpecularMapUv = ( specularMapTransform * vec3 ( SPECULARMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULAR _COLORMAP
vSpecularColorMapUv = ( specularColorMapTransform * vec3 ( SPECULAR _COLORMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3 ( SPECULAR _INTENSITYMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _TRANSMISSIONMAP
vTransmissionMapUv = ( transmissionMapTransform * vec3 ( TRANSMISSIONMAP _UV , 1 ) ) . xy ;
# endif
# ifdef USE _THICKNESSMAP
vThicknessMapUv = ( thicknessMapTransform * vec3 ( THICKNESSMAP _UV , 1 ) ) . xy ;
2024-10-20 21:50:56 +00:00
# endif ` ,xyt= ` # if defined ( USE _ENVMAP ) || defined ( DISTANCE ) || defined ( USE _SHADOWMAP ) || defined ( USE _TRANSMISSION ) || NUM _SPOT _LIGHT _COORDS > 0
2024-09-29 19:46:45 +00:00
vec4 worldPosition = vec4 ( transformed , 1.0 ) ;
# ifdef USE _BATCHING
worldPosition = batchingMatrix * worldPosition ;
# endif
# ifdef USE _INSTANCING
worldPosition = instanceMatrix * worldPosition ;
# endif
worldPosition = modelMatrix * worldPosition ;
2024-10-20 21:50:56 +00:00
# endif ` ;const Cyt= ` varying vec2 vUv ;
2024-09-29 19:46:45 +00:00
uniform mat3 uvTransform ;
void main ( ) {
vUv = ( uvTransform * vec3 ( uv , 1 ) ) . xy ;
gl _Position = vec4 ( position . xy , 1.0 , 1.0 ) ;
2024-10-20 21:50:56 +00:00
} ` ,wyt= ` uniform sampler2D t2D ;
2024-09-29 19:46:45 +00:00
uniform float backgroundIntensity ;
varying vec2 vUv ;
void main ( ) {
vec4 texColor = texture2D ( t2D , vUv ) ;
# ifdef DECODE _VIDEO _TEXTURE
texColor = vec4 ( mix ( pow ( texColor . rgb * 0.9478672986 + vec3 ( 0.0521327014 ) , vec3 ( 2.4 ) ) , texColor . rgb * 0.0773993808 , vec3 ( lessThanEqual ( texColor . rgb , vec3 ( 0.04045 ) ) ) ) , texColor . w ) ;
# endif
texColor . rgb *= backgroundIntensity ;
gl _FragColor = texColor ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Ryt= ` varying vec3 vWorldDirection ;
2024-09-29 19:46:45 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
gl _Position . z = gl _Position . w ;
2024-10-20 21:50:56 +00:00
} ` ,Ayt= ` # ifdef ENVMAP _TYPE _CUBE
2024-09-29 19:46:45 +00:00
uniform samplerCube envMap ;
# elif defined ( ENVMAP _TYPE _CUBE _UV )
uniform sampler2D envMap ;
# endif
uniform float flipEnvMap ;
uniform float backgroundBlurriness ;
uniform float backgroundIntensity ;
varying vec3 vWorldDirection ;
# include < cube _uv _reflection _fragment >
void main ( ) {
# ifdef ENVMAP _TYPE _CUBE
vec4 texColor = textureCube ( envMap , vec3 ( flipEnvMap * vWorldDirection . x , vWorldDirection . yz ) ) ;
# elif defined ( ENVMAP _TYPE _CUBE _UV )
vec4 texColor = textureCubeUV ( envMap , vWorldDirection , backgroundBlurriness ) ;
# else
vec4 texColor = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
# endif
texColor . rgb *= backgroundIntensity ;
gl _FragColor = texColor ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Myt= ` varying vec3 vWorldDirection ;
2024-09-29 19:46:45 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
gl _Position . z = gl _Position . w ;
2024-10-20 21:50:56 +00:00
} ` ,Nyt= ` uniform samplerCube tCube ;
2024-09-29 19:46:45 +00:00
uniform float tFlip ;
uniform float opacity ;
varying vec3 vWorldDirection ;
void main ( ) {
vec4 texColor = textureCube ( tCube , vec3 ( tFlip * vWorldDirection . x , vWorldDirection . yz ) ) ;
gl _FragColor = texColor ;
gl _FragColor . a *= opacity ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Oyt= ` # include < common >
2024-09-29 19:46:45 +00:00
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
varying vec2 vHighPrecisionZW ;
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < skinbase _vertex >
# ifdef USE _DISPLACEMENTMAP
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vHighPrecisionZW = gl _Position . zw ;
2024-10-20 21:50:56 +00:00
} ` ,Iyt= ` # if DEPTH _PACKING == 3200
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# endif
# include < common >
# include < packing >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
varying vec2 vHighPrecisionZW ;
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( 1.0 ) ;
# if DEPTH _PACKING == 3200
diffuseColor . a = opacity ;
# endif
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < logdepthbuf _fragment >
float fragCoordZ = 0.5 * vHighPrecisionZW [ 0 ] / vHighPrecisionZW [ 1 ] + 0.5 ;
# if DEPTH _PACKING == 3200
gl _FragColor = vec4 ( vec3 ( 1.0 - fragCoordZ ) , opacity ) ;
# elif DEPTH _PACKING == 3201
gl _FragColor = packDepthToRGBA ( fragCoordZ ) ;
# endif
2024-10-20 21:50:56 +00:00
} ` ,kyt= ` # define DISTANCE
2024-09-29 19:46:45 +00:00
varying vec3 vWorldPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < skinbase _vertex >
# ifdef USE _DISPLACEMENTMAP
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < worldpos _vertex >
# include < clipping _planes _vertex >
vWorldPosition = worldPosition . xyz ;
2024-10-20 21:50:56 +00:00
} ` ,Dyt= ` # define DISTANCE
2024-09-29 19:46:45 +00:00
uniform vec3 referencePosition ;
uniform float nearDistance ;
uniform float farDistance ;
varying vec3 vWorldPosition ;
# include < common >
# include < packing >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( 1.0 ) ;
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
float dist = length ( vWorldPosition - referencePosition ) ;
dist = ( dist - nearDistance ) / ( farDistance - nearDistance ) ;
dist = saturate ( dist ) ;
gl _FragColor = packDepthToRGBA ( dist ) ;
2024-10-20 21:50:56 +00:00
} ` ,Lyt= ` varying vec3 vWorldDirection ;
2024-09-29 19:46:45 +00:00
# include < common >
void main ( ) {
vWorldDirection = transformDirection ( position , modelMatrix ) ;
# include < begin _vertex >
# include < project _vertex >
2024-10-20 21:50:56 +00:00
} ` ,Pyt= ` uniform sampler2D tEquirect ;
2024-09-29 19:46:45 +00:00
varying vec3 vWorldDirection ;
# include < common >
void main ( ) {
vec3 direction = normalize ( vWorldDirection ) ;
vec2 sampleUV = equirectUv ( direction ) ;
gl _FragColor = texture2D ( tEquirect , sampleUV ) ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Fyt= ` uniform float scale ;
2024-09-29 19:46:45 +00:00
attribute float lineDistance ;
varying float vLineDistance ;
# include < common >
# include < uv _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
vLineDistance = scale * lineDistance ;
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,Uyt= ` uniform vec3 diffuse ;
2024-09-29 19:46:45 +00:00
uniform float opacity ;
uniform float dashSize ;
uniform float totalSize ;
varying float vLineDistance ;
# include < common >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
if ( mod ( vLineDistance , totalSize ) > dashSize ) {
discard ;
}
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Byt= ` # include < common >
2024-09-29 19:46:45 +00:00
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# if defined ( USE _ENVMAP ) || defined ( USE _SKINNING )
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# endif
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < worldpos _vertex >
# include < envmap _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,Gyt= ` uniform vec3 diffuse ;
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# ifndef FLAT _SHADED
varying vec3 vNormal ;
# endif
# include < common >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
# ifdef USE _LIGHTMAP
vec4 lightMapTexel = texture2D ( lightMap , vLightMapUv ) ;
reflectedLight . indirectDiffuse += lightMapTexel . rgb * lightMapIntensity * RECIPROCAL _PI ;
# else
reflectedLight . indirectDiffuse += vec3 ( 1.0 ) ;
# endif
# include < aomap _fragment >
reflectedLight . indirectDiffuse *= diffuseColor . rgb ;
vec3 outgoingLight = reflectedLight . indirectDiffuse ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Vyt= ` # define LAMBERT
2024-09-29 19:46:45 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < envmap _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,zyt= ` # define LAMBERT
2024-09-29 19:46:45 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _lambert _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _lambert _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + totalEmissiveRadiance ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Hyt= ` # define MATCAP
2024-09-29 19:46:45 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < color _pars _vertex >
# include < displacementmap _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
vViewPosition = - mvPosition . xyz ;
2024-10-20 21:50:56 +00:00
} ` ,qyt= ` # define MATCAP
2024-09-29 19:46:45 +00:00
uniform vec3 diffuse ;
uniform float opacity ;
uniform sampler2D matcap ;
varying vec3 vViewPosition ;
# include < common >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < normal _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
vec3 viewDir = normalize ( vViewPosition ) ;
vec3 x = normalize ( vec3 ( viewDir . z , 0.0 , - viewDir . x ) ) ;
vec3 y = cross ( viewDir , x ) ;
vec2 uv = vec2 ( dot ( x , normal ) , dot ( y , normal ) ) * 0.495 + 0.5 ;
# ifdef USE _MATCAP
vec4 matcapColor = texture2D ( matcap , uv ) ;
# else
vec4 matcapColor = vec4 ( vec3 ( mix ( 0.2 , 0.8 , uv . y ) ) , 1.0 ) ;
# endif
vec3 outgoingLight = diffuseColor . rgb * matcapColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Yyt= ` # define NORMAL
2024-09-29 19:46:45 +00:00
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
varying vec3 vViewPosition ;
# endif
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
vViewPosition = - mvPosition . xyz ;
# endif
2024-10-20 21:50:56 +00:00
} ` , $ yt= ` # define NORMAL
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# if defined ( FLAT _SHADED ) || defined ( USE _BUMPMAP ) || defined ( USE _NORMALMAP _TANGENTSPACE )
varying vec3 vViewPosition ;
# endif
# include < packing >
# include < uv _pars _fragment >
# include < normal _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
# include < logdepthbuf _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
gl _FragColor = vec4 ( packNormalToRGB ( normal ) , opacity ) ;
# ifdef OPAQUE
gl _FragColor . a = 1.0 ;
# endif
2024-10-20 21:50:56 +00:00
} ` ,Wyt= ` # define PHONG
2024-09-29 19:46:45 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < envmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < envmap _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,Kyt= ` # define PHONG
2024-09-29 19:46:45 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform vec3 specular ;
uniform float shininess ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _phong _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < specularmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < specularmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _phong _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + reflectedLight . directSpecular + reflectedLight . indirectSpecular + totalEmissiveRadiance ;
# include < envmap _fragment >
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,jyt= ` # define STANDARD
2024-09-29 19:46:45 +00:00
varying vec3 vViewPosition ;
# ifdef USE _TRANSMISSION
varying vec3 vWorldPosition ;
# endif
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
# ifdef USE _TRANSMISSION
vWorldPosition = worldPosition . xyz ;
# endif
2024-10-20 21:50:56 +00:00
} ` ,Qyt= ` # define STANDARD
2024-09-29 19:46:45 +00:00
# ifdef PHYSICAL
# define IOR
# define USE _SPECULAR
# endif
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float roughness ;
uniform float metalness ;
uniform float opacity ;
# ifdef IOR
uniform float ior ;
# endif
# ifdef USE _SPECULAR
uniform float specularIntensity ;
uniform vec3 specularColor ;
# ifdef USE _SPECULAR _COLORMAP
uniform sampler2D specularColorMap ;
# endif
# ifdef USE _SPECULAR _INTENSITYMAP
uniform sampler2D specularIntensityMap ;
# endif
# endif
# ifdef USE _CLEARCOAT
uniform float clearcoat ;
uniform float clearcoatRoughness ;
# endif
# ifdef USE _IRIDESCENCE
uniform float iridescence ;
uniform float iridescenceIOR ;
uniform float iridescenceThicknessMinimum ;
uniform float iridescenceThicknessMaximum ;
# endif
# ifdef USE _SHEEN
uniform vec3 sheenColor ;
uniform float sheenRoughness ;
# ifdef USE _SHEEN _COLORMAP
uniform sampler2D sheenColorMap ;
# endif
# ifdef USE _SHEEN _ROUGHNESSMAP
uniform sampler2D sheenRoughnessMap ;
# endif
# endif
# ifdef USE _ANISOTROPY
uniform vec2 anisotropyVector ;
# ifdef USE _ANISOTROPYMAP
uniform sampler2D anisotropyMap ;
# endif
# endif
varying vec3 vViewPosition ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < iridescence _fragment >
# include < cube _uv _reflection _fragment >
# include < envmap _common _pars _fragment >
# include < envmap _physical _pars _fragment >
# include < fog _pars _fragment >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _physical _pars _fragment >
# include < transmission _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < clearcoat _pars _fragment >
# include < iridescence _pars _fragment >
# include < roughnessmap _pars _fragment >
# include < metalnessmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < roughnessmap _fragment >
# include < metalnessmap _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < clearcoat _normal _fragment _begin >
# include < clearcoat _normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _physical _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 totalDiffuse = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse ;
vec3 totalSpecular = reflectedLight . directSpecular + reflectedLight . indirectSpecular ;
# include < transmission _fragment >
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance ;
# ifdef USE _SHEEN
float sheenEnergyComp = 1.0 - 0.157 * max3 ( material . sheenColor ) ;
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect ;
# endif
# ifdef USE _CLEARCOAT
float dotNVcc = saturate ( dot ( geometryClearcoatNormal , geometryViewDir ) ) ;
vec3 Fcc = F _Schlick ( material . clearcoatF0 , material . clearcoatF90 , dotNVcc ) ;
outgoingLight = outgoingLight * ( 1.0 - material . clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material . clearcoat ;
# endif
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Xyt= ` # define TOON
2024-09-29 19:46:45 +00:00
varying vec3 vViewPosition ;
# include < common >
# include < batching _pars _vertex >
# include < uv _pars _vertex >
# include < displacementmap _pars _vertex >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < normal _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < shadowmap _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
# include < color _vertex >
# include < morphcolor _vertex >
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < normal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < displacementmap _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
vViewPosition = - mvPosition . xyz ;
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,Zyt= ` # define TOON
2024-09-29 19:46:45 +00:00
uniform vec3 diffuse ;
uniform vec3 emissive ;
uniform float opacity ;
# include < common >
# include < packing >
# include < dithering _pars _fragment >
# include < color _pars _fragment >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < aomap _pars _fragment >
# include < lightmap _pars _fragment >
# include < emissivemap _pars _fragment >
# include < gradientmap _pars _fragment >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < normal _pars _fragment >
# include < lights _toon _pars _fragment >
# include < shadowmap _pars _fragment >
# include < bumpmap _pars _fragment >
# include < normalmap _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
ReflectedLight reflectedLight = ReflectedLight ( vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) , vec3 ( 0.0 ) ) ;
vec3 totalEmissiveRadiance = emissive ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < color _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
# include < normal _fragment _begin >
# include < normal _fragment _maps >
# include < emissivemap _fragment >
# include < lights _toon _fragment >
# include < lights _fragment _begin >
# include < lights _fragment _maps >
# include < lights _fragment _end >
# include < aomap _fragment >
vec3 outgoingLight = reflectedLight . directDiffuse + reflectedLight . indirectDiffuse + totalEmissiveRadiance ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
# include < dithering _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Jyt= ` uniform float size ;
2024-09-29 19:46:45 +00:00
uniform float scale ;
# include < common >
# include < color _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
# ifdef USE _POINTS _UV
varying vec2 vUv ;
uniform mat3 uvTransform ;
# endif
void main ( ) {
# ifdef USE _POINTS _UV
vUv = ( uvTransform * vec3 ( uv , 1 ) ) . xy ;
# endif
# include < color _vertex >
# include < morphcolor _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < project _vertex >
gl _PointSize = size ;
# ifdef USE _SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix ( projectionMatrix ) ;
if ( isPerspective ) gl _PointSize *= ( scale / - mvPosition . z ) ;
# endif
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < worldpos _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,eEt= ` uniform vec3 diffuse ;
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# include < common >
# include < color _pars _fragment >
# include < map _particle _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _particle _fragment >
# include < color _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
# include < premultiplied _alpha _fragment >
2024-10-20 21:50:56 +00:00
} ` ,tEt= ` # include < common >
2024-09-29 19:46:45 +00:00
# include < batching _pars _vertex >
# include < fog _pars _vertex >
# include < morphtarget _pars _vertex >
# include < skinning _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < shadowmap _pars _vertex >
void main ( ) {
# include < batching _vertex >
# include < beginnormal _vertex >
# include < morphnormal _vertex >
# include < skinbase _vertex >
# include < skinnormal _vertex >
# include < defaultnormal _vertex >
# include < begin _vertex >
# include < morphtarget _vertex >
# include < skinning _vertex >
# include < project _vertex >
# include < logdepthbuf _vertex >
# include < worldpos _vertex >
# include < shadowmap _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,nEt= ` uniform vec3 color ;
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# include < common >
# include < packing >
# include < fog _pars _fragment >
# include < bsdfs >
# include < lights _pars _begin >
# include < logdepthbuf _pars _fragment >
# include < shadowmap _pars _fragment >
# include < shadowmask _pars _fragment >
void main ( ) {
# include < logdepthbuf _fragment >
gl _FragColor = vec4 ( color , opacity * ( 1.0 - getShadowMask ( ) ) ) ;
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
2024-10-20 21:50:56 +00:00
} ` ,sEt= ` uniform float rotation ;
2024-09-29 19:46:45 +00:00
uniform vec2 center ;
# include < common >
# include < uv _pars _vertex >
# include < fog _pars _vertex >
# include < logdepthbuf _pars _vertex >
# include < clipping _planes _pars _vertex >
void main ( ) {
# include < uv _vertex >
vec4 mvPosition = modelViewMatrix * vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
vec2 scale ;
scale . x = length ( vec3 ( modelMatrix [ 0 ] . x , modelMatrix [ 0 ] . y , modelMatrix [ 0 ] . z ) ) ;
scale . y = length ( vec3 ( modelMatrix [ 1 ] . x , modelMatrix [ 1 ] . y , modelMatrix [ 1 ] . z ) ) ;
# ifndef USE _SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix ( projectionMatrix ) ;
if ( isPerspective ) scale *= - mvPosition . z ;
# endif
vec2 alignedPosition = ( position . xy - ( center - vec2 ( 0.5 ) ) ) * scale ;
vec2 rotatedPosition ;
rotatedPosition . x = cos ( rotation ) * alignedPosition . x - sin ( rotation ) * alignedPosition . y ;
rotatedPosition . y = sin ( rotation ) * alignedPosition . x + cos ( rotation ) * alignedPosition . y ;
mvPosition . xy += rotatedPosition ;
gl _Position = projectionMatrix * mvPosition ;
# include < logdepthbuf _vertex >
# include < clipping _planes _vertex >
# include < fog _vertex >
2024-10-20 21:50:56 +00:00
} ` ,iEt= ` uniform vec3 diffuse ;
2024-09-29 19:46:45 +00:00
uniform float opacity ;
# include < common >
# include < uv _pars _fragment >
# include < map _pars _fragment >
# include < alphamap _pars _fragment >
# include < alphatest _pars _fragment >
# include < alphahash _pars _fragment >
# include < fog _pars _fragment >
# include < logdepthbuf _pars _fragment >
# include < clipping _planes _pars _fragment >
void main ( ) {
# include < clipping _planes _fragment >
vec3 outgoingLight = vec3 ( 0.0 ) ;
vec4 diffuseColor = vec4 ( diffuse , opacity ) ;
# include < logdepthbuf _fragment >
# include < map _fragment >
# include < alphamap _fragment >
# include < alphatest _fragment >
# include < alphahash _fragment >
outgoingLight = diffuseColor . rgb ;
# include < opaque _fragment >
# include < tonemapping _fragment >
# include < colorspace _fragment >
# include < fog _fragment >
2024-10-20 21:50:56 +00:00
} ` ,Et={alphahash_fragment:wbt,alphahash_pars_fragment:Rbt,alphamap_fragment:Abt,alphamap_pars_fragment:Mbt,alphatest_fragment:Nbt,alphatest_pars_fragment:Obt,aomap_fragment:Ibt,aomap_pars_fragment:kbt,batching_pars_vertex:Dbt,batching_vertex:Lbt,begin_vertex:Pbt,beginnormal_vertex:Fbt,bsdfs:Ubt,iridescence_fragment:Bbt,bumpmap_pars_fragment:Gbt,clipping_planes_fragment:Vbt,clipping_planes_pars_fragment:zbt,clipping_planes_pars_vertex:Hbt,clipping_planes_vertex:qbt,color_fragment:Ybt,color_pars_fragment: $ bt,color_pars_vertex:Wbt,color_vertex:Kbt,common:jbt,cube_uv_reflection_fragment:Qbt,defaultnormal_vertex:Xbt,displacementmap_pars_vertex:Zbt,displacementmap_vertex:Jbt,emissivemap_fragment:e0t,emissivemap_pars_fragment:t0t,colorspace_fragment:n0t,colorspace_pars_fragment:s0t,envmap_fragment:i0t,envmap_common_pars_fragment:r0t,envmap_pars_fragment:o0t,envmap_pars_vertex:a0t,envmap_physical_pars_fragment:y0t,envmap_vertex:l0t,fog_vertex:c0t,fog_pars_vertex:d0t,fog_fragment:u0t,fog_pars_fragment:p0t,gradientmap_pars_fragment:f0t,lightmap_fragment:_0t,lightmap_pars_fragment:m0t,lights_lambert_fragment:h0t,lights_lambert_pars_fragment:g0t,lights_pars_begin:b0t,lights_toon_fragment:E0t,lights_toon_pars_fragment:v0t,lights_phong_fragment:S0t,lights_phong_pars_fragment:T0t,lights_physical_fragment:x0t,lights_physical_pars_fragment:C0t,lights_fragment_begin:w0t,lights_fragment_maps:R0t,lights_fragment_end:A0t,logdepthbuf_fragment:M0t,logdepthbuf_pars_fragment:N0t,logdepthbuf_pars_vertex:O0t,logdepthbuf_vertex:I0t,map_fragment:k0t,map_pars_fragment:D0t,map_particle_fragment:L0t,map_particle_pars_fragment:P0t,metalnessmap_fragment:F0t,metalnessmap_pars_fragment:U0t,morphcolor_vertex:B0t,morphnormal_vertex:G0t,morphtarget_pars_vertex:V0t,morphtarget_vertex:z0t,normal_fragment_begin:H0t,normal_fragment_maps:q0t,normal_pars_fragment:Y0t,normal_pars_vertex: $ 0t,normal_vertex:W0t,normalmap_pars_fragment:K0t,clearcoat_normal_fragment_begin:j0t,clearcoat_normal_fragment_maps:Q0t,clearcoat_pars_fragment:X0t,iridescence_pars_fragment:Z0t,opaque_fragment:J0t,packing:eyt,premultiplied_alpha_fragment:tyt,project_vertex:nyt,dithering_fragment:syt,dithering_pars_fragment:iyt,roughnessmap_fragment:ryt,roughnessmap_pars_fragment:oyt,shadowmap_pars_fragment:ayt,shadowmap_pars_vertex:lyt,shadowmap_vertex:cyt,shadowmask_pars_fragment:dyt,skinbase_vertex:uyt,skinning_pars_vertex:pyt,skinning_vertex:fyt,skinnormal_vertex:_yt,specularmap_fragment:myt,specularmap_pars_fragment:hyt,tonemapping_fragment:gyt,tonemapping_pars_fragment:byt,transmission_fragment:yyt,transmission_pars_fragment:Eyt,uv_pars_fragment:vyt,uv_pars_vertex:Syt,uv_vertex:Tyt,worldpos_vertex:xyt,background_vert:Cyt,background_frag:wyt,backgroundCube_vert:Ryt,backgroundCube_frag:Ayt,cube_vert:Myt,cube_frag:Nyt,depth_vert:Oyt,depth_frag:Iyt,distanceRGBA_vert:kyt,distanceRGBA_frag:Dyt,equirect_vert:Lyt,equirect_frag:Pyt,linedashed_vert:Fyt,linedashed_frag:Uyt,meshbasic_vert:Byt,meshbasic_frag:Gyt,meshlambert_vert:Vyt,meshlambert_frag:zyt,meshmatcap_vert:Hyt,meshmatcap_frag:qyt,meshnormal_vert:Yyt,meshnormal_frag: $ yt,meshphong_vert:Wyt,meshphong_frag:Kyt,meshphysical_vert:jyt,meshphysical_frag:Qyt,meshtoon_vert:Xyt,meshtoon_frag:Zyt,points_vert:Jyt,points_frag:eEt,shadow_vert:tEt,shadow_frag:nEt,sprite_vert:sEt,sprite_frag:iEt}, $ e={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new St},alphaMap:{value:null},alphaMapTransform:{value:new St},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new St}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new St}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new St}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new St},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new St},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:
2024-09-29 19:46:45 +00:00
precision mediump float ;
precision mediump int ;
varying vec3 vOutputDirection ;
uniform sampler2D envMap ;
uniform int samples ;
uniform float weights [ n ] ;
uniform bool latitudinal ;
uniform float dTheta ;
uniform float mipInt ;
uniform vec3 poleAxis ;
# define ENVMAP _TYPE _CUBE _UV
# include < cube _uv _reflection _fragment >
vec3 getSample ( float theta , vec3 axis ) {
float cosTheta = cos ( theta ) ;
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross ( axis , vOutputDirection ) * sin ( theta )
+ axis * dot ( axis , vOutputDirection ) * ( 1.0 - cosTheta ) ;
return bilinearCubeUV ( envMap , sampleDirection , mipInt ) ;
}
void main ( ) {
vec3 axis = latitudinal ? poleAxis : cross ( poleAxis , vOutputDirection ) ;
if ( all ( equal ( axis , vec3 ( 0.0 ) ) ) ) {
axis = vec3 ( vOutputDirection . z , 0.0 , - vOutputDirection . x ) ;
}
axis = normalize ( axis ) ;
gl _FragColor = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ;
gl _FragColor . rgb += weights [ 0 ] * getSample ( 0.0 , axis ) ;
for ( int i = 1 ; i < n ; i ++ ) {
if ( i >= samples ) {
break ;
}
float theta = dTheta * float ( i ) ;
gl _FragColor . rgb += weights [ i ] * getSample ( - 1.0 * theta , axis ) ;
gl _FragColor . rgb += weights [ i ] * getSample ( theta , axis ) ;
}
}
2024-10-20 20:24:55 +00:00
` ,blending:hr,depthTest:!1,depthWrite:!1})}function _w(){return new mo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:vy(),fragmentShader: `
2024-09-29 19:46:45 +00:00
precision mediump float ;
precision mediump int ;
varying vec3 vOutputDirection ;
uniform sampler2D envMap ;
# include < common >
void main ( ) {
vec3 outputDirection = normalize ( vOutputDirection ) ;
vec2 uv = equirectUv ( outputDirection ) ;
gl _FragColor = vec4 ( texture2D ( envMap , uv ) . rgb , 1.0 ) ;
}
2024-10-20 20:24:55 +00:00
` ,blending:hr,depthTest:!1,depthWrite:!1})}function mw(){return new mo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:vy(),fragmentShader: `
2024-09-29 19:46:45 +00:00
precision mediump float ;
precision mediump int ;
uniform float flipEnvMap ;
varying vec3 vOutputDirection ;
uniform samplerCube envMap ;
void main ( ) {
gl _FragColor = textureCube ( envMap , vec3 ( flipEnvMap * vOutputDirection . x , vOutputDirection . yz ) ) ;
}
2024-10-20 20:24:55 +00:00
` ,blending:hr,depthTest:!1,depthWrite:!1})}function vy(){return `
2024-09-29 19:46:45 +00:00
precision mediump float ;
precision mediump int ;
attribute float faceIndex ;
varying vec3 vOutputDirection ;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection ( vec2 uv , float face ) {
uv = 2.0 * uv - 1.0 ;
vec3 direction = vec3 ( uv , 1.0 ) ;
if ( face == 0.0 ) {
direction = direction . zyx ; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction . xzy ;
direction . xz *= - 1.0 ; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction . x *= - 1.0 ; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction . zyx ;
direction . xz *= - 1.0 ; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction . xzy ;
direction . xy *= - 1.0 ; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction . z *= - 1.0 ; // ( u, v, -1 ) neg z
}
return direction ;
}
void main ( ) {
vOutputDirection = getDirection ( uv , faceIndex ) ;
gl _Position = vec4 ( position , 1.0 ) ;
}
2024-10-20 21:50:56 +00:00
` }function fEt(n){let e=new WeakMap,t=null;function s(a){if(a&&a.isTexture){const c=a.mapping,d=c===yb||c===Eb,u=c===ba||c===ya;if(d||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let _=e.get(a);return t===null&&(t=new pw(n)),_=d?t.fromEquirectangular(a,_):t.fromCubemap(a,_),e.set(a,_),_.texture}else{if(e.has(a))return e.get(a).texture;{const _=a.image;if(d&&_&&_.height>0||u&&_&&i(_)){t===null&&(t=new pw(n));const m=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,m),a.addEventListener("dispose",r),m.texture}else return null}}}return a}function i(a){let c=0;const d=6;for(let u=0;u<d;u++)a[u]!==void 0&&c++;return c===d}function r(a){const c=a.target;c.removeEventListener("dispose",r);const d=e.get(c);d!==void 0&&(e.delete(c),d.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:s,dispose:o}}function _Et(n){const e={};function t(s){if(e[s]!==void 0)return e[s];let i;switch(s){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(s)}return e[s]=i,i}return{has:function(s){return t(s)!==null},init:function(s){s.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"),t("WEBGL_multisampled_render_to_texture")},get:function(s){const i=t(s);return i===null&&console.warn("THREE.WebGLRenderer: "+s+" extension not supported."),i}}}function mEt(n,e,t,s){const i={},r=new WeakMap;function o(_){const m=_.target;m.index!==null&&e.remove(m.index);for(const f in m.attributes)e.remove(m.attributes[f]);for(const f in m.morphAttributes){const g=m.morphAttributes[f];for(let b=0,y=g.length;b<y;b++)e.remove(g[b])}m.removeEventListener("dispose",o),delete i[m.id];const h=r.get(m);h&&(e.remove(h),r.delete(m)),s.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function a(_,m){return i[m.id]===!0||(m.addEventListener("dispose",o),i[m.id]=!0,t.memory.geometries++),m}function c(_){const m=_.attributes;for(const f in m)e.update(m[f],n.ARRAY_BUFFER);const h=_.morphAttributes;for(const f in h){const g=h[f];for(let b=0,y=g.length;b<y;b++)e.update(g[b],n.ARRAY_BUFFER)}}function d(_){const m=[],h=_.index,f=_.attributes.position;let g=0;if(h!==null){const E=h.array;g=h.version;for(let v=0,S=E.length;v<S;v+=3){const R=E[v+0],C=E[v+1],A=E[v+2];m.push(R,C,C,A,A,R)}}else if(f!==void 0){const E=f.array;g=f.version;for(let v=0,S=E.length/3-1;v<S;v+=3){const R=v+0,C=v+1,A=v+2;m.push(R,C,C,A,A,R)}}else return;const b=new( $ N(m)?JN:ZN)(m,1);b.version=g;const y=r.get(_);y&&e.remove(y),r.set(_,b)}function u(_){const m=r.get(_);if(m){const h=_.index;h!==null&&m.version<h.version&&d(_)}else d(_);return r.get(_)}return{get:a,update:c,getWireframeAttribute:u}}function hEt(n,e,t,s){const i=s.isWebGL2;let r;function o(h){r=h}let a,c;function d(h){a=h.type,c=h.bytesPerElement}function u(h,f){n.drawElements(r,f,a,h*c),t.update(f,r,1)}function _(h,f,g){if(g===0)return;let b,y;if(i)b=n,y="drawElementsInstanced";else if(b=e.get("ANGLE_instanced_arrays"),y="drawElementsInstancedANGLE",b===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support ex
2024-09-29 19:46:45 +00:00
` ),s=[],i=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let o=i;o<r;o++){const a=o+1;s.push( ` $ { a === e ? ">" : " " } $ { a } : $ { t [ o ] } ` )}return s.join( `
2024-10-20 21:50:56 +00:00
` )}function mvt(n){const e=Lt.getPrimaries(Lt.workingColorSpace),t=Lt.getPrimaries(n);let s;switch(e===t?s="":e===Tu&&t===Su?s="LinearDisplayP3ToLinearSRGB":e===Su&&t===Tu&&(s="LinearSRGBToLinearDisplayP3"),n){case Cn:case bp:return[s,"LinearTransferOETF"];case nn:case hy:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[s,"LinearTransferOETF"]}}function Tw(n,e,t){const s=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(s&&i==="")return"";const r=/ERROR: 0:( \d +)/.exec(i);if(r){const o=parseInt(r[1]);return t.toUpperCase()+ `
2024-09-29 19:46:45 +00:00
` +i+ `
2024-10-20 21:50:56 +00:00
` +_vt(n.getShaderSource(e),o)}else return i}function hvt(n,e){const t=mvt(e);return ` vec4 $ { n } ( vec4 value ) { return $ { t [ 0 ] } ( $ { t [ 1 ] } ( value ) ) ; } ` }function gvt(n,e){let t;switch(e){case fgt:t="Linear";break;case _gt:t="Reinhard";break;case mgt:t="OptimizedCineon";break;case hgt:t="ACESFilmic";break;case ggt:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function bvt(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||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)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(gl).join( `
` )}function yvt(n){const e=[];for(const t in n){const s=n[t];s!==!1&&e.push("#define "+t+" "+s)}return e.join( `
` )}function Evt(n,e){const t={},s=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<s;i++){const r=n.getActiveAttrib(e,i),o=r.name;let a=1;r.type===n.FLOAT_MAT2&&(a=2),r.type===n.FLOAT_MAT3&&(a=3),r.type===n.FLOAT_MAT4&&(a=4),t[o]={type:r.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function gl(n){return n!==""}function xw(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Cw(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const vvt=/^[ \t ]*#include +<([ \w \d ./]+)>/gm;function wb(n){return n.replace(vvt,Tvt)}const Svt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Tvt(n,e){let t=Et[e];if(t===void 0){const s=Svt.get(e);if(s!==void 0)t=Et[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return wb(t)}const xvt=/#pragma unroll_loop_start \s +for \s * \( \s *int \s +i \s *= \s *( \d +) \s *; \s *i \s *< \s *( \d +) \s *; \s *i \s * \+ \+ \s * \) \s *{([ \s \S ]+?)} \s +#pragma unroll_loop_end/g;function ww(n){return n.replace(xvt,Cvt)}function Cvt(n,e,t,s){let i="";for(let r=parseInt(e);r<parseInt(t);r++)i+=s.replace(/ \[ \s *i \s * \] /g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function Rw(n){let e="precision "+n.precision+ ` float ;
2024-09-29 19:46:45 +00:00
precision ` +n.precision+" int;";return n.precision==="highp"?e+= `
# define HIGH _PRECISION ` :n.precision==="mediump"?e+= `
# define MEDIUM _PRECISION ` :n.precision==="lowp"&&(e+= `
2024-10-20 21:50:56 +00:00
# define LOW _PRECISION ` ),e}function wvt(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===kN?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Vht?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Ci&&(e="SHADOWMAP_TYPE_VSM"),e}function Rvt(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case ba:case ya:e="ENVMAP_TYPE_CUBE";break;case gp:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Avt(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case ya:e="ENVMAP_MODE_REFRACTION";break}return e}function Mvt(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case fy:e="ENVMAP_BLENDING_MULTIPLY";break;case ugt:e="ENVMAP_BLENDING_MIX";break;case pgt:e="ENVMAP_BLENDING_ADD";break}return e}function Nvt(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,s=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:s,maxMip:t}}function Ovt(n,e,t,s){const i=n.getContext(),r=t.defines;let o=t.vertexShader,a=t.fragmentShader;const c=wvt(t),d=Rvt(t),u=Avt(t),_=Mvt(t),m=Nvt(t),h=t.isWebGL2?"":bvt(t),f=yvt(r),g=i.createProgram();let b,y,E=t.glslVersion?"#version "+t.glslVersion+ `
2024-10-18 23:54:04 +00:00
` :"";t.isRawShaderMaterial?(b=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(gl).join( `
2024-09-29 19:46:45 +00:00
` ),b.length>0&&(b+= `
2024-10-20 20:24:55 +00:00
` ),y=[h,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(gl).join( `
2024-09-29 19:46:45 +00:00
` ),y.length>0&&(y+= `
2024-10-17 11:28:01 +00:00
` )):(b=[Rw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?
2024-10-18 23:54:04 +00:00
` ].filter(gl).join( `
2024-10-20 21:50:56 +00:00
` ),y=[h,Rw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",t.envMap?"#define "+_:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==gr?"#define TONE_MAPPING":"",t.toneMapping!==gr?Et.tonemapping_pars_fragment:"",t.toneMapping!==gr?gvt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Et.colorspace_pars_fragment,hvt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"", `
2024-10-18 23:54:04 +00:00
` ].filter(gl).join( `
2024-10-17 11:28:01 +00:00
` )),o=wb(o),o=xw(o,t),o=Cw(o,t),a=wb(a),a=xw(a,t),a=Cw(a,t),o=ww(o),a=ww(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(E= ` # version 300 es
2024-09-29 19:46:45 +00:00
` ,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join( `
` )+ `
2024-10-17 11:28:01 +00:00
` +b,y=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===YC?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===YC?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join( `
2024-09-29 19:46:45 +00:00
` )+ `
2024-10-20 20:24:55 +00:00
` +y);const v=E+b+o,S=E+y+a,R=Sw(i,i.VERTEX_SHADER,v),C=Sw(i,i.FRAGMENT_SHADER,S);i.attachShader(g,R),i.attachShader(g,C),t.index0AttributeName!==void 0?i.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function A(G){if(n.debug.checkShaderErrors){const V=i.getProgramInfoLog(g).trim(),te=i.getShaderInfoLog(R).trim(),O=i.getShaderInfoLog(C).trim();let H=!0,q=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(H=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,g,R,C);else{const L=Tw(i,R,"vertex"),Y=Tw(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+ `
2024-09-29 19:46:45 +00:00
Program Info Log : ` +V+ `
` +L+ `
2024-10-20 21:50:56 +00:00
` +Y)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(te===""||O==="")&&(q=!1);q&&(G.diagnostics={runnable:H,programLog:V,vertexShader:{log:te,prefix:b},fragmentShader:{log:O,prefix:y}})}i.deleteShader(R),i.deleteShader(C),I=new Ud(i,g),x=Evt(i,g)}let I;this.getUniforms=function(){return I===void 0&&A(this),I};let x;this.getAttributes=function(){return x===void 0&&A(this),x};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(g,pvt)),M},this.destroy=function(){s.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=fvt++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=R,this.fragmentShader=C,this}let Ivt=0;class kvt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,s=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const s of t)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let s=t.get(e);return s===void 0&&(s=new Set,t.set(e,s)),s}_getShaderStage(e){const t=this.shaderCache;let s=t.get(e);return s===void 0&&(s=new Dvt(e),t.set(e,s)),s}}class Dvt{constructor(e){this.id=Ivt++,this.code=e,this.usedTimes=0}}function Lvt(n,e,t,s,i,r,o){const a=new QN,c=new kvt,d=[],u=i.isWebGL2,_=i.logarithmicDepthBuffer,m=i.vertexTextures;let h=i.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(x){return x===0?"uv": ` uv$ { x } ` }function b(x,M,G,V,te){const O=V.fog,H=te.geometry,q=x.isMeshStandardMaterial?V.environment:null,L=(x.isMeshStandardMaterial?t:e).get(x.envMap||q),Y=L&&L.mapping===gp?L.image.height:null,se=f[x.type];x.precision!==null&&(h=i.getMaxPrecision(x.precision),h!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",h,"instead."));const oe=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ye=oe!==void 0?oe.length:0;let xe=0;H.morphAttributes.position!==void 0&&(xe=1),H.morphAttributes.normal!==void 0&&(xe=2),H.morphAttributes.color!==void 0&&(xe=3);let le,ve,Oe,Le;if(se){const wn=Zs[se];le=wn.vertexShader,ve=wn.fragmentShader}else le=x.vertexShader,ve=x.fragmentShader,c.update(x),Oe=c.getVertexShaderID(x),Le=c.getFragmentShaderID(x);const Q=n.getRenderTarget(),fe=te.isInstancedMesh===!0,_e=te.isBatchedMesh===!0,Ae=!!x.map,Fe=!!x.matcap,ne=!!L,U=!!x.aoMap,P=!!x.lightMap,J=!!x.bumpMap,ce=!!x.normalMap,pe=!!x.displacementMap,he=!!x.emissiveMap,ae=!!x.metalnessMap,Me=!!x.roughnessMap,Re=x.anisotropy>0,ge=x.clearcoat>0,D=x.iridescence>0,N=x.sheen>0,K=x.transmission>0,me=Re&&!!x.anisotropyMap,j=ge&&!!x.clearcoatMap,ie=ge&&!!x.clearcoatNormalMap,Ce=ge&&!!x.clearcoatRoughnessMap,we=D&&!!x.iridescenceMap,ke=D&&!!x.iridescenceThicknessMap,We=N&&!!x.sheenColorMap,lt=N&&!!x.sheenRoughnessMap,Pe=!!x.specularMap,Mt=!!x.specularColorMap,tt=!!x.specularIntensityMap,nt=K&&!!x.transmissionMap,ze=K&&!!x.thicknessMap,Ke=!!x.gradientMap,_t=!!x.alphaMap,ee=x.alphaTest>0,je=!!x.alphaHash,Ve=!!x.extensions,Ne=!!H.attributes.uv1,He=!!H.attributes.uv2,dt=!!H.attributes.uv3;let Nt=gr;return x.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(Nt=n.toneMapping),{isWebGL2
2024-09-29 19:46:45 +00:00
gl _Position = vec4 ( position , 1.0 ) ;
2024-10-20 21:50:56 +00:00
} ` ,Kvt= ` uniform sampler2D shadow _pass ;
2024-09-29 19:46:45 +00:00
uniform vec2 resolution ;
uniform float radius ;
# include < packing >
void main ( ) {
const float samples = float ( VSM _SAMPLES ) ;
float mean = 0.0 ;
float squared _mean = 0.0 ;
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ) ;
float uvStart = samples <= 1.0 ? 0.0 : - 1.0 ;
for ( float i = 0.0 ; i < samples ; i ++ ) {
float uvOffset = uvStart + i * uvStride ;
# ifdef HORIZONTAL _PASS
vec2 distribution = unpackRGBATo2Half ( texture2D ( shadow _pass , ( gl _FragCoord . xy + vec2 ( uvOffset , 0.0 ) * radius ) / resolution ) ) ;
mean += distribution . x ;
squared _mean += distribution . y * distribution . y + distribution . x * distribution . x ;
# else
float depth = unpackRGBAToDepth ( texture2D ( shadow _pass , ( gl _FragCoord . xy + vec2 ( 0.0 , uvOffset ) * radius ) / resolution ) ) ;
mean += depth ;
squared _mean += depth * depth ;
# endif
}
mean = mean / samples ;
squared _mean = squared _mean / samples ;
float std _dev = sqrt ( squared _mean - mean * mean ) ;
gl _FragColor = pack2HalfToRGBA ( vec2 ( mean , std _dev ) ) ;
2024-10-20 22:07:51 +00:00
} ` ;function jvt(n,e,t){let s=new by;const i=new Rt,r=new Rt,o=new $ t,a=new Yvt({depthPacking:Ngt}),c=new $ vt,d={},u=t.maxTextureSize,_={[Fi]:Xn,[Xn]:Fi,[Js]:Js},m=new mo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:Wvt,fragmentShader:Kvt}),h=m.clone();h.defines.HORIZONTAL_PASS=1;const f=new _i;f.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Vn(f,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=kN;let y=this.type;this.render=function(R,C,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||R.length===0)return;const I=n.getRenderTarget(),x=n.getActiveCubeFace(),M=n.getActiveMipmapLevel(),G=n.state;G.setBlending(hr),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=y!==Ci&&this.type===Ci,te=y===Ci&&this.type!==Ci;for(let O=0,H=R.length;O<H;O++){const q=R[O],L=q.shadow;if(L===void 0){console.warn("THREE.WebGLShadowMap:",q,"has no shadow.");continue}if(L.autoUpdate===!1&&L.needsUpdate===!1)continue;i.copy(L.mapSize);const Y=L.getFrameExtents();if(i.multiply(Y),r.copy(L.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(r.x=Math.floor(u/Y.x),i.x=r.x*Y.x,L.mapSize.x=r.x),i.y>u&&(r.y=Math.floor(u/Y.y),i.y=r.y*Y.y,L.mapSize.y=r.y)),L.map===null||V===!0||te===!0){const oe=this.type!==Ci?{minFilter:gn,magFilter:gn}:{};L.map!==null&&L.map.dispose(),L.map=new _o(i.x,i.y,oe),L.map.texture.name=q.name+".shadowMap",L.camera.updateProjectionMatrix()}n.setRenderTarget(L.map),n.clear();const se=L.getViewportCount();for(let oe=0;oe<se;oe++){const ye=L.getViewport(oe);o.set(r.x*ye.x,r.y*ye.y,r.x*ye.z,r.y*ye.w),G.viewport(o),L.updateMatrices(q,oe),s=L.getFrustum(),S(C,A,L.camera,q,this.type)}L.isPointLightShadow!==!0&&this.type===Ci&&E(L,A),L.needsUpdate=!1}y=this.type,b.needsUpdate=!1,n.setRenderTarget(I,x,M)};function E(R,C){const A=e.update(g);m.defines.VSM_SAMPLES!==R.blurSamples&&(m.defines.VSM_SAMPLES=R.blurSamples,h.defines.VSM_SAMPLES=R.blurSamples,m.needsUpdate=!0,h.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new _o(i.x,i.y)),m.uniforms.shadow_pass.value=R.map.texture,m.uniforms.resolution.value=R.mapSize,m.uniforms.radius.value=R.radius,n.setRenderTarget(R.mapPass),n.clear(),n.renderBufferDirect(C,null,A,m,g,null),h.uniforms.shadow_pass.value=R.mapPass.texture,h.uniforms.resolution.value=R.mapSize,h.uniforms.radius.value=R.radius,n.setRenderTarget(R.map),n.clear(),n.renderBufferDirect(C,null,A,h,g,null)}function v(R,C,A,I){let x=null;const M=A.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(M!==void 0)x=M;else if(x=A.isPointLight===!0?c:a,n.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0||C.map&&C.alphaTest>0){const G=x.uuid,V=C.uuid;let te=d[G];te===void 0&&(te={},d[G]=te);let O=te[V];O===void 0&&(O=x.clone(),te[V]=O),x=O}if(x.visible=C.visible,x.wireframe=C.wireframe,I===Ci?x.side=C.shadowSide!==null?C.shadowSide:C.side:x.side=C.shadowSide!==null?C.shadowSide:_[C.side],x.alphaMap=C.alphaMap,x.alphaTest=C.alphaTest,x.map=C.map,x.clipShadows=C.clipShadows,x.clippingPlanes=C.clippingPlanes,x.clipIntersection=C.clipIntersection,x.displacementMap=C.displacementMap,x.displacementScale=C.displacementScale,x.displacementBias=C.displacementBias,x.wireframeLinewidth=C.wireframeLinewidth,x.linewidth=C.linewidth,A.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const G=n.properties.get(x);G.light=A}return x}function S(R,C,A,I,x){if(R.visible===!1)return;if(R.layers.test(C.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&x===Ci)&&(!R.frustumCulled||s.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,R.matrixWorld);const V=e.update(R),te=R.material;if(Array.isArray(te)){const O=V.groups;for(let H=0,q=O.length;H<q;H++){const L=O[H],Y=te[L.materialIndex];if(Y&&Y.visible){const se=v(R,Y,I,x);R.onBeforeShadow(n,R,C,A,V,se,L),n.renderBufferDirect(A,null,V,se,R,L),R.onAfterShad
2024-09-29 19:46:45 +00:00
Please check that you don ' t accidentally use the same token twice to register two different handlers for the same event / hook . ` ),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const s=this._listeners.indexOf(t);s>=0&&this._listeners.splice(s,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn( ` Already subscribed . Unsubscribing for you .
2024-10-20 21:50:56 +00:00
Please check that you don 't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class Gt extends io{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class kn extends io{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const i of Array.from(this.listeners.values()))if(i(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class vO extends io{execute(e,t){let s=e;for(const i of this.listeners)s=i(s,t);return s}}class ls extends vO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class Q1t extends io{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Qs(){const n=Symbol(),e=new Map,t=new Set,s=(c,d)=>{d instanceof io&&d.registerProxy(n,()=>{var u,_;return(_=(u=e.get(c))===null||u===void 0?void 0:u.listeners)!==null&&_!==void 0?_:[]})},i=c=>{const d=new io;e.set(c,d),t.forEach(u=>s(c,u[c]))},r=c=>{t.add(c);for(const d of e.keys())s(d,c[d])},o=c=>{for(const d of e.keys())c[d]instanceof io&&c[d].unregisterProxy(n);t.delete(c)},a=()=>{t.forEach(c=>o(c)),e.clear()};return new Proxy({},{get(c,d){return d==="addTarget"?r:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?c[d]:(e.has(d)||i(d),e.get(d))}})}class s2{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Gt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for ' from ' or ' to ' values");this.id=Di(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class SO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for ' from ' or ' to ' values ");this.id=Di(),this.from=e,this.to=t}}function Ob(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class TO{constructor(){this._title=" ",this.id=Di(),this.events={loaded:new Gt(this),beforeAddInput:new kn(this),addInput:new Gt(this),beforeRemoveInput:new kn(this),removeInput:new Gt(this),beforeAddOutput:new kn(this),addOutput:new Gt(this),beforeRemoveOutput:new kn(this),removeOutput:new Gt(this),beforeTitleChanged:new kn(this),titleChanged:new Gt(this),update:new Gt(this)},this.hooks={beforeLoad:new ls(this),afterSave:new ls(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface(" input ",e,t)}addOutput(e,t){return this.addInterface(" output ",e,t)}removeInput(e){return this.removeInterface(" input ",e)}removeOutput(e){return this.removeInterface(" output ",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Ob(this.inputs,i=>i.save()),t=Ob(this.outputs,i=>i.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf(" input ",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf(" output ",e,t))}initializeIntf(e,t,s){s.isInput=e===" input ",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const i=e===" input " ? this . events . beforeAddInput : this . events . beforeAddOutput , r = e ===
2024-10-20 20:24:55 +00:00
This is likely a Baklava internal issue . Please report it on GitHub . ` );const h=this.hooks.transferData.execute(d[m],u);u.to.allowMultipleConnections?t.has(u.to.id)?t.get(u.to.id).push(h):t.set(u.to.id,[h]):t.set(u.to.id,h)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const s of e.nodes)Object.values(s.inputs).forEach(i=>{i.connectionCount===0&&t.set(i.id,i.value)}),s.calculate||Object.values(s.outputs).forEach(i=>{t.set(i.id,i.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error( ` Could not find value for interface $ { t }
2024-10-20 22:07:51 +00:00
This is likely a Baklava internal issue . Please report it on GitHub . ` );return e.get(t)}}const rTt=["INPUT","TEXTAREA","SELECT"];function AO(n){return rTt.includes(n.tagName)}let Ib=null;function oTt(n){Ib=n}function cs(){if(!Ib)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Ib}}function As(){const{viewModel:n}=cs();return{graph:Hd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function MO(n){const{graph:e}=As(),t=ot(null),s=ot(null);return{dragging:Je(()=>!!t.value),onPointerDown:c=>{t.value={x:c.pageX,y:c.pageY},s.value={x:n.value.x,y:n.value.y}},onPointerMove:c=>{if(t.value){const d=c.pageX-t.value.x,u=c.pageY-t.value.y;n.value.x=s.value.x+d/e.value.scaling,n.value.y=s.value.y+u/e.value.scaling}},onPointerUp:()=>{t.value=null,s.value=null}}}function NO(n,e,t){if(!e.template)return!1;if(Na(e.template)===t)return!0;const s=n.graphTemplates.find(r=>Na(r)===t);return s?s.nodes.filter(r=>r.type.startsWith(Jl)).some(r=>NO(n,e,r.type)):!1}function OO(n){return Je(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,i])=>i.category)),s=[];for(const i of t.values()){let r=e.filter(([,o])=>o.category===i);n.value.displayedGraph.template?r=r.filter(([o])=>!NO(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![Aa,Ma].includes(o)),r.length>0&&s.push({name:i,nodeTypes:Object.fromEntries(r)})}return s.sort((i,r)=>i.name==="default"?-1:r.name==="default"||i.name>r.name?1:-1),s})}function IO(){const{graph:n}=As();return{transform:(t,s)=>{const i=t/n.value.scaling-n.value.panning.x,r=s/n.value.scaling-n.value.panning.y;return[i,r]}}}function aTt(){const{graph:n}=As();let e=[],t=-1,s={x:0,y:0};const i=Je(()=>n.value.panning),r=MO(i),o=Je(()=>({"transform-origin":"0 0",transform: ` scale ( $ { n . value . scaling } ) translate ( $ { n . value . panning . x } px , $ { n . value . panning . y } px ) ` })),a=(h,f,g)=>{const b=[h/n.value.scaling-n.value.panning.x,f/n.value.scaling-n.value.panning.y],y=[h/g-n.value.panning.x,f/g-n.value.panning.y],E=[y[0]-b[0],y[1]-b[1]];n.value.panning.x+=E[0],n.value.panning.y+=E[1],n.value.scaling=g},c=h=>{h.preventDefault();let f=h.deltaY;h.deltaMode===1&&(f*=32);const g=n.value.scaling*(1-f/3e3);a(h.offsetX,h.offsetY,g)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:h=>{if(e.push(h),r.onPointerDown(h),e.length===2){const{ax:f,ay:g,bx:b,by:y}=d();s={x:f+(b-f)/2,y:g+(y-g)/2}}},onPointerMove:h=>{for(let f=0;f<e.length;f++)if(h.pointerId==e[f].pointerId){e[f]=h;break}if(e.length==2){const{ax:f,ay:g,bx:b,by:y}=d(),E=f-b,v=g-y,S=Math.sqrt(E*E+v*v);if(t>0){const R=n.value.scaling*(1+(S-t)/500);a(s.x,s.y,R)}t=S}else r.onPointerMove(h)},onPointerUp:h=>{e=e.filter(f=>f.pointerId!==h.pointerId),t=-1,r.onPointerUp()},onMouseWheel:c}}var bs=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(bs||{});const kO=Symbol();function lTt(){const{graph:n}=As(),e=ot(null),t=ot(null),s=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},i=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(c=>c.to===t.value);t.value.isInput&&a?(e.value={status:bs.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:bs.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const c=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=c.connectionAllowed?bs.ALLOWED:bs.FORBIDDEN,c.connectionAllowed){const d=c.connectionsInDanger.map(u=>u.id);n.value.connections.forEach(u=>{d.includes(u.id)&&(u.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=bs.NONE,n.value.connections.forEach(c=>{c.isInDanger=!1}))};return ta(kO,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:s,onMouseDown:i,onMouseUp:r,hoveredOver:o}}function cTt(n){const e=ot(!1),t=ot(0),s=ot(0),i=OO(n),{transform:r}=IO(),o=Je(
2024-10-20 21:50:56 +00:00
This may take some time the first time as some libraries need to be installed . ` ),Z.post("/apps/start_server",e).then(t=>{this. $ store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this. $ notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,i;this. $ store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this. $ notify({type:"error",title:"Server Start Failed",text:((i=(s=t.response)==null?void 0:s.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this. $ refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this. $ store.state.client_id);try{const s=await Z.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this. $ refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await Z.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await Z.post("/show_apps_folder",{client_id:this. $ store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await Z.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await Z.get( ` / apps / $ { n . folder _name } / README . md ` );this.appCode=Pt(e.data)}else this.showMessage( ` Please install $ { n . folder _name } to view its code . ` ,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this. $ store.state.messageBox.showBlockingMessage( ` Installing app $ { n } ` );try{await Z.post( ` / install / $ { n } ` ,{client_id:this. $ store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this. $ store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await Z.post( ` / uninstall / $ { n } ` ,{client_id:this. $ store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await Z.post( ` / delete / $ { n } ` , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d } ) , t h i s . s h o w M e s s a g e ( " D e l e t i o n s u c c e e d e d ! " , ! 0 ) } c a t c h { t h i s . s h o w M e s s a g e ( " D e l e t i o n f a i l e d . " , ! 1 ) } f i n a l l y { t h i s . l o a d i n g = ! 1 , t h i s . f e t c h A p p s ( ) } } , a s y n c e d i t A p p ( n ) { t h i s . l o a d i n g = ! 0 ; t r y { c o n s t e = a w a i t Z . p o s t ( " / o p e n _ a p p _ i n _ v s c o d e " , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d , a p p _ n a m e : n . f o l d e r _ n a m e } ) ; t h i s . s h o w M e s s a g e ( e . d a t a . m e s s a g e , ! 0 ) } c a t c h { t h i s . s h o w M e s s a g e ( " F a i l e d t o o p e n f o l d e r i n V S C o d e . " , ! 1 ) } f i n a l l y { t h i s . l o a d i n g = ! 1 } } , a s y n c d o w n l o a d A p p ( n ) { t h i s . i s L o a d i n g = ! 0 , t h i s . e r r o r = n u l l ; t r y { c o n s t e = a w a i t Z . p o s t ( " / d o w n l o a d _ a p p " , { c l i e n t _ i d : t h i s . $ s t o r e . s t a t e . c l i e n t _ i d , a p p _ n a m e : n } , { r e s p o n s e T y p e : " a r r a y b u f f e r " } ) , t = e . h e a d e r s [ " c o n t e n t - d i s p o s i t i o n " ] , s = t & & t . m a t c h ( / f i l e n a m e = " ? ( . + ) " ? / i ) , i = s ? s [ 1 ] : " a p p . z i p " , r = n e w B l o b ( [ e . d a t a ] , { t y p e : " a p p l i c a t i o n / z i p " } ) , o = w i n d o w . U R L . c r e a t e O b j e c t U R L ( r ) , a = d o c u m e n t . c r e a t e E l e m e n t ( " a " ) ; a . s t y l e . d i s p l a y = " n o n e " , a . h r e f = o , a . d o w n l o a d = i , d o c u m e n t . b o d y . a p p e n d C h i l d ( a ) , a . c l i c k ( ) , w i n d o w . U R L . r e v o k e O b j e c t U R L ( o ) , d o c u m e n t . b o d y . r e m o v e C h i l d ( a ) } c a t c h ( e ) { c o n s o l e . e r r o r ( " E r r o r d o w n l o a d i n g a p p : " , e ) , t h i s . e r r o r = " F a i l e d t o d o w n l o a d t h e a p p . P l e a s e t r y a g a i n . " } f i n a l l y { t h i s . i s L o a d i n g = ! 1 }
2024-09-29 19:46:45 +00:00
` +n.name,4,!0):this. $ store.state.toast.showToast( ` Error on select personality :
2024-10-20 20:24:55 +00:00
` +n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);De(()=>{feather.replace()})}},onModelSelected(n){if(this.isLoading){this. $ store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this. $ store.state.toast.showToast( ` Selected model :
` +n.name,4,!0),De(()=>{feather.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this. $ store.commit("setIsModelOk",t)})):(this. $ store.state.toast.showToast( ` Couldn ' t select model :
` +n.name,4,!1),De(()=>{feather.replace()})),this.settingsChanged=!0,this.isModelSelected=!0}):this. $ store.state.toast.showToast( ` Model :
2024-09-29 19:46:45 +00:00
` +n.model.name+ `
2024-10-20 20:24:55 +00:00
is not installed ` ,4,!1),De(()=>{feather.replace()}))},toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){console.log("Toggling favorite");const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this. $ store.state.client_id,app_name:n};this. $ store.state.messageBox.showBlockingMessage( ` Loading server .
2024-09-29 19:46:45 +00:00
This may take some time the first time as some libraries need to be installed . ` ),Z.post("/personalities/start_server",e).then(t=>{this. $ store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this. $ notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,i;this. $ store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this. $ notify({type:"error",title:"Server Start Failed",text:((i=(s=t.response)==null?void 0:s.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this. $ refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this. $ store.state.client_id);try{const s=await Z.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this. $ refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async mount_personality(n){if(this. $ store.state.messageBox.showMessage("Loading personality"),!n)return{status:!1,error:"no personality - mount_personality"};try{const e={client_id:this. $ store.state.client_id,language:n.language?n.language:"",category:n.category?n.category:"",folder:n.folder?n.folder:""},t=await Z.post("/mount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}this. $ store.state.messageBox.hideMessage()},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};let e=n.language==null?n.full_path:n.full_path+":"+n.language;console.log("pth",e);const t=this.configFile.personalities.findIndex(i=>i===e),s={client_id:this. $ store.state.client_id,id:t};try{const i=await Z.post("/select_personality",s,{headers:this.posts_headers});if(i)return this. $ store.dispatch("refreshConfig").then(()=>{this. $ store.dispatch("refreshPersonalitiesZoo").then(()=>{this. $ store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},async mountPersonality(n){if(this.isLoading=!0,console.log("mount pers",n),n.personality.disclaimer!=""&&this. $ store.state.messageBox.showMessage(n.personality.disclaimer),!n)return;if(this.configFile.personalities.includes(n.personality.full_path)){this.isLoading=!1,this. $ store.state.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(n.personality);console.log("mount_personality res",e),e&&e.status&&e.active_personality_id>-1&&e.personalities.includes(n.personality.full_path)?(this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality mounted",4,!0),n.isMounted=!0,(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +n.personality.name,4,!0),this. $ store.dispatch("refreshMountedPersonalities"),window.location.href.split("/").length>4?window.location.href="/":window.location.reload(!0)):(n.isMounted=!1,this. $ store.state.toast.showToast( ` Could not mount personality
Error : ` +e.error+ `
Response :
` +e,4,!1)),this.isLoading=!1},async unmountAll(){await Z.post("/unmount_all_personalities",{client_id:this. $ store.state.client_id},{headers:this.posts_headers}),this. $ store.dispatch("refreshMountedPersonalities"),this. $ store.dispatch("refreshConfig"),this. $ store.state.toast.showToast("All personas unmounted",4,!0)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this. $ store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await Z.post("/unmount_personality",e,{headers:this.posts_headers});if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this. $ store.state.toast.showToast("Personality unmounted",4,!0);const t=this. $ store.state.personalities.findIndex(a=>a.full_path==n.full_path),s=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),i=this. $ refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this. $ store.state.personalities[t]),this. $ store.state.personalities[t].isMounted=!1,s>-1&&(this.personalitiesFiltered[s].isMounted=!1),i>-1&&(this. $ refs.personalitiesZoo[i].isMounted=!1),this. $ store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this. $ store.state.toast.showToast( ` Selected personality :
` +r.name,4,!0)}else this. $ store.state.toast.showToast( ` Could not unmount personality
Error : ` +e.error,4,!1);this.isLoading=!1},editPersonality(n){n=n.personality,Z.post("/get_personality_config",{client_id:this. $ store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this. $ store.state.currentPersonConfig=t.config,this. $ store.state.showPersonalityEditor=!0,this. $ store.state.personality_editor.showPanel(),this. $ store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},copyToCustom(n){n=n.personality,Z.post("/copy_to_custom_personas",{category:n.category,name:n.folder}).then(e=>{e.status?(this. $ store.state.messageBox.showMessage( ` Personality copied to the custom personalities folder :
Now it ' s up to you to modify it , enhance it , and maybe even share it .
Feel free to add your name as an author , but please remember to keep the original creator ' s name as well .
You have the freedom to give , sell , or keep the personas you create for yourself .
The possibilities are endless , they are now yours to mold and customize as you see fit . ` ),this. $ store.dispatch("refreshPersonalitiesZoo")):this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
Verify that the personality is not already copied there . ` ,4,!1)}).catch(e=>{this. $ store.state.toast.showToast( ` Personality couldn ' t be copied to the custom personalities folder :
` ,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),Z.post("/reinstall_personality",{client_id:this. $ store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this. $ store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this. $ store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this. $ store.state.toast.showToast( ` Could not reinstall personality
2024-10-20 21:50:56 +00:00
` +e.message,4,!1),{status:!1}))},async handleOpenFolder(n){await Z.post("/open_personality_folder",{client_id:this. $ store.state.client_id,personality_folder:n.personality.folder})},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this. $ store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this. $ store.state.personalities,this.loading=!1},500)}},Y2t={class:"app-zoo mb-100 pb-100 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"}, $ 2t={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},W2t={class:"flex flex-wrap items-center justify-between gap-4"},K2t={key:0},j2t={key:1,class:"error"},Q2t={class:"relative flex-grow max-w-md"},X2t={class:"flex items-center space-x-4"},Z2t=["value"],J2t={class:"flex items-center space-x-4"},eRt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},tRt={key:1},nRt={class:"container mx-auto px-4 flex flex-column pb-20"},sRt={key:0},iRt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},rRt={class:"container mx-auto px-4 flex flex-column pb-20"},oRt={class:"text-2xl font-bold my-8"},aRt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},lRt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},cRt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},dRt={class:"flex justify-between items-center mb-4"},uRt={class:"text-2xl font-bold"},pRt=["srcdoc"],fRt={key:1,class:"text-center text-red-500"};function _Rt(n,e,t,s,i,r){const o=et("personality-entry");return T(),w("div",Y2t,[l("nav", $ 2t,[l("div",W2t,[i.message?(T(),w("p",K2t, $ (i.message),1)):B("",!0),i.error?(T(),w("p",j2t, $ (i.error),1)):B("",!0),l("div",Q2t,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ue,i.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",X2t,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),w(Be,null,Xe(r.categories,a=>(T(),w("option",{key:a,value:a}, $ (a),9,Z2t))),128))],512),[[It,i.selectedCategory]])]),l("div",J2t,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[It,i.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>r.toggleSortOrder&&r.toggleSortOrder(...a)),class:"btn btn-secondary"}, $ (i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),w("div",eRt,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),w("div",tRt,[l("div",nRt,[r.favoriteAp