PageSourceSearch

https://pinobite.com/assets/index-Do3puBAy.js

js pinobite.com collected 2026-10-08 02:01:29 UTC 873,591 bytes, 4,221 lines download raw bytes

vendor: 5,111 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CartDrawer-3GZs0giw.js","assets/vendor-framer-Bi1qEhT1.js","assets/analytics-Dq79UYMc.js","assets/AuthModal-DmN7z9X5.js","assets/vendor-tiptap-DCrKpgXq.js","assets/vendor-gsap-C0eCJjti.js","assets/ProductPage-GdFo4Vrv.js","assets/ShopPage-DygP303R.js","assets/CheckoutPage-B4SzS6og.js","assets/Dashboard-Bp8qIar0.js","assets/FAQPage--cNBFvA6.js","assets/BlogsPage-zN7oHJdw.js","assets/DistributorPage-Cv7nPbuJ.js","assets/BlogDetailPage-D41Eg4b0.js","assets/EventBlogsPage-BUM4r-aC.js","assets/EventDetailsPage-DYpleLks.js","assets/AdminLoginPage-0o_NtH6d.js","assets/AdminDashboard-_iDphIBr.js","assets/VisitorFormPage-CFMam66i.js","assets/VisitorFormPage-CF6Ilk6z.css","assets/JourneyPage-D3uhwk0Q.js","assets/PrivacyPolicyPage-DqHGwksm.js","assets/TermsAndConditionsPage-DeI9v_qW.js","assets/RefundPolicyPage-CZfSNR9T.js","assets/ShippingPolicyPage-CNlOGWvX.js","assets/SharedWishlistPage-VWhs_5d5.js","assets/NotFoundPage-BWQN-cTR.js","assets/EventModal-BI_BVbUC.js","assets/SnaxxoProductWheel-Ym-N_u5r.js"])))=>i.map(i=>d[i]);
2var rv=r=>{throw TypeError(r)};var gh=(r,e,i)=>e.has(r)||rv("Cannot "+i);var W=(r,e,i)=>(gh(r,e,"read from private field"),i?i.call(r):e.get(r)),st=(r,e,i)=>e.has(r)?rv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,i),Xe=(r,e,i,s)=>(gh(r,e,"write to private field"),s?s.call(r,i):e.set(r,i),i),Ut=(r,e,i)=>(gh(r,e,"access private method"),i);var Mu=(r,e,i,s)=>({set _(l){Xe(r,e,l,i)},get _(){return W(r,e,s)}});import{r as HS,g as GS,a as ye,u as O_,b as P_,j as x,m as na,A as Yo,R as et}from"./vendor-framer-Bi1qEhT1.js";import{r as kS}from"./vendor-tiptap-DCrKpgXq.js";import{g as Za}from"./vendor-gsap-C0eCJjti.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var xh={exports:{}},kl={},vh={exports:{}},_h={};/**
3 * @license React
4 * scheduler.production.js
5 *
6 * Copyright (c) Meta Platforms, Inc. and affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var ov;function VS(){return ov||(ov=1,(function(r){function e(B,j){var Y=B.length;B.push(j);e:for(;0<Y;){var ce=Y-1>>>1,Se=B[ce];if(0<l(Se,j))B[ce]=j,B[Y]=Se,Y=ce;else break e}}function i(B){return B.length===0?null:B[0]}function s(B){if(B.length===0)return null;var j=B[0],Y=B.pop();if(Y!==j){B[0]=Y;e:for(var ce=0,Se=B.length,Ce=Se>>>1;ce<Ce;){var Ae=2*(ce+1)-1,je=B[Ae],dt=Ae+1,ft=B[dt];if(0>l(je,Y))dt<Se&&0>l(ft,je)?(B[ce]=ft,B[dt]=Y,ce=dt):(B[ce]=je,B[Ae]=Y,ce=Ae);else if(dt<Se&&0>l(ft,Y))B[ce]=ft,B[dt]=Y,ce=dt;else break e}}return j}function l(B,j){var Y=B.sortIndex-j.sortIndex;return Y!==0?Y:B.id-j.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();r.unstable_now=function(){return d.now()-h}}var p=[],m=[],_=1,v=null,g=3,b=!1,A=!1,D=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function C(B){for(var j=i(m);j!==null;){if(j.callback===null)s(m);else if(j.startTime<=B)s(m),j.sortIndex=j.expirationTime,e(p,j);else break;j=i(m)}}function I(B){if(D=!1,C(B),!A)if(i(p)!==null)A=!0,L||(L=!0,$());else{var j=i(m);j!==null&&te(I,j.startTime-B)}}var L=!1,H=-1,w=5,O=-1;function V(){return E?!0:!(r.unstable_now()-O<w)}function k(){if(E=!1,L){var B=r.unstable_now();O=B;var j=!0;try{e:{A=!1,D&&(D=!1,z(H),H=-1),b=!0;var Y=g;try{t:{for(C(B),v=i(p);v!==null&&!(v.expirationTime>B&&V());){var ce=v.callback;if(typeof ce=="function"){v.callback=null,g=v.priorityLevel;var Se=ce(v.expirationTime<=B);if(B=r.unstable_now(),typeof Se=="function"){v.callback=Se,C(B),j=!0;break t}v===i(p)&&s(p),C(B)}else s(p);v=i(p)}if(v!==null)j=!0;else{var Ce=i(m);Ce!==null&&te(I,Ce.startTime-B),j=!1}}break e}finally{v=null,g=Y,b=!1}j=void 0}}finally{j?$():L=!1}}}var $;if(typeof F=="function")$=function(){F(k)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,fe=me.port2;me.port1.onmessage=k,$=function(){fe.postMessage(null)}}else $=function(){M(k,0)};function te(B,j){H=M(function(){B(r.unstable_now())},j)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(B){B.
vendor: 5,231 bytes, lines 10-18
10callback=null},r.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<B?Math.floor(1e3/B):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_next=function(B){switch(g){case 1:case 2:case 3:var j=3;break;default:j=g}var Y=g;g=j;try{return B()}finally{g=Y}},r.unstable_requestPaint=function(){E=!0},r.unstable_runWithPriority=function(B,j){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=g;g=B;try{return j()}finally{g=Y}},r.unstable_scheduleCallback=function(B,j,Y){var ce=r.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ce+Y:ce):Y=ce,B){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=Y+Se,B={id:_++,callback:j,priorityLevel:B,startTime:Y,expirationTime:Se,sortIndex:-1},Y>ce?(B.sortIndex=Y,e(m,B),i(p)===null&&B===i(m)&&(D?(z(H),H=-1):D=!0,te(I,Y-ce))):(B.sortIndex=Se,e(p,B),A||b||(A=!0,L||(L=!0,$()))),B},r.unstable_shouldYield=V,r.unstable_wrapCallback=function(B){var j=g;return function(){var Y=g;g=j;try{return B.apply(this,arguments)}finally{g=Y}}}})(_h)),_h}var lv;function jS(){return lv||(lv=1,vh.exports=VS()),vh.exports}/**
11 * @license React
12 * react-dom-client.production.js
13 *
14 * Copyright (c) Meta Platforms, Inc. and affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var cv;function XS(){if(cv)return kl;cv=1;var r=jS(),e=HS(),i=kS();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(s(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(s(188));return n!==t?null:t}for(var a=t,o=n;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(o=u.return,o!==null){a=o;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return p(u),t;if(f===o)return p(u),n;f=f.sibling}throw Error(s(188))}if(a.return!==o.return)a=u,o=f;else{for(var y=!1,N=u.child;N;){if(N===a){y=!0,a=u,o=f;break}if(N===o){y=!0,o=u,a=f;break}N=N.sibling}if(!y){for(N=f.child;N;){if(N===a){y=!0,a=f,o=u;break}if(N===o){y=!0,o=f,a=u;break}N=N.sibling}if(!y)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:n}function _(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=_(t),n!==null)return n;t=t.sibling}return null}var v=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),F=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=k&&t[k]||t["@@iterator"],typeof t=="function"?t:null)}var me=Symbol.for("react.client.reference");function fe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===me?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case L:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case F:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case C:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return n=t.displayName||null,n!==null?n:fe(t.type)||"Memo";case w:n=t._payload,t=t._init;try{return fe(t(n))}catch{}}return null}var te=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ce=[],Se=-1;function Ce(t){return{current:t}}function Ae(t){0>Se||(t.current=ce[Se],ce[Se]=null,Se--)}function je(t,n){Se++,ce[Se]=t.current,t.current=n}var dt=Ce(null),ft=Ce(null),Z=Ce(null),we=Ce(null);
vendor: 10,524 bytes, lines 18-25
18function Te(t,n){switch(je(Z,n),je(ft,t),je(dt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Rx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Rx(n),t=Nx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ae(dt),je(dt,t)}function ke(){Ae(dt),Ae(ft),Ae(Z)}function rt(t){t.memoizedState!==null&&je(we,t);var n=dt.current,a=Nx(n,t.type);n!==a&&(je(ft,t),je(dt,a))}function Ze(t){ft.current===t&&(Ae(dt),Ae(ft)),we.current===t&&(Ae(we),zl._currentValue=Y)}var en,yt;function Et(t){if(en===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);en=n&&n[1]||"",yt=-1<a.stack.indexOf(`
19    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
20`+en+t+yt}var vt=!1;function ht(t,n){if(!t||vt)return"";vt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ue){var oe=ue}Reflect.construct(t,[],_e)}else{try{_e.call()}catch(ue){oe=ue}t.call(_e.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(_e=t())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),y=f[0],N=f[1];if(y&&N){var G=y.split(`
21`),ae=N.split(`
22`);for(u=o=0;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;for(;u<ae.length&&!ae[u].includes("DetermineComponentFrameRoot");)u++;if(o===G.length||u===ae.length)for(o=G.length-1,u=ae.length-1;1<=o&&0<=u&&G[o]!==ae[u];)u--;for(;1<=o&&0<=u;o--,u--)if(G[o]!==ae[u]){if(o!==1||u!==1)do if(o--,u--,0>u||G[o]!==ae[u]){var ge=`
23`+G[o].replace(" at new "," at ");return t.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",t.displayName)),ge}while(1<=o&&0<=u);break}}}finally{vt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Et(a):""}function sn(t,n){switch(t.tag){case 26:case 27:case 5:return Et(t.type);case 16:return Et("Lazy");case 13:return t.child!==n&&n!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return ht(t.type,!1);case 11:return ht(t.type.render,!1);case 1:return ht(t.type,!0);case 31:return Et("Activity");default:return""}}function pn(t){try{var n="",a=null;do n+=sn(t,a),a=t,t=t.return;while(t);return n}catch(o){return`
24Error generating stack: `+o.message+`
25`+o.stack}}var Wt=Object.prototype.hasOwnProperty,rn=r.unstable_scheduleCallback,qt=r.unstable_cancelCallback,un=r.unstable_shouldYield,Q=r.unstable_requestPaint,Ht=r.unstable_now,zt=r.unstable_getCurrentPriorityLevel,P=r.unstable_ImmediatePriority,T=r.unstable_UserBlockingPriority,ee=r.unstable_NormalPriority,se=r.unstable_LowPriority,he=r.unstable_IdlePriority,Re=r.log,Oe=r.unstable_setDisableYieldValue,de=null,pe=null;function De(t){if(typeof Re=="function"&&Oe(t),pe&&typeof pe.setStrictMode=="function")try{pe.setStrictMode(de,t)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ie=Math.log,Pe=Math.LN2;function Je(t){return t>>>=0,t===0?32:31-(Ie(t)/Pe|0)|0}var $e=256,ot=262144,q=4194304;function Ne(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function xe(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var u=0,f=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var N=o&134217727;return N!==0?(o=N&~f,o!==0?u=Ne(o):(y&=N,y!==0?u=Ne(y):a||(a=N&~t,a!==0&&(u=Ne(a))))):(N=o&~f,N!==0?u=Ne(N):y!==0?u=Ne(y):a||(a=o&~t,a!==0&&(u=Ne(a)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,a=n&-n,f>=a||f===32&&(a&4194048)!==0)?n:u}function Ue(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Fe(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function be(){var t=q;return q<<=1,(q&62914560)===0&&(q=4194304),t}function qe(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Ve(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function cn(t,n,a,o,u,f){var y=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var N=t.entanglements,G=t.expirationTimes,ae=t.hiddenUpdates;for(a=y&~a;0<a;){var ge=31-Ge(a),_e=1<<ge;N[ge]=0,G[ge]=-1;var oe=ae[ge];if(oe!==null)for(ae[ge]=null,ge=0;ge<oe.length;ge++){var ue=oe[ge];ue!==null&&(ue.lane&=-536870913)}a&=~_e}o!==0&&At(t,o,0),f!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=f&~(y&~n))}function At(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-Ge(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function Zn(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var o=31-Ge(a),u=1<<o;u&n|t[o]&n&&(t[o]|=n),a&=~u}}function Jn(t,n){var a=n&-n;return a=(a&42)!==0?1:pi(a),(a&(t.suspendedLanes|n))!==0?0:a}function pi(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function $n(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Aa(){var t=j.p;return t!==0?t:(t=window.event,t===void 0?32:$x(t.type))}function ls(t,n){var a=j.p;try{return j.p=t,n()}finally{j.p=a}}var wi=Math.random().toString(36).slice(2),mn="__reactFiber$"+wi,Un="__reactProps$"+wi,Wn="__reactContainer$"+wi,Ci="__reactEvents$"+wi,cs="__reactListeners$"+wi,us="__reactHandles$"+wi,aa="__reactResources$"+wi,sa="__reactMarker$"+wi;function ki(t){delete t[mn],delete t[Un],delete t[Ci],delete t[cs],delete t[us]}function Vi(t){var n=t[mn];if(n)return n;for(var a=t.parentNode;a;){if(n=a[Wn]||a[mn]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Fx(t);t!==null;){if(a=t[mn])return a;t=Fx(t)}return n}t=a,a=t.parentNode}return null}function ji(t){if(t=t[mn]||t[Wn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function wa(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function ra(t){var n=t[aa];return n||(n=t[aa]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function mt(t){t[sa]=!0}var Hr=new Set,R={};function K(t,n){ne(t,n),ne(t+"Capture",n)}function ne(t,n){for(R[t]=n,t=0;t<n.length;t++)Hr.add(n[t])}var S=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),U={},re={};function Ee(t){return Wt.call(re,t)?!0:Wt.call(U,t)?!1:S.test(t)?re[t]=!0:(U[t]=!0,!1)}function Me(t,n,a){if(Ee(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+a)}}function ze(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function Be(t,n,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+o)}}function Qe(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function lt(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ye(t,n,a){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return u.call(this)},set:function(y){a=""+y,f.call(this,y)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function wt(t){if(!t._valueTracker){var n=lt(t)?"checked":"value";t._valueTracker=Ye(t,n,""+t[n])}}function it(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return t&&(o=lt(t)?t.checked?"true":"false":t.value),t=o,t!==a?(n.setValue(t),!0):!1}function gt(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var tt=/[\n"\\]/g;function Ft(t){return t.replace(tt,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Le(t,n,a,o,u,f,y,N){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Qe(n)):t.value!==""+Qe(n)&&(t.value=""+Qe(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?pt(t,y,Qe(n)):a!=null?pt(t,y,Qe(a
vendor: 4,122 bytes, line 25
25)):o!=null&&t.removeAttribute("value"),u==null&&f!=null&&(t.defaultChecked=!!f),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.name=""+Qe(N):t.removeAttribute("name")}function Tt(t,n,a,o,u,f,y,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),n!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){wt(t);return}a=a!=null?""+Qe(a):"",n=n!=null?""+Qe(n):a,N||n===t.value||(t.value=n),t.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=N?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),wt(t)}function pt(t,n,a){n==="number"&&gt(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function fn(t,n,a,o){if(t=t.options,n){n={};for(var u=0;u<a.length;u++)n["$"+a[u]]=!0;for(a=0;a<t.length;a++)u=n.hasOwnProperty("$"+t[a].value),t[a].selected!==u&&(t[a].selected=u),u&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Qe(a),n=null,u=0;u<t.length;u++){if(t[u].value===a){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}n!==null||t[u].disabled||(n=t[u])}n!==null&&(n.selected=!0)}}function St(t,n,a){if(n!=null&&(n=""+Qe(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+Qe(a):""}function Mn(t,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(s(92));if(te(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Qe(n),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),wt(t)}function mi(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var Kt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gn(t,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,a):typeof a!="number"||a===0||Kt.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Xi(t,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&a[u]!==o&&gn(t,u,o)}else for(var f in n)n.hasOwnProperty(f)&&gn(t,f,n[f])}function Yt(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var oa=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackgroun
25d","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fs=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function er(t){return fs.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ca(){}var hf=null;function pf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gr=null,kr=null;function Cm(t){var n=ji(t);if(n&&(t=n.stateNode)){var a=t[Un]||null;e:switch(t=n.stateNode,n.type){case"input":if(Le(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ft(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==t&&o.form===t.form){var u=o[Un]||null;if(!u)throw Error(s(90));Le(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===t.form&&it(o)}break e;case"textarea":St(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&fn(t,!!a.multiple,n,!1)}}}var mf=!1;function Rm(t,n,a){if(mf)return t(n,a);mf=!0;try{var o=t(n);return o}finally{if(mf=!1,(Gr!==null||kr!==null)&&(tu(),Gr&&(n=Gr,t=kr,kr=Gr=null,Cm(n),t)))for(n=0;n<t.length;n++)Cm(t[n])}}function tl(t,n){var a=t.stateNode;if(a===null)return null;var o=a[Un]||null;if(o===null)return null;a=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gf=!1;if(Ra)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){gf=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{gf=!1}var ds=null,xf=null,mc=null;
vendor: 6,610 bytes, line 25
25function Nm(){if(mc)return mc;var t,n=xf,a=n.length,o,u="value"in ds?ds.value:ds.textContent,f=u.length;for(t=0;t<a&&n[t]===u[t];t++);var y=a-t;for(o=1;o<=y&&n[a-o]===u[f-o];o++);return mc=u.slice(t,1<o?1-o:void 0)}function gc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function xc(){return!0}function Dm(){return!1}function ai(t){function n(a,o,u,f,y){this._reactName=a,this._targetInst=u,this.type=o,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var N in t)t.hasOwnProperty(N)&&(a=t[N],this[N]=a?a(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?xc:Dm,this.isPropagationStopped=Dm,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=xc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=xc)},persist:function(){},isPersistent:xc}),n}var tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vc=ai(tr),il=v({},tr,{view:0,detail:0}),zy=ai(il),vf,_f,al,_c=v({},il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==al&&(al&&t.type==="mousemove"?(vf=t.screenX-al.screenX,_f=t.screenY-al.screenY):_f=vf=0,al=t),vf)},movementY:function(t){return"movementY"in t?t.movementY:_f}}),Um=ai(_c),By=v({},_c,{dataTransfer:0}),Hy=ai(By),Gy=v({},il,{relatedTarget:0}),yf=ai(Gy),ky=v({},tr,{animationName:0,elapsedTime:0,pseudoElement:0}),Vy=ai(ky),jy=v({},tr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Xy=ai(jy),Wy=v({},tr,{data:0}),Lm=ai(Wy),qy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Qy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ky(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Qy[t])?!!n[t]:!1}function bf(){return Ky}var Zy=v({},il,{key:function(t){if(t.key){var n=qy[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=gc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Yy[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bf,charCode:function(t){return t.type==="keypress"?gc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?gc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Jy=ai(Zy),$y=v({},_c,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Om=ai($y),eb=v({},il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bf}),tb=ai(eb),nb=v({},tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ib=ai(nb),ab=v({},_c,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),sb=ai(ab),rb=v({},tr,{newState:0,oldState:0}),ob=ai(rb),lb=[9,13,27,32],Sf=Ra&&"CompositionEvent"in window,sl=null;Ra&&"documentMode"in document&&(sl=document.documentMode);var cb=Ra&&"TextEvent"in window&&!sl,Pm=Ra&&(!Sf||sl&&8<sl&&11>=sl),Im=" ",Fm=!1;function zm(t,n){switch(t){case"keyup":return lb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Vr=!1;function ub(t,n){switch(t){case"compositionend":return Bm(n);case"keypress":return n.which!==32?null:(Fm=!0,Im);case"textInput":return t=n.data,t===Im&&Fm?null:t;default:return null}}function fb(t,n){if(Vr)return t==="compositionend"||!Sf&&zm(t,n)?(t=Nm(),mc=xf=ds=null,Vr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Pm&&n.locale!=="ko"?null:n.data;default:return null}}var db={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hm(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!db[t.type]:n==="textarea"}function Gm(t,n,a,o){Gr?kr?kr.push(o):kr=[o]:Gr=o,n=lu(n,"onChange"),0<n.length&&(a=new vc("onChange","change",null,a,o),t.push({event:a,listeners:n}))}var rl=null,ol=null;function hb(t){Mx(t,0)}function yc(t){var n=wa(t);if(it(n))return t}function km(t,n){if(t==="change")return n}var Vm=!1;if(Ra){var Mf;if(Ra){var Ef="oninput"in document;if(!Ef){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Ef=typeof jm.oninput=="function"}Mf=Ef}else Mf=!1;Vm=Mf&&(!document.documentMode||9<document.documentMode)}function Xm(){rl&&(rl.detachEvent("onpropertychange",Wm),ol=rl=null)}function Wm(t){if(t.propertyName==="value"&&yc(ol)){var n=[];Gm(n,ol,t,pf(t)),Rm(hb,n)}}function pb(t,n,a){t==="focusin"?(Xm(),rl=n,ol=a,rl.attachEvent("onpropertychange",Wm)):t==="focusout"&&Xm()}function mb(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return yc(ol)}function gb(t,n){if(t==="click")return yc(n)}function xb(t,n){if(t==="input"||t==="change")return yc(n)}function vb(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var gi=typeof Object.is=="function"?Object.is:vb;function ll(t,n){if(gi(t,n))return!0;
vendor: 20,670 bytes, line 25
25if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var u=a[o];if(!Wt.call(n,u)||!gi(t[u],n[u]))return!1}return!0}function qm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ym(t,n){var a=qm(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=qm(a)}}function Qm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Qm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Km(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=gt(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=gt(t.document)}return n}function Tf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var _b=Ra&&"documentMode"in document&&11>=document.documentMode,jr=null,Af=null,cl=null,wf=!1;function Zm(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wf||jr==null||jr!==gt(o)||(o=jr,"selectionStart"in o&&Tf(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),cl&&ll(cl,o)||(cl=o,o=lu(Af,"onSelect"),0<o.length&&(n=new vc("onSelect","select",null,n,a),t.push({event:n,listeners:o}),n.target=jr)))}function nr(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var Xr={animationend:nr("Animation","AnimationEnd"),animationiteration:nr("Animation","AnimationIteration"),animationstart:nr("Animation","AnimationStart"),transitionrun:nr("Transition","TransitionRun"),transitionstart:nr("Transition","TransitionStart"),transitioncancel:nr("Transition","TransitionCancel"),transitionend:nr("Transition","TransitionEnd")},Cf={},Jm={};Ra&&(Jm=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);function ir(t){if(Cf[t])return Cf[t];if(!Xr[t])return t;var n=Xr[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in Jm)return Cf[t]=n[a];return t}var $m=ir("animationend"),e0=ir("animationiteration"),t0=ir("animationstart"),yb=ir("transitionrun"),bb=ir("transitionstart"),Sb=ir("transitioncancel"),n0=ir("transitionend"),i0=new Map,Rf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Rf.push("scrollEnd");function Wi(t,n){i0.set(t,n),K(n,[t])}var bc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ri=[],Wr=0,Nf=0;function Sc(){for(var t=Wr,n=Nf=Wr=0;n<t;){var a=Ri[n];Ri[n++]=null;var o=Ri[n];Ri[n++]=null;var u=Ri[n];Ri[n++]=null;var f=Ri[n];if(Ri[n++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}f!==0&&a0(a,u,f)}}function Mc(t,n,a,o){Ri[Wr++]=t,Ri[Wr++]=n,Ri[Wr++]=a,Ri[Wr++]=o,Nf|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Df(t,n,a,o){return Mc(t,n,a,o),Ec(t)}function ar(t,n){return Mc(t,null,null,n),Ec(t)}function a0(t,n,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var u=!1,f=t.return;f!==null;)f.childLanes|=a,o=f.alternate,o!==null&&(o.childLanes|=a),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(u=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,u&&n!==null&&(u=31-Ge(a),t=f.hiddenUpdates,o=t[u],o===null?t[u]=[n]:o.push(n),n.lane=a|536870912),f):null}function Ec(t){if(50<Dl)throw Dl=0,Hd=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var qr={};function Mb(t,n,a,o){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xi(t,n,a,o){return new Mb(t,n,a,o)}function Uf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Na(t,n){var a=t.alternate;return a===null?(a=xi(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function s0(t,n){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Tc(t,n,a,o,u,f){var y=0;if(o=t,typeof t=="function")Uf(t)&&(y=1);else if(typeof t=="string")y=CS(t,a,dt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=xi(31,a,n,u),t.elementType=O,t.lanes=f,t;case D:return sr(a.children,u,f,n);case E:y=8,u|=24;break;case M:return t=xi(12,a,n,u|2),t.elementType=M,t.lanes=f,t;case I:return t=xi(13,a,n,u),t.elementType=I,t.lanes=f,t;case L:return t=xi(19,a,n,u),t.elementType=L,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case F:y=10;break e;case z:y=9;break e;case C:y=11;break e;case H:y=14;break e;case w:y=16,o=null;break e}y=29,a=Error(s(130,t===null?"null":typeof t,"")),o=null}return n=xi(y,a,n,u),n.elementType=t,n.type=o,n.lanes=f,n}function sr(t,n,a,o){return t=xi(7,t,o,n),t.lanes=a,t}function Lf(t,n,a){return t=xi(6,t,null,n),t.lanes=a,t}function r0(t){var n=xi(18,null,null,0);return n.stateNode=t,n}function Of(t,n,a){return n=xi(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var o0=new WeakMap;function Ni(t,n){if(typeof t=="object"&&t!==null){var a=o0.get(t);return a!==void 0?a:(n={value:t,source:n,stack:pn(n)},o0.set(t,n),n)}return{value:t,source:n,stack:pn(n)}}var Yr=[],Qr=0,Ac=null,ul=0,Di=[],Ui=0,hs=null,la=1,ca="";function Da(t,n){Yr[Qr++]=ul,Yr[Qr++]=Ac,Ac=t,ul=n}function l0(t,n,a){Di[Ui++]=la,Di[Ui++]=ca,Di[Ui++]=hs,hs=t;var o=la;t=ca;var u=32-Ge(o)-1;o&=~(1<<u),a+=1;var f=32-Ge(n)+u;if(30<f){var y=u-u%5;f=(o&(1<<y)-1).toString(32),o>>=y,u-=y,la=1<<32-Ge(n)+u|a<<u|o,ca=f+t}else la=1<<f|a<<u|o,ca=t}function Pf(t){t.return!==null&&(Da(t,1),l0(t,1,0))}function If(t){for(;t===Ac;)Ac=Yr[--Qr],Yr[Qr]=null,ul=Yr[--Qr],Yr[Qr]=null;for(;t===hs;)hs=Di[--Ui],Di[Ui]=null,ca=Di[--Ui],Di[Ui]=null,la=Di[--Ui],Di[Ui]=null}function c0(t,n){Di[Ui++]=la,Di[Ui++]=ca,Di[Ui++]=hs,la=n.id,ca=n.overflow,hs=t}var Hn=null,dn=null,Lt=!1,ps=null,Li=!1,Ff=Error(s(519));function ms(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(Ni(n,t)),Ff}function u0(t){var n=t.stateNode,a=t.type,o=t.memoizedProps;switch(n[mn]=t,n[Un]=o,a){case"dialog":Rt("cancel",n),Rt("close",n);break;case"iframe":case"object":case"embed":Rt("load",n);break;case"video":case"audio":for(a=0;a<Ll.length;a++)Rt(Ll[a],n);break;case"source":Rt("error",n);break;case"img":case"image":case"link":Rt("error",n),Rt("load",n);break;case"details":Rt("toggle",n);break;case"input":Rt("invalid",n),Tt(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Rt("invalid",n);break;case"textarea":Rt("invalid",n),Mn(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||wx(n.textContent,a)?(o.popover!=null&&(Rt("beforetoggle",n),Rt("toggle",n)),o.onScroll!=null&&Rt("scroll",n),o.onScrollEnd!=null&&Rt("scrollend",n),o.onClick!=null&&(n.onclick=Ca),n=!0):n=!1,n||ms(t,!0)}function f0(t){for(Hn=t.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Hn=Hn.return}}function Kr(t){if(t!==Hn)return!1;if(!Lt)return f0(t),Lt=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||th(t.type,t.memoizedProps)),a=!a),a&&dn&&ms(t),f0(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));dn=Ix(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));dn=Ix(t)}else n===27?(n=dn,Rs(t.type)?(t=rh,rh=null,dn=t):dn=n):dn=Hn?Pi(t.stateNode.nextSibling):null;return!0}function rr(){dn=Hn=null,Lt=!1}function zf(){var t=ps;return t!==null&&(li===null?li=t:li.push.apply(li,t),ps=null),t}function fl(t){ps===null?ps=[t]:ps.push(t)}var Bf=Ce(null),or=null,Ua=null;function gs(t,n,a){je(Bf,n._currentValue),n._currentValue=a}function La(t){t._currentValue=Bf.current,Ae(Bf)}function Hf(t,n,a){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===a)break;t=t.return}}function Gf(t,n,a,o){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var f=u.dependencies;if(f!==null){var y=u.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=u;for(var G=0;G<n.length;G++)if(N.context===n[G]){f.lanes|=a,N=f.alternate,N!==null&&(N.lanes|=a),Hf(f.return,a,t),o||(y=null);break e}f=N.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(s(341));y.lanes|=a,f=y.alternate,f!==null&&(f.lanes|=a),Hf(y,a,t),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===t){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function Zr(t,n,a,o){t=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var N=u.type;gi(u.pendingProps.value,y.value)||(t!==null?t.push(N):t=[N])}}else if(u===we.current){if(y=u.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(zl):t=[zl])}u=u.return}t!==null&&Gf(n,t,a,o),n.flags|=262144}function wc(t){for(t=t.firstContext;t!==null;){if(!gi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function lr(t){or=t,Ua=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Gn(t){return d0(or,t)}function Cc(t,n){return or===null&&lr(t),d0(t,n)}function d0(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Ua===null){if(t===null)throw Error(s(308));Ua=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Ua=Ua.next=n;return a}var Eb=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},Tb=r.unstable_scheduleCallback,Ab=r.unstable_NormalPriority,An={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kf(){return{controller:new Eb,data:new Map,refCount:0}}function dl(t){t.refCount--,t.refCount===0&&Tb(Ab,function(){t.controller.abort()})}var hl=null,Vf=0,Jr=0,$r=null;function wb(t,n){if(hl===null){var a=hl=[];Vf=0,Jr=Wd(),$r={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Vf++,n.then(h0,h0),n}function h0(){if(--Vf===0&&hl!==null){$r!==null&&($r.status="fulfilled");var t=hl;hl=null,Jr=0,$r=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Cb(t,n){var a=[],o={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<a.length;u++)(0,a[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),o}var p0=B.S;B.S=function(t,n){Zg=Ht(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&wb(t,n),p0!==null&&p0(t,n)};var cr=Ce(null);function jf(){var t=cr.current;return t!==null?t:on.pooledCache}function Rc(t,n){n===null?je(cr,cr.current):je(cr,n.pool)}function m0(){var t=jf();return t===null?null:{parent:An._currentValue,pool:t}}var eo=Error(s(460)),Xf=Error(s(474)),Nc=Error(s(542)),Dc={then:function(){}};function g0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function x0(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(Ca,Ca),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,_0(t),t;default:if(typeof n.status=="string")n.then(Ca,Ca);else{if(t=on,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,_0(t),t}throw fr=n,eo}}function ur(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fr=a,eo):a}}var fr=null;function v0(){if(fr===null)throw Error(s(459));var t=fr;return fr=null,t}function _0(t){if(t===eo||t===Nc)throw Error(s(483))}var to=null,pl=0;function Uc(t){var n=pl;return pl+=1,to===null&&(to=[]),x0(to,t,n)}function ml(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Lc(t,n){throw n.$$typeof===g?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function y0(t){function n(J,X){if(t){var ie=J.deletions;ie===null?(J.deletions=[X],J.flags|=16):ie.push(X)}}function a(J,X){if(!t)return null;for(;X!==null;)n(J,X),X=X.sibling;return null}function o(J){for(var X=new Map;J!==null;)J.key!==null?X.set(J.key,J):X.set(J.index,J),J=J.sibling;return X}function u(J,X){return J=Na(J,X),J.index=0,J.sibling=null,J}function f(J,X,ie){return J.index=ie,t?(ie=J.alternate,ie!==null?(ie=ie.index,ie<X?(J.flags|=67108866,X):ie):(J.flags|=67108866,X)):(J.flags|=1048576,X)}function y(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function N(J,X,ie,ve){return X===null||X.tag!==6?(X=Lf(ie,J.mode,ve),X.return=J,X):(X=u(X,ie),X.return=J,X)}function G(J,X,ie,ve){var nt=ie.type;return nt===D?ge(J,X,ie.props.children,ve,ie.key):X!==null&&(X.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===w&&ur(nt)===X.type)?(X=u(X,ie.props),ml(X,ie),X.return=J,X):(X=Tc(ie.type,ie.key,ie.props,null,J.mode,ve),ml(X,ie),X.return=J,X)}function ae(J,X,ie,ve){return X===null||X.tag!==4||X.stateNode.containerInfo!==ie.containerInfo||X.stateNode.implementation!==ie.implementation?(X=Of(ie,J.mode,ve),X.return=J,X):(X=u(X,ie.children||[]),X.return=J,X)}function ge(J,X,ie,ve,nt){return X===null||X.tag!==7?(X=sr(ie,J.mode,ve,nt),X.return=J,X):(X=u(X,ie),X.return=J,X)}function _e(J,X,ie){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Lf(""+X,J.mode,ie),X.return=J,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return ie=Tc(X.type,X.key,X.props,null,J.mode,ie),ml(ie,X),ie.return=J,ie;case A:return X=Of(X,J.mode,ie),X.return=J,X;case w:return X=ur(X),_e(J,X,ie)}if(te(X)||$(X))return X=sr(X,J.mode,ie,null),X.return=J,X;if(typeof X.then=="function")return _e(J,Uc(X),ie);if(X.$$typeof===F)return _e(J,Cc(J,X),ie);Lc(J,X)}return null}function oe(J,X,ie,ve){var nt=X!==null?X.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return nt!==null?null:N(J,X,""+ie,ve);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return ie.key===nt?G(J,X,ie,ve):null;case A:return ie.key===nt?ae(J,X,ie,ve):null;case w:return ie=ur(ie),oe(J,X,ie,ve)}if(te(ie)||$(ie))return nt!==null?null:ge(J,X,ie,ve,null);if(typeof ie.then=="function")return oe(J,X,Uc(ie),ve);if(ie.$$typeof===F)return oe(J,X,Cc(J,ie),ve);Lc(J,ie)}return null}function ue(J,X,ie,ve,nt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return J=J.get(ie)||null,N(X,J,""+ve,nt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:return J=J.get(ve.key===null?ie:ve.key)||null,G(X,J,ve,nt);case A:return J=J.get(ve.key===null?ie:ve.key)||null,ae(X,J,ve,nt);case w:return ve=ur(ve),ue(J,X,ie,ve,nt)}if(te(ve)||$(ve))return J=J.get(ie)||null,ge(X,J,ve,nt,null);if(typeof ve.then=="function")return ue(J,X,ie,Uc(ve),nt);if(ve.$$typeof===F)return ue(J,X,ie,Cc(X,ve),nt);Lc(X,ve)}return null}function We(J,X,ie,ve){for(var nt=null,Gt=null,Ke=X,bt=X=0,Dt=null;Ke!==null&&bt<ie.length;bt++){Ke.index>bt?(Dt=Ke,Ke=null):Dt=Ke.sibling;var kt=oe(J,Ke,ie[bt],ve);if(kt===null){Ke===null&&(Ke=Dt);break}t&&Ke&&kt.alternate===null&&n(J,Ke),X=f(kt,X,bt),Gt===null?nt=kt:Gt.sibling=kt,Gt=kt,Ke=Dt}if(bt===ie.length)return a(J,Ke),Lt&&Da(J,bt),nt;if(Ke===null){for(;bt<ie.length;bt++)Ke=_e(J,ie[bt],ve),Ke!==null&&(X=f(Ke,X,bt),Gt===null?nt=Ke:Gt.sibling=Ke,Gt=Ke);return Lt&&Da(J,bt),nt}for(Ke=o(Ke);bt<ie.length;bt++)Dt=ue(Ke,J,bt,ie[bt],ve),Dt!==null&&(t&&Dt.alternate!==null&&Ke.delete(Dt.key===null?bt:Dt.key),X=f(Dt,X,bt),Gt===null?nt=Dt:Gt.sibling=Dt,Gt=Dt);return t&&Ke.forEach(function(Os){return n(J,Os)}),Lt&&Da(J,bt),nt}function at(J,X,ie,ve){if(ie==null)throw Error(s(151));for(var nt=null,Gt=null,Ke=X,bt=X=0,Dt=null,kt=ie.next();Ke!==null&&!kt.done;bt++,kt=ie.next()){Ke.index>bt?(Dt=Ke,Ke=null):Dt=Ke.sibling;var Os=oe(J,Ke,kt.value,ve);if(Os===null){Ke===null&&(Ke=Dt);break}t&&Ke&&Os.alternate===null&&n(J,Ke),X=f(Os,X,bt),Gt===null?nt=Os:Gt.sibling=Os,Gt=Os,Ke=Dt}if(kt.done)return a(J,Ke),Lt&&Da(J,bt),nt;if(Ke===null){for(;!kt.done;bt++,kt=ie.next())kt=_e(J,kt.value,ve),kt!==null&&(X=f(kt,X,bt),Gt===null?nt=kt:Gt.sibling=kt,Gt=kt);return Lt&&Da(J,bt),nt}for(Ke=o(Ke);!kt.done;bt++,kt=ie.next())kt=ue(Ke,J,bt,kt.value,ve),kt!==null&&(t&&kt.alternate!==null&&Ke.delete(kt.key===null?bt:kt.key),X=f(kt,X,bt),Gt===null?nt=kt:Gt.sibling=kt,Gt=kt);return t&&Ke.forEach(function(BS){return n(J,BS)}),Lt&&Da(J,bt),nt}function an(J,X,ie,ve){if(typeof ie=="object"&&ie!==null&&ie.type===D&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:e:{for(var nt=ie.key;X!==null;){if(X.key===nt){if(nt=ie.type,nt===D){if(X.tag===7){a(J,X.sibling),ve=u(X,ie.props.children),ve.return=J,J=ve;break e}}else if(X.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===w&&ur(nt)===X.type){a(J,X.sibling),ve=u(X,ie.props),ml(ve,ie),ve.return=J,J=ve;break e}a(J,X);break}else n(J,X);X=X.sibling}ie.type===D?(ve=sr(ie.props.children,J.mode,ve,ie.key),ve.return=J,J=ve):(ve=Tc(ie.type,ie.key,ie.props,null,J.mode,ve),ml(ve,ie),ve.return=J,J=ve)}return y(J);case A:e:{for(nt=ie.key;X!==null;){if(X.key===nt)if(X.tag===4&&X.stateNode.containerInfo===ie.containerInfo&&X.stateNode.implementation===ie.implementation){a(J,X.sibling),ve=u(X,ie.children||[]),ve.return=J,J=ve;break e}else{a(J,X);break}else n(J,X);X=X.sibling}ve=Of(ie,J.mode,ve),ve.return=J,J=ve}return y(J);case w:return ie=ur(ie),an(J,X,ie,ve)}if(te(ie))return We(J,X,ie,ve);
vendor: 4,191 bytes, line 25
25if($(ie)){if(nt=$(ie),typeof nt!="function")throw Error(s(150));return ie=nt.call(ie),at(J,X,ie,ve)}if(typeof ie.then=="function")return an(J,X,Uc(ie),ve);if(ie.$$typeof===F)return an(J,X,Cc(J,ie),ve);Lc(J,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,X!==null&&X.tag===6?(a(J,X.sibling),ve=u(X,ie),ve.return=J,J=ve):(a(J,X),ve=Lf(ie,J.mode,ve),ve.return=J,J=ve),y(J)):a(J,X)}return function(J,X,ie,ve){try{pl=0;var nt=an(J,X,ie,ve);return to=null,nt}catch(Ke){if(Ke===eo||Ke===Nc)throw Ke;var Gt=xi(29,Ke,null,J.mode);return Gt.lanes=ve,Gt.return=J,Gt}finally{}}}var dr=y0(!0),b0=y0(!1),xs=!1;function Wf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function vs(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _s(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(jt&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Ec(t),a0(t,null,a),n}return Mc(t,o,n,a),Ec(t)}function gl(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Zn(t,a)}}function Yf(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=y:f=f.next=y,a=a.next}while(a!==null);f===null?u=f=n:f=f.next=n}else u=f=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var Qf=!1;function xl(){if(Qf){var t=$r;if(t!==null)throw t}}function vl(t,n,a,o){Qf=!1;var u=t.updateQueue;xs=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var G=N,ae=G.next;G.next=null,y===null?f=ae:y.next=ae,y=G;var ge=t.alternate;ge!==null&&(ge=ge.updateQueue,N=ge.lastBaseUpdate,N!==y&&(N===null?ge.firstBaseUpdate=ae:N.next=ae,ge.lastBaseUpdate=G))}if(f!==null){var _e=u.baseState;y=0,ge=ae=G=null,N=f;do{var oe=N.lane&-536870913,ue=oe!==N.lane;if(ue?(Nt&oe)===oe:(o&oe)===oe){oe!==0&&oe===Jr&&(Qf=!0),ge!==null&&(ge=ge.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var We=t,at=N;oe=n;var an=a;switch(at.tag){case 1:if(We=at.payload,typeof We=="function"){_e=We.call(an,_e,oe);break e}_e=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=at.payload,oe=typeof We=="function"?We.call(an,_e,oe):We,oe==null)break e;_e=v({},_e,oe);break e;case 2:xs=!0}}oe=N.callback,oe!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=u.callbacks,ue===null?u.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ge===null?(ae=ge=ue,G=_e):ge=ge.next=ue,y|=oe;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;ue=N,N=ue.next,ue.next=null,u.lastBaseUpdate=ue,u.shared.pending=null}}while(!0);ge===null&&(G=_e),u.baseState=G,u.firstBaseUpdate=ae,u.lastBaseUpdate=ge,f===null&&(u.shared.lanes=0),Es|=y,t.lanes=y,t.memoizedState=_e}}function S0(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function M0(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)S0(a[t],n)}var no=Ce(null),Oc=Ce(0);function E0(t,n){t=ka,je(Oc,t),je(no,n),ka=t|n.baseLanes}function Kf(){je(Oc,ka),je(no,no.current)}function Zf(){ka=Oc.current,Ae(no),Ae(Oc)}var vi=Ce(null),Oi=null;function ys(t){var n=t.alternate;je(En,En.current&1),je(vi,t),Oi===null&&(n===null||no.current!==null||n.memoizedState!==null)&&(Oi=t)}function Jf(t){je(En,En.current),je(vi,t),Oi===null&&(Oi=t)}function T0(t){t.tag===22?(je(En,En.current),je(vi,t),Oi===null&&(Oi=t)):bs()}function bs(){je(En,En.current),je(vi,vi.current)}function _i(t){Ae(vi),Oi===t&&(Oi=null),Ae(En)}var En=Ce(0);function Pc(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;
vendor: 21,748 bytes, line 25
25if(a!==null&&(a=a.dehydrated,a===null||ah(a)||sh(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Oa=0,_t=null,tn=null,wn=null,Ic=!1,io=!1,hr=!1,Fc=0,_l=0,ao=null,Rb=0;function _n(){throw Error(s(321))}function $f(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!gi(t[a],n[a]))return!1;return!0}function ed(t,n,a,o,u,f){return Oa=f,_t=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,B.H=t===null||t.memoizedState===null?lg:md,hr=!1,f=a(o,u),hr=!1,io&&(f=w0(n,a,o,u)),A0(t),f}function A0(t){B.H=Sl;var n=tn!==null&&tn.next!==null;if(Oa=0,wn=tn=_t=null,Ic=!1,_l=0,ao=null,n)throw Error(s(300));t===null||Cn||(t=t.dependencies,t!==null&&wc(t)&&(Cn=!0))}function w0(t,n,a,o){_t=t;var u=0;do{if(io&&(ao=null),_l=0,io=!1,25<=u)throw Error(s(301));if(u+=1,wn=tn=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}B.H=cg,f=n(a,o)}while(io);return f}function Nb(){var t=B.H,n=t.useState()[0];return n=typeof n.then=="function"?yl(n):n,t=t.useState()[0],(tn!==null?tn.memoizedState:null)!==t&&(_t.flags|=1024),n}function td(){var t=Fc!==0;return Fc=0,t}function nd(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function id(t){if(Ic){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Ic=!1}Oa=0,wn=tn=_t=null,io=!1,_l=Fc=0,ao=null}function ei(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?_t.memoizedState=wn=t:wn=wn.next=t,wn}function Tn(){if(tn===null){var t=_t.alternate;t=t!==null?t.memoizedState:null}else t=tn.next;var n=wn===null?_t.memoizedState:wn.next;if(n!==null)wn=n,tn=t;else{if(t===null)throw _t.alternate===null?Error(s(467)):Error(s(310));tn=t,t={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},wn===null?_t.memoizedState=wn=t:wn=wn.next=t}return wn}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yl(t){var n=_l;return _l+=1,ao===null&&(ao=[]),t=x0(ao,t,n),n=_t,(wn===null?n.memoizedState:wn.next)===null&&(n=n.alternate,B.H=n===null||n.memoizedState===null?lg:md),t}function Bc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return yl(t);if(t.$$typeof===F)return Gn(t)}throw Error(s(438,String(t)))}function ad(t){var n=null,a=_t.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=_t.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=zc(),_t.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),o=0;o<t;o++)a[o]=V;return n.index++,a}function Pa(t,n){return typeof n=="function"?n(t):n}function Hc(t){var n=Tn();return sd(n,tn,t)}function sd(t,n,a){var o=t.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var u=t.baseQueue,f=o.pending;if(f!==null){if(u!==null){var y=u.next;u.next=f.next,f.next=y}n.baseQueue=u=f,o.pending=null}if(f=t.baseState,u===null)t.memoizedState=f;else{n=u.next;var N=y=null,G=null,ae=n,ge=!1;do{var _e=ae.lane&-536870913;if(_e!==ae.lane?(Nt&_e)===_e:(Oa&_e)===_e){var oe=ae.revertLane;if(oe===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),_e===Jr&&(ge=!0);else if((Oa&oe)===oe){ae=ae.next,oe===Jr&&(ge=!0);continue}else _e={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?(N=G=_e,y=f):G=G.next=_e,_t.lanes|=oe,Es|=oe;_e=ae.action,hr&&a(f,_e),f=ae.hasEagerState?ae.eagerState:a(f,_e)}else oe={lane:_e,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?(N=G=oe,y=f):G=G.next=oe,_t.lanes|=_e,Es|=_e;ae=ae.next}while(ae!==null&&ae!==n);if(G===null?y=f:G.next=N,!gi(f,t.memoizedState)&&(Cn=!0,ge&&(a=$r,a!==null)))throw a;t.memoizedState=f,t.baseState=y,t.baseQueue=G,o.lastRenderedState=f}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function rd(t){var n=Tn(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var o=a.dispatch,u=a.pending,f=n.memoizedState;if(u!==null){a.pending=null;var y=u=u.next;do f=t(f,y.action),y=y.next;while(y!==u);gi(f,n.memoizedState)||(Cn=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),a.lastRenderedState=f}return[f,o]}function C0(t,n,a){var o=_t,u=Tn(),f=Lt;if(f){if(a===void 0)throw Error(s(407));a=a()}else a=n();var y=!gi((tn||u).memoizedState,a);if(y&&(u.memoizedState=a,Cn=!0),u=u.queue,cd(D0.bind(null,o,u,t),[t]),u.getSnapshot!==n||y||wn!==null&&wn.memoizedState.tag&1){if(o.flags|=2048,so(9,{destroy:void 0},N0.bind(null,o,u,a,n),null),on===null)throw Error(s(349));f||(Oa&127)!==0||R0(o,n,a)}return a}function R0(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=_t.updateQueue,n===null?(n=zc(),_t.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function N0(t,n,a,o){n.value=a,n.getSnapshot=o,U0(n)&&L0(t)}function D0(t,n,a){return a(function(){U0(n)&&L0(t)})}function U0(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!gi(t,a)}catch{return!0}}function L0(t){var n=ar(t,2);n!==null&&ci(n,t,2)}function od(t){var n=ei();if(typeof t=="function"){var a=t;if(t=a(),hr){De(!0);try{a()}finally{De(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pa,lastRenderedState:t},n}function O0(t,n,a,o){return t.baseState=a,sd(t,tn,typeof o=="function"?o:Pa)}function Db(t,n,a,o,u){if(Vc(t))throw Error(s(485));if(t=n.action,t!==null){var f={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};B.T!==null?a(!0):f.isTransition=!1,o(f),a=n.pending,a===null?(f.next=n.pending=f,P0(n,f)):(f.next=a.next,n.pending=a.next=f)}}function P0(t,n){var a=n.action,o=n.payload,u=t.state;if(n.isTransition){var f=B.T,y={};B.T=y;try{var N=a(u,o),G=B.S;G!==null&&G(y,N),I0(t,n,N)}catch(ae){ld(t,n,ae)}finally{f!==null&&y.types!==null&&(f.types=y.types),B.T=f}}else try{f=a(u,o),I0(t,n,f)}catch(ae){ld(t,n,ae)}}function I0(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){F0(t,n,o)},function(o){return ld(t,n,o)}):F0(t,n,a)}function F0(t,n,a){n.status="fulfilled",n.value=a,z0(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,P0(t,a)))}function ld(t,n,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,z0(n),n=n.next;while(n!==o)}t.action=null}function z0(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function B0(t,n){return n}function H0(t,n){if(Lt){var a=on.formState;if(a!==null){e:{var o=_t;if(Lt){if(dn){t:{for(var u=dn,f=Li;u.nodeType!==8;){if(!f){u=null;break t}if(u=Pi(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){dn=Pi(u.nextSibling),o=u.data==="F!";break e}}ms(o)}o=!1}o&&(n=a[0])}}return a=ei(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B0,lastRenderedState:n},a.queue=o,a=sg.bind(null,_t,o),o.dispatch=a,o=od(!1),f=pd.bind(null,_t,!1,o.queue),o=ei(),u={state:n,dispatch:null,action:t,pending:null},o.queue=u,a=Db.bind(null,_t,u,f,a),u.dispatch=a,o.memoizedState=t,[n,a,!1]}function G0(t){var n=Tn();return k0(n,tn,t)}function k0(t,n,a){if(n=sd(t,n,B0)[0],t=Hc(Pa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=yl(n)}catch(y){throw y===eo?Nc:y}else o=n;n=Tn();var u=n.queue,f=u.dispatch;return a!==n.memoizedState&&(_t.flags|=2048,so(9,{destroy:void 0},Ub.bind(null,u,a),null)),[o,f,t]}function Ub(t,n){t.action=n}function V0(t){var n=Tn(),a=tn;if(a!==null)return k0(n,a,t);Tn(),n=n.memoizedState,a=Tn();var o=a.queue.dispatch;return a.memoizedState=t,[n,o,!1]}function so(t,n,a,o){return t={tag:t,create:a,deps:o,inst:n,next:null},n=_t.updateQueue,n===null&&(n=zc(),_t.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,n.lastEffect=t),t}function j0(){return Tn().memoizedState}function Gc(t,n,a,o){var u=ei();_t.flags|=t,u.memoizedState=so(1|n,{destroy:void 0},a,o===void 0?null:o)}function kc(t,n,a,o){var u=Tn();o=o===void 0?null:o;var f=u.memoizedState.inst;tn!==null&&o!==null&&$f(o,tn.memoizedState.deps)?u.memoizedState=so(n,f,a,o):(_t.flags|=t,u.memoizedState=so(1|n,f,a,o))}function X0(t,n){Gc(8390656,8,t,n)}function cd(t,n){kc(2048,8,t,n)}function Lb(t){_t.flags|=4;var n=_t.updateQueue;if(n===null)n=zc(),_t.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function W0(t){var n=Tn().memoizedState;return Lb({ref:n,nextImpl:t}),function(){if((jt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function q0(t,n){return kc(4,2,t,n)}function Y0(t,n){return kc(4,4,t,n)}function Q0(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function K0(t,n,a){a=a!=null?a.concat([t]):null,kc(4,4,Q0.bind(null,n,t),a)}function ud(){}function Z0(t,n){var a=Tn();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&$f(n,o[1])?o[0]:(a.memoizedState=[t,n],t)}function J0(t,n){var a=Tn();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&$f(n,o[1]))return o[0];if(o=t(),hr){De(!0);try{t()}finally{De(!1)}}return a.memoizedState=[o,n],o}function fd(t,n,a){return a===void 0||(Oa&1073741824)!==0&&(Nt&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=$g(),_t.lanes|=t,Es|=t,a)}function $0(t,n,a,o){return gi(a,n)?a:no.current!==null?(t=fd(t,a,o),gi(t,n)||(Cn=!0),t):(Oa&42)===0||(Oa&1073741824)!==0&&(Nt&261930)===0?(Cn=!0,t.memoizedState=a):(t=$g(),_t.lanes|=t,Es|=t,n)}function eg(t,n,a,o,u){var f=j.p;j.p=f!==0&&8>f?f:8;var y=B.T,N={};B.T=N,pd(t,!1,n,a);try{var G=u(),ae=B.S;if(ae!==null&&ae(N,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ge=Cb(G,o);bl(t,n,ge,Si(t))}else bl(t,n,o,Si(t))}catch(_e){bl(t,n,{then:function(){},status:"rejected",reason:_e},Si())}finally{j.p=f,y!==null&&N.types!==null&&(y.types=N.types),B.T=y}}function Ob(){}function dd(t,n,a,o){if(t.tag!==5)throw Error(s(476));var u=tg(t).queue;eg(t,u,n,Y,a===null?Ob:function(){return ng(t),a(o)})}function tg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pa,lastRenderedState:Y},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pa,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ng(t){var n=tg(t);n.next===null&&(n=t.alternate.memoizedState),bl(t,n.next.queue,{},Si())}function hd(){return Gn(zl)}function ig(){return Tn().memoizedState}function ag(){return Tn().memoizedState}function Pb(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Si();t=vs(a);var o=_s(n,t,a);o!==null&&(ci(o,n,a),gl(o,n,a)),n={cache:kf()},t.payload=n;return}n=n.return}}function Ib(t,n,a){var o=Si();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Vc(t)?rg(n,a):(a=Df(t,n,a,o),a!==null&&(ci(a,t,o),og(a,n,o)))}function sg(t,n,a){var o=Si();bl(t,n,a,o)}function bl(t,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vc(t))rg(n,u);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,N=f(y,a);if(u.hasEagerState=!0,u.eagerState=N,gi(N,y))return Mc(t,n,u,0),on===null&&Sc(),!1}catch{}finally{}if(a=Df(t,n,u,o),a!==null)return ci(a,t,o),og(a,n,o),!0}return!1}function pd(t,n,a,o){if(o={lane:2,revertLane:Wd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Vc(t)){if(n)throw Error(s(479))}else n=Df(t,a,o,2),n!==null&&ci(n,t,2)}function Vc(t){var n=t.alternate;return t===_t||n!==null&&n===_t}function rg(t,n){io=Ic=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function og(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Zn(t,a)}}var Sl={readContext:Gn,use:Bc,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useLayoutEffect:_n,useInsertionEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useSyncExternalStore:_n,useId:_n,useHostTransitionStatus:_n,useFormState:_n,useActionState:_n,useOptimistic:_n,useMemoCache:_n,useCacheRefresh:_n};Sl.useEffectEvent=_n;var lg={readContext:Gn,use:Bc,useCallback:function(t,n){return ei().memoizedState=[t,n===void 0?null:n],t},useContext:Gn,useEffect:X0,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Gc(4194308,4,Q0.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Gc(4194308,4,t,n)},useInsertionEffect:function(t,n){Gc(4,2,t,n)},useMemo:function(t,n){var a=ei();n=n===void 0?null:n;var o=t();if(hr){De(!0);try{t()}finally{De(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=ei();if(a!==void 0){var u=a(n);if(hr){De(!0);try{a(n)}finally{De(!1)}}}else u=n;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=Ib.bind(null,_t,t),[o.memoizedState,t]},useRef:function(t){var n=ei();return t={current:t},n.memoizedState=t},useState:function(t){t=od(t);var n=t.queue,a=sg.bind(null,_t,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:ud,useDeferredValue:function(t,n){var a=ei();return fd(a,t,n)},useTransition:function(){var t=od(!1);return t=eg.bind(null,_t,t.queue,!0,!1),ei().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=_t,u=ei();if(Lt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),on===null)throw Error(s(349));(Nt&127)!==0||R0(o,n,a)}u.memoizedState=a;var f={value:a,getSnapshot:n};return u.queue=f,X0(D0.bind(null,o,f,t),[t]),o.flags|=2048,so(9,{destroy:void 0},N0.bind(null,o,f,a,n),null),a},useId:function(){var t=ei(),n=on.identifierPrefix;if(Lt){var a=ca,o=la;a=(o&~(1<<32-Ge(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Fc++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Rb++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:hd,useFormState:H0,useActionState:H0,useOptimistic:function(t){var n=ei();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=pd.bind(null,_t,!0,a),a.dispatch=n,[t,n]},useMemoCache:ad,useCacheRefresh:function(){return ei().memoizedState=Pb.bind(null,_t)},useEffectEvent:function(t){var n=ei(),a={impl:t};return n.memoizedState=a,function(){if((jt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},md={readContext:Gn,use:Bc,useCallback:Z0,useContext:Gn,useEffect:cd,useImperativeHandle:K0,useInsertionEffect:q0,useLayoutEffect:Y0,useMemo:J0,useReducer:Hc,useRef:j0,useState:function(){return Hc(Pa)},useDebugValue:ud,useDeferredValue:function(t,n){var a=Tn();return $0(a,tn.memoizedState,t,n)},useTransition:function(){var t=Hc(Pa)[0],n=Tn().memoizedState;return[typeof t=="boolean"?t:yl(t),n]},useSyncExternalStore:C0,useId:ig,useHostTransitionStatus:hd,useFormState:G0,useActionState:G0,useOptimistic:function(t,n){var a=Tn();return O0(a,tn,t,n)},useMemoCache:ad,useCacheRefresh:ag};md.useEffectEvent=W0;var cg={readContext:Gn,use:Bc,useCallback:Z0,useContext:Gn,useEffect:cd,useImperativeHandle:K0,useInsertionEffect:q0,useLayoutEffect:Y0,useMemo:J0,useReducer:rd,useRef:j0,useState:function(){return rd(Pa)},useDebugValue:ud,useDeferredValue:function(t,n){var a=Tn();return tn===null?fd(a,t,n):$0(a,tn.memoizedState,t,n)},useTransition:function(){var t=rd(Pa)[0],n=Tn().memoizedState;return[typeof t=="boolean"?t:yl(t),n]},useSyncExternalStore:C0,useId:ig,useHostTransitionStatus:hd,useFormState:V0,useActionState:V0,useOptimistic:function(t,n){var a=Tn();return tn!==null?O0(a,tn,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:ad,useCacheRefresh:ag};cg.useEffectEvent=W0;function gd(t,n,a,o){n=t.memoizedState,a=a(o,n),a=a==null?n:v({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var xd={enqueueSetState:function(t,n,a){t=t._reactInternals;var o=Si(),u=vs(o);u.payload=n,a!=null&&(u.callback=a),n=_s(t,u,o),n!==null&&(ci(n,t,o),gl(n,t,o))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var o=Si(),u=vs(o);u.tag=1,u.payload=n,a!=null&&(u.callback=a),n=_s(t,u,o),n!==null&&(ci(n,t,o),gl(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=Si(),o=vs(a);o.tag=2,n!=null&&(o.callback=n),n=_s(t,o,a),n!==null&&(ci(n,t,a),gl(n,t,a))}};function ug(t,n,a,o,u,f,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,f,y):n.prototype&&n.prototype.isPureReactComponent?!ll(a,o)||!ll(u,f):!0}function fg(t,n,a,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==t&&xd.enqueueReplaceState(n,n.state,null)}function pr(t,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(t=t.defaultProps){a===n&&(a=v({},a));for(var u in t)a[u]===void 0&&(a[u]=t[u])}return a}function dg(t){bc(t)}function hg(t){console.error(t)}function pg(t){bc(t)}function jc(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function mg(t,n,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function vd(t,n,a){return a=vs(a),a.tag=3,a.payload={element:null},a.callback=function(){jc(t,n)},a}function gg(t){return t=vs(t),t.tag=3,t}function xg(t,n,a,o){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=o.value;t.payload=function(){return u(f)},t.callback=function(){mg(n,a,o)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){mg(n,a,o),typeof u!="function"&&(Ts===null?Ts=new Set([this]):Ts.add(this));var N=o.stack;this.componentDidCatch(o.value,{componentStack:N!==null?N:""})})}function Fb(t,n,a,o,u){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&Zr(n,a,u,!0),a=vi.current,a!==null){switch(a.tag){case 31:case 13:return Oi===null?nu():a.alternate===null&&yn===0&&(yn=3),a.flags&=-257,a.flags|=65536,a.lanes=u,o===Dc?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),Vd(t,o,u)),!1;case 22:return a.flags|=65536,o===Dc?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),Vd(t,o,u)),!1}throw Error(s(435,a.tag))}return Vd(t,o,u),nu(),!1}if(Lt)return n=vi.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==Ff&&(t=Error(s(422),{cause:o}),fl(Ni(t,a)))):(o!==Ff&&(n=Error(s(423),{cause:o}),fl(Ni(n,a))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=Ni(o,a),u=vd(t.stateNode,o,u),Yf(t,u),yn!==4&&(yn=2)),!1;var f=Error(s(520),{cause:o});if(f=Ni(f,a),Nl===null?Nl=[f]:Nl.push(f),yn!==4&&(yn=2),n===null)return!0;o=Ni(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=u&-u,a.lanes|=t,t=vd(a.stateNode,o,t),Yf(a,t),!1;case 1:if(n=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ts===null||!Ts.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=gg(u),xg(u,t,a,o),Yf(a,u),!1}a=a.return}while(a!==null);return!1}var _d=Error(s(461)),Cn=!1;function kn(t,n,a,o){n.child=t===null?b0(n,null,a,o):dr(n,t.child,a,o)}function vg(t,n,a,o,u){a=a.render;var f=n.ref;if("ref"in o){var y={};for(var N in o)N!=="ref"&&(y[N]=o[N])}else y=o;return lr(n),o=ed(t,n,a,y,f,u),N=td(),t!==null&&!Cn?(nd(t,n,u),Ia(t,n,u)):(Lt&&N&&Pf(n),n.flags|=1,kn(t,n,o,u),n.child)}function _g(t,n,a,o,u){if(t===null){var f=a.type;return typeof f=="function"&&!Uf(f)&&f.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=f,yg(t,n,f,o,u)):(t=Tc(a.type,null,o,n,n.mode,u),t.ref=n.ref,t.return=n,n.child=t)}if(f=t.child,!wd(t,u)){var y=f.memoizedProps;if(a=a.compare,a=a!==null?a:ll,a(y,o)&&t.ref===n.ref)return Ia(t,n,u)}return n.flags|=1,t=Na(f,o),t.ref=n.ref,t.return=n,n.child=t}function yg(t,n,a,o,u){if(t!==null){var f=t.memoizedProps;if(ll(f,o)&&t.ref===n.ref)if(Cn=!1,n.pendingProps=o=f,wd(t,u))(t.flags&131072)!==0&&(Cn=!0);else return n.lanes=t.lanes,Ia(t,n,u)}return yd(t,n,a,o,u)}function bg(t,n,a,o){var u=o.children,f=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,t!==null){for(o=n.child=t.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~f}else o=0,n.child=null;return Sg(t,n,f,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Rc(n,f!==null?f.cachePool:null),f!==null?E0(n,f):Kf(),T0(n);else return o=n.lanes=536870912,Sg(t,n,f!==null?f.baseLanes|a:a,a,o)}
vendor: 10,060 bytes, line 25
25else f!==null?(Rc(n,f.cachePool),E0(n,f),bs(),n.memoizedState=null):(t!==null&&Rc(n,null),Kf(),bs());return kn(t,n,u,a),n.child}function Ml(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Sg(t,n,a,o,u){var f=jf();return f=f===null?null:{parent:An._currentValue,pool:f},n.memoizedState={baseLanes:a,cachePool:f},t!==null&&Rc(n,null),Kf(),T0(n),t!==null&&Zr(t,n,o,!0),n.childLanes=u,null}function Xc(t,n){return n=qc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Mg(t,n,a){return dr(n,t.child,null,a),t=Xc(n,n.pendingProps),t.flags|=2,_i(n),n.memoizedState=null,t}function zb(t,n,a){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Lt){if(o.mode==="hidden")return t=Xc(n,o),n.lanes=536870912,Ml(null,t);if(Jf(n),(t=dn)?(t=Px(t,Li),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:hs!==null?{id:la,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},a=r0(t),a.return=n,n.child=a,Hn=n,dn=null)):t=null,t===null)throw ms(n);return n.lanes=536870912,null}return Xc(n,o)}var f=t.memoizedState;if(f!==null){var y=f.dehydrated;if(Jf(n),u)if(n.flags&256)n.flags&=-257,n=Mg(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(Cn||Zr(t,n,a,!1),u=(a&t.childLanes)!==0,Cn||u){if(o=on,o!==null&&(y=Jn(o,a),y!==0&&y!==f.retryLane))throw f.retryLane=y,ar(t,y),ci(o,t,y),_d;nu(),n=Mg(t,n,a)}else t=f.treeContext,dn=Pi(y.nextSibling),Hn=n,Lt=!0,ps=null,Li=!1,t!==null&&c0(n,t),n=Xc(n,o),n.flags|=4096;return n}return t=Na(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Wc(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function yd(t,n,a,o,u){return lr(n),a=ed(t,n,a,o,void 0,u),o=td(),t!==null&&!Cn?(nd(t,n,u),Ia(t,n,u)):(Lt&&o&&Pf(n),n.flags|=1,kn(t,n,a,u),n.child)}function Eg(t,n,a,o,u,f){return lr(n),n.updateQueue=null,a=w0(n,o,a,u),A0(t),o=td(),t!==null&&!Cn?(nd(t,n,f),Ia(t,n,f)):(Lt&&o&&Pf(n),n.flags|=1,kn(t,n,a,f),n.child)}function Tg(t,n,a,o,u){if(lr(n),n.stateNode===null){var f=qr,y=a.contextType;typeof y=="object"&&y!==null&&(f=Gn(y)),f=new a(o,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=xd,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=o,f.state=n.memoizedState,f.refs={},Wf(n),y=a.contextType,f.context=typeof y=="object"&&y!==null?Gn(y):qr,f.state=n.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(gd(n,a,y,o),f.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&xd.enqueueReplaceState(f,f.state,null),vl(n,o,f,u),xl(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){f=n.stateNode;var N=n.memoizedProps,G=pr(a,N);f.props=G;var ae=f.context,ge=a.contextType;y=qr,typeof ge=="object"&&ge!==null&&(y=Gn(ge));var _e=a.getDerivedStateFromProps;ge=typeof _e=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,ge||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||ae!==y)&&fg(n,f,o,y),xs=!1;var oe=n.memoizedState;f.state=oe,vl(n,o,f,u),xl(),ae=n.memoizedState,N||oe!==ae||xs?(typeof _e=="function"&&(gd(n,a,_e,o),ae=n.memoizedState),(G=xs||ug(n,a,G,o,oe,ae,y))?(ge||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=ae),f.props=o,f.state=ae,f.context=y,o=G):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{f=n.stateNode,qf(t,n),y=n.memoizedProps,ge=pr(a,y),f.props=ge,_e=n.pendingProps,oe=f.context,ae=a.contextType,G=qr,typeof ae=="object"&&ae!==null&&(G=Gn(ae)),N=a.getDerivedStateFromProps,(ae=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==_e||oe!==G)&&fg(n,f,o,G),xs=!1,oe=n.memoizedState,f.state=oe,vl(n,o,f,u),xl();var ue=n.memoizedState;y!==_e||oe!==ue||xs||t!==null&&t.dependencies!==null&&wc(t.dependencies)?(typeof N=="function"&&(gd(n,a,N,o),ue=n.memoizedState),(ge=xs||ug(n,a,ge,o,oe,ue,G)||t!==null&&t.dependencies!==null&&wc(t.dependencies))?(ae||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,ue,G),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,ue,G)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&oe===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&oe===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=ue),f.props=o,f.state=ue,f.context=G,o=ge):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&oe===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&oe===t.memoizedState||(n.flags|=1024),o=!1)}return f=o,Wc(t,n),o=(n.flags&128)!==0,f||o?(f=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,t!==null&&o?(n.child=dr(n,t.child,null,u),n.child=dr(n,null,a,u)):kn(t,n,a,u),n.memoizedState=f.state,t=n.child):t=Ia(t,n,u),t}function Ag(t,n,a,o){return rr(),n.flags|=256,kn(t,n,a,o),n.child}var bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sd(t){return{baseLanes:t,cachePool:m0()}}function Md(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=bi),t}function wg(t,n,a){var o=n.pendingProps,u=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=t!==null&&t.memoizedState===null?!1:(En.current&2)!==0),y&&(u=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,t===null){if(Lt){if(u?ys(n):bs(),(t=dn)?(t=Px(t,Li),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:hs!==null?{id:la,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},a=r0(t),a.return=n,n.child=a,Hn=n,dn=null)):t=null,t===null)throw ms(n);return sh(t)?n.lanes=32:n.lanes=536870912,null}var N=o.children;return o=o.fallback,u?(bs(),u=n.mode,N=qc({mode:"hidden",children:N},u),o=sr(o,u,a,null),N.return=n,o.return=n,N.sibling=o,n.child=N,o=n.child,o.memoizedState=Sd(a),o.childLanes=Md(t,y,a),n.memoizedState=bd,Ml(null,o)):(ys(n),Ed(n,N))}var G=t.memoizedState;if(G!==null&&(N=G.dehydrated,N!==null)){if(f)n.flags&256?(ys(n),n.flags&=-257,n=Td(t,n,a)):n.memoizedState!==null?(bs(),n.child=t.child,n.flags|=128,n=null):(bs(),N=o.fallback,u=n.mode,o=qc({mode:"visible",children:o.children},u),N=sr(N,u,a,null),N.flags|=2,o.return=n,N.return=n,o.sibling=N,n.child=o,dr(n,t.child,null,a),o=n.child,o.memoizedState=Sd(a),o.childLanes=Md(t,y,a),n.memoizedState=bd,n=Ml(null,o));else if(ys(n),sh(N)){if(y=N.nextSibling&&N.nextSibling.dataset,y)var ae=y.dgst;y=ae,o=Error(s(419)),o.stack="",o.digest=y,fl({value:o,source:null,stack:null}),n=Td(t,n,a)}else if(Cn||Zr(t,n,a,!1),y=(a&t.childLanes)!==0,Cn||y){if(y=on,y!==null&&(o=Jn(y,a),o!==0&&o!==G.retryLane))throw G.retryLane=o,ar(t,o),ci(y,t,o),_d;ah(N)||nu(),n=Td(t,n,a)}else ah(N)?(n.flags|=192,n.child=t.child,n=null):(t=G.treeContext,dn=Pi(N.nextSibling),Hn=n,Lt=!0,ps=null,Li=!1,t!==null&&c0(n,t),n=Ed(n,o.children),n.flags|=4096);return n}return u?(bs(),N=o.fallback,u=n.mode,G=t.child,ae=G.sibling,o=Na(G,{mode:"hidden",children:o.children}),o.subtreeFlags=G.subtreeFlags&65011712,ae!==null?N=Na(ae,N):(N=sr(N,u,a,null),N.flags|=2),N.return=n,o.return=n,o.sibling=N,n.child=o,Ml(null,o),o=n.child,N=t.child.memoizedState,N===null?N=Sd(a):(u=N.cachePool,u!==null?(G=An._currentValue,u=u.parent!==G?{parent:G,pool:G}:u):u=m0(),N={baseLanes:N.baseLanes|a,cachePool:u}),o.memoizedState=N,o.childLanes=Md(t,y,a),n.memoizedState=bd,Ml(t.child,o)):(ys(n),a=t.child,t=a.sibling,a=Na(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(y=n.deletions,y===null?(n.deletions=[t],n.flags|=16):y.push(t)),n.child=a,n.memoizedState=null,a)}function Ed(t,n){return n=qc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function qc(t,n){return t=xi(22,t,null,n),t.lanes=0,t}function Td(t,n,a){return dr(n,t.child,null,a),t=Ed(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Cg(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Hf(t.return,n,a)}function Ad(t,n,a,o,u,f){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=a,y.tailMode=u,y.treeForkCount=f)}function Rg(t,n,a){var o=n.pendingProps,u=o.revealOrder,f=o.tail;o=o.children;var y=En.current,N=(y&2)!==0;if(N?(y=y&1|2,n.flags|=128):y&=1,je(En,y),kn(t,n,o,a),o=Lt?ul:0,!N&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Cg(t,a,n);else if(t.tag===19)Cg(t,a,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(a=n.child,u=null;a!==null;)t=a.alternate,t!==null&&Pc(t)===null&&(u=a),a=a.sibling;
vendor: 4,367 bytes, line 25
25a=u,a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),Ad(n,!1,u,a,f,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(t=u.alternate,t!==null&&Pc(t)===null){n.child=u;break}t=u.sibling,u.sibling=a,a=u,u=t}Ad(n,!0,a,null,f,o);break;case"together":Ad(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Ia(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),Es|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(Zr(t,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,a=Na(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=Na(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function wd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&wc(t)))}function Bb(t,n,a){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),gs(n,An,t.memoizedState.cache),rr();break;case 27:case 5:rt(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:gs(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Jf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ys(n),n.flags|=128,null):(a&n.child.childLanes)!==0?wg(t,n,a):(ys(n),t=Ia(t,n,a),t!==null?t.sibling:null);ys(n);break;case 19:var u=(t.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(Zr(t,n,a,!1),o=(a&n.childLanes)!==0),u){if(o)return Rg(t,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),je(En,En.current),o)break;return null;case 22:return n.lanes=0,bg(t,n,a,n.pendingProps);case 24:gs(n,An,t.memoizedState.cache)}return Ia(t,n,a)}function Ng(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Cn=!0;else{if(!wd(t,a)&&(n.flags&128)===0)return Cn=!1,Bb(t,n,a);Cn=(t.flags&131072)!==0}else Cn=!1,Lt&&(n.flags&1048576)!==0&&l0(n,ul,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=ur(n.elementType),n.type=t,typeof t=="function")Uf(t)?(o=pr(t,o),n.tag=1,n=Tg(null,n,t,o,a)):(n.tag=0,n=yd(null,n,t,o,a));else{if(t!=null){var u=t.$$typeof;if(u===C){n.tag=11,n=vg(null,n,t,o,a);break e}else if(u===H){n.tag=14,n=_g(null,n,t,o,a);break e}}throw n=fe(t)||t,Error(s(306,n,""))}}return n;case 0:return yd(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,u=pr(o,n.pendingProps),Tg(t,n,o,u,a);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(s(387));o=n.pendingProps;var f=n.memoizedState;u=f.element,qf(t,n),vl(n,o,null,a);var y=n.memoizedState;if(o=y.cache,gs(n,An,o),o!==f.cache&&Gf(n,[An],a,!0),xl(),o=y.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=Ag(t,n,o,a);break e}else if(o!==u){u=Ni(Error(s(424)),n),fl(u),n=Ag(t,n,o,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(dn=Pi(t.firstChild),Hn=n,Lt=!0,ps=null,Li=!0,a=b0(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(rr(),o===u){n=Ia(t,n,a);break e}kn(t,n,o,a)}n=n.child}return n;case 26:return Wc(t,n),t===null?(a=Gx(n.type,null,n.pendingProps,null))?n.memoizedState=a:Lt||(a=n.type,t=n.pendingProps,o=cu(Z.current).createElement(a),o[mn]=n,o[Un]=t,Vn(o,a,t),mt(o),n.stateNode=o):n.memoizedState=Gx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return rt(n),t===null&&Lt&&(o=n.stateNode=zx(n.type,n.pendingProps,Z.current),Hn=n,Li=!0,u=dn,Rs(n.type)?(rh=u,dn=Pi(o.firstChild)):dn=u),kn(t,n,n.pendingProps.children,a),Wc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Lt&&((u=o=dn)&&(o=mS(o,n.type,n.pendingProps,Li),o!==null?(n.stateNode=o,Hn=n,dn=Pi(o.firstChild),Li=!1,u=!0):u=!1),u||ms(n)),rt(n),u=n.type,f=n.pendingProps,y=t!==null?t.memoizedProps:null,o=f.children,th(u,f)?o=null:y!==null&&th(u,y)&&(n.flags|=32),n.memoizedState!==null&&(u=ed(t,n,Nb,null,null,a),zl._currentValue=u),Wc(t,n),kn(t,n,o,a),n.child;case 6:return t===null&&Lt&&((t=a=dn)&&(a=gS(a,n.pendingProps,Li),a!==null?(n.stateNode=a,Hn=n,dn=null,t=!0):t=!1),t||ms(n)),null;case 13:return wg(t,n,a);case 4:return Te(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=dr(n,null,o,a):kn(t,n,o,a),n.child;case 11:return vg(t,n,n.type,n.pendingProps,a);
vendor: 3,831 bytes, line 25
25case 7:return kn(t,n,n.pendingProps,a),n.child;case 8:return kn(t,n,n.pendingProps.children,a),n.child;case 12:return kn(t,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,gs(n,n.type,o.value),kn(t,n,o.children,a),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,lr(n),u=Gn(u),o=o(u),n.flags|=1,kn(t,n,o,a),n.child;case 14:return _g(t,n,n.type,n.pendingProps,a);case 15:return yg(t,n,n.type,n.pendingProps,a);case 19:return Rg(t,n,a);case 31:return zb(t,n,a);case 22:return bg(t,n,a,n.pendingProps);case 24:return lr(n),o=Gn(An),t===null?(u=jf(),u===null&&(u=on,f=kf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),n.memoizedState={parent:o,cache:u},Wf(n),gs(n,An,u)):((t.lanes&a)!==0&&(qf(t,n),vl(n,null,null,a),xl()),u=t.memoizedState,f=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),gs(n,An,o)):(o=f.cache,gs(n,An,o),o!==u.cache&&Gf(n,[An],a,!0))),kn(t,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Fa(t){t.flags|=4}function Cd(t,n,a,o,u){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(ix())t.flags|=8192;else throw fr=Dc,Xf}else t.flags&=-16777217}function Dg(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Wx(n))if(ix())t.flags|=8192;else throw fr=Dc,Xf}function Yc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?be():536870912,t.lanes|=n,co|=n)}function El(t,n){if(!Lt)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function hn(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var u=t.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function Hb(t,n,a){var o=n.pendingProps;switch(If(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(n),null;case 1:return hn(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),La(An),ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Kr(n)?Fa(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,zf())),hn(n),null;case 26:var u=n.type,f=n.memoizedState;return t===null?(Fa(n),f!==null?(hn(n),Dg(n,f)):(hn(n),Cd(n,u,null,o,a))):f?f!==t.memoizedState?(Fa(n),hn(n),Dg(n,f)):(hn(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Fa(n),hn(n),Cd(n,u,t,o,a)),null;case 27:if(Ze(n),a=Z.current,u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Fa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return hn(n),null}t=dt.current,Kr(n)?u0(n):(t=zx(u,o,a),n.stateNode=t,Fa(n))}return hn(n),null;case 5:if(Ze(n),u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Fa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return hn(n),null}if(f=dt.current,Kr(n))u0(n);else{var y=cu(Z.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>
25",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}f[mn]=n,f[Un]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Vn(f,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Fa(n)}}return hn(n),Cd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Fa(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(t=Z.current,Kr(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,u=Hn,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[mn]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||wx(t.nodeValue,a)),t||ms(n,!0)}else t=cu(t).createTextNode(o),t[mn]=n,n.stateNode=t}return hn(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=Kr(n),a!==null){if(t===null){if(!o)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[mn]=n}else rr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;hn(n),t=!1}else a=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(_i(n),n):(_i(n),null);if((n.flags&128)!==0)throw Error(s(558))}return hn(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=Kr(n),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[mn]=n}else rr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;hn(n),u=!1}else u=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(_i(n),n):(_i(n),null)}return _i(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),Yc(n,n.updateQueue),hn(n),null);case 4:return ke(),t===null&&Kd(n.stateNode.containerInfo),hn(n),null;case 10:return La(n.type),hn(n),null;case 19:if(Ae(En),o=n.memoizedState,o===null)return hn(n),null;if(u=(n.flags&128)!==0,f=o.rendering,f===null)if(u)El(o,!1);else{if(yn!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(f=Pc(t),f!==null){for(n.flags|=128,El(o,!1),t=f.updateQueue,n.updateQueue=t,Yc(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)s0(a,t),a=a.sibling;return je(En,En.current&1|2),Lt&&Da(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Ht()>$c&&(n.flags|=128,u=!0,El(o,!1),n.lanes=4194304)}else{if(!u)if(t=Pc(f),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,Yc(n,t),El(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!Lt)return hn(n),null}else 2*Ht()-o.renderingStartTime>$c&&a!==536870912&&(n.flags|=128,u=!0,El(o,!1),n.lanes=4194304);o.isBackwards?(f.sibling=n.child,n.child=f):(t=o.last,t!==null?t.sibling=f:n.child=f,o.last=f)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,a=En.current,je(En,u?a&1|2:a&1),Lt&&Da(n,o.treeForkCount),t):(hn(n),null);case 22:case 23:return _i(n),Zf(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(hn(n),n.subtreeFlags&6&&(n.flags|=8192)):hn(n),a=n.updateQueue,a!==null&&Yc(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&Ae(cr),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),La(An),hn(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function Gb(t,n){switch(If(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return La(An),ke(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Ze(n),null;case 31:if(n.memoizedState!==null){if(_i(n),n.alternate===null)throw Error(s(340));rr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(_i(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));rr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Ae(En),null;case 4:return ke(),null;case 10:return La(n.type),null;case 22:case 23:return _i(n),Zf(),t!==null&&Ae(cr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return La(An),null;case 25:return null;default:return null}}function Ug(t,n){switch(If(n),n.tag){case 3:La(An),ke();break;case 26:case 27:case 5:Ze(n);break;case 4:ke();break;case 31:n.memoizedState!==null&&_i(n);break;case 13:_i(n);break;case 19:Ae(En);break;case 10:La(n.type);break;case 22:case 23:_i(n),Zf(),t!==null&&Ae(cr);break;case 24:La(An)}}function Tl(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&t)===t){o=void 0;var f=a.create,y=a.inst;o=f(),y.destroy=o}a=a.next}while(a!==u)}}catch(N){Jt(n,n.return,N)}}function Ss(t,n,a){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var f=u.next;o=f;do{if((o.tag&t)===t){var y=o.inst,N=y.destroy;if(N!==void 0){y.destroy=void 0,u=n;var G=a,ae=N;try{ae()}catch(ge){Jt(u,G,ge)}}}o=o.next}while(o!==f)}}catch(ge){Jt(n,n.return,ge)}}function Lg(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{M0(n,a)}catch(o){Jt(t,t.return,o)}}}function Og(t,n,a){a.props=pr(t.type,t.memoizedProps),a.state=t.memoizedState;
vendor: 10,500 bytes, line 25
25try{a.componentWillUnmount()}catch(o){Jt(t,n,o)}}function Al(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(u){Jt(t,n,u)}}function ua(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){Jt(t,n,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Jt(t,n,u)}else a.current=null}function Pg(t){var n=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(u){Jt(t,t.return,u)}}function Rd(t,n,a){try{var o=t.stateNode;cS(o,t.type,a,n),o[Un]=n}catch(u){Jt(t,t.return,u)}}function Ig(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Rs(t.type)||t.tag===4}function Nd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ig(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Rs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Dd(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Ca));else if(o!==4&&(o===27&&Rs(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(Dd(t,n,a),t=t.sibling;t!==null;)Dd(t,n,a),t=t.sibling}function Qc(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(o!==4&&(o===27&&Rs(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Qc(t,n,a),t=t.sibling;t!==null;)Qc(t,n,a),t=t.sibling}function Fg(t){var n=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);Vn(n,o,a),n[mn]=t,n[Un]=a}catch(f){Jt(t,t.return,f)}}var za=!1,Rn=!1,Ud=!1,zg=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function kb(t,n){if(t=t.containerInfo,$d=gu,t=Km(t),Tf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var u=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var y=0,N=-1,G=-1,ae=0,ge=0,_e=t,oe=null;t:for(;;){for(var ue;_e!==a||u!==0&&_e.nodeType!==3||(N=y+u),_e!==f||o!==0&&_e.nodeType!==3||(G=y+o),_e.nodeType===3&&(y+=_e.nodeValue.length),(ue=_e.firstChild)!==null;)oe=_e,_e=ue;for(;;){if(_e===t)break t;if(oe===a&&++ae===u&&(N=y),oe===f&&++ge===o&&(G=y),(ue=_e.nextSibling)!==null)break;_e=oe,oe=_e.parentNode}_e=ue}a=N===-1||G===-1?null:{start:N,end:G}}else a=null}a=a||{start:0,end:0}}else a=null;for(eh={focusedElem:t,selectionRange:a},gu=!1,Fn=n;Fn!==null;)if(n=Fn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Fn=t;else for(;Fn!==null;){switch(n=Fn,f=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)u=t[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,a=n,u=f.memoizedProps,f=f.memoizedState,o=a.stateNode;try{var We=pr(a.type,u);t=o.getSnapshotBeforeUpdate(We,f),o.__reactInternalSnapshotBeforeUpdate=t}catch(at){Jt(a,a.return,at)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)ih(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ih(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=n.sibling,t!==null){t.return=n.return,Fn=t;break}Fn=n.return}}function Bg(t,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Ha(t,a),o&4&&Tl(5,a);break;case 1:if(Ha(t,a),o&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(y){Jt(a,a.return,y)}else{var u=pr(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(u,n,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Jt(a,a.return,y)}}o&64&&Lg(a),o&512&&Al(a,a.return);break;case 3:if(Ha(t,a),o&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{M0(t,n)}catch(y){Jt(a,a.return,y)}}break;case 27:n===null&&o&4&&Fg(a);case 26:case 5:Ha(t,a),n===null&&o&4&&Pg(a),o&512&&Al(a,a.return);break;case 12:Ha(t,a);break;case 31:Ha(t,a),o&4&&kg(t,a);break;case 13:Ha(t,a),o&4&&Vg(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=Zb.bind(null,a),xS(t,a))));break;case 22:if(o=a.memoizedState!==null||za,!o){n=n!==null&&n.memoizedState!==null||Rn,u=za;var f=Rn;za=o,(Rn=n)&&!f?Ga(t,a,(a.subtreeFlags&8772)!==0):Ha(t,a),za=u,Rn=f}break;case 30:break;default:Ha(t,a)}}function Hg(t){var n=t.alternate;n!==null&&(t.alternate=null,Hg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&ki(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xn=null,si=!1;function Ba(t,n,a){for(a=a.child;a!==null;)Gg(t,n,a),a=a.sibling}function Gg(t,n,a){if(pe&&typeof pe.onCommitFiberUnmount=="function")try{pe.onCommitFiberUnmount(de,a)}catch{}switch(a.tag){case 26:Rn||ua(a,n),Ba(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rn||ua(a,n);var o=xn,u=si;Rs(a.type)&&(xn=a.stateNode,si=!1),Ba(t,n,a),Pl(a.stateNode),xn=o,si=u;break;case 5:Rn||ua(a,n);case 6:if(o=xn,u=si,xn=null,Ba(t,n,a),xn=o,si=u,xn!==null)if(si)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(a.stateNode)}catch(f){Jt(a,n,f)}else try{xn.removeChild(a.stateNode)}catch(f){Jt(a,n,f)}break;case 18:xn!==null&&(si?(t=xn,Lx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),vo(t)):Lx(xn,a.stateNode));break;case 4:o=xn,u=si,xn=a.stateNode.containerInfo,si=!0,Ba(t,n,a),xn=o,si=u;break;case 0:case 11:case 14:case 15:Ss(2,a,n),Rn||Ss(4,a,n),Ba(t,n,a);break;case 1:Rn||(ua(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Og(a,n,o)),Ba(t,n,a);break;case 21:Ba(t,n,a);break;case 22:Rn=(o=Rn)||a.memoizedState!==null,Ba(t,n,a),Rn=o;break;default:Ba(t,n,a)}}function kg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{vo(t)}catch(a){Jt(n,n.return,a)}}}function Vg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{vo(t)}catch(a){Jt(n,n.return,a)}}function Vb(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new zg),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new zg),n;default:throw Error(s(435,t.tag))}}function Kc(t,n){var a=Vb(t);n.forEach(function(o){if(!a.has(o)){a.add(o);var u=Jb.bind(null,t,o);o.then(u,u)}})}function ri(t,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var u=a[o],f=t,y=n,N=y;e:for(;N!==null;){switch(N.tag){case 27:if(Rs(N.type)){xn=N.stateNode,si=!1;break e}break;case 5:xn=N.stateNode,si=!1;break e;case 3:case 4:xn=N.stateNode.containerInfo,si=!0;break e}N=N.return}if(xn===null)throw Error(s(160));Gg(f,y,u),xn=null,si=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)jg(n,t),n=n.sibling}var qi=null;function jg(t,n){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ri(n,t),oi(t),o&4&&(Ss(3,t,t.return),Tl(3,t),Ss(5,t,t.return));break;case 1:ri(n,t),oi(t),o&512&&(Rn||a===null||ua(a,a.return)),o&64&&za&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var u=qi;if(ri(n,t),oi(t),o&512&&(Rn||a===null||ua(a,a.return)),o&4){var f=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":f=u.getElementsByTagName("title")[0],(!f||f[sa]||f[mn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(o),u.head.insertBefore(f,u.querySelector("head > title"))),Vn(f,o,a),f[mn]=t,mt(f),o=f;break e;case"link":var y=jx("link","href",u).get(o+(a.href||""));if(y){for(var N=0;N<y.length;N++)if(f=y[N],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(N,1);break t}}f=u.createElement(o),Vn(f,o,a),u.head.appendChild(f);break;case"meta":if(y=jx("meta","content",u).get(o+(a.content||""))){for(N=0;N<y.length;N++)if(f=y[N],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(N,1);break t}}f=u.createElement(o),Vn(f,o,a),u.head.appendChild(f);break;default:throw Error(s(468,o))}f[mn]=t,mt(f),o=f}t.stateNode=o}else Xx(u,t.type,t.stateNode);else t.stateNode=Vx(u,o,t.memoizedProps);else f!==o?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,o===null?Xx(u,t.type,t.stateNode):Vx(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Rd(t,t.memoizedProps,a.memoizedProps)}break;case 27:ri(n,t),oi(t),o&512&&(Rn||a===null||ua(a,a.return)),a!==null&&o&4&&Rd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ri(n,t),oi(t),o&512&&(Rn||a===null||ua(a,a.return)),t.flags&32){u=t.stateNode;try{mi(u,"")}catch(We){Jt(t,t.return,We)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,Rd(t,u,a!==null?a.memoizedProps:u)),o&1024&&(Ud=!0);break;case 6:if(ri(n,t),oi(t),o&4){if(t.stateNode===null)throw Error(s(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(We){Jt(t,t.return,We)}}break;case 3:if(du=null,u=qi,qi=uu(n.containerInfo),ri(n,t),qi=u,oi(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{vo(n.containerInfo)}catch(We){Jt(t,t.return,We)}
vendor: 11,061 bytes, line 25
25Ud&&(Ud=!1,Xg(t));break;case 4:o=qi,qi=uu(t.stateNode.containerInfo),ri(n,t),oi(t),qi=o;break;case 12:ri(n,t),oi(t);break;case 31:ri(n,t),oi(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Kc(t,o)));break;case 13:ri(n,t),oi(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Jc=Ht()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Kc(t,o)));break;case 22:u=t.memoizedState!==null;var G=a!==null&&a.memoizedState!==null,ae=za,ge=Rn;if(za=ae||u,Rn=ge||G,ri(n,t),Rn=ge,za=ae,oi(t),o&8192)e:for(n=t.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(a===null||G||za||Rn||mr(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){G=a=n;try{if(f=G.stateNode,u)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{N=G.stateNode;var _e=G.memoizedProps.style,oe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;N.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(We){Jt(G,G.return,We)}}}else if(n.tag===6){if(a===null){G=n;try{G.stateNode.nodeValue=u?"":G.memoizedProps}catch(We){Jt(G,G.return,We)}}}else if(n.tag===18){if(a===null){G=n;try{var ue=G.stateNode;u?Ox(ue,!0):Ox(G.stateNode,!1)}catch(We){Jt(G,G.return,We)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Kc(t,a))));break;case 19:ri(n,t),oi(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Kc(t,o)));break;case 30:break;case 21:break;default:ri(n,t),oi(t)}}function oi(t){var n=t.flags;if(n&2){try{for(var a,o=t.return;o!==null;){if(Ig(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,f=Nd(t);Qc(t,f,u);break;case 5:var y=a.stateNode;a.flags&32&&(mi(y,""),a.flags&=-33);var N=Nd(t);Qc(t,N,y);break;case 3:case 4:var G=a.stateNode.containerInfo,ae=Nd(t);Dd(t,ae,G);break;default:throw Error(s(161))}}catch(ge){Jt(t,t.return,ge)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Xg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Xg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ha(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Bg(t,n.alternate,n),n=n.sibling}function mr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Ss(4,n,n.return),mr(n);break;case 1:ua(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Og(n,n.return,a),mr(n);break;case 27:Pl(n.stateNode);case 26:case 5:ua(n,n.return),mr(n);break;case 22:n.memoizedState===null&&mr(n);break;case 30:mr(n);break;default:mr(n)}t=t.sibling}}function Ga(t,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=t,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:Ga(u,f,a),Tl(4,f);break;case 1:if(Ga(u,f,a),o=f,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(ae){Jt(o,o.return,ae)}if(o=f,u=o.updateQueue,u!==null){var N=o.stateNode;try{var G=u.shared.hiddenCallbacks;if(G!==null)for(u.shared.hiddenCallbacks=null,u=0;u<G.length;u++)S0(G[u],N)}catch(ae){Jt(o,o.return,ae)}}a&&y&64&&Lg(f),Al(f,f.return);break;case 27:Fg(f);case 26:case 5:Ga(u,f,a),a&&o===null&&y&4&&Pg(f),Al(f,f.return);break;case 12:Ga(u,f,a);break;case 31:Ga(u,f,a),a&&y&4&&kg(u,f);break;case 13:Ga(u,f,a),a&&y&4&&Vg(u,f);break;case 22:f.memoizedState===null&&Ga(u,f,a),Al(f,f.return);break;case 30:break;default:Ga(u,f,a)}n=n.sibling}}function Ld(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&dl(a))}function Od(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&dl(t))}function Yi(t,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Wg(t,n,a,o),n=n.sibling}function Wg(t,n,a,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Yi(t,n,a,o),u&2048&&Tl(9,n);break;case 1:Yi(t,n,a,o);break;case 3:Yi(t,n,a,o),u&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&dl(t)));break;case 12:if(u&2048){Yi(t,n,a,o),t=n.stateNode;try{var f=n.memoizedProps,y=f.id,N=f.onPostCommit;typeof N=="function"&&N(y,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(G){Jt(n,n.return,G)}}else Yi(t,n,a,o);break;case 31:Yi(t,n,a,o);break;case 13:Yi(t,n,a,o);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?Yi(t,n,a,o):wl(t,n):f._visibility&2?Yi(t,n,a,o):(f._visibility|=2,ro(t,n,a,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Ld(y,n);break;case 24:Yi(t,n,a,o),u&2048&&Od(n.alternate,n);break;default:Yi(t,n,a,o)}}function ro(t,n,a,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=t,y=n,N=a,G=o,ae=y.flags;switch(y.tag){case 0:case 11:case 15:ro(f,y,N,G,u),Tl(8,y);break;case 23:break;case 22:var ge=y.stateNode;y.memoizedState!==null?ge._visibility&2?ro(f,y,N,G,u):wl(f,y):(ge._visibility|=2,ro(f,y,N,G,u)),u&&ae&2048&&Ld(y.alternate,y);break;case 24:ro(f,y,N,G,u),u&&ae&2048&&Od(y.alternate,y);break;default:ro(f,y,N,G,u)}n=n.sibling}}function wl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,o=n,u=o.flags;switch(o.tag){case 22:wl(a,o),u&2048&&Ld(o.alternate,o);break;case 24:wl(a,o),u&2048&&Od(o.alternate,o);break;default:wl(a,o)}n=n.sibling}}var Cl=8192;function oo(t,n,a){if(t.subtreeFlags&Cl)for(t=t.child;t!==null;)qg(t,n,a),t=t.sibling}function qg(t,n,a){switch(t.tag){case 26:oo(t,n,a),t.flags&Cl&&t.memoizedState!==null&&RS(a,qi,t.memoizedState,t.memoizedProps);break;case 5:oo(t,n,a);break;case 3:case 4:var o=qi;qi=uu(t.stateNode.containerInfo),oo(t,n,a),qi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Cl,Cl=16777216,oo(t,n,a),Cl=o):oo(t,n,a));break;default:oo(t,n,a)}}function Yg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Rl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Fn=o,Kg(o,t)}Yg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qg(t),t=t.sibling}function Qg(t){switch(t.tag){case 0:case 11:case 15:Rl(t),t.flags&2048&&Ss(9,t,t.return);break;case 3:Rl(t);break;case 12:Rl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Zc(t)):Rl(t);break;default:Rl(t)}}function Zc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Fn=o,Kg(o,t)}Yg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Ss(8,n,n.return),Zc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Zc(n));break;default:Zc(n)}t=t.sibling}}function Kg(t,n){for(;Fn!==null;){var a=Fn;switch(a.tag){case 0:case 11:case 15:Ss(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:dl(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Fn=o;else e:for(a=t;Fn!==null;){o=Fn;var u=o.sibling,f=o.return;if(Hg(o),o===a){Fn=null;break e}if(u!==null){u.return=f,Fn=u;break e}Fn=f}}}var jb={getCacheForType:function(t){var n=Gn(An),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return Gn(An).controller.signal}},Xb=typeof WeakMap=="function"?WeakMap:Map,jt=0,on=null,Ct=null,Nt=0,Zt=0,yi=null,Ms=!1,lo=!1,Pd=!1,ka=0,yn=0,Es=0,gr=0,Id=0,bi=0,co=0,Nl=null,li=null,Fd=!1,Jc=0,Zg=0,$c=1/0,eu=null,Ts=null,Ln=0,As=null,uo=null,Va=0,zd=0,Bd=null,Jg=null,Dl=0,Hd=null;function Si(){return(jt&2)!==0&&Nt!==0?Nt&-Nt:B.T!==null?Wd():Aa()}function $g(){if(bi===0)if((Nt&536870912)===0||Lt){var t=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),bi=t}else bi=536870912;return t=vi.current,t!==null&&(t.flags|=32),bi}function ci(t,n,a){(t===on&&(Zt===2||Zt===9)||t.cancelPendingCommit!==null)&&(fo(t,0),ws(t,Nt,bi,!1)),Ve(t,a),((jt&2)===0||t!==on)&&(t===on&&((jt&2)===0&&(gr|=a),yn===4&&ws(t,Nt,bi,!1)),fa(t))}function ex(t,n,a){if((jt&6)!==0)throw Error(s(327));var o=!a&&(n&127)===0&&(n&t.expiredLanes)===0||Ue(t,n),u=o?Yb(t,n):kd(t,n,!0),f=o;do{if(u===0){lo&&!o&&ws(t,n,0,!1);break}else{if(a=t.current.alternate,f&&!Wb(a)){u=kd(t,n,!1),f=!1;continue}if(u===2){if(f=n,t.errorRecoveryDisabledLanes&f)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var N=t;u=Nl;var G=N.current.memoizedState.isDehydrated;if(G&&(fo(N,y).flags|=256),y=kd(N,y,!1),y!==2){if(Pd&&!G){N.errorRecoveryDisabledLanes|=f,gr|=f,u=4;break e}f=li,li=u,f!==null&&(li===null?li=f:li.push.apply(li,f))}u=y}if(f=!1,u!==2)continue}}if(u===1){fo(t,0),ws(t,n,0,!0);break}e:{switch(o=t,f=u,f){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:ws(o,n,bi,!Ms);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=Jc+300-Ht(),10<u)){if(ws(o,n,bi,!Ms),xe(o,0,!0)!==0)break e;Va=n,o.timeoutHandle=Dx(tx.bind(null,o,a,li,eu,Fd,n,bi,gr,co,Ms,f,"Throttled",-0,0),u);break e}tx(o,a,li,eu,Fd,n,bi,gr,co,Ms,f,null,-0,0)}}break}while(!0);fa(t)}function tx(t,n,a,o,u,f,y,N,G,ae,ge,_e,oe,ue){if(t.timeoutHandle=-1,_e=n.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ca},qg(n,f,_e);var We=(f&62914560)===f?Jc-Ht():(f&4194048)===f?Zg-Ht():0;if(We=NS(_e,We),We!==null){Va=f,t.cancelPendingCommit=We(cx.bind(null,t,n,f,a,o,u,y,N,G,ge,_e,null,oe,ue)),ws(t,f,y,!ae);return}}cx(t,n,f,a,o,u,y,N,G)}function Wb(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var u=a[o],f=u.getSnapshot;u=u.value;try{if(!gi(f(),u))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ws(t,n,a,o){n&=~Id,n&=~gr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var u=n;0<u;){var f=31-Ge(u),y=1<<f;o[f]=-1,u&=~y}a!==0&&At(t,a,n)}function tu(){return(jt&6)===0?(Ul(0),!1):!0}function Gd(){if(Ct!==null){if(Zt===0)var t=Ct.return;else t=Ct,Ua=or=null,id(t),to=null,pl=0,t=Ct;for(;t!==null;)Ug(t.alternate,t),t=t.return;Ct=null}}function fo(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,dS(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Va=0,Gd(),on=t,Ct=a=Na(t.current,null),Nt=n,Zt=0,yi=null,Ms=!1,lo=Ue(t,n),Pd=!1,co=bi=Id=gr
vendor: 21,800 bytes, lines 25-26
25=Es=yn=0,li=Nl=null,Fd=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var u=31-Ge(o),f=1<<u;n|=t[u],o&=~f}return ka=n,Sc(),a}function nx(t,n){_t=null,B.H=Sl,n===eo||n===Nc?(n=v0(),Zt=3):n===Xf?(n=v0(),Zt=4):Zt=n===_d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,yi=n,Ct===null&&(yn=1,jc(t,Ni(n,t.current)))}function ix(){var t=vi.current;return t===null?!0:(Nt&4194048)===Nt?Oi===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?t===Oi:!1}function ax(){var t=B.H;return B.H=Sl,t===null?Sl:t}function sx(){var t=B.A;return B.A=jb,t}function nu(){yn=4,Ms||(Nt&4194048)!==Nt&&vi.current!==null||(lo=!0),(Es&134217727)===0&&(gr&134217727)===0||on===null||ws(on,Nt,bi,!1)}function kd(t,n,a){var o=jt;jt|=2;var u=ax(),f=sx();(on!==t||Nt!==n)&&(eu=null,fo(t,n)),n=!1;var y=yn;e:do try{if(Zt!==0&&Ct!==null){var N=Ct,G=yi;switch(Zt){case 8:Gd(),y=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(n=!0);var ae=Zt;if(Zt=0,yi=null,ho(t,N,G,ae),a&&lo){y=0;break e}break;default:ae=Zt,Zt=0,yi=null,ho(t,N,G,ae)}}qb(),y=yn;break}catch(ge){nx(t,ge)}while(!0);return n&&t.shellSuspendCounter++,Ua=or=null,jt=o,B.H=u,B.A=f,Ct===null&&(on=null,Nt=0,Sc()),y}function qb(){for(;Ct!==null;)rx(Ct)}function Yb(t,n){var a=jt;jt|=2;var o=ax(),u=sx();on!==t||Nt!==n?(eu=null,$c=Ht()+500,fo(t,n)):lo=Ue(t,n);e:do try{if(Zt!==0&&Ct!==null){n=Ct;var f=yi;t:switch(Zt){case 1:Zt=0,yi=null,ho(t,n,f,1);break;case 2:case 9:if(g0(f)){Zt=0,yi=null,ox(n);break}n=function(){Zt!==2&&Zt!==9||on!==t||(Zt=7),fa(t)},f.then(n,n);break e;case 3:Zt=7;break e;case 4:Zt=5;break e;case 7:g0(f)?(Zt=0,yi=null,ox(n)):(Zt=0,yi=null,ho(t,n,f,7));break;case 5:var y=null;switch(Ct.tag){case 26:y=Ct.memoizedState;case 5:case 27:var N=Ct;if(y?Wx(y):N.stateNode.complete){Zt=0,yi=null;var G=N.sibling;if(G!==null)Ct=G;else{var ae=N.return;ae!==null?(Ct=ae,iu(ae)):Ct=null}break t}}Zt=0,yi=null,ho(t,n,f,5);break;case 6:Zt=0,yi=null,ho(t,n,f,6);break;case 8:Gd(),yn=6;break e;default:throw Error(s(462))}}Qb();break}catch(ge){nx(t,ge)}while(!0);return Ua=or=null,B.H=o,B.A=u,jt=a,Ct!==null?0:(on=null,Nt=0,Sc(),yn)}function Qb(){for(;Ct!==null&&!un();)rx(Ct)}function rx(t){var n=Ng(t.alternate,t,ka);t.memoizedProps=t.pendingProps,n===null?iu(t):Ct=n}function ox(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=Eg(a,n,n.pendingProps,n.type,void 0,Nt);break;case 11:n=Eg(a,n,n.pendingProps,n.type.render,n.ref,Nt);break;case 5:id(n);default:Ug(a,n),n=Ct=s0(n,ka),n=Ng(a,n,ka)}t.memoizedProps=t.pendingProps,n===null?iu(t):Ct=n}function ho(t,n,a,o){Ua=or=null,id(n),to=null,pl=0;var u=n.return;try{if(Fb(t,u,n,a,Nt)){yn=1,jc(t,Ni(a,t.current)),Ct=null;return}}catch(f){if(u!==null)throw Ct=u,f;yn=1,jc(t,Ni(a,t.current)),Ct=null;return}n.flags&32768?(Lt||o===1?t=!0:lo||(Nt&536870912)!==0?t=!1:(Ms=t=!0,(o===2||o===9||o===3||o===6)&&(o=vi.current,o!==null&&o.tag===13&&(o.flags|=16384))),lx(n,t)):iu(n)}function iu(t){var n=t;do{if((n.flags&32768)!==0){lx(n,Ms);return}t=n.return;var a=Hb(n.alternate,n,ka);if(a!==null){Ct=a;return}if(n=n.sibling,n!==null){Ct=n;return}Ct=n=t}while(n!==null);yn===0&&(yn=5)}function lx(t,n){do{var a=Gb(t.alternate,t);if(a!==null){a.flags&=32767,Ct=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Ct=t;return}Ct=t=a}while(t!==null);yn=6,Ct=null}function cx(t,n,a,o,u,f,y,N,G){t.cancelPendingCommit=null;do au();while(Ln!==0);if((jt&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));if(f=n.lanes|n.childLanes,f|=Nf,cn(t,a,f,y,N,G),t===on&&(Ct=on=null,Nt=0),uo=n,As=t,Va=a,zd=f,Bd=u,Jg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,$b(ee,function(){return px(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,u=j.p,j.p=2,y=jt,jt|=4;try{kb(t,n,a)}finally{jt=y,j.p=u,B.T=o}}Ln=1,ux(),fx(),dx()}}function ux(){if(Ln===1){Ln=0;var t=As,n=uo,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=B.T,B.T=null;var o=j.p;j.p=2;var u=jt;jt|=4;try{jg(n,t);var f=eh,y=Km(t.containerInfo),N=f.focusedElem,G=f.selectionRange;if(y!==N&&N&&N.ownerDocument&&Qm(N.ownerDocument.documentElement,N)){if(G!==null&&Tf(N)){var ae=G.start,ge=G.end;if(ge===void 0&&(ge=ae),"selectionStart"in N)N.selectionStart=ae,N.selectionEnd=Math.min(ge,N.value.length);else{var _e=N.ownerDocument||document,oe=_e&&_e.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),We=N.textContent.length,at=Math.min(G.start,We),an=G.end===void 0?at:Math.min(G.end,We);!ue.extend&&at>an&&(y=an,an=at,at=y);var J=Ym(N,at),X=Ym(N,an);if(J&&X&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==X.node||ue.focusOffset!==X.offset)){var ie=_e.createRange();ie.setStart(J.node,J.offset),ue.removeAllRanges(),at>an?(ue.addRange(ie),ue.extend(X.node,X.offset)):(ie.setEnd(X.node,X.offset),ue.addRange(ie))}}}}for(_e=[],ue=N;ue=ue.parentNode;)ue.nodeType===1&&_e.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<_e.length;N++){var ve=_e[N];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}gu=!!$d,eh=$d=null}finally{jt=u,j.p=o,B.T=a}}t.current=n,Ln=2}}function fx(){if(Ln===2){Ln=0;var t=As,n=uo,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=B.T,B.T=null;var o=j.p;j.p=2;var u=jt;jt|=4;try{Bg(t,n.alternate,n)}finally{jt=u,j.p=o,B.T=a}}Ln=3}}function dx(){if(Ln===4||Ln===3){Ln=0,Q();var t=As,n=uo,a=Va,o=Jg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ln=5:(Ln=0,uo=As=null,hx(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ts=null),$n(a),n=n.stateNode,pe&&typeof pe.onCommitFiberRoot=="function")try{pe.onCommitFiberRoot(de,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=B.T,u=j.p,j.p=2,B.T=null;try{for(var f=t.onRecoverableError,y=0;y<o.length;y++){var N=o[y];f(N.value,{componentStack:N.stack})}}finally{B.T=n,j.p=u}}(Va&3)!==0&&au(),fa(t),u=t.pendingLanes,(a&261930)!==0&&(u&42)!==0?t===Hd?Dl++:(Dl=0,Hd=t):Dl=0,Ul(0)}}function hx(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,dl(n)))}function au(){return ux(),fx(),dx(),px()}function px(){if(Ln!==5)return!1;var t=As,n=zd;zd=0;var a=$n(Va),o=B.T,u=j.p;try{j.p=32>a?32:a,B.T=null,a=Bd,Bd=null;var f=As,y=Va;if(Ln=0,uo=As=null,Va=0,(jt&6)!==0)throw Error(s(331));var N=jt;if(jt|=4,Qg(f.current),Wg(f,f.current,y,a),jt=N,Ul(0,!1),pe&&typeof pe.onPostCommitFiberRoot=="function")try{pe.onPostCommitFiberRoot(de,f)}catch{}return!0}finally{j.p=u,B.T=o,hx(t,n)}}function mx(t,n,a){n=Ni(a,n),n=vd(t.stateNode,n,2),t=_s(t,n,2),t!==null&&(Ve(t,2),fa(t))}function Jt(t,n,a){if(t.tag===3)mx(t,t,a);else for(;n!==null;){if(n.tag===3){mx(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ts===null||!Ts.has(o))){t=Ni(a,t),a=gg(2),o=_s(n,a,2),o!==null&&(xg(a,o,n,t),Ve(o,2),fa(o));break}}n=n.return}}function Vd(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Xb;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(a)||(Pd=!0,u.add(a),t=Kb.bind(null,t,n,a),n.then(t,t))}function Kb(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,on===t&&(Nt&a)===a&&(yn===4||yn===3&&(Nt&62914560)===Nt&&300>Ht()-Jc?(jt&2)===0&&fo(t,0):Id|=a,co===Nt&&(co=0)),fa(t)}function gx(t,n){n===0&&(n=be()),t=ar(t,n),t!==null&&(Ve(t,n),fa(t))}function Zb(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),gx(t,a)}function Jb(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),gx(t,a)}function $b(t,n){return rn(t,n)}var su=null,po=null,jd=!1,ru=!1,Xd=!1,Cs=0;function fa(t){t!==po&&t.next===null&&(po===null?su=po=t:po=po.next=t),ru=!0,jd||(jd=!0,tS())}function Ul(t,n){if(!Xd&&ru){Xd=!0;do for(var a=!1,o=su;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var f=0;else{var y=o.suspendedLanes,N=o.pingedLanes;f=(1<<31-Ge(42|t)+1)-1,f&=u&~(y&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,yx(o,f))}else f=Nt,f=xe(o,o===on?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Ue(o,f)||(a=!0,yx(o,f));o=o.next}while(a);Xd=!1}}function eS(){xx()}function xx(){ru=jd=!1;var t=0;Cs!==0&&fS()&&(t=Cs);for(var n=Ht(),a=null,o=su;o!==null;){var u=o.next,f=vx(o,n);f===0?(o.next=null,a===null?su=u:a.next=u,u===null&&(po=a)):(a=o,(t!==0||(f&3)!==0)&&(ru=!0)),o=u}Ln!==0&&Ln!==5||Ul(t),Cs!==0&&(Cs=0)}function vx(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var y=31-Ge(f),N=1<<y,G=u[y];G===-1?((N&a)===0||(N&o)!==0)&&(u[y]=Fe(N,n)):G<=n&&(t.expiredLanes|=N),f&=~N}if(n=on,a=Nt,a=xe(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===n&&(Zt===2||Zt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&qt(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ue(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(o!==null&&qt(o),$n(a)){case 2:case 8:a=T;break;case 32:a=ee;break;case 268435456:a=he;break;default:a=ee}return o=_x.bind(null,t),a=rn(a,o),t.callbackPriority=n,t.callbackNode=a,n}return o!==null&&o!==null&&qt(o),t.callbackPriority=2,t.callbackNode=null,2}function _x(t,n){if(Ln!==0&&Ln!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(au()&&t.callbackNode!==a)return null;var o=Nt;return o=xe(t,t===on?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(ex(t,o,n),vx(t,Ht()),t.callbackNode!=null&&t.callbackNode===a?_x.bind(null,t):null)}function yx(t,n){if(au())return null;ex(t,n,!0)}function tS(){hS(function(){(jt&6)!==0?rn(P,eS):xx()})}function Wd(){if(Cs===0){var t=Jr;t===0&&(t=$e,$e<<=1,($e&261888)===0&&($e=256)),Cs=t}return Cs}function bx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:er(""+t)}function Sx(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function nS(t,n,a,o,u){if(n==="submit"&&a&&a.stateNode===u){var f=bx((u[Un]||null).action),y=o.submitter;y&&(n=(n=y[Un]||null)?bx(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var N=new vc("action","action",null,o,u);t.push({event:N,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Cs!==0){var G=y?Sx(u,y):new FormData(u);dd(a,{pending:!0,data:G,method:u.method,action:f},null,G)}}else typeof f=="function"&&(N.preventDefault(),G=y?Sx(u,y):new FormData(u),dd(a,{pending:!0,data:G,method:u.method,action:f},f,G))},currentTarget:u}]})}}for(var qd=0;qd<Rf.length;qd++){var Yd=Rf[qd],iS=Yd.toLowerCase(),aS=Yd[0].toUpperCase()+Yd.slice(1);Wi(iS,"on"+aS)}Wi($m,"onAnimationEnd"),Wi(e0,"onAnimationIteration"),Wi(t0,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(yb,"onTransitionRun"),Wi(bb,"onTransitionStart"),Wi(Sb,"onTransitionCancel"),Wi(n0,"onTransitionEnd"),ne("onMouseEnter",["mouseout","mouseover"]),ne("onMouseLeave",["mouseout","mouseover"]),ne("onPointerEnter",["pointerout","pointerover"]),ne("onPointerLeave",["pointerout","pointerover"]),K("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),K("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),K("onBeforeInput",["compositionend","keypress","textInput","paste"]),K("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),K("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),K("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ll));function Mx(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],u=o.event;o=o.listeners;e:{var f=void 0;if(n)for(var y=o.length-1;0<=y;y--){var N=o[y],G=N.instance,ae=N.currentTarget;if(N=N.listener,G!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ae;try{f(u)}catch(ge){bc(ge)}u.currentTarget=null,f=G}else for(y=0;y<o.length;y++){if(N=o[y],G=N.instance,ae=N.currentTarget,N=N.listener,G!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ae;try{f(u)}catch(ge){bc(ge)}u.currentTarget=null,f=G}}}}function Rt(t,n){var a=n[Ci];a===void 0&&(a=n[Ci]=new Set);var o=t+"__bubble";a.has(o)||(Ex(n,t,2,!1),a.add(o))}function Qd(t,n,a){var o=0;n&&(o|=4),Ex(a,t,o,n)}var ou="_reactListening"+Math.random().toString(36).slice(2);function Kd(t){if(!t[ou]){t[ou]=!0,Hr.forEach(function(a){a!=="selectionchange"&&(sS.has(a)||Qd(a,!1,t),Qd(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ou]||(n[ou]=!0,Qd("selectionchange",!1,n))}}function Ex(t,n,a,o){switch($x(n)){case 2:var u=LS;break;case 8:u=OS;break;default:u=fh}a=u.bind(null,n,a,t),u=void 0,!gf||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(n,a,{capture:!0,passive:u}):t.addEventListener(n,a,!0):u!==void 0?t.addEventListener(n,a,{passive:u}):t.addEventListener(n,a,!1)}function Zd(t,n,a,o,u){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var N=o.stateNode.containerInfo;if(N===u)break;if(y===4)for(y=o.return;y!==null;){var G=y.tag;if((G===3||G===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;N!==null;){if(y=Vi(N),y===null)return;if(G=y.tag,G===5||G===6||G===26||G===27){o=f=y;continue e}N=N.parentNode}}o=o.return}Rm(function(){var ae=f,ge=pf(a),_e=[];e:{var oe=i0.get(t);if(oe!==void 0){var ue=vc,We=t;switch(t){case"keypress":if(gc(a)===0)break e;case"keydown":case"keyup":ue=Jy;break;case"focusin":We="focus",ue=yf;break;case"focusout":We="blur",ue=yf;break;case"beforeblur":case"afterblur":ue=yf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=tb;break;case $m:case e0:case t0:ue=Vy;break;case n0:ue=ib;break;case"scroll":case"scrollend":ue=zy;break;case"wheel":ue=sb;break;case"copy":case"cut":case"paste":ue=Xy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Om;break;case"toggle":case"beforetoggle":ue=ob}var at=(n&4)!==0,an=!at&&(t==="scroll"||t==="scrollend"),J=at?oe!==null?oe+"Capture":null:oe;at=[];for(var X=ae,ie;X!==null;){var ve=X;if(ie=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ie===null||J===null||(ve=tl(X,J),ve!=null&&at.push(Ol(X,ve,ie))),an)break;X=X.return}0<at.length&&(oe=new ue(oe,We,null,a,ge),_e.push({event:oe,listeners:at}))}}if((n&7)===0){e:{if(oe=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",oe&&a!==hf&&(We=a.relatedTarget||a.fromElement)&&(Vi(We)||We[Wn]))break e;if((ue||oe)&&(oe=ge.window===ge?ge:(oe=ge.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(We=a.relatedTarget||a.toElement,ue=ae,We=We?Vi(We):null,We!==null&&(an=c(We),at=We.tag,We!==an||at!==5&&at!==27&&at!==6)&&(We=null)):(ue=null,We=ae),ue!==We)){if(at=Um,ve="onMouseLeave",J="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(at=Om,ve="onPointerLeave",J="onPointerEnter",X="pointer"),an=ue==null?oe:wa(ue),ie=We==null?oe:wa(We),oe=new at(ve,X+"leave",ue,a,ge),oe.target=an,oe.relatedTarget=ie,ve=null,Vi(ge)===ae&&(at=new at(J,X+"enter",We,a,ge),at.target=ie,at.relatedTarget=an,ve=at),an=ve,ue&&We)t:{for(at=rS,J=ue,X=We,ie=0,ve=J;ve;ve=at(ve))ie++;ve=0;for(var nt=X;nt;nt=at(nt))ve++;for(;0<ie-ve;)J=at(J),ie--;for(;0<ve-ie;)X=at(X),ve--;for(;ie--;){if(J===X||X!==null&&J===X.alternate){at=J;break t}J=at(J),X=at(X)}at=null}else at=null;ue!==null&&Tx(_e,oe,ue,at,!1),We!==null&&an!==null&&Tx(_e,an,We,at,!0)}}e:{if(oe=ae?wa(ae):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var Gt=km;else if(Hm(oe))if(Vm)Gt=xb;else{Gt=mb;var Ke=pb}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&Yt(ae.elementType)&&(Gt=km):Gt=gb;if(Gt&&(Gt=Gt(t,ae))){Gm(_e,Gt,a,ge);break e}Ke&&Ke(t,oe,ae),t==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&pt(oe,"number",oe.value)}switch(Ke=ae?wa(ae):window,t){case"focusin":(Hm(Ke)||Ke.contentEditable==="true")&&(jr=Ke,Af=ae,cl=null);break;case"focusout":cl=Af=jr=null;break;case"mousedown":wf=!0;break;case"contextmenu":case"mouseup":case"dragend":wf=!1,Zm(_e,a,ge);break;case"selectionchange":if(_b)break;case"keydown":case"keyup":Zm(_e,a,ge)}var bt;if(Sf)e:{switch(t){case"compositionstart":var Dt="onCompositionStart";break e;case"compositionend":Dt="onCompositionEnd";break e;case"compositionupdate":Dt="onCompositionUpdate";break e}Dt=void 0}else Vr?zm(t,a)&&(Dt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Dt="onCompositionStart");Dt&&(Pm&&a.locale!=="ko"&&(Vr||Dt!=="onCompositionStart"?Dt==="onCompositionEnd"&&Vr&&(bt=Nm()):(ds=ge,xf="value"in ds?ds.value:ds.textContent,Vr=!0)),Ke=lu(ae,Dt),0<Ke.length&&(Dt=new Lm(Dt,t,null,a,ge),_e.push({event:Dt,listeners:Ke}),bt?Dt.data=bt:(bt=Bm(a),bt!==null&&(Dt.data=bt)))),(bt=cb?ub(t,a):fb(t,a))&&(Dt=lu(ae,"onBeforeInput"),0<Dt.length&&(Ke=new Lm("onBeforeInput","beforeinput",null,a,ge),_e.push({event:Ke,listeners:Dt}),Ke.data=bt)),nS(_e,t,ae,a,ge)}Mx(_e,n)})}function Ol(t,n,a){return{instance:t,listener:n,currentTarget:a}}function lu(t,n){for(var a=n+"Capture",o=[];t!==null;){var u=t,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=tl(t,a),u!=null&&o.unshift(Ol(t,u,f)),u=tl(t,n),u!=null&&o.push(Ol(t,u,f))),t.tag===3)return o;t=t.return}return[]}function rS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Tx(t,n,a,o,u){for(var f=n._reactName,y=[];a!==null&&a!==o;){var N=a,G=N.alternate,ae=N.stateNode;if(N=N.tag,G!==null&&G===o)break;N!==5&&N!==26&&N!==27||ae===null||(G=ae,u?(ae=tl(a,f),ae!=null&&y.unshift(Ol(a,ae,G))):u||(ae=tl(a,f),ae!=null&&y.push(Ol(a,ae,G)))),a=a.return}y.length!==0&&t.push({event:n,listeners:y})}var oS=/\r\n?/g,lS=/\u0000|\uFFFD/g;function Ax(t){return(typeof t=="string"?t:""+t).replace(oS,`
26`).replace(lS,"")}function wx(t,n){return n=Ax(n),Ax(t)===n}function nn(t,n,a,o,u,f){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||mi(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&mi(t,""+o);break;case"className":ze(t,"class",o);break;case"tabIndex":ze(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ze(t,a,o);break;case"style":Xi(t,o,f);break;case"data":if(n!=="object"){ze(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=er(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(n!=="input"&&nn(t,n,"name",u.name,u,null),nn(t,n,"formEncType",u.formEncType,u,null),nn(t,n,"formMethod",u.formMethod,u,null),nn(t,n,"formTarget",u.formTarget,u,null)):(nn(t,n,"encType",u.encType,u,null),nn(t,n,"method",u.method,u,null),nn(t,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=er(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=Ca);break;case"onScroll":o!=null&&Rt("scroll",t);break;case"onScrollEnd":o!=null&&Rt("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}a=er(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""+o):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
26ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":Rt("beforetoggle",t),Rt("toggle",t),Me(t,"popover",o);break;case"xlinkActuate":Be(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Be(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Be(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Be(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Be(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Be(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Be(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Be(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Be(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Me(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=oa.get(a)||a,Me(t,a,o))}}function Jd(t,n,a,o,u,f){switch(a){case"style":Xi(t,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof o=="string"?mi(t,o):(typeof o=="number"||typeof o=="bigint")&&mi(t,""+o);break;case"onScroll":o!=null&&Rt("scroll",t);break;case"onScrollEnd":o!=null&&Rt("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Ca);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!R.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),n=a.slice(2,u?a.length-7:void 0),f=t[Un]||null,f=f!=null?f[a]:null,typeof f=="function"&&t.removeEventListener(n,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,o,u);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):Me(t,a,o)}}}function Vn(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",t),Rt("load",t);var o=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var y=a[f];if(y!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:nn(t,n,f,y,a,null)}}u&&nn(t,n,"srcSet",a.srcSet,a,null),o&&nn(t,n,"src",a.src,a,null);return;case"input":Rt("invalid",t);var N=f=y=u=null,G=null,ae=null;for(o in a)if(a.hasOwnProperty(o)){var ge=a[o];if(ge!=null)switch(o){case"name":u=ge;break;case"type":y=ge;break;case"checked":G=ge;break;case"defaultChecked":ae=ge;break;case"value":f=ge;break;case"defaultValue":N=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,n));break;default:nn(t,n,o,ge,a,null)}}Tt(t,f,N,G,ae,y,u,!1);return;case"select":Rt("invalid",t),o=y=f=null;for(u in a)if(a.hasOwnProperty(u)&&(N=a[u],N!=null))switch(u){case"value":f=N;break;case"defaultValue":y=N;break;case"multiple":o=N;default:nn(t,n,u,N,a,null)}n=f,a=y,t.multiple=!!o,n!=null?fn(t,!!o,n,!1):a!=null&&fn(t,!!o,a,!0);return;case"textarea":Rt("invalid",t),f=u=o=null;for(y in a)if(a.hasOwnProperty(y)&&(N=a[y],N!=null))switch(y){case"value":o=N;break;case"defaultValue":u=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(s(91));break;default:nn(t,n,y,N,a,null)}Mn(t,o,u,f);return;case"option":for(G in a)if(a.hasOwnProperty(G)&&(o=a[G],o!=null))switch(G){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:nn(t,n,G,o,a,null)}return;case"dialog":Rt("beforetoggle",t),Rt("toggle",t),Rt("cancel",t),Rt("close",t);break;case"iframe":case"object":Rt("load",t);break;case"video":case"audio":for(o=0;o<Ll.length;o++)Rt(Ll[o],t);break;case"image":Rt("error",t),Rt("load",t);break;case"details":Rt("toggle",t);break;case"embed":case"source":case"link":Rt("error",t),Rt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in a)if(a.hasOwnProperty(ae)&&(o=a[ae],o!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:nn(t,n,ae,o,a,null)}return;default:if(Yt(n)){for(ge in a)a.hasOwnProperty(ge)&&(o=a[ge],o!==void 0&&Jd(t,n,ge,o,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(o=a[N],o!=null&&nn(t,n,N,o,a,null))}function cS(t,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,y=null,N=null,G=null,ae=null,ge=null;for(ue in a){var _e=a[ue];if(a.hasOwnProperty(ue)&&_e!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":G=_e;default:o.hasOwnProperty(ue)||nn(t,n,ue,null,o,_e)}}for(var oe in o){var ue=o[oe];if(_e=a[oe],o.hasOwnProperty(oe)&&(ue!=null||_e!=null))switch(oe){case"type":f=ue;break;case"name":u=ue;break;case"checked":ae=ue;break;case"defaultChecked":ge=ue;break;case"value":y=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,n));break;default:ue!==_e&&nn(t,n,oe,ue,o,_e)}}Le(t,y,N,G,ae,ge,f,u);return;case"select":ue=y=N=oe=null;for(f in a)if(G=a[f],a.hasOwnProperty(f)&&G!=null)switch(f){case"value":break;case"multiple":ue=G;default:o.hasOwnProperty(f)||nn(t,n,f,null,o,G)}for(u in o)if(f=o[u],G=a[u],o.hasOwnProperty(u)&&(f!=null||G!=null))switch(u){case"value":oe=f;break;case"defaultValue":N=f;break;case"multiple":y=f;default:f!==G&&nn(t,n,u,f,o,G)}n=N,a=y,o=ue,oe!=null?fn(t,!!a,oe,!1):!!o!=!!a&&(n!=null?fn(t,!!a,n,!0):fn(t,!!a,a?[]:"",!1));return;case"textarea":ue=oe=null;for(N in a)if(u=a[N],a.hasOwnProperty(N)&&u!=null&&!o.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:nn(t,n,N,null,o,u)}for(y in o)if(u=o[y],f=a[y],o.hasOwnProperty(y)&&(u!=null||f!=null))switch(y){case"value":oe=u;break;case"defaultValue":ue=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==f&&nn(t,n,y,u,o,f)}St(t,oe,ue);return;case"option":for(var We in a)if(oe=a[We],a.hasOwnProperty(We)&&oe!=null&&!o.hasOwnProperty(We))switch(We){case"selected":t.selected=!1;break;default:nn(t,n,We,null,o,oe)}for(G in o)if(oe=o[G],ue=a[G],o.hasOwnProperty(G)&&oe!==ue&&(oe!=null||ue!=null))switch(G){case"selected":t.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:nn(t,n,G,oe,o,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in a)oe=a[at],a.hasOwnProperty(at)&&oe!=null&&!o.hasOwnProperty(at)&&nn(t,n,at,null,o,oe);for(ae in o)if(oe=o[ae],ue=a[ae],o.hasOwnProperty(ae)&&oe!==ue&&(oe!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,n));break;default:nn(t,n,ae,oe,o,ue)}return;default:if(Yt(n)){for(var an in a)oe=a[an],a.hasOwnProperty(an)&&oe!==void 0&&!o.hasOwnProperty(an)&&Jd(t,n,an,void 0,o,oe);for(ge in o)oe=o[ge],ue=a[ge],!o.hasOwnProperty(ge)||oe===ue||oe===void 0&&ue===void 0||Jd(t,n,ge,oe,o,ue);return}}for(var J in a)oe=a[J],a.hasOwnProperty(J)&&oe!=null&&!o.hasOwnProperty(J)&&nn(t,n,J,null,o,oe);for(_e in o)oe=o[_e],ue=a[_e],!o.hasOwnProperty(_e)||oe===ue||oe==null&&ue==null||nn(t,n,_e,oe,o,ue)}function Cx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],f=u.transferSize,y=u.initiatorType,N=u.duration;if(f&&N&&Cx(y)){for(y=0,N=u.responseEnd,o+=1;o<a.length;o++){var G=a[o],ae=G.startTime;if(ae>N)break;var ge=G.transferSize,_e=G.initiatorType;ge&&Cx(_e)&&(G=G.responseEnd,y+=ge*(G<N?1:(N-ae)/(G-ae)))}if(--o,n+=8*(f+y)/(u.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var $d=null,eh=null;function cu(t){return t.nodeType===9?t:t.ownerDocument}function Rx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Nx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function th(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var nh=null;function fS(){var t=window.event;return t&&t.type==="popstate"?t===nh?!1:(nh=t,!0):(nh=null,!1)}var Dx=typeof setTimeout=="function"?setTimeout:void 0,dS=typeof clearTimeout=="function"?clearTimeout:void 0,Ux=typeof Promise=="function"?Promise:void 0,hS=typeof queueMicrotask=="function"?queueMicrotask:typeof Ux<"u"?function(t){return Ux.resolve(null).then(t).cat
vendor: 13,731 bytes, line 26
26ch(pS)}:Dx;function pS(t){setTimeout(function(){throw t})}function Rs(t){return t==="head"}function Lx(t,n){var a=n,o=0;do{var u=a.nextSibling;if(t.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(u),vo(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Pl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Pl(a);for(var f=a.firstChild;f;){var y=f.nextSibling,N=f.nodeName;f[sa]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=y}}else a==="body"&&Pl(t.ownerDocument.body);a=u}while(a);vo(n)}function Ox(t,n){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function ih(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ih(a),ki(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function mS(t,n,a,o){for(;t.nodeType===1;){var u=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[sa])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=Pi(t.nextSibling),t===null)break}return null}function gS(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Pi(t.nextSibling),t===null))return null;return t}function Px(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Pi(t.nextSibling),t===null))return null;return t}function ah(t){return t.data==="$?"||t.data==="$~"}function sh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function xS(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Pi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var rh=null;function Ix(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return Pi(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Fx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function zx(t,n,a){switch(n=cu(a),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Pl(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ki(t)}var Ii=new Map,Bx=new Set;function uu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ja=j.d;j.d={f:vS,r:_S,D:yS,C:bS,L:SS,m:MS,X:TS,S:ES,M:AS};function vS(){var t=ja.f(),n=tu();return t||n}function _S(t){var n=ji(t);n!==null&&n.tag===5&&n.type==="form"?ng(n):ja.r(t)}var mo=typeof document>"u"?null:document;function Hx(t,n,a){var o=mo;if(o&&typeof n=="string"&&n){var u=Ft(n);u='link[rel="'+t+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Bx.has(u)||(Bx.add(u),t={rel:t,crossOrigin:a,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),Vn(n,"link",t),mt(n),o.head.appendChild(n)))}}function yS(t){ja.D(t),Hx("dns-prefetch",t,null)}function bS(t,n){ja.C(t,n),Hx("preconnect",t,n)}function SS(t,n,a){ja.L(t,n,a);var o=mo;if(o&&t&&n){var u='link[rel="preload"][as="'+Ft(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Ft(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Ft(a.imageSizes)+'"]')):u+='[href="'+Ft(t)+'"]';var f=u;switch(n){case"style":f=go(t);break;case"script":f=xo(t)}Ii.has(f)||(t=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),Ii.set(f,t),o.querySelector(u)!==null||n==="style"&&o.querySelector(Il(f))||n==="script"&&o.querySelector(Fl(f))||(n=o.createElement("link"),Vn(n,"link",t),mt(n),o.head.appendChild(n)))}}function MS(t,n){ja.m(t,n);var a=mo;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+Ft(o)+'"][href="'+Ft(t)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=xo(t)}if(!Ii.has(f)&&(t=v({rel:"modulepreload",href:t},n),Ii.set(f,t),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Fl(f)))return}o=a.createElement("link"),Vn(o,"link",t),mt(o),a.head.appendChild(o)}}}function ES(t,n,a){ja.S(t,n,a);var o=mo;if(o&&t){var u=ra(o).hoistableStyles,f=go(t);n=n||"default";var y=u.get(f);if(!y){var N={loading:0,preload:null};if(y=o.querySelector(Il(f)))N.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},a),(a=Ii.get(f))&&oh(t,a);var G=y=o.createElement("link");mt(G),Vn(G,"link",t),G._p=new Promise(function(ae,ge){G.onload=ae,G.onerror=ge}),G.addEventListener("load",function(){N.loading|=1}),G.addEventListener("error",function(){N.loading|=2}),N.loading|=4,fu(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:N},u.set(f,y)}}}function TS(t,n){ja.X(t,n);var a=mo;if(a&&t){var o=ra(a).hoistableScripts,u=xo(t),f=o.get(u);f||(f=a.querySelector(Fl(u)),f||(t=v({src:t,async:!0},n),(n=Ii.get(u))&&lh(t,n),f=a.createElement("script"),mt(f),Vn(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function AS(t,n){ja.M(t,n);var a=mo;if(a&&t){var o=ra(a).hoistableScripts,u=xo(t),f=o.get(u);f||(f=a.querySelector(Fl(u)),f||(t=v({src:t,async:!0,type:"module"},n),(n=Ii.get(u))&&lh(t,n),f=a.createElement("script"),mt(f),Vn(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function Gx(t,n,a,o){var u=(u=Z.current)?uu(u):null;if(!u)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=go(a.href),a=ra(u).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=go(a.href);var f=ra(u).hoistableStyles,y=f.get(t);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,y),(f=u.querySelector(Il(t)))&&!f._p&&(y.instance=f,y.state.loading=5),Ii.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ii.set(t,a),f||wS(u,t,a,y.state))),n&&o===null)throw Error(s(528,""));return y}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=xo(a),a=ra(u).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function go(t){return'href="'+Ft(t)+'"'}function Il(t){return'link[rel="stylesheet"]['+t+"]"}function kx(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function wS(t,n,a,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Vn(n,"link",a),mt(n),t.head.appendChild(n))}function xo(t){return'[src="'+Ft(t)+'"]'}function Fl(t){return"script[async]"+t}function Vx(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Ft(a.href)+'"]');if(o)return n.instance=o,mt(o),o;var u=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),mt(o),Vn(o,"style",u),fu(o,a.precedence,t),n.instance=o;case"stylesheet":u=go(a.href);var f=t.querySelector(Il(u));if(f)return n.state.loading|=4,n.instance=f,mt(f),f;o=kx(a),(u=Ii.get(u))&&oh(o,u),f=(t.ownerDocument||t).createElement("link"),mt(f);var y=f;return y._p=new Promise(function(N,G){y.onload=N,y.onerror=G}),Vn(f,"link",o),n.state.loading|=4,fu(f,a.precedence,t),n.instance=f;case"script":return f=xo(a.src),(u=t.querySelector(Fl(f)))?(n.instance=u,mt(u),u):(o=a,(u=Ii.get(f))&&(o=v({},a),lh(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),mt(u),Vn(u,"link",o),t.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,fu(o,a.precedence,t));return n.instance}function fu(t,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,y=0;y<o.length;y++){var N=o[y];if(N.dataset.precedence===n)f=N;else if(f!==u)break}f?f.parentNode.insertBefore(t,f.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function oh(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function lh(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var du=null;function jx(t,n,a){if(du===null){var o=new Map,u=du=new Map;u.set(a,o)}else u=du,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),u=0;u<a.length;u++){var f=a[u];if(!(f[sa]||f[mn]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=t+y;var N=o.get(y);N?N.push(f):o.set(y,[f])}}return o}function Xx(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function CS(t,n,a){if(a===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Wx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function RS(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=go(o.href),f=n.querySelector(Il(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=hu.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=f,mt(f);return}f=n.ownerDocument||n,o=kx(o),(u=Ii.get(u))&&oh(o,u),f=f.createElement("link"),mt(f);var y=f;y._p=new Promise(function(N,G){y.onload=N,y.onerror=G}),Vn(f,"link",o),a.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=hu.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var ch=0;function NS(t,n){return t.stylesheets&&t.count===0&&mu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+n);0<t.imgBytes&&ch===0&&(ch=62500*uS());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>ch?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function hu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var pu=null;function mu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,pu=new Map,n.forEac
vendor: 9,858 bytes, line 26
26h(DS,t),pu=null,hu.call(t))}function DS(t,n){if(!(n.state.loading&4)){var a=pu.get(t);if(a)var o=a.get(null);else{a=new Map,pu.set(t,a);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var y=u[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),o=y)}o&&a.set(null,o)}u=n.instance,y=u.getAttribute("data-precedence"),f=a.get(y)||o,f===o&&a.set(null,u),a.set(y,u),this.count++,o=hu.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),n.state.loading|=4}}var zl={$$typeof:F,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function US(t,n,a,o,u,f,y,N,G){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qe(0),this.hiddenUpdates=qe(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function qx(t,n,a,o,u,f,y,N,G,ae,ge,_e){return t=new US(t,n,a,y,G,ae,ge,_e,N),n=1,f===!0&&(n|=24),f=xi(3,null,null,n),t.current=f,f.stateNode=t,n=kf(),n.refCount++,t.pooledCache=n,n.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:n},Wf(f),t}function Yx(t){return t?(t=qr,t):qr}function Qx(t,n,a,o,u,f){u=Yx(u),o.context===null?o.context=u:o.pendingContext=u,o=vs(n),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=_s(t,o,n),a!==null&&(ci(a,t,n),gl(a,t,n))}function Kx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function uh(t,n){Kx(t,n),(t=t.alternate)&&Kx(t,n)}function Zx(t){if(t.tag===13||t.tag===31){var n=ar(t,67108864);n!==null&&ci(n,t,67108864),uh(t,67108864)}}function Jx(t){if(t.tag===13||t.tag===31){var n=Si();n=pi(n);var a=ar(t,n);a!==null&&ci(a,t,n),uh(t,n)}}var gu=!0;function LS(t,n,a,o){var u=B.T;B.T=null;var f=j.p;try{j.p=2,fh(t,n,a,o)}finally{j.p=f,B.T=u}}function OS(t,n,a,o){var u=B.T;B.T=null;var f=j.p;try{j.p=8,fh(t,n,a,o)}finally{j.p=f,B.T=u}}function fh(t,n,a,o){if(gu){var u=dh(o);if(u===null)Zd(t,n,o,xu,a),ev(t,o);else if(IS(u,t,n,a,o))o.stopPropagation();else if(ev(t,o),n&4&&-1<PS.indexOf(t)){for(;u!==null;){var f=ji(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=Ne(f.pendingLanes);if(y!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;y;){var G=1<<31-Ge(y);N.entanglements[1]|=G,y&=~G}fa(f),(jt&6)===0&&($c=Ht()+500,Ul(0))}}break;case 31:case 13:N=ar(f,2),N!==null&&ci(N,f,2),tu(),uh(f,2)}if(f=dh(o),f===null&&Zd(t,n,o,xu,a),f===u)break;u=f}u!==null&&o.stopPropagation()}else Zd(t,n,o,null,a)}}function dh(t){return t=pf(t),hh(t)}var xu=null;function hh(t){if(xu=null,t=Vi(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=d(n),t!==null)return t;t=null}else if(a===31){if(t=h(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return xu=t,null}function $x(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zt()){case P:return 2;case T:return 8;case ee:case se:return 32;case he:return 268435456;default:return 32}default:return 32}}var ph=!1,Ns=null,Ds=null,Us=null,Bl=new Map,Hl=new Map,Ls=[],PS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ev(t,n){switch(t){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":Ds=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":Bl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hl.delete(n.pointerId)}}function Gl(t,n,a,o,u,f){return t===null||t.nativeEvent!==f?(t={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},n!==null&&(n=ji(n),n!==null&&Zx(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),t)}function IS(t,n,a,o,u){switch(n){case"focusin":return Ns=Gl(Ns,t,n,a,o,u),!0;case"dragenter":return Ds=Gl(Ds,t,n,a,o,u),!0;case"mouseover":return Us=Gl(Us,t,n,a,o,u),!0;case"pointerover":var f=u.pointerId;return Bl.set(f,Gl(Bl.get(f)||null,t,n,a,o,u)),!0;case"gotpointercapture":return f=u.pointerId,Hl.set(f,Gl(Hl.get(f)||null,t,n,a,o,u)),!0}return!1}function tv(t){var n=Vi(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){t.blockedOn=n,ls(t.priority,function(){Jx(a)});return}}else if(n===31){if(n=h(a),n!==null){t.blockedOn=n,ls(t.priority,function(){Jx(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function vu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=dh(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);hf=o,a.target.dispatchEvent(o),hf=null}else return n=ji(a),n!==null&&Zx(n),t.blockedOn=a,!1;n.shift()}return!0}function nv(t,n,a){vu(t)&&a.delete(n)}function FS(){ph=!1,Ns!==null&&vu(Ns)&&(Ns=null),Ds!==null&&vu(Ds)&&(Ds=null),Us!==null&&vu(Us)&&(Us=null),Bl.forEach(nv),Hl.forEach(nv)}function _u(t,n){t.blockedOn===n&&(t.blockedOn=null,ph||(ph=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,FS)))}var yu=null;function iv(t){yu!==t&&(yu=t,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){yu===t&&(yu=null);for(var n=0;n<t.length;n+=3){var a=t[n],o=t[n+1],u=t[n+2];if(typeof o!="function"){if(hh(o||a)===null)continue;break}var f=ji(a);f!==null&&(t.splice(n,3),n-=3,dd(f,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function vo(t){function n(G){return _u(G,t)}Ns!==null&&_u(Ns,t),Ds!==null&&_u(Ds,t),Us!==null&&_u(Us,t),Bl.forEach(n),Hl.forEach(n);for(var a=0;a<Ls.length;a++){var o=Ls[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Ls.length&&(a=Ls[0],a.blockedOn===null);)tv(a),a.blockedOn===null&&Ls.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],f=a[o+1],y=u[Un]||null;if(typeof f=="function")y||iv(a);else if(y){var N=null;if(f&&f.hasAttribute("formAction")){if(u=f,y=f[Un]||null)N=y.formAction;else if(hh(u)!==null)continue}else N=y.action;typeof N=="function"?a[o+1]=N:(a.splice(o,3),o-=3),iv(a)}}}function av(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function mh(t){this._internalRoot=t}bu.prototype.render=mh.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,o=Si();Qx(a,o,t,n,null,null)},bu.prototype.unmount=mh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Qx(t.current,2,null,t,null,null),tu(),n[Wn]=null}};function bu(t){this._internalRoot=t}bu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Aa();t={blockedOn:null,target:t,priority:n};for(var a=0;a<Ls.length&&n!==0&&n<Ls[a].priority;a++);Ls.splice(a,0,t),a===0&&tv(t)}};var sv=e.version;if(sv!=="19.2.4")throw Error(s(527,sv,"19.2.4"));j.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=m(n),t=t!==null?_(t):null,t=t===null?null:t.stateNode,t};var zS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};
26if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{de=Su.inject(zS),pe=Su}catch{}}return kl.createRoot=function(t,n){if(!l(t))throw Error(s(299));var a=!1,o="",u=dg,f=hg,y=pg;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=qx(t,1,!1,null,null,a,o,null,u,f,y,av),t[Wn]=n.current,Kd(t),new mh(n)},kl.hydrateRoot=function(t,n,a){if(!l(t))throw Error(s(299));var o=!1,u="",f=dg,y=hg,N=pg,G=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(G=a.formState)),n=qx(t,1,!0,n,a??null,o,u,G,f,y,N,av),n.context=Yx(null),a=n.current,o=Si(),o=pi(o),u=vs(o),u.callback=null,_s(a,u,o),a=o,n.current.lanes=a,Ve(n,a),fa(n),t[Wn]=n.current,Kd(t),new bu(n)},kl.version="19.2.4",kl}var uv;function WS(){if(uv)return xh.exports;uv=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),xh.exports=XS(),xh.exports}var qS=WS();const YS=GS(qS),QS="modulepreload",KS=function(r){return"/"+r},fv={},vn=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let d=function(m){return Promise.all(m.map(_=>Promise.resolve(_).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),p=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));l=d(i.map(m=>{if(m=KS(m),m in fv)return;fv[m]=!0;const _=m.endsWith(".css"),v=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":QS,_||(g.as="script"),g.crossOrigin="",g.href=m,p&&g.setAttribute("nonce",p),document.head.appendChild(g),_)return new Promise((b,A)=>{g.addEventListener("load",b),g.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return e().catch(c)})},ZS=({cartCount:r,isLoggedIn:e,onCartClick:i,onAccountClick:s,onLogoClick:l,onProductsClick:c,onDashboardClick:d,onStoriesClick:h,onJourneyClick:p,onSearch:m,categories:_=[],onCategoryClick:v,announcements:g=[],onMenuStateChange:b,products:A,blogPosts:D,events:E,onProductClick:M,onBlogClick:z,onEventClick:F})=>{const[C,I]=ye.useState(!1),[L,H]=ye.useState(!1),[w,O]=ye.useState(!1),[V,k]=ye.useState(""),[$,me]=ye.useState(0),fe=ye.useRef(null),te=ye.useRef(null),{scrollY:B}=O_(),[j,Y]=ye.useState(!1);P_(B,"change",Z=>{const we=B.getPrevious()||0;Z>we&&Z>150?Y(!0):Y(!1)}),ye.useEffect(()=>{const Z=we=>{fe.current&&!fe.current.contains(we.target)&&O(!1)};return document.addEventListener("mousedown",Z),()=>document.removeEventListener("mousedown",Z)},[]),ye.useEffect(()=>{if(g.length>1){const Z=setInterval(()=>{me(we=>(we+1)%g.length)},5e3);return()=>clearInterval(Z)}},[g.length]),ye.useEffect(()=>{C&&te.current&&te.current.focus()},[C]),ye.useEffect(()=>{L?(document.body.style.overflow="hidden",b==null||b(!0)):(document.body.style.overflow="unset",b==null||b(!1))},[L,b]);const ce=Z=>{Z.preventDefault(),V.trim()&&(m(V),I(!1),k(""))},Se=()=>H(!1),Ce=(A||[]).filter(Z=>(Z.name||"").toLowerCase().includes((V||"").toLowerCase())||(Z.description||"").toLowerCase().includes((V||"").toLowerCase())).slice(0,4),Ae=(D||[]).filter(Z=>(Z.title||"").toLowerCase().includes((V||"").toLowerCase())||(Z.excerpt||"").toLowerCase().includes((V||"").toLowerCase())).slice(0,3),je=(E||[]).filter(Z=>(Z.title||"").toLowerCase().includes((V||"").toLowerCase())||(Z.summary||"").toLowerCase().includes((V||"").toLowerCase())).slice(0,3),dt=(V||"").length>1&&(Ce.length>0||Ae.length>0||je.length>
260),ft=g.length>0;return x.jsxs(x.Fragment,{children:[x.jsxs(na.div,{variants:{visible:{y:0},hidden:{y:"-100%"}},animate:j?"hidden":"visible",transition:{duration:.35,ease:"easeInOut"},className:"sticky top-0 z-[1000] w-full",children:[ft&&x.jsx("div",{className:"bg-[#008a45] text-white px-4 text-center overflow-hidden min-h-[40px] lg:min-h-[44px] flex items-center justify-center relative",children:x.jsx("div",{className:"max-w-7xl mx-auto w-full relative min-h-[40px] lg:min-h-[44px]",children:g.map((Z,we)=>x.jsx("div",{className:`absolute inset-0 flex items-center justify-center transition-all duration-700 ease-in-out ${we===$?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"}`,children:x.jsx("p",{className:"text-[10px] lg:text-[12px] font-black tracking-[0.25em] uppercase whitespace-nowrap overflow-hidden text-ellipsis pt-1",children:Z})},we))})}),x.jsx("nav",{className:"bg-white/80 backdrop-blur-md border-b border-slate-200 ",children:x.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative",children:[x.jsxs("div",{className:"hidden lg:grid grid-cols-[1fr_auto_1fr] items-center h-24",children:[x.jsxs("div",{className:"flex items-center gap-10 font-black text-[13px] tracking-widest text-slate-800 transition-all duration-300",children:[x.jsx("button",{onClick:p,className:"hover:text-primary transition-colors uppercase force-anton tracking-wide [word-spacing:0.02em]",style:{fontSize:"22px"},children:"OUR JOURNEY"}),x.jsxs("div",{className:"relative group/menu",ref:fe,children:[x.jsxs("button",{onClick:()=>O(!w),className:`hover:text-primary transition-colors uppercase force-anton tracking-wide [word-spacing:0.02em] flex items-center gap-1 ${w?"text-primary":""}`,style:{fontSize:"22px"},children:["PRODUCTS ",x.jsx("span",{className:"material-symbols-outlined text-[18px] font-bold",children:"expand_more"})]}),x.jsx("div",{className:`absolute top-full left-0 mt-2 w-56 bg-white border border-slate-100 rounded-xl shadow-xl transition-all duration-200 origin-top-left ${w?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-2 pointer-events-none"}`,children:x.jsxs("div",{className:"p-2 py-3",children:[x.jsx("button",{onClick:()=>{c(),O(!1)},className:"w-full text-left px-4 py-2 hover:bg-primary/5 hover:text-primary transition-colors rounded-lg font-bold text-[12px] uppercase",children:"Shop All"}),x.jsx("div",{className:"h-px bg-slate-100 my-2"}),_.map(Z=>x.jsx("button",{onClick:()=>{v==null||v(Z.name),O(!1)},className:"w-full text-left px-4 py-2 hover:bg-primary/5 hover:text-primary transition-colors rounded-lg font-bold text-[12px] uppercase",children:Z.name},Z.id||Z.name))]})})]})]}),x.jsx("div",{className:"flex justify-center transition-all duration-300 z-[60]",children:x.jsx("button",{onClick:l,className:"flex items-center group pointer-events-auto",children:x.jsx("img",{src:"/logos/Pinobite-logo.png",alt:"Pinobite Logo",className:"h-14 w-auto object-contain"})})}),x.jsxs("div",{className:"flex items-center justify-end gap-6",children:[x.jsx("button",{onClick:()=>I(!C),className:`w-10 h-10 rounded-full flex items-center justify-center transition-all duration-300 ${C?"!bg-primary !text-white shadow-lg":"hover:bg-slate-100 !text-slate-800"} group`,"aria-label":"Search",children:x.jsx("span",{className:"material-symbols-outlined text-[24px]",children:"search"})}),x.jsx("button",{onClick:s,className:`flex items-center justify-center w-10 h-10 rounded-full transition-colors ${e?"!text-primary bg-primary/10":"!text-slate-800 hover:bg-slate-100"}`,children:x.jsx("span",{className:"material-symbols-outlined text-[24px]",children:e?"account_circle":"person"})}),x.jsxs("button",{onClick:i,className:"bg-[#c5f82a] text-[#0b3d2e] px-5 py-2.5 rounded-lg force-anton text-[22px] leading-none tracking-wide hover:brightness-95 transition-all uppercase flex items-center justify-center min-w-[120px]",children:["CART (",r,")"]})]})]}),x.jsxs("div",{className:"lg:hidden grid grid-cols-3 items-center h-20 relative",children:[x.jsx("div",{className:"flex items-center",children:x.jsx("button",{onClick:()=>I(!C),className:`flex items-center justify-center w-10 h-10 transition-all duration-300 ${C?"!text-primary scale-110":"!text-slate-700"}`,"aria-label":"Search",children:x.jsx("span",{className:"material-symbols-outlined text-[26px]",children:C?"close"
26:"search"})})}),x.jsx("div",{className:"flex justify-center",children:x.jsx("button",{onClick:l,className:"flex items-center",children:x.jsx("img",{src:"/logos/Pinobite-logo.png",alt:"Pinobite Logo",className:"h-12 w-auto object-contain"})})}),x.jsx("div",{className:"flex items-center justify-end gap-3",children:x.jsx("button",{onClick:()=>H(!0),className:"w-11 h-11 bg-[#0b3d2e] texture-overlay texture-speckles !text-white rounded-lg flex items-center justify-center shadow-lg active:scale-95 transition-transform relative overflow-hidden","aria-label":"Open menu",children:x.jsx("span",{className:"material-symbols-outlined text-[28px] relative z-10 !text-white",children:"menu"})})})]}),x.jsx(Yo,{children:C&&x.jsx(na.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.4,ease:[.04,.62,.23,.98]},className:"overflow-hidden border-t border-slate-50",children:x.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8 relative",children:[x.jsxs("form",{onSubmit:ce,className:"relative flex items-center group",children:[x.jsx("span",{className:"absolute left-6 material-symbols-outlined !text-slate-400 group-focus-within:!text-primary transition-colors",children:"search"}),x.jsx("input",{ref:te,type:"text",value:V,onChange:Z=>k(Z.target.value),placeholder:"Search for healthy snacks...",className:"w-full pl-16 pr-24 py-5 bg-white border-2 border-slate-200 focus:border-primary rounded-[28px] text-slate-900 placeholder:text-slate-400 placeholder:font-anton outline-none transition-all font-anton text-xl shadow-lg"}),x.jsxs("div",{className:"absolute right-4 flex items-center gap-2",children:[V&&x.jsx("button",{type:"button",onClick:()=>k(""),className:"p-2 hover:bg-slate-100 rounded-full !text-slate-400 transition-colors",children:x.jsx("span",{className:"material-symbols-outlined text-xl",children:"backspace"})}),x.jsx("button",{type:"button",onClick:()=>I(!1),className:"p-2 hover:bg-primary/10 rounded-full !text-slate-400 hover:!text-primary transition-colors",children:x.jsx("span",{className:"material-symbols-outlined text-2xl",children:"close"})})]})]}),x.jsxs("div",{className:`
27                    mt-8 space-y-8 max-h-[50vh] overflow-y-auto custom-scroll pr-2 transition-all duration-300
28                    ${dt?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none hidden"}
29                  `,children:[Ce.length>0&&x.jsxs("div",{className:"space-y-4",children:[x.jsxs("h4",{className:"text-[12px] font-anton uppercase tracking-[0.2em] !text-slate-400 flex items-center gap-2 px-2",children:[x.jsx("span",{className:"w-8 h-px bg-slate-100"}),"Products"]}),x.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Ce.map(Z=>x.jsxs("div",{onClick:()=>{M(Z),I(!1),k("")},className:"flex items-center gap-4 p-3 bg-white border border-slate-100 rounded-2xl cursor-pointer hover:border-primary/30 hover:shadow-md transition-all group",children:[x.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-xl overflow-hidden flex-shrink-0",children:x.jsx("img",{src:Z.image,alt:Z.name,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-500"})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("h5",{className:"font-bold text-sm uppercase text-slate-900 truncate group-hover:text-primary transition-colors",children:Z.name}),x.jsxs("p",{className:"text-primary font-bold text-xs",children:["Rs. ",Z.price]})]}),x.jsx("span",{className:"material-symbols-outlined !text-slate-300 group-hover:!text-primary group-hover:translate-x-1 transition-all",children:"chevron_right"})]},Z.id))})]}),x.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[Ae.length>0&&x.jsxs("div",{className:"space-y-4",children:[x.jsxs("h4",{className:"text-[12px] font-anton uppercase tracking-[0.2em] !text-slate-400 flex items-center gap-2 px-2",children:[x.jsx("span",{className:"w-8 h-px bg-slate-100"}),"Insights"]}),x.jsx("div",{className:"space-y-2",children:Ae.map(Z=>x.jsxs("div",{onClick:()=>{z(Z),I(!1),k("")},className:"flex items-center gap-3 p-2 hover:bg-slate-50 rounded-xl cursor-pointer transition-all group",children:[x.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-lg overflow-hidden flex-shrink-0",children:x.jsx("img",{src:Z.image,alt:Z.title,className:"w-full h-full object-cover"})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("h5",{className:"font-bold text-[13px] text-slate-900 truncate",children:Z.title}),x.jsxs("p",{className:"text-[9px] text-slate-400 font-bold uppercase tracking-widest",children:[Z.type," • ",Z.readTime]})]})]}
29,Z.id))})]}),je.length>0&&x.jsxs("div",{className:"space-y-4",children:[x.jsxs("h4",{className:"text-[12px] font-anton uppercase tracking-[0.2em] !text-slate-400 flex items-center gap-2 px-2",children:[x.jsx("span",{className:"w-8 h-px bg-slate-100"}),"Community"]}),x.jsx("div",{className:"space-y-2",children:je.map(Z=>x.jsxs("div",{onClick:()=>{F(Z),I(!1),k("")},className:"p-3 bg-slate-50/50 border border-slate-100 rounded-xl cursor-pointer hover:bg-slate-100 transition-all",children:[x.jsx("h5",{className:"font-bold text-[13px] text-slate-900 mb-1",children:Z.title}),x.jsxs("div",{className:"flex justify-between items-center",children:[x.jsxs("p",{className:"text-[9px] text-slate-400 font-bold uppercase tracking-widest flex items-center gap-1",children:[x.jsx("span",{className:"material-symbols-outlined text-[12px]",children:"location_on"}),Z.location]}),x.jsx("span",{className:"text-[9px] font-black text-primary uppercase",children:Z.date})]})]},Z.id))})]})]}),!dt&&V.length>1&&x.jsxs("div",{className:"text-center py-12",children:[x.jsx("span",{className:"material-symbols-outlined text-6xl text-slate-100 mb-4 font-variation-settings: 'wght' 200",children:"sentiment_dissatisfied"}),x.jsxs("p",{className:"text-slate-400 font-bold text-lg",children:['No results found for "',V,'"']}),x.jsx("p",{className:"text-slate-300 text-[10px] font-black uppercase tracking-widest mt-2",children:"Try different keywords"})]})]})]})})})]})})]}),x.jsxs("div",{className:`lg:hidden fixed inset-0 z-[9999] transition-opacity duration-500 ${L?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[x.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:Se,"aria-hidden":"true"}),x.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-full max-w-[340px] bg-[#0b3d2e] text-white shadow-2xl transition-transform duration-500 ease-out z-10 ${L?"translate-x-0":"translate-x-full"}`,children:[x.jsx("div",{className:"!absolute inset-0 texture-overlay texture-speckles pointer-events-none z-0"}),x.jsxs("div",{className:"flex flex-col h-full relative z-20 px-8 pt-12 pb-10",children:[x.jsxs("div",{className:"flex items-center justify-between mb-12",children:[x.jsxs("div",{className:"flex items-center gap-6",children:[x.jsx("a",{href:"tel:+918882828282",className:"text-white/90 hover:text-white transition-colors",children:x.jsx("span",{className:"material-symbols-outlined text-[24px]",children:"call"})}),x.jsx("a",{href:"mailto:[email protected]",className:"text-white/90 hover:text-white transition-colors",children:x.jsx("span",{className:"material-symbols-outlined text-[24px]",children:"mail"})})]}),x.jsx("button",{onClick:Se,className:"w-12 h-12 border-2 border-white/40 flex items-center justify-center rounded-sm hover:border-white transition-colors active:scale-90",children:x.jsx("span",{className:"material-symbols-outlined text-[28px]",children:"close"})})]}),x.jsxs("div",{className:"flex-1 space-y-4",children:[x.jsx("p",{className:"text-white/50 font-anton text-[10px] tracking-[0.2em] mb-4 uppercase",children:"COLLECTIONS"}),x.jsxs("div",{className:"space-y-3",children:[_.map(Z=>x.jsx("button",{onClick:()=>{v==null||v(Z.name),Se()},className:"block font-bold text-base text-white/80 hover:text-white transition-colors",children:Z.name},Z.id||Z.name)),x.jsx("button",{onClick:()=>{s(),Se()},className:"block font-bold text-base text-white/80 hover:text-white transition-colors pt-4",children:e?"ACCOUNT SETTINGS":"LOG IN / SIGN UP"})]})]}),x.jsxs("div",{className:"flex items-center gap-8 pt-8 border-t border-white/10 mt-auto",children:[x.jsx("a",{href:"https://www.facebook.com/profile.php?id=61574254086582",target:"_blank",rel:"noopener noreferrer",className:"text-white/70 hover:text-white active:scale-90 transition-all",children:x.jsx("i",{className:"fa-brands fa-facebook-f text-xl"})}),x.jsx("a",{href:"https://www.instagram.com/pino.bite/",target:"_blank",rel:"noopener noreferrer",className:"text-white/70 hover:text-white active:scale-90 transition-all",children:x.jsx("i",{className:"fa-brands fa-instagram text-xl"})})]})]})]})]})]})},JS=()=>"https://pinobite.com",ct=JS(),On=r=>{if(!r||typeof r!="string")return;let e=r.trim(),i=e;i.startsWith("/media/")?i=i.slice(7):i.startsWith("media/")?i=i.slice(6):i.startsWith("/")&&(i=i.slice(1));const l=(h=>{let p=h.replace(/[\r\n\s]+/g,"");if(p==="data:;base64,="||p==="data:,"||p==="data:;base64,")return null;const m=v=>v==="data:;base64,="||v==="data:,"||v==="data:;base64,"?null:v.startsWith("data:")?v.length<20&&v.includes("base64")?null:v:null;for(let v=0;v<3;v++){const g=m(p);if(g)return g;if(p.toLowerCase().startsWith("data%"))try{p=decodeURIComponent(p)}catch{break}else break}const _=m(p);if(_)return _;try{const v=decodeURIComponent(h),g=m(v.replace(/[\r\n\s]+/g,""));if(g)return g}catch{}return null})(i);if(l)return l;if(e.startsWith("http")){const h=e.toLowerCase();if(h.includes("/media/data%")||h.includes("/media/data:")){const p=e.indexOf("/media/");if(p!==-1){let m=e.slice(p+7).replace(/[\r\n\s]+/g,"");try{for(let _=0;_<3;_++)(m.includes("%25")||m.toLowerCase().includes("%3a"))&&(m=decodeURIComponent(m));return m.replace(/[\r\n\s]+/g,"")}catch{return m.replace(/[\r\n\s]+/g,"")}}}try{const p=new URL(e);if(p.hostname==="localhost"){const m=new URL(ct);return p.hostname=m.hostname,p.port=m.port,p.toString()}}catch{}return e}if(e.startsWith("<svg")||e.startsWith("<?xml"))return e;if(e.length>1e3){console.warn("getMediaUrl: Received an unusually long path. Potential 414 error prevented.",e.substring(0,50)+"...");return}if(e.startsWith("/assets/")||e.startsWith("/logos/")||e.startsWith("/3D-assets/"))return e;let c=e.startsWith("/")?e:`/${e}`;return!c.startsWith("/media/")&&!c.startsWith("/assets/")&&!c.startsWith("/logos/")&&!c.startsWith("/3D-assets/")&&(c=`/media${c}`),`${ct.endsWith("/")?ct.slice(0,-1):ct}${c}`},$S=r=>{if(!r)return"/3D-assets/AmericanNuts.glb";const e=r.toLowerCase();return e.includes("american")?"/3D-assets/AmericanNuts.glb":e.includes("dark")&&e.includes("muesli")?"/3D-assets/Dark-Chocolate-Berries-Almonds-Muesli.glb":e.includes("dark")||e.includes("almond")?"/3D-assets/Dark Chocolate with almond.glb":e.includes("chocolate")&&e.includes("muesli")?"/3D-assets/Chocolate-Muesli.glb":e.includes("coffee")||e.includes("mocha")?"/3D-assets/Coffee-Mocha-Oats.glb":e.includes("mango")?"/3D-assets/mango-with-chia.glb":e.includes("pineapple")?"/3D-assets/pineapple.glb":e.includes("strawberry")?"/3D-assets/strawberry-with-chia.glb":e.includes("natural")||e.includes("classic")?"/3D-assets/natural.glb":e.includes("muesli")?"/3D-assets/Chocolate-Muesli.glb":e.includes("oat")?"/3D-assets/Coffee-Mocha-Oats.glb":"/3D-assets/AmericanNuts.glb"},e1=({slides:r=[]})=>{const[e,i]=ye.useState(0),[s,l]=ye.useState(0),[c,d]=ye.useState(!1);ye.useEffect(()=>{const v=()=>d(window.innerWidth<768);return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const h=r.filter(v=>v.isActive),p=ye.useCallback(()=>
29{l(1),i(v=>(v+1)%h.length)},[h.length]),m=ye.useCallback(()=>{l(-1),i(v=>(v-1+h.length)%h.length)},[h.length]);if(ye.useEffect(()=>{var b;if(h.length<=1)return;const v=(((b=h[e])==null?void 0:b.displayDuration)||5)*1e3,g=setTimeout(p,v);return()=>clearTimeout(g)},[e,p,h]),h.length===0)return null;const _={enter:v=>({x:v>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:v=>({x:v<0?"100%":"-100%",opacity:0})};return x.jsxs("div",{className:"relative w-full overflow-hidden bg-background-light flex items-center justify-center",children:[x.jsx("img",{src:On(c&&h[e].mobileImage?h[e].mobileImage:h[e].image||h[e].backgroundImage),alt:"placeholder",className:"w-full h-auto invisible block"}),x.jsx(Yo,{initial:!1,custom:s,children:x.jsx(na.div,{custom:s,variants:_,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.5}},className:"absolute inset-0 w-full h-full",children:x.jsx("img",{src:On(c&&h[e].mobileImage?h[e].mobileImage:h[e].image||h[e].backgroundImage),alt:`Slide ${e+1}`,className:"w-full h-full object-cover"})},e)}),h.length>1&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:v=>{v.stopPropagation(),m()},className:"absolute left-4 top-1/2 -translate-y-1/2 z-20 w-12 h-12 rounded-full bg-black/20 hover:bg-black/40 flex items-center justify-center transition-all backdrop-blur-sm",style:{color:"#f9bc15"},children:x.jsx("span",{className:"material-symbols-outlined",style:{color:"#f9bc15",fontVariationSettings:'"wght" 900'},children:"chevron_left"})}),x.jsx("button",{onClick:v=>{v.stopPropagation(),p()},className:"absolute right-4 top-1/2 -translate-y-1/2 z-20 w-12 h-12 rounded-full bg-black/20 hover:bg-black/40 flex items-center justify-center transition-all backdrop-blur-sm",style:{color:"#f9bc15"},children:x.jsx("span",{className:"material-symbols-outlined",style:{color:"#f9bc15",fontVariationSettings:'"wght" 900'},children:"chevron_right"})}),x.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 z-20 flex gap-2",children:h.map((v,g)=>x.jsx("button",{onClick:()=>{l(g>e?1:-1),i(g)},className:`h-1.5 rounded-full transition-all duration-300 ${e===g?"w-8 bg-white":"w-2 bg-white/40"}`},g))})]})]})},t1=[{id:"Oats",display:"Oats",image:"/assets/oats-display.jpg",mobileImage:"homepage/oats.png",count:"0 Varieties",bgClass:"bg-[#f0fdf4]",borderClass:"border-green-100 hover:border-green-300",textClass:"text-green-950",accentClass:"bg-green-600",rotation:"rotate-1",imagePosition:"object-bottom"},{id:"Muesli",display:"Muesli",image:"/assets/muesli-display.jpg",mobileImage:"homepage/musli.png",count:"0 Blends",bgClass:"bg-[#fefce8]",borderClass:"border-yellow-100 hover:border-yellow-300",textClass:"text-yellow-950",accentClass:"bg-yellow-500",rotation:"-rotate-2",imagePosition:"object-bottom"},{id:"Peanut Butter",display:"Peanut Butter",image:"/assets/peanut-butter-display.jpg",mobileImage:"homepage/peanutbutter.png",count:"0 Flavors",bgClass:"bg-[#fff7ed]",borderClass:"border-orange-100 hover:border-orange-300",textClass:"text-orange-950",accentClass:"bg-orange-600",rotation:"rotate-2",imagePosition:"object-center"}],n1=({onCategoryClick:r,products:e=[]})=>{et.useRef(null);const[i,s]=et.useState(!1),[l,c]=et.useState(0),[d,h]=et.useState(0),[p,m]=et.useState(0),_=g=>{p<25&&r(g)},v=t1.map(g=>{const b=e.filter(D=>{var E;return((E=D.category)==null?void 0:E.toLowerCase())===g.id.toLowerCase()}).length;let A="Flavors";return g.id==="Muesli"&&(A="Blends"),g.id==="Oats"&&(A="Varieties"),g.id==="Peanut Butter"&&(A="Flavors"),b===1&&(A==="Varieties"?A="Variety":A=A.substring(0,A.length-1)),{...g,count:`${b} ${A}`}});return x.jsx("section",{className:"pt-20 pb-4 md:pb-12 md:pt-24 bg-whiteboard texture-overlay texture-speckles relative z-20 overflow-hidden",children:x.jsxs("div",{className:"max-w-7xl mx-auto px-4 relative z-10",children:[x.jsxs("div",{className:"text-center mb-8 md:mb-24 relative",children:[x.jsx("span",{className:"font-handdrawn text-2xl md:text-3xl text-primary transform rotate-6 inline-block mb-2 absolute -top-10 left-1/2 translate-x-[20px] md:translate-x-[90px] lg:translate-x-[120px] drop-shadow-sm",children:"Pick your fav!"}),x.jsxs("h2",{className:"font-normal uppercase !font-anton text-textured-green leading-tight tracking-normal [word-spacing:0.05em] text-center text-[40px] lg:text-[100px] lg:leading-[110px] lg:-mb-[12px] lg:pb-[12px] lg:font-bold",children:["Explore What You ",x.jsx("span",{className:"font-bold",children:"Love"})]}),x.jsx("div",{className:"w-16 md:w-24 h-1.5 md:h-2 bg-[#0b3d2e] mx-auto mt-4 md:mt-6 rounded-full"})]}),x.jsx("div",{className:"hidden lg:grid grid-cols-3 gap-12",children:v.map((g,b)=>x.jsxs("div",{onClick:()=>r(g.id),className:`relative h-[550px] rounded-[48px] border-2 ${g.bgClass} ${g.borderClass} p-8 cursor-pointer group transition-[transform,shadow,border-color] duration-500 hover:shadow-[0_30px_60px_-15px_rgba(0,0,0,0.1)] hover:-translate-y-2 overflow-hidden flex flex-col`,style:{transform:"translateZ(0)",isolation:"isolate"},children:[x.jsxs("div",{className:"flex justify-between items-start z-2
290",children:[x.jsx("span",{className:`px-4 py-2 rounded-full bg-white/60 backdrop-blur-md text-xs font-bold uppercase tracking-widest ${g.textClass} shadow-sm font-anton`,children:g.count}),x.jsx("div",{className:`w-14 h-14 rounded-full bg-white flex items-center justify-center shadow-sm group-hover:scale-110 transition-transform duration-300 ${g.textClass}`,children:x.jsx("span",{className:"material-symbols-outlined text-2xl",children:"arrow_forward"})})]}),x.jsx("div",{className:"relative z-20 mt-8",children:x.jsx("h3",{className:`text-6xl uppercase leading-[1.1] tracking-wider ${g.textClass} !font-anton drop-shadow-[0_2px_8px_rgba(255,255,255,0.8)]`,children:g.display.split(" ").map((A,D)=>x.jsx("span",{className:"block",children:A},D))})}),x.jsxs("div",{className:"absolute bottom-0 left-0 w-full h-[75%] z-10 transition-transform duration-700 group-hover:scale-105 group-hover:rotate-1 origin-bottom",children:[x.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[140%] h-[120%] bg-white rounded-t-full opacity-40 blur-xl"}),x.jsx("img",{src:On(g.image),alt:g.display,className:`w-full h-full object-cover ${g.imagePosition||"object-center"} drop-shadow-2xl`,style:{maskImage:"linear-gradient(to top, black 70%, transparent 100%)",WebkitMaskImage:"linear-gradient(to top, black 70%, transparent 100%)"},draggable:!1})]}),x.jsx("div",{className:"absolute bottom-8 left-0 w-full flex justify-center z-30 opacity-0 group-hover:opacity-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-500",children:x.jsx("button",{className:`px-10 py-4 rounded-full !text-white font-black uppercase text-sm tracking-widest shadow-xl hover:scale-105 active:scale-95 transition-transform ${g.accentClass}`,children:"Shop Collection"})})]},g.id))}),x.jsxs("div",{className:"lg:hidden mt-4 mb-0 px-4 flex flex-col pb-8 ",children:[v.filter(g=>g.id==="Oats").map(g=>x.jsxs("div",{className:"relative w-full pt-0 pb-2",children:[x.jsx("img",{src:On(g.mobileImage||g.image),alt:g.display,className:"block h-auto w-full max-w-full"}),x.jsx("div",{className:"absolute inset-0 flex flex-col justify-center pl-6 pr-4 pt-7 pb-0 pointer-events-none",children:x.jsxs("div",{onClick:()=>_(g.id),className:"pointer-events-auto cursor-pointer self-start active:scale-[0.95] transition-transform duration-300 drop-shadow-[0_4px_10px_rgba(0,0,0,0.3)]",children:[x.jsx("h3",{className:"text-white text-3xl sm:text-4xl font-normal uppercase tracking-widest font-anton mb-1 leading-none",children:g.display}),x.jsxs("p",{className:"text-white/90 text-[13px] sm:text-sm font-bold tracking-wider uppercase font-satoshi mt-1",children:["Explore ",g.count]})]})})]},g.id)),v.filter(g=>g.id==="Muesli").map(g=>x.jsxs("div",{className:"relative w-full pt-0 pb-4 -mt-3",children:[x.jsx("img",{src:On(g.mobileImage||g.image),alt:g.display,className:"block h-auto w-[104%] mx-auto max-w-none"}),x.jsx("div",{className:"absolute inset-0 flex flex-col justify-center pl-5 pr-4 pt-2 pb-0 pointer-events-none",children:x.jsxs("div",{onClick:()=>_(g.id),className:"pointer-events-auto cursor-pointer self-start active:scale-[0.95] transition-transform duration-300 drop-shadow-[0_4px_10px_rgba(0,0,0,0.3)]",children:[x.jsx("h3",{className:"text-white text-3xl sm:text-4xl font-normal uppercase tracking-widest font-anton mb-1 leading-none",children:g.display}),x.jsxs("p",{className:"text-white/90 text-[13px] sm:text-sm font-bold tracking-wider uppercase font-satoshi mt-1",children:["Explore ",g.count]})]})})]},g.id)),v.filter(g=>g.id==="Peanut Butter").map(g=>x.jsxs("div",{className:"relative w-full pt-0 pb-0",children:[x.jsx("img",{src:On(g.mobileImage||g.image),alt:g.display,className:"block h-auto w-[108%] mx-auto max-w-none"}),x.jsx("div",{className:"absolute inset-0 flex flex-col justify-center pl-4 pr-4 pt-0 pb-11 pointer-events-none",children:x.jsxs("div",{onClick:()=>_(g.id),className:"pointer-events-auto cursor-pointer self-start active:scale-[0.95] transition-transform duration-300 drop-shadow-[0_4px_10px_rgba(0,0,0,0.3)]",children:[x.jsx("h3",{className:"text-white text-3xl sm:text-4xl font-normal uppercase tracking-widest font-anton mb-1 leading-none",children:g.display}),x.jsxs("p",{className:"text-white/90 text-[13px] sm:text-sm font-bold tracking-wider up
29percase font-satoshi mt-1",children:["Explore ",g.count]})]})})]},g.id))]})]})})},i1=(r,e)=>{let i;return function(...s){i||(r.apply(this,s),i=!0,setTimeout(()=>i=!1,e))}},a1=({product:r})=>{const e=ye.useRef(null),i=ye.useRef(null),[s,l]=ye.useState(!1);ye.useEffect(()=>{const p=e.current;if(!p)return;const m=Za.quickTo(p,"x",{duration:1,ease:"power2.out"}),_=Za.quickTo(p,"y",{duration:1,ease:"power2.out"}),v=Za.quickTo(p,"rotateX",{duration:1,ease:"power2.out"}),g=Za.quickTo(p,"rotateY",{duration:1,ease:"power2.out"}),b=Za.to(p,{y:"-=35",rotateX:"+=2",duration:3,ease:"sine.inOut",yoyo:!0,repeat:-1}),A=i1(E=>{const{clientX:M,clientY:z}=E,{left:F,top:C,width:I,height:L}=p.getBoundingClientRect(),H=(M-(F+I/2))/25,w=(z-(C+L/2))/25;m(H*.5),_(w*.5),v(-w),g(H)},16),D=()=>{m(0),_(0),v(0),g(0),Za.to(p,{rotateY:0,rotateX:0,x:0,y:0,duration:1.5,ease:"elastic.out(1, 0.3)",overwrite:!0})};return window.addEventListener("mousemove",A),p.addEventListener("mouseleave",D),()=>{b.kill(),window.removeEventListener("mousemove",A),p.removeEventListener("mouseleave",D)}},[]);const c=r!=null&&r.model3d?On(r.model3d):$S(r==null?void 0:r.name);ye.useEffect(()=>{l(!1)},[c]),ye.useEffect(()=>{const p=i.current;if(!p||!c)return;const m=()=>l(!0);return p.addEventListener("error",m),()=>p.removeEventListener("error",m)},[c]);const d=[{title:"Naturally Sweetened",desc:"Contains only 1.6g natural sugar and just 2.24g added brown sugar per serving — a better sweet choice!"},{title:"Good Source of Fiber",desc:"Each serving offers 2.56g of dietary fiber for better digestion and fullness."},{title:"Energy Dense",desc:"Each serving packs 184.64 Kcal of clean energy — great for active lifestyles and fitness goals."}],h=[{title:"High Protein Power",desc:"Delivers 8.64g protein per serving, supporting muscle growth and energy."},{title:"Healthy Fats Only",desc:"Rich in monounsaturated and polyunsaturated fats, promoting heart health — with zero trans fat & cholesterol."},{title:"Low Sodium",desc:"Contains just 49.6mg of sodium per serving, making it suitable for low-salt diets."}];return x.jsxs("section",{className:"py-8 md:py-12 lg:py-[60px] relative overflow-hidden bg-whiteboard texture-overlay texture-speckles",children:[x.jsx("style",{children:`
30        @keyframes floatShadowLarge {
31          0% { transform: scale(1); opacity: 0.3; }
32          50% { transform: scale(0.7); opacity: 0.1; }
33          100% { transform: scale(1); opacity: 0.3; }
34        }
35      `}),x.jsxs("div",{className:"max-w-7xl mx-auto px-4 relative z-10",children:[x.jsxs("div",{className:"text-center mb-6 md:mb-16 lg:mb-24 relative pt-4",children:[x.jsx("span",{className:"font-handdrawn text-2xl sm:text-3xl text-primary transform -rotate-3 inline-block absolute -top-3 sm:-top-6 md:-top-10 left-1/2 -translate-x-1/2 md:-translate-x-[130px] lg:-translate-x-[110px] z-10 whitespace-nowrap drop-shadow-sm font-bold",children:"Our New Flavor"}),x.jsx("div",{className:"relative inline-block px-2 sm:px-6",children:x.jsx("h2",{className:"font-normal text-textured-green tracking-tight sm:tracking-normal [word-spacing:0.05em] !font-anton uppercase text-[46px] sm:text-[60px] md:text-[80px] lg:text-[100px] leading-[1.05] lg:leading-[110px]",children:"Latest product"})})]}),x.jsxs("div",{className:"grid lg:grid-cols-3 gap-8 md:gap-12 lg:gap-20 items-center mt-[-1rem] md:mt-[-2rem]",children:[x.jsx("div",{className:"space-y-12 md:space-y-24 text-center lg:text-right order-2 lg:order-1",children:d.map((p,m)=>x.jsxs("div",{className:"group px-4 md:px-0 flex flex-col items-center lg:items-end",children:[x.jsx("h3",{className:"text-[22px] lg:text-[26px] force-anton text-[#0b3d2e] mb-1 md:mb-2 uppercase leading-tight md:leading-none md:whitespace-nowrap text-center lg:text-right",children:p.title}),x.jsx("p",{className:"text-[16px] text-slate-500 font-medium leading-relaxed font-satoshi text-center lg:text-right max-w-[320px]",children:p.desc})]},m))}),x.jsxs("div",{className:"order-1 lg:order-2 flex flex-col items-center justify-center relative",style:{perspective:"1000px"},children:[x.jsxs("div",{ref:e,className:"w-full max-w-[650px]",style:{transformStyle:"preserve-3d",position:"relative",zIndex:2},children:[s?x.jsx("div",{className:"flex items-center justify-center h-[400px] md:h-[500px] lg:h-[600px]",children:x.jsx("img",{src:On((r==null?void 0:r.image)||""),alt:(r==null?void 0:r.name)||"Product",className:"max-w-full max-h-full object-contain"})}):x.jsx("model-viewer",{ref:i,src:c,alt:"3D Interactive Jar","shadow-intensity":"0","camera-controls":!0,"auto-rotate":!0,"rotation-per-second":"15deg","disable-zoom":!0,"disable-tap":!0,"interaction-prompt":"auto",reveal:"auto","touch-action":"pan-y",style:{width:"100%",outline:"none"},className:"h-[400px] md:h-[500px] lg:h-[600px]",children:x.jsx("div",{slot:"poster",className:"flex flex-col items-center justify-center h-full",children:x.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent roun
35ded-full animate-spin"})})}),x.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden rounded-full opacity-30 mix-blend-overlay",children:x.jsx("div",{className:"absolute w-[200%] h-[200%] bg-gradient-to-tr from-transparent via-white/40 to-transparent -rotate-45 animate-[light-sweep_8s_linear_infinite]"})})]}),x.jsx("div",{className:"absolute bottom-[40px] md:bottom-[60px] lg:bottom-[80px] left-1/2 -translate-x-1/2",style:{width:"min(200px, 60vw)",height:"20px",background:"radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 75%)",borderRadius:"100%",filter:"blur(8px)",animation:"floatShadowLarge 6s ease-in-out infinite",zIndex:1,pointerEvents:"none"}})]}),x.jsx("div",{className:"space-y-12 md:space-y-24 text-center lg:text-left order-3",children:h.map((p,m)=>x.jsxs("div",{className:"group px-4 md:px-0 flex flex-col items-center lg:items-start",children:[x.jsx("h3",{className:"text-[22px] lg:text-[26px] force-anton text-[#0b3d2e] mb-1 md:mb-2 uppercase leading-tight md:leading-none md:whitespace-nowrap text-center lg:text-left",children:p.title}),x.jsx("p",{className:"text-[16px] text-slate-500 font-medium leading-relaxed font-satoshi text-center lg:text-left max-w-[320px]",children:p.desc})]},m))})]})]})]})},Vl=[{feature:"Cost",ghar:"Mom's Pampering",pino:"Moderate",junk:"Too High (Not Deserved)"},{feature:"Time",ghar:"20 Mins",pino:"2 Minutes",junk:"Instant (But Regret)"},{feature:"Taste",ghar:"Delicious",pino:"Flavorful",junk:"Artificial Flavors"},{feature:"Nutrition",ghar:"High",pino:"Very High",junk:"Not Nutritious at All"},{feature:"Ingredients",ghar:"100% Natural",pino:"100% Natural",junk:"Far from Natural"},{feature:"Protein",ghar:"Moderate",pino:"Very High",junk:"Protein? What's That?"}],s1=()=>x.jsx("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles overflow-hidden font-satoshi",children:x.jsxs("div",{className:"max-w-6xl mx-auto px-4",children:[x.jsx("div",{className:"text-center mb-16 md:mb-24",children:x.jsxs("div",{className:"inline-block relative",children:[x.jsx("div",{className:"absolute inset-0 bg-[#c7e9d9] transform -rotate-1 scale-110 rounded-lg"}),x.jsxs("h2",{className:"relative text-[2.8rem] sm:text-5xl md:text-7xl lg:text-[72px] !font-anton italic tracking-tight md:tracking-wide [word-spacing:0.05em] leading-[0.95] md:leading-[1.1] text-slate-900 uppercase px-6 md:px-12 py-4",children:["Pinobite ",x.jsx("span",{className:"text-primary italic block md:inline",children:"vs."})," Others"]})]})}),x.jsxs("div",{className:"hidden md:grid grid-cols-4 gap-0 items-start mt-12 mx-auto max-w-[1050px]",children:[x.jsxs("div",{className:"flex flex-col mt-6 pr-2 lg:pr-8",children:[x.jsx("div",{className:"h-[100px] lg:h-[120px] flex items-center justify-start pb-4",children:x.jsx("h3",{className:"font-anton text-3xl lg:text-[32px] text-slate-800 uppercase tracking-tight",children:"FEATURES"})}),x.jsx("div",{className:"flex flex-col",children:Vl.map((r,e)=>x.jsx("div",{className:"min-h-[64px] lg:min-h-[72px] py-2 flex items-center font-bold text-slate-800 text-sm lg:text-[15px]",children:r.feature},e))})]}),x.jsxs("div",{className:"flex flex-col bg-white rounded-l-[2rem] shadow-[0_8px_30px_rgb(0,0,0,0.04)] border-y border-l border-slate-100 mt-6 z-0",children:[x.jsxs("div",{className:"h-[100px] lg:h-[120px] p-4 lg:p-6 text-center flex flex-col justify-center items-center",children:[x.jsx("span",{className:"font-bold text-[10px] lg:text-[11px] text-slate-400 uppercase tracking-[0.15em] mb-1.5",children:"Traditional"}),x.jsx("span",{className:"font-black text-sm lg:text-[15px] text-slate-800 uppercase tracking-widest leading-tight",children:"Home Food"})]}),x.jsx("div",{className:"flex flex-col",children:Vl.map((r,e)=>x.jsx("div",{className:"min-h-[64px] lg:min-h-[72px] py-2 px-4 flex items-center justify-center text-center text-slate-500 text-[13px] lg:text-[15px] font-medium border-t border-slate-100/80",children:r.ghar},e))})]}),x.jsxs("div",{className:"flex flex-col bg-[#f4fcf7] rounded-[2rem] lg:rounded-[2.5rem] shadow-[0_20px_40px_rgb(0,138,69,0.15)] border border-primary/20 mt-0 relative z-10 pb-4 lg:pb-6",children:[x.jsx("div",{className:"absolute top-[-12px] left-1/2 -translate-x-1/2 z-40 bg-secondary text-slate-900 px-6 py-1.5 rounded-full text-[10px] lg:text-[11px] font-black shadow-md whitespace-nowrap",children:"THE BEST"}),x.jsx("div",{className:"h-[124px] lg:h-[144px] bg-primary text-white rounded-t-[2rem] lg:rounded-t-[2.5rem] p-6 text-center flex items-center justify-center",children:x.jsx("span",{className:"font-black text-xl lg:text-[22px] tracking-[0.15em] uppercase",children:"PINOBITE"})}),x.jsx("div",{className:"flex flex-col",children:Vl.map((r,e)=>x.jsx("div",{className:"min-h-[64px] lg:min-h-[72px] py-2 px-4 flex items-center justify-center text-center font-bold text-primary text-[13px] lg:text-[15px] border-t border-primary/10",children:r.pino},e))})]}),x.jsxs("div",{className:"flex flex-col bg-white rounded-r-[2rem] shadow-[0_8px_30px_rgb(0,0,0,0.04)] border-y border-r border-slate-100 mt-6 z-0",children:[x.jsx("div",{className:"h-[100px] lg:h-[120px] p-4 lg:p-6 text-center flex flex-col justify-center items-center",children:x.jsx("span",{className:"font-black text-sm lg:text-[15px] text-slate-800 uppercase tracking-widest leading-tight",children:"Junk Food"})}),x.jsx("div",{className:"flex flex-col",children:Vl.map((r,e)=>x.jsx("div",{className:"min-h-[64px] lg:min-h-[72px] py-2 px-4 flex items-center justify-center text-center text-slate-500 text-[13px] lg:text-[15px] font-medium border-t border-slate-100/80",children:r.junk},e))})]})]}),x.jsx("div",{className:"md:hidden",children:x.jsxs("div",{className:"relative rounded-[2rem] border-4 border-primary/20 overflow-hidden shadow-2xl bg-white flex flex-col w-full mx-auto max-w-md",children:[x.jsxs("div",{className:"absolute inset-0 flex pointer-events-none z-0",children:[x.jsx("div",{className:"w-[33.33%] h-full bg-[#99d4c0]"}),x.jsx("div",{className:"w-[33.33%] h-full bg-[#b2dfcc]"}),x.jsx("div",{className:"w-[33.33%] h-full bg-[#0b3d2e]"})]}),x.jsxs("div",{className:"relative z-10 grid grid-cols-3 pt-6 pb-2",children:[x.jsxs("div",{className:"px-2 text-center text-[10px] sm:text-[11px] font-black text-[#0b3d2e] leading-tight flex items-center justify-center uppercase tracking-widest",children:["Ghar Ka",x.jsx("br",{}),"Khaana"]}),x.jsx("div",{className:"px-2 text-center text-[10px] sm:text-[11px] font-black text-[#0b3d2e] leading-tight flex items-center justify-center uppercase tracking-widest",children:"Junk Food"}),x.jsx("div",{className:"px-2 text-center flex items-center justify-center",children:x.jsx("span",{className:"font-handdrawn text-[26px] text-white transform -rotate-2 -mt-2",children:"Pinobite"})})]}),x.jsx("div",{className:"relative z-10 flex flex-col pb-8 pt-2",children:Vl.map((r,e)=>x.jsxs("div",{className:"flex flex-col w-full",children:[x.jsx("div",{className:"px-4 py-2 w-full",children:x.jsx("div",{className:"bg-[#fff0eb] w-full rounded-xl py-2 flex items-center justify-center shadow-sm",children:x.jsx("span",{className:"font-black text-[13px] sm:text-sm text-[#0b3d2e] uppercase tracking-widest",children:r.feature})})}),x.jsxs("div",{className:"grid grid-cols-3 text-center items-stretch w-full min-h-[60
35px]",children:[x.jsx("div",{className:"px-2 py-3 flex items-center justify-center text-[11px] sm:text-xs font-bold text-[#0b3d2e] leading-snug",children:r.ghar}),x.jsx("div",{className:"px-2 py-3 flex items-center justify-center text-[11px] sm:text-xs font-bold text-[#0b3d2e] leading-snug",children:r.junk}),x.jsx("div",{className:"px-2 py-3 flex items-center justify-center text-[11px] sm:text-xs font-black text-[#9cd92a] leading-snug",children:r.pino})]})]},e))})]})}),x.jsx("div",{className:"mt-16 md:mt-20 text-center",children:x.jsx("p",{className:"font-handdrawn text-2xl md:text-3xl text-slate-800",style:{fontFamily:'"Gochi Hand", cursive'},children:"made on trusted nutrition standards for family use 💚"})})]})}),r1=et.memo(s1),o1=()=>x.jsx("svg",{className:"w-8 h-8 text-amber-500",viewBox:"0 0 512 512",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:x.jsxs("g",{children:[x.jsx("path",{d:"M481.091,68.928c-40.235-45.742-93.628-58.255-154.403-36.173l9.588,26.396l-9.592-26.396h-0.008 c-5.463,1.994-11.059,4.277-16.644,6.827c-51.833,23.594-75.274,69.033-92.39,102.205c-5.092,9.88-12.016,23.312-15.796,26.87 c-10.663,4.959-20.811,8.902-31.541,13.068c-27.815,10.778-56.572,21.934-93.724,50.732C25.446,272.09,0.4,322.014,0.002,385.08 c-0.215,34.29,14.232,63.629,40.688,82.642c26.354,18.939,75.515,35.417,160.04,6.382c1.278-0.445,2.538-0.89,3.792-1.342 c73.725-26.781,106.24-82.072,123.707-111.78c3.536-6.004,7.539-12.817,9.444-14.981c5.892-6.679,20.748-14.603,39.538-24.639 c18.235-9.733,40.924-21.845,68.225-39.339c35.981-23.046,59.07-59.048,65.038-101.374 C516.331,138.999,505.071,96.183,481.091,68.928z M430.286,258.37c-59.419,38.064-97.041,50.19-113.672,69.048 c-16.415,18.606-38.838,88.854-121.684,118.942c-1.097,0.408-2.202,0.793-3.325,1.171c-108.175,37.174-163.88-4.506-163.517-62.273 c0.323-51.154,19.065-94.443,65.702-130.594c48.155-37.33,80.752-42.148,120.868-60.991 c27.004-12.675,37.404-96.837,107.015-128.526c5.004-2.283,9.866-4.277,14.592-5.99c61.064-22.186,99.506,0.771,123.73,28.324 C492.729,124.685,499.556,213.998,430.286,258.37z"}),x.jsx("path",{d:"M406.884,129.458c-2.386,4.263-0.874,9.644,3.373,12.031c4.254,2.386,9.628,0.874,12.022-3.38 c2.558-4.544,4.544-8.532,6.049-11.779c1.498-3.239,2.543-5.76,3.136-7.22c1.868-4.507-0.289-9.666-4.796-11.519 c-4.507-1.868-9.666,0.282-11.519,4.796c-0.6,1.438-1.498,3.618-2.839,6.508C410.976,121.787,409.197,125.36,406.884,129.458z"}),x.jsx("path",{d:"M202.676,327.966c3.202,3.677,8.776,4.055,12.456,0.845c10.738-9.354,21.4-18.902,31.815-28.316 c3.618-3.268,3.899-8.85,0.63-12.467c-3.272-3.625-8.85-3.899-12.471-0.63c-10.374,9.369-20.963,18.842-31.585,28.116 C199.848,318.715,199.47,324.297,202.676,327.966z"}),x.jsx("path",{d:"M304.884,224.925c-9.921,8.413-20.691,17.998-32.051,28.242c-3.618,3.262-3.903,8.85-0.634,12.468 c3.266,3.617,8.847,3.906,12.464,0.637c11.3-10.199,21.948-19.658,31.64-27.878c3.718-3.158,4.177-8.724,1.027-12.446 C314.176,222.234,308.605,221.774,304.884,224.925z"}),x.jsx("path",{d:"M164.791,347.935c-11.493,9.126-22.775,17.546-33.56,24.832c-4.043,2.736-5.11,8.214-2.38,12.253 c2.728,4.047,8.217,5.107,12.261,2.38c11.286-7.621,22.898-16.3,34.654-25.64c3.821-3.016,4.458-8.576,1.423-12.402 C174.157,345.541,168.6,344.904,164.791,347.935z"}),x.jsx("path",{d:"M377.672,168.056c-8.517,8.673-18.791,17.545-31.185,26.018c-4.025,2.75-5.059,8.25-2.301,12.268 c2.746,4.025,8.246,5.056,12.264,2.313c13.372-9.154,24.55-18.784,33.816-28.234c3.424-3.469,3.372-9.058-0.112-12.482 C386.685,164.528,381.089,164.579,377.672,168.056z"}),x.jsx("path",{d:"M88.694,395.976l-0.534,0.193c-6.163,2.246-11.801,3.618-16.704,4.092c-4.852,0.467-8.402,4.781-7.935,9.636 c0.47,4.856,4.788,8.406,9.64,7.939c6.816-0.674,13.813-2.446,21.03-5.063l0.612-0.229c4.573-1.683,6.916-6.761,5.229-11.334 C98.345,396.629,93.267,394.294,88.694,395.976z"}),x.jsx("path",{d:"M217.164,389.246c-2.294,1.854-4.648,3.625-7.064,5.315c-6.234,4.374-12.46,8.198-18.594,11.549 c-3.702,2.016-5.063,6.649-3.043,10.348c2.017,3.691,6.649,5.048,10.348,3.039c6.612-3.618,13.324-7.732,20.04-12.446 c2.709-1.898,5.329-3.876,7.876-5.93c3.28-2.632,3.798-7.427,1.156-10.712C225.247,387.126,220.444,386.607,217.164,389.246z"}),x.jsx("path",{d:"M155.988,421.238c-11.453,3.624-21.756,5.789-30.124,7.138c-4.155,0.682-6.983,4.596-6.312,8.747 c0.678,4.166,4.588,6.983,8.751,6.316c8.951-1.453,19.998-3.773,32.293-7.672c4.014-1.275,6.237-5.552,4.963-9.57 C164.287,422.187,160.002,419.963,155.988,421.238z"}),x.jsx("path",{d:"M272.41,333.8c-3.569-2.238-8.272-1.156-10.508,2.409c-5.3,8.458-11.24,17.19-17.927,25.604 c-2.62,3.284-2.072,8.087,1.226,10.711c3.295,2.616,8.094,2.075,10.712-1.23c7.142-8.984,13.394-18.183,18.91-26.982 C277.057,340.746,275.975,336.039,272.41,333.8z"}),x.jsx("path",{d:"M305.251,275.486c-6.604,4.529-12.142,9.132-16.07,14.692c-2.309,3.291-4.652,7.175-7.201,11.571 c-2.113,3.64-0.868,8.302,2.772,10.407c3.647,2.112,8.309,0.874,10.422-2.765c2.446-4.232,4.637-7.827,6.494-10.459 c2.135-3.098,6.349-6.894,12.175-10.838c3.476-2.379,4.378-7.116,2.009-10.592C313.479,274.018,308.738,273.121,305.251,275.486z"}),x.jsx("path",{d:"M423.429,199.218v-0.007c-5.344,7.628-12.075,14.766-20.6,20.74l-0.044,0.037 c-3.439,2.417-4.285,7.168-1.868,10.614c2.424,3.447,7.175,4.285,10.63,1.876l0.044-0.045 c10.126-7.093,18.102-15.581,24.328-24.476c2.409-3.447,1.579-8.198-1.876-10.622C430.597,194.926,425.838,195.764,423.429,199.218 z"}),x.jsx("path",{d:"M451.086,127.909c-4.218,0.023-7.606,3.454-7.584,7.657c0.008,0.378-0.059,13.342-4.544,29.688 c-1.112,4.054,1.282,8.25,5.344,9.362c4.055,1.111,8.242-1.283,9.362-5.338c5.152-18.842,5.077-33.334,5.085-33.793 C458.728,131.275,455.295,127.887,451.086,127.909z"}),x.jsx("path",{d:"M369.288,240.513c-9.636,5.293-19.214,10.199-28.25,14.847c-3.744,1.935-5.214,6.531-3.284,10.281 c1.927,3.736,6.53,5.212,10.274,3.277c9.014-4.64,18.71-9.606,28.598-15.04c3.691-2.03,5.041-6.664,3.01-10.355 C377.612,239.831,372.979,238.482,369.288,240.513z"}),x.jsx("path",{d:"M338.192,103.218c-3.461-3.425-9.058-3.388-12.482,0.081c-10.148,10.267-18.59,21.564-25.881,32.972 c-2.624,4.114-1.419,9.577,2.687,
3512.193c4.11,2.624,9.57,1.423,12.198-2.683c6.8-10.652,14.52-20.925,23.553-30.073 C341.694,112.239,341.658,106.65,338.192,103.218z"}),x.jsx("path",{d:"M374.699,89.935c2.713-1.23,5.522-2.387,8.413-3.439c7.205-2.61,14.988-4.648,23.468-5.974 c4.811-0.749,8.109-5.271,7.353-10.088c-0.756-4.818-5.278-8.11-10.095-7.354c-9.57,1.505-18.465,3.825-26.745,6.827 c-3.328,1.208-6.56,2.535-9.688,3.951c-4.44,2.024-6.404,7.257-4.388,11.698C365.033,89.986,370.266,91.944,374.699,89.935z"}),x.jsx("path",{d:"M271.809,223.606c7.161-9.777,13.302-22.423,20.266-36.381c2.172-4.366,0.393-9.659-3.973-11.83 c-4.366-2.179-9.662-0.393-11.842,3.973c-6.92,13.966-12.987,26.108-18.672,33.779c-2.887,3.921-2.046,9.444,1.879,12.342 C263.396,228.372,268.918,227.541,271.809,223.606z"}),x.jsx("path",{d:"M85.358,347.238c3.258-3.632,2.962-9.213-0.663-12.467c-3.624-3.262-9.21-2.972-12.468,0.652 c-10.655,11.89-19.009,23.928-23.524,36.336c-1.652,4.581,0.726,9.644,5.311,11.304c4.582,1.646,9.644-0.72,11.301-5.308 C68.584,368.602,75.614,358.039,85.358,347.238z"}),x.jsx("path",{d:"M192.143,267.554c12.768-7.22,24.795-13.439,35.047-18.257c4.41-2.068,6.308-7.323,4.236-11.742 c-2.075-4.41-7.331-6.308-11.745-4.239c-10.733,5.048-23.101,11.445-36.232,18.88c-4.244,2.402-5.738,7.782-3.332,12.03 C182.518,268.466,187.903,269.963,192.143,267.554z"}),x.jsx("path",{d:"M151.667,292.497c4.051-2.713,5.137-8.198,2.42-12.252c-2.709-4.048-8.195-5.13-12.249-2.424 c-11.334,7.606-22.53,15.663-33.072,24.009c-3.825,3.032-4.469,8.584-1.438,12.409c3.024,3.81,8.58,4.462,12.402,1.431 C129.833,307.67,140.667,299.865,151.667,292.497z"})]})}),l1=({reviews:r,showHeading:e=!0})=>{const i=r.filter(s=>s.rating>=4).slice(0,6);return x.jsx("section",{className:"py-[60px] bg-whiteboard overflow-hidden",children:x.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[e&&x.jsxs("div",{className:"text-center mb-0 relative",children:[x.jsx("span",{className:"font-handdrawn text-xl md:text-3xl text-primary transform -rotate-2 inline-block absolute -top-4 left-1/2 -translate-x-1/2 z-10 whitespace-nowrap",children:"Customer Spotlight"}),x.jsx("h2",{className:"text-4xl sm:text-5xl md:text-7xl lg:text-8xl !font-anton text-center mb-16 md:mb-28 text-textured-green uppercase leading-tight md:leading-normal tracking-wide [word-spacing:0.05em]",children:"What Our Community Says"})]}),x.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8",children:i.length>0?i.map((s,l)=>x.jsxs("div",{className:"bg-white p-5 rounded-[2.5rem] flex flex-col items-center text-center shadow-lg transition-all hover:scale-[1.02] border-4 border-transparent hover:border-primary/5",children:[x.jsx("div",{className:"w-full aspect-[4/3] bg-slate-100 rounded-[2rem] mb-6 overflow-hidden shadow-inner",children:x.jsx("img",{alt:s.userName,className:"w-full h-full object-cover",src:s.avatar||`https://ui-avatars.com/api/?name=${s.userName}&background=random`})}),x.jsx("div",{className:"flex gap-1 mb-6",children:[...Array(5)].map((c,d)=>x.jsx("div",{className:d<s.rating?"opacity-100":"opacity-20",children:x.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:x.jsx(o1,{})})},d))}),x.jsx("p",{className:"text-base font-medium text-[#4a2c2a] leading-relaxed mb-8 flex-1 px-2 line-clamp-4",children:s.comment}),x.jsx("div",{className:"mt-auto pb-6",children:x.jsx("h4",{className:"text-lg font-black text-[#1a2333] tracking-tight uppercase font-anton",children:s.userName})})]},l)):x.jsx("div",{className:"col-span-3 text-center py-20 bg-white/50 rounded-[3rem] border-4 border-dashed border-primary/20",children:x.jsx("p",{className:"font-anton text-3xl text-primary uppercase tracking-widest",children:"No reviews yet. Be the first!"})})})]})})},c1=()=>{const[r,e]=ye.useState(""),[i,s]=ye.useState("idle"),[l,c]=ye.useState(""),d=async h=>{var p;if(h.preventDefault(),!r){s("error"),c("Please enter your email address.");return}s("loading");try{const m=await fetch(`${ct}/api/newsletter/subscribe/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r})}),_=await m.json();m.ok?(s("success"),c(_.message||"Successfully subscribed!"),e("")):(s("error"),c(_.error||((p=_.email)==null?void 0:p[0])||"Failed to subscribe. Please try again."))}catch{s("error"),c("Network error. Please try again.")}};return x.jsx("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles px-4 md:px-6",children:x.jsx("div",{className:"max-w-7xl mx-auto",children:x.jsxs("div",{className:"bg-greenboard texture-overlay texture-speckles rounded-[40px] py-16 md:py-24 px-8 md:px-12 text-white overflow-hidden relative shadow-2xl",children:[x.jsxs("div",{className:"max-w-4xl mx-auto text-center relative z-10",children:[x.jsxs("h2",{className:"text-[2.2rem] sm:text-4xl md:text-7xl font-normal mb-6 uppercase tracking-normal [word-spacing:0.05em] !font-anton leading-[1.1] md:leading-[1.1] lg:text-[100px] lg:leading-[110px] lg:-mb-[12px] lg:pb-[12px] lg:font-bold",children:["Nuts about health?",x.jsx("br",{}),"Join our newsletter"]}),x.jsx("p",{className:"text-base md:text-xl mb-12 opacity-90 max-w-2xl mx-auto font-medium px-4 md:px-0",children:"Get exclusive recipes, health tips and 10% off your first order!"}),x.jsxs("form",{className:"flex flex-col sm:flex-row gap-4 max-w-lg mx-auto",onSubmit:d,children:[x.jsx("input",{className:"flex-1 px-8 py-5 rounded-3xl bg-[#082a20] text-white placeholder-white/50 focus:outline-none focus:ring-4 focus:ring-secondary/30 transition-all border border-white/20 font-bold font-satoshi",placeholder:"Enter your email",type:"email",value:r,onChange:h=>e(h.target.value),disabled:i==="loading"}),x.jsxs("button",{className:`px-10 py-5 rounded-3xl font-bold uppercase active:scale-95 font-satoshi relative overflow-hidden bg-[#0c4535] text-white border border-white/30 shadow-lg hover:border-white/60 transition-all ${i==="loading"?"opacity-70 cursor-not-allowed":""}`,disabled:i==="loading",children:[x.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3Cfe
35ColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E")`}}),x.jsx("span",{className:"relative z-10",children:i==="loading"?"SUBSCRIBING...":"SUBSCRIBE"})]})]}),l&&x.jsx("p",{className:`mt-6 text-sm font-black uppercase tracking-wider ${i==="success"?"text-green-200":i==="error"?"text-red-200":""}`,children:l})]}),x.jsx("span",{className:"absolute top-[-20px] left-[-20px] font-anton text-9xl opacity-10 rotate-12 select-none pointer-events-none",children:"YUM!"}),x.jsx("span",{className:"absolute bottom-[-20px] right-[-20px] font-anton text-9xl opacity-10 -rotate-12 select-none pointer-events-none",children:"FREE!"}),x.jsx("div",{className:"absolute inset-0 opacity-5 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 2px 2px, white 1px, transparent 0)",backgroundSize:"24px 24px"}})]})})})},u1=({fill:r="#0b3d2e",className:e,flipped:i=!1,inverseBg:s})=>{const l=ye.useRef(null),c=ye.useRef(null),d=ye.useRef(null),[h,p]=ye.useState(!0),m="M0 100 C 150 20, 250 180, 400 100 C 550 20, 650 180, 800 100 L 800 500 L 0 500 Z",_="M0 0 L 800 0 L 800 100 C 650 180, 550 20, 400 100 C 250 180, 150 20, 0 100 Z";return ye.useEffect(()=>{if(!d.current)return;const v=new IntersectionObserver(([g])=>p(g.isIntersecting),{threshold:.1});return v.observe(d.current),()=>v.disconnect()},[]),ye.useEffect(()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!h)return;const g=Za.to(l.current,{x:-800,duration:18,repeat:-1,ease:"none"}),b=Za.to(c.current,{y:-8,scaleY:1.08,skewX:1.5,duration:4,repeat:-1,yoyo:!0,ease:"sine.inOut",transformOrigin:"center bottom"});return()=>{g.kill(),b.kill()}},[h]),x.jsx("div",{ref:d,className:`relative overflow-hidden w-full h-full ${e||""}`,style:i?{transform:"scaleY(-1)"}:{},children:x.jsxs("svg",{viewBox:"0 0 1600 240",preserveAspectRatio:"none",className:"absolute top-0 left-0 w-[400%] md:w-[200%] h-full pointer-events-none overflow-visible",xmlns:"http://www.w3.org/2000/svg",children:[x.jsx("defs",{children:x.jsx("pattern",{id:"noisePattern",patternUnits:"userSpaceOnUse",width:"400",height:"400",children:x.jsx("image",{href:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E",width:"400",height:"400",preserveAspectRatio:"none"})})}),x.jsx("g",{ref:c,children:x.jsx("g",{ref:l,children:[0,1,2,3,4,5,6].map(v=>x.jsx("g",{transform:`translate(${v*800}, 0)`,children:s?x.jsx("path",{d:_,fill:s}):x.jsxs(x.Fragment,{children:[x.jsx("path",{d:m,fill:r,stroke:r,strokeWidth:"2"}),x.jsx("path",{d:m,fill:"url(#noisePattern)",style:{mixBlendMode:"overlay"}})]})},v))})})]})})};/**
36 * @license
37 * Copyright 2010-2026 Three.js Authors
38 * SPDX-License-Identifier: MIT
39 */const rm="185",f1=0,dv=1,d1=2,Yu=1,h1=2,Zl=3,$s=0,hi=1,es=2,ns=0,Lo=1,hv=2,pv=3,mv=4,p1=5,Sr=100,m1=101,g1=102,x1=103,v1=104,_1=200,y1=201,b1=202,S1=203,$h=204,ep=205,M1=206,E1=207,T1=208,A1=209,w1=210,C1=211,R1=212,N1=213,D1=214,tp=0,np=1,ip=2,Qo=3,ap=4,sp=5,rp=6,op=7,I_=0,U1=1,L1=2,ba=0,F_=1,z_=2,B_=3,H_=4,G_=5,k_=6,V_=7,j_=300,Ir=301,Ko=302,yh=303,bh=304,cf=306,lp=1e3,ts=1001,cp=1002,Xn=1003,O1=1004,Eu=1005,Kn=1006,Sh=1007,Er=1008,Gi=1009,X_=1010,W_=1011,ec=1012,om=1013,Ea=1014,_a=1015,ss=1016,lm=1017,cm=1018,tc=1020,q_=35902,Y_=35899,Q_=1021,K_=1022,ta=1023,rs=1026,Tr=1027,Z_=1028,um=1029,Fr=1030,fm=1031,dm=1033,Qu=33776,Ku=33777,Zu=33778,Ju=33779,up=35840,fp=35841,dp=35842,hp=35843,pp=36196,mp=37492,gp=37496,xp=37488,vp=37489,ef=37490,_p=37491,yp=37808,bp=37809,Sp=37810,Mp=37811,Ep=37812,Tp=37813,Ap=37814,wp=37815,Cp=37816,Rp=37817,Np=37818,Dp=37819,Up=37820,Lp=37821,Op=36492,Pp=36494,Ip=36495,Fp=36283,zp=36284,tf=36285,Bp=36286,P1=3200,gv=0,I1=1,ks="",Bi="srgb",nf="srgb-linear",af="linear",$t="srgb",_o=7680,xv=519,F1=512,z1=513,B1=514,hm=515,H1=516,G1=517,pm=518,k1=519,vv=35044,_v="300 es",ya=2e3,sf=2001;function V1(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function rf(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function j1(){const r=rf("canvas");return r.style.display="block",r}const yv={};function bv(...r){const e="THREE."+r.shift();console.log(e,...r)}function J_(r){const e=r[0];if(typeof e=="string"&&e.startsWith("TSL:")){const i=r[1];i&&i.isStackTrace?r[0]+=" "+i.getLocation():r[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return r}function ut(...r){r=J_(r);const e="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.warn(i.getError(e)):console.warn(e,...r)}}function Bt(...r){r=J_(r);const e="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.error(i.getError(e)):console.error(e,...r)}}function Oo(...r){const e=r.join(" ");e in yv||(yv[e]=!0,ut(...r))}function X1(r,e,i){return new Promise(function(s,l){function c(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:l();break;case r.TIMEOUT_EXPIRED:setTimeout(c,i);break;default:s()}}setTimeout(c,i)})}const W1={[tp]:np,[ip]:rp,[ap]:op,[Qo]:sp,[np]:tp,[rp]:ip,[op]:ap,[sp]:Qo};class Br{addEventListener(e,i){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(i)===-1&&s[e].push(i)}hasEventListener(e,i){const s=this._listeners;return s===void 0?!1:s[e]!==void 0&&s[e].indexOf(i)!==-1}removeEventListener(e,i){const s=this._listeners;if(s===void 0)return;const l=s[e];if(l!==void 0){const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}dispatchEvent(e){const i=this._listeners;if(i===void 0)return;const s=i[e.type];if(s!==void 0){e.target=this;const l=s.slice(0);for(let c=0,d=l.length;c<d;c++)l[c].call(this,e);e.target=null}}}const qn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
395","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Mh=Math.PI/180,Hp=180/Math.PI;function uc(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,i=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(qn[r&255]+qn[r>>8&255]+qn[r>>16&255]+qn[r>>24&255]+"-"+qn[e&255]+qn[e>>8&255]+"-"+qn[e>>16&15|64]+qn[e>>24&255]+"-"+qn[i&63|128]+qn[i>>8&255]+"-"+qn[i>>16&255]+qn[i>>24&255]+qn[s&255]+qn[s>>8&255]+qn[s>>16&255]+qn[s>>24&255]).toLowerCase()}function It(r,e,i){return Math.max(e,Math.min(i,r))}function q1(r,e){return(r%e+e)%e}function Eh(r,e,i){return(1-i)*r+i*e}function jl(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function ui(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const Mm=class Mm{constructor(e=0,i=0){this.x=e,this.y=i}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,i){return this.x=e,this.y=i,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const i=this.x,s=this.y,l=e.elements;return this.x=l[0]*i+l[3]*s+l[6],this.y=l[1]*i+l[4]*s+l[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,i){return this.x=It(this.x,e.x,i.x),this.y=It(this.y,e.y,i.y),this}clampScalar(e,i){return this.x=It(this.x,e,i),this.y=It(this.y,e,i),this}clampLength(e,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(It(s,e,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}
vendor: 37,007 bytes, line 39
39roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const i=Math.sqrt(this.lengthSq()*e.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(e)/i;return Math.acos(It(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,s=this.y-e.y;return i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this}lerpVectors(e,i,s){return this.x=e.x+(i.x-e.x)*s,this.y=e.y+(i.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this}rotateAround(e,i){const s=Math.cos(i),l=Math.sin(i),c=this.x-e.x,d=this.y-e.y;return this.x=c*s-d*l+e.x,this.y=c*l+d*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Mm.prototype.isVector2=!0;let Xt=Mm;class $o{constructor(e=0,i=0,s=0,l=1){this.isQuaternion=!0,this._x=e,this._y=i,this._z=s,this._w=l}static slerpFlat(e,i,s,l,c,d,h){let p=s[l+0],m=s[l+1],_=s[l+2],v=s[l+3],g=c[d+0],b=c[d+1],A=c[d+2],D=c[d+3];if(v!==D||p!==g||m!==b||_!==A){let E=p*g+m*b+_*A+v*D;E<0&&(g=-g,b=-b,A=-A,D=-D,E=-E);let M=1-h;if(E<.9995){const z=Math.acos(E),F=Math.sin(z);M=Math.sin(M*z)/F,h=Math.sin(h*z)/F,p=p*M+g*h,m=m*M+b*h,_=_*M+A*h,v=v*M+D*h}else{p=p*M+g*h,m=m*M+b*h,_=_*M+A*h,v=v*M+D*h;const z=1/Math.sqrt(p*p+m*m+_*_+v*v);p*=z,m*=z,_*=z,v*=z}}e[i]=p,e[i+1]=m,e[i+2]=_,e[i+3]=v}static multiplyQuaternionsFlat(e,i,s,l,c,d){const h=s[l],p=s[l+1],m=s[l+2],_=s[l+3],v=c[d],g=c[d+1],b=c[d+2],A=c[d+3];return e[i]=h*A+_*v+p*b-m*g,e[i+1]=p*A+_*g+m*v-h*b,e[i+2]=m*A+_*b+h*g-p*v,e[i+3]=_*A-h*v-p*g-m*b,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,i,s,l){return this._x=e,this._y=i,this._z=s,this._w=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,i=!0){const s=e._x,l=e._y,c=e._z,d=e._order,h=Math.cos,p=Math.sin,m=h(s/2),_=h(l/2),v=h(c/2),g=p(s/2),b=p(l/2),A=p(c/2);switch(d){case"XYZ":this._x=g*_*v+m*b*A,this._y=m*b*v-g*_*A,this._z=m*_*A+g*b*v,this._w=m*_*v-g*b*A;break;case"YXZ":this._x=g*_*v+m*b*A,this._y=m*b*v-g*_*A,this._z=m*_*A-g*b*v,this._w=m*_*v+g*b*A;break;case"ZXY":this._x=g*_*v-m*b*A,this._y=m*b*v+g*_*A,this._z=m*_*A+g*b*v,this._w=m*_*v-g*b*A;break;case"ZYX":this._x=g*_*v-m*b*A,this._y=m*b*v+g*_*A,this._z=m*_*A-g*b*v,this._w=m*_*v+g*b*A;break;case"YZX":this._x=g*_*v+m*b*A,this._y=m*b*v+g*_*A,this._z=m*_*A-g*b*v,this._w=m*_*v-g*b*A;break;case"XZY":this._x=g*_*v-m*b*A,this._y=m*b*v-g*_*A,this._z=m*_*A+g*b*v,this._w=m*_*v+g*b*A;break;default:ut("Quaternion: .setFromEuler() encountered an unknown order: "+d)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,i){const s=i/2,l=Math.sin(s);return this._x=e.x*l,this._y=e.y*l,this._z=e.z*l,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const i=e.elements,s=i[0],l=i[4],c=i[8],d=i[1],h=i[5],p=i[9],m=i[2],_=i[6],v=i[10],g=s+h+v;if(g>0){const b=.5/Math.sqrt(g+1);this._w=.25/b,this._x=(_-p)*b,this._y=(c-m)*b,this._z=(d-l)*b}else if(s>h&&s>v){const b=2*Math.sqrt(1+s-h-v);this._w=(_-p)/b,this._x=.25*b,this._y=(l+d)/b,this._z=(c+m)/b}else if(h>v){const b=2*Math.sqrt(1+h-s-v);this._w=(c-m)/b,this._x=(l+d)/b,this._y=.25*b,this._z=(p+_)/b}else{const b=2*Math.sqrt(1+v-s-h);this._w=(d-l)/b,this._x=(c+m)/b,this._y=(p+_)/b,this._z=.25*b}return this._onChangeCallback(),this}setFromUnitVectors(e,i){let s=e.dot(i)+1;return s<1e-8?(s=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*i.z-e.z*i.y,this._y=e.z*i.x-e.x*i.z,this._z=e.x*i.y-e.y*i.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,i){const s=this.angleTo(e);if(s===0)return this;const l=Math.min(1,i/s);return this.slerp(e,l),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,i){const s=e._x,l=e._y,c=e._z,d=e._w,h=i._x,p=i._y,m=i._z,_=i._w;return this._x=s*_+d*h+l*m-c*p,this._y=l*_+d*p+c*h-s*m,this._z=c*_+d*m+s*p-l*h,this._w=d*_-s*h-l*p-c*m,this._onChangeCallback(),this}slerp(e,i){let s=e._x,l=e._y,c=e._z,d=e._w,h=this.dot(e);h<0&&(s=-s,l=-l,c=-c,d=-d,h=-h);let p=1-i;if(h<.9995){const m=Math.acos(h),_=Math.sin(m);p=Math.sin(p*m)/_,i=Math.sin(i*m)/_,this._x=this._x*p+s*i,this._y=this._y*p+l*i,this._z=this._z*p+c*i,this._w=this._w*p+d*i,this._onChangeCallback()}else this._x=this._x*p+s*i,this._y=this._y*p+l*i,this._z=this._z*p+c*i,this._w=this._w*p+d*i,this.normalize();return this}slerpQuaternions(e,i,s){return this.copy(e).slerp(i,s)}random(){const e=2*Math.PI*Math.random(),i=2*Math.PI*Math.random(),s=Math.random(),l=Math.sqrt(1-s),c=Math.sqrt(s);return this.set(l*Math.sin(e),l*Math.cos(e),c*Math.sin(i),c*Math.cos(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,i=0){return this._x=e[i],this._y=e[i+1],this._z=e[i+2],this._w=e[i+3],this._onChangeCallback(),this}toArray(e=[],i=0){return e[i]=this._x,e[i+1]=this._y,e[i+2]=this._z,e[i+3]=this._w,e}fromBufferAttribute(e,i){return this._x=e.getX(i),this._y=e.getY(i),this._z=e.getZ(i),this._w=e.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Em=class Em{constructor(e=0,i=0,s=0){this.x=e,this.y=i,this.z=s}set(e,i,s){return s===void 0&&(s=this.z),this.x=e,this.y=i,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this.z=e.z+i.z,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this.z+=e.z*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this.z=e.z-i.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,i){return this.x=e.x*i.x,this.y=e.y*i.y,this.z=e.z*i.z,this}applyEuler(e){return this.applyQuaternion(Sv.setFromEuler(e))}applyAxisAngle(e,i){return this.applyQuaternion(Sv.setFromAxisAngle(e,i))}applyMatrix3(e){const i=this.x,s=this.y,l=this.z,c=e.elements;return this.x=c[0]*i+c[3]*s+c[6]*l,this.y=c[1]*i+c[4]*s+c[7]*l,this.z=c[2]*i+c[5]*s+c[8]*l,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const i=this.x,s=this.y,l=this.z,c=e.elements,d=1/(c[3]*i+c[7]*s+c[11]*l+c[15]);return this.x=(c[0]*i+c[4]*s+c[8]*l+c[12])*d,this.y=(c[1]*i+c[5]*s+c[9]*l+c[13])*d,this.z=(c[2]*i+c[6]*s+c[10]*l+c[14])*d,this}applyQuaternion(e){const i=this.x,s=this.y,l=this.z,c=e.x,d=e.y,h=e.z,p=e.w,m=2*(d*l-h*s),_=2*(h*i-c*l),v=2*(c*s-d*i);return this.x=i+p*m+d*v-h*_,this.y=s+p*_+h*m-c*v,this.z=l+p*v+c*_-d*m,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const i=this.x,s=this.y,l=this.z,c=e.elements;return this.x=c[0]*i+c[4]*s+c[8]*l,this.y=c[1]*i+c[5]*s+c[9]*l,this.z=c[2]*i+c[6]*s+c[10]*l,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,i){return this.x=It(this.x,e.x,i.x),this.y=It(this.y,e.y,i.y),this.z=It(this.z,e.z,i.z),this}clampScalar(e,i){return this.x=It(this.x,e,i),this.y=It(this.y,e,i),this.z=It(this.z,e,i),this}clampLength(e,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(It(s,e,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this.z+=(e.z-this.z)*i,this}lerpVectors(e,i,s){return this.x=e.x+(i.x-e.x)*s,this.y=e.y+(i.y-e.y)*s,this.z=e.z+(i.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,i){const s=e.x,l=e.y,c=e.z,d=i.x,h=i.y,p=i.z;return this.x=l*p-c*h,this.y=c*d-s*p,this.z=s*h-l*d,this}projectOnVector(e){const i=e.lengthSq();if(i===0)return this.set(0,0,0);const s=e.dot(this)/i;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return Th.copy(this).projectOnVector(e),this.sub(Th)}reflect(e){return this.sub(Th.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const i=Math.sqrt(this.lengthSq()*e.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(e)/i;return Math.acos(It(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,s=this.y-e.y,l=this.z-e.z;return i*i+s*s+l*l}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,i,s){const l=Math.sin(i)*e;return this.x=l*Math.sin(s),this.y=Math.cos(i)*e,this.z=l*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,i,s){return this.x=e*Math.sin(i),this.y=s,this.z=e*Math.cos(i),this}setFromMatrixPosition(e){const i=e.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(e){const i=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),l=this.setFromMatrixColumn(e,2).length();return this.x=i,this.y=s,this.z=l,this}setFromMatrixColumn(e,i){return this.fromArray(e.elements,i*4)}setFromMatrix3Column(e,i){return this.fromArray(e.elements,i*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this.z=e.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,i=Math.random()*2-1,s=Math.sqrt(1-i*i);return this.x=s*Math.cos(e),this.y=i,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Em.prototype.isVector3=!0;let le=Em;const Th=new le,Sv=new $o,Tm=class Tm{constructor(e,i,s,l,c,d,h,p,m){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,i,s,l,c,d,h,p,m)}set(e,i,s,l,c,d,h,p,m){const _=this.elements;return _[0]=e,_[1]=l,_[2]=h,_[3]=i,_[4]=c,_[5]=p,_[6]=s,_[7]=d,_[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const i=this.elements,s=e.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],this}extractBasis(e,i,s){return e.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const i=e.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,i){const s=e.elements,l=i.elements,c=this.elements,d=s[0],h=s[3],p=s[6],m=s[1],_=s[4],v=s[7],g=s[2],b=s[5],A=s[8],D=l[0],E=l[3],M=l[6],z=l[1],F=l[4],C=l[7],I=l[2],L=l[5],H=l[8];return c[0]=d*D+h*z+p*I,c[3]=d*E+h*F+p*L,c[6]=d*M+h*C+p*H,c[1]=m*D+_*z+v*I,c[4]=m*E+_*F+v*L,c[7]=m*M+_*C+v*H,c[2]=g*D+b*z+A*I,c[5]=g*E+b*F+A*L,c[8]=g*M+b*C+A*H,this}multiplyScalar(e){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=e,i[4]*=e,i[7]*=e,i[2]*=e,i[5]*=e,i[8]*=e,this}determinant(){const e=this.elements,i=e[0],s=e[1],l=e[2],c=e[3],d=e[4],h=e[5],p=e[6],m=e[7],_=e[8];return i*d*_-i*h*m-s*c*_+s*h*p+l*c*m-l*d*p}invert(){const e=this.elements,i=e[0],s=e[1],l=e[2],c=e[3],d=e[4],h=e[5],p=e[6],m=e[7],_=e[8],v=_*d-h*m,g=h*p-_*c,b=m*c-d*p,A=i*v+s*g+l*b;if(A===0)return this.set(0,0,0,0,0,0,0,0,0);const D=1/A;return e[0]=v*D,e[1]=(l*m-_*s)*D,e[2]=(h*s-l*d)*D,e[3]=g*D,e[4]=(_*i-l*p)*D,e[5]=(l*c-h*i)*D,e[6]=b*D,e[7]=(s*p-m*i)*D,e[8]=(d*i-s*c)*D,this}transpose(){let e;const i=this.elements;return e=i[1],i[1]=i[3],i[3]=e,e=i[2],i[2]=i[6],i[6]=e,e=i[5],i[5]=i[7],i[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const i=this.elements;return e[0]=i[0],e[1]=i[3],e[2]=i[6],e[3]=i[1],e[4]=i[4],e[5]=i[7],e[6]=i[2],e[7]=i[5],e[8]=i[8],this}setUvTransform(e,i,s,l,c,d,h){const p=Math.cos(c),m=Math.sin(c);return this.set(s*p,s*m,-s*(p*d+m*h)+d+e,-l*m,l*p,-l*(-m*d+p*h)+h+i,0,0,1),this}scale(e,i){return Oo("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Ah.makeScale(e,i)),this}rotate(e){return Oo("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Ah.makeRotation(-e)),this}translate(e,i){return Oo("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Ah.makeTranslation(e,i)),this}makeTranslation(e,i){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,i,0,0,1),this}makeRotation(e){const i=Math.cos(e),s=Math.sin(e);return this.set(i,-s,0,s,i,0,0,0,1),this}makeScale(e,i){return this.set(e,0,0,0,i,0,0,0,1),this}equals(e){const i=this.elements,s=e.elements;for(let l=0;l<9;l++)if(i[l]!==s[l])return!1;return!0}fromArray(e,i=0){for(let s=0;s<9;s++)this.elements[s]=e[s+i];return this}toArray(e=[],i=0){const s=this.elements;return e[i]=s[0],e[i+1]=s[1],e[i+2]=s[2],e[i+3]=s[3],e[i+4]=s[4],e[i+5]=s[5],e[i+6]=s[6],e[i+7]=s[7],e[i+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Tm.prototype.isMatrix3=!0;let xt=Tm;const Ah=new xt,Mv=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ev=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Y1(){const r={enabled:!0,workingColorSpace:nf,spaces:{},convert:function(l,c,d){return this.enabled===!1||c===d||!c||!d||(this.spaces[c].transfer===$t&&(l.r=is(l.r),l.g=is(l.g),l.b=is(l.b)),this.spaces[c].primaries!==this.spaces[d].primaries&&(l.applyMatrix3(this.spaces[c].toXYZ),l.applyMatrix3(this.spaces[d].fromXYZ)),this.spaces[d].transfer===$t&&(l.r=Po(l.r),l.g=Po(l.g),l.b=Po(l.b))),l},workingToColorSpace:function(l,c){return this.convert(l,this.workingColorSpace,c)},colorSpaceToWorking:function(l,c){return this.convert(l,c,this.workingColorSpace)},getPrimaries:function(l){return this.spaces[l].primaries},getTransfer:function(l){return l===ks?af:this.spaces[l].transfer},getToneMappingMode:function(l){return this.spaces[l].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(l,c=this.workingColorSpace){return l.fromArray(this.spaces[c].luminanceCoefficients)},define:function(l){Object.assign(this.spaces,l)},_getMatrix:function(l,c,d){return l.copy(this.spaces[c].toXYZ).multiply(this.spaces[d].fromXYZ)},_getDrawingBufferColorSpace:function(l){return this.spaces[l].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(l=this.workingColorSpace){return this.spaces[l].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(l,c){return Oo("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(l,c)},toWorkingColorSpace:function(l,c){return Oo("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(l,c)}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return r.define({[nf]:{primaries:e,whitePoint:s,transfer:af,toXYZ:Mv,fromXYZ:Ev,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Bi},outputColorSpaceConfig:{drawingBufferColorSpace:Bi}},[Bi]:{primaries:e,whitePoint:s,transfer:$t,toXYZ:Mv,fromXYZ:Ev,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Bi}}}),r}const Pt=Y1();function is(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Po(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let yo;class Q1{static getDataURL(e,i="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let s;if(e instanceof HTMLCanvasElement)s=e;else{yo===void 0&&(yo=rf("canvas")),yo.width=e.width,yo.height=e.height;const l=yo.getContext("2d");e instanceof ImageData?l.putImageData(e,0,0):l.drawImage(e,0,0,e.width,e.height),s=yo}return s.toDataURL(i)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const i=rf("canvas");i.width=e.width,i.height=e.height;const s=i.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const l=s.getImageData(0,0,e.width,e.height),c=l.data;for(let d=0;d<c.length;d++)c[d]=is(c[d]/255)*255;return s.putImageData(l,0,0),i}else if(e.data){const i=e.data.slice(0);for(let s=0;s<i.length;s++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[s]=Math.floor(is(i[s]/255)*255):i[s]=is(i[s]);return{data:i,width:e.width,height:e.height}}else return ut("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let K1=0;class mm{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:K1++}),this.uuid=uc(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const i=this.data;return typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?e.set(i.videoWidth,i.videoHeight,0):typeof VideoFrame<"u"&&i instanceof VideoFrame?e.set(i.displayWidth,i.displayHeight,0):i!==null?e.set(i.width,i.height,i.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const i=e===void 0||typeof e=="string";if(!i&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const s={uuid:this.uuid,url:""},l=this.data;if(l!==null){let c;if(Array.isArray(l)){c=[];for(let d=0,h=l.length;d<h;d++)l[d].isDataTexture?c.push(wh(l[d].image)):c.push(wh(l[d]))}else c=wh(l);s.url=c}return i||(e.images[this.uuid]=s),s}}function wh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Q1.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(ut("Texture: Unable to serialize Texture."),{})}let Z1=0;const Ch=new le;class ii extends Br{constructor(e=ii.DEFAULT_IMAGE,i=ii.DEFAULT_MAPPING,s=ts,l=ts,c=Kn,d=Er,h=ta,p=Gi,m=ii.DEFAULT_ANISOTROPY,_=ks){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Z1++}),this.uuid=uc(),this.name="",this.source=new mm(e),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=s,this.wrapT=l,this.magFilter=c,this.minFilter=d,this.anisotropy=m,this.format=h,this.internalFormat=null,this.type=p,this.offset=new Xt(0,0),this.repeat=new Xt(1,1),this.center=new Xt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new xt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=_,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ch).x}get height(){return this.source.getSize(Ch).y}get depth(){return this.source.getSize(Ch).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,i){this.updateRanges.push({start:e,count:i})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const i in e){const s=e[i];if(s===void 0){ut(`Texture.setValues(): parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ut(`Texture.setValues(): property '${i}' does not exist.`);continue}l&&s&&l.isVector2&&s.isVector2||l&&s&&l.isVector3&&s.isVector3||l&&s&&l.isMatrix3&&s.isMatrix3?l.copy(s):this[i]=s}}toJSON(e){const i=e===void 0||typeof e=="string";if(!i&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),i||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==j_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case lp:e.x=e.x-Math.floor(e.x);break;case ts:e.x=e.x<0?0:1;break;case cp:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case lp:e.y=e.y-Math.floor(e.y);break;case ts:e.y=e.y<0?0:1;break;case cp:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ii.DEFAULT_IMAGE=null;ii.DEFAULT_MAPPING=j_;ii.DEFAULT_ANISOTROPY=1;const Am=class Am{constructor(e=0,i=0,s=0,l=1){this.x=e,this.y=i,this.z=s,this.w=l}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,i,s,l){return this.x=e,this.y=i,this.z=s,this.w=l,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this.z=e.z+i.z,this.w=e.w+i.w,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this.z+=e.z*i,this.w+=e.w*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this.z=e.z-i.z,this.w=e.w-i.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const i=this.x,s=this.y,l=this.z,c=this.w,d=e.elements;return this.x=d[0]*i+d[4]*s+d[8]*l+d[12]*c,this.y=d[1]*i+d[5]*s+d[9]*l+d[13]*c,this.z=d[2]*i+d[6]*s+d[10]*l+d[14]*c,this.w=d[3]*i+d[7]*s+d[11]*l+d[15]*c,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const i=Math.sqrt(1-e.w*e.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/i,this.y=e.y/i,this.z=e.z/i),this}setAxisAngleFromRotationMatrix(e){let i,s,l,c;const p=e.elements,m=p[0],_=p[4],v=p[8],g=p[1],b=p[5],A=p[9],D=p[2],E=p[6],M=p[10];if(Math.abs(_-g)<.01&&Math.abs(v-D)<.01&&Math.abs(A-E)<.01){if(Math.abs(_+g)<.1&&Math.abs(v+D)<.1&&Math.abs(A+E)<.1&&Math.abs(m+b+M-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const F=(m+1)/2,C=(b+1)/2,I=(M+1)/2,L=(_+g)/4,H=(v+D)/4,w=(A+E)/4;return F>C&&F>I?F<.01?(s=0,l=.707106781,c=.707106781):(s=Math.sqrt(F),l=L/s,c=H/s):C>I?C<.01?(s=.707106781,l=0,c=.707106781):(l=Math.sqrt(C),s=L/l,c=w/l):I<.01?(s=.707106781,l=.707106781,c=0):(c=Math.sqrt(I),s=H/c,l=w/c),this.set(s,l,c,i),this}let z=Math.sqrt((E-A)*(E-A)+(v-D)*(v-D)+(g-_)*(g-_));return Math.abs(z)<.001&&(z=1),this.x=(E-A)/z,this.y=(v-D)/z,this.z=(g-_)/z,this.w=Math.acos((m+b+M-1)/2),this}setFromMatrixPosition(e){const i=e.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this.w=i[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,i){return this.x=It(this.x,e.x,i.x),this.y=It(this.y,e.y,i.y),this.z=It(this.z,e.z,i.z),this.w=It(this.w,e.w,i.w),this}clampScalar(e,i){return this.x=It(this.x,e,i),this.y=It(this.y,e,i),this.z=It(this.z,e,i),this.w=It(this.w,e,i),this}clampLength(e,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(It(s,e,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this.z+=(e.z-this.z)*i,this.w+=(e.w-this.w)*i,this}lerpVectors(e,i,s){return this.x=e.x+(i.x-e.x)*s,this.y=e.y+(i.y-e.y)*s,this.z=e.z+(i.z-e.z)*s,this.w=e.w+(i.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this.w=e[i+3],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e[i+3]=this.w,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this.z=e.getZ(i),this.w=e.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Am.prototype.isVector4=!0;let Sn=Am;class J1 extends Br{constructor(e=1,i=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Kn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},s),this.isRenderTarget=!0,this.width=e,this.height=i,this.depth=s.depth,this.scissor=new Sn(0,0,e,i),this.scissorTest=!1,this.viewport=new Sn(0,0,e,i),this.textures=[];const l={width:e,height:i,depth:s.depth},c=new ii(l),d=s.count;for(let h=0;h<d;h++)this.textures[h]=c.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview,this.useArrayDepthTexture=s.useArrayDepthTexture}_setTextureOptions(e={}){const i={minFilter:Kn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(i.mapping=e.mapping),e.wrapS!==void 0&&(i.wrapS=e.wrapS),e.wrapT!==void 0&&(i.wrapT=e.wrapT),e.wrapR!==void 0&&(i.wrapR=e.wrapR),e.magFilter!==void 0&&(i.magFilter=e.magFilter),e.minFilter!==void 0&&(i.minFilter=e.minFilter),e.format!==void 0&&(i.format=e.format),e.type!==void 0&&(i.type=e.type),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(i.colorSpace=e.colorSpace),e.flipY!==void 0&&(i.flipY=e.flipY),e.generateMipmaps!==void 0&&(i.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(i.internalFormat=e.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(i)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,i,s=1){if(this.width!==e||this.height!==i||this.depth!==s){this.width=e,this.height=i,this.depth=s;for(let l=0,c=this.textures.length;l<c;l++)this.textures[l].image.width=e,this.textures[l].image.height=i,this.textures[l].image.depth=s,this.textures[l].isData3DTexture!==!0&&(this.textures[l].isArrayTexture=this.textures[l].image.depth>1);this.dispose()}this.viewport.set(0,0,e,i),this.scissor.set(0,0,e,i)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,s=e.textures.length;i<s;i++){this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const l=Object.assign({},e.textures[i].image);this.textures[i].source=new mm(l)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Sa extends J1{constructor(e=1,i=1,s={}){super(e,i,s),this.isWebGLRenderTarget=!0}}class $_ extends ii{constructor(e=null,i=1,s=1,l=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:i,height:s,depth:l},this.magFilter=Xn,this.minFilter=Xn,this.wrapR=ts,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class $1 extends ii{constructor(e=null,i=1,s=1,l=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:i,height:s,depth:l},this.magFilter=Xn,this.minFilter=Xn,this.wrapR=ts,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const lf=class lf{constructor(e,i,s,l,c,d,h,p,m,_,v,g,b,A,D,E){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,i,s,l,c,d,h,p,m,_,v,g,b,A,D,E)}set(e,i,s,l,c,d,h,p,m,_,v,g,b,A,D,E){const M=this.elements;return M[0]=e,M[4]=i,M[8]=s,M[12]=l,M[1]=c,M[5]=d,M[9]=h,M[13]=p,M[2]=m,M[6]=_,M[10]=v,M[14]=g,M[3]=b,M[7]=A,M[11]=D,M[15]=E,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new lf().fromArray(this.elements)}copy(e){const i=this.elements,s=e.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],this}copyPosition(e){const i=this.elements,s=e.elements;return i[12]=s[12],i[13]=s[13],i[14]=s[14],this}setFromMatrix3(e){const i=e.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(e,i,s){return this.determinantAffine()===0?(e.set(1,0,0),i.set(0,1,0),s.set(0,0,1),this):(e.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this)}makeBasis(e,i,s){return this.set(e.x,i.x,s.x,0,e.y,i.y,s.y,0,e.z,i.z,s.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const i=this.elements,s=e.elements,l=1/bo.setFromMatrixColumn(e,0).length(),c=1/bo.setFromMatrixColumn(e,1).length(),d=1/bo.setFromMatrixColumn(e,2).length();return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=0,i[4]=s[4]*c,i[5]=s[5]*c,i[6]=s[6]*c,i[7]=0,i[8]=s[8]*d,i[9]=s[9]*d,i[10]=s[10]*d,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(e){const i=this.elements,s=e.x,l=e.y,c=e.z,d=Math.cos(s),h=Math.sin(s),p=Math.cos(l),m=Math.sin(l),_=Math.cos(c),v=Math.sin(c);if(e.order==="XYZ"){const g=d*_,b=d*v,A=h*_,D=h*v;i[0]=p*_,i[4]=-p*v,i[8]=m,i[1]=b+A*m,i[5]=g-D*m,i[9]=-h*p,i[2]=D-g*m,i[6]=A+b*m,i[10]=d*p}
vendor: 3,573 bytes, line 39
39else if(e.order==="YXZ"){const g=p*_,b=p*v,A=m*_,D=m*v;i[0]=g+D*h,i[4]=A*h-b,i[8]=d*m,i[1]=d*v,i[5]=d*_,i[9]=-h,i[2]=b*h-A,i[6]=D+g*h,i[10]=d*p}else if(e.order==="ZXY"){const g=p*_,b=p*v,A=m*_,D=m*v;i[0]=g-D*h,i[4]=-d*v,i[8]=A+b*h,i[1]=b+A*h,i[5]=d*_,i[9]=D-g*h,i[2]=-d*m,i[6]=h,i[10]=d*p}else if(e.order==="ZYX"){const g=d*_,b=d*v,A=h*_,D=h*v;i[0]=p*_,i[4]=A*m-b,i[8]=g*m+D,i[1]=p*v,i[5]=D*m+g,i[9]=b*m-A,i[2]=-m,i[6]=h*p,i[10]=d*p}else if(e.order==="YZX"){const g=d*p,b=d*m,A=h*p,D=h*m;i[0]=p*_,i[4]=D-g*v,i[8]=A*v+b,i[1]=v,i[5]=d*_,i[9]=-h*_,i[2]=-m*_,i[6]=b*v+A,i[10]=g-D*v}else if(e.order==="XZY"){const g=d*p,b=d*m,A=h*p,D=h*m;i[0]=p*_,i[4]=-v,i[8]=m*_,i[1]=g*v+D,i[5]=d*_,i[9]=b*v-A,i[2]=A*v-b,i[6]=h*_,i[10]=D*v+g}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(e){return this.compose(eM,e,tM)}lookAt(e,i,s){const l=this.elements;return Mi.subVectors(e,i),Mi.lengthSq()===0&&(Mi.z=1),Mi.normalize(),Ps.crossVectors(s,Mi),Ps.lengthSq()===0&&(Math.abs(s.z)===1?Mi.x+=1e-4:Mi.z+=1e-4,Mi.normalize(),Ps.crossVectors(s,Mi)),Ps.normalize(),Tu.crossVectors(Mi,Ps),l[0]=Ps.x,l[4]=Tu.x,l[8]=Mi.x,l[1]=Ps.y,l[5]=Tu.y,l[9]=Mi.y,l[2]=Ps.z,l[6]=Tu.z,l[10]=Mi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,i){const s=e.elements,l=i.elements,c=this.elements,d=s[0],h=s[4],p=s[8],m=s[12],_=s[1],v=s[5],g=s[9],b=s[13],A=s[2],D=s[6],E=s[10],M=s[14],z=s[3],F=s[7],C=s[11],I=s[15],L=l[0],H=l[4],w=l[8],O=l[12],V=l[1],k=l[5],$=l[9],me=l[13],fe=l[2],te=l[6],B=l[10],j=l[14],Y=l[3],ce=l[7],Se=l[11],Ce=l[15];return c[0]=d*L+h*V+p*fe+m*Y,c[4]=d*H+h*k+p*te+m*ce,c[8]=d*w+h*$+p*B+m*Se,c[12]=d*O+h*me+p*j+m*Ce,c[1]=_*L+v*V+g*fe+b*Y,c[5]=_*H+v*k+g*te+b*ce,c[9]=_*w+v*$+g*B+b*Se,c[13]=_*O+v*me+g*j+b*Ce,c[2]=A*L+D*V+E*fe+M*Y,c[6]=A*H+D*k+E*te+M*ce,c[10]=A*w+D*$+E*B+M*Se,c[14]=A*O+D*me+E*j+M*Ce,c[3]=z*L+F*V+C*fe+I*Y,c[7]=z*H+F*k+C*te+I*ce,c[11]=z*w+F*$+C*B+I*Se,c[15]=z*O+F*me+C*j+I*Ce,this}multiplyScalar(e){const i=this.elements;return i[0]*=e,i[4]*=e,i[8]*=e,i[12]*=e,i[1]*=e,i[5]*=e,i[9]*=e,i[13]*=e,i[2]*=e,i[6]*=e,i[10]*=e,i[14]*=e,i[3]*=e,i[7]*=e,i[11]*=e,i[15]*=e,this}determinant(){const e=this.elements,i=e[0],s=e[4],l=e[8],c=e[12],d=e[1],h=e[5],p=e[9],m=e[13],_=e[2],v=e[6],g=e[10],b=e[14],A=e[3],D=e[7],E=e[11],M=e[15],z=p*b-m*g,F=h*b-m*v,C=h*g-p*v,I=d*b-m*_,L=d*g-p*_,H=d*v-h*_;return i*(D*z-E*F+M*C)-s*(A*z-E*I+M*L)+l*(A*F-D*I+M*H)-c*(A*C-D*L+E*H)}determinantAffine(){const e=this.elements,i=e[0],s=e[4],l=e[8],c=e[1],d=e[5],h=e[9],p=e[2],m=e[6],_=e[10];return i*(d*_-h*m)-s*(c*_-h*p)+l*(c*m-d*p)}transpose(){const e=this.elements;let i;return i=e[1],e[1]=e[4],e[4]=i,i=e[2],e[2]=e[8],e[8]=i,i=e[6],e[6]=e[9],e[9]=i,i=e[3],e[3]=e[12],e[12]=i,i=e[7],e[7]=e[13],e[13]=i,i=e[11],e[11]=e[14],e[14]=i,this}setPosition(e,i,s){const l=this.elements;return e.isVector3?(l[12]=e.x,l[13]=e.y,l[14]=e.z):(l[12]=e,l[13]=i,l[14]=s),this}invert(){const e=this.elements,i=e[0],s=e[1],l=e[2],c=e[3],d=e[4],h=e[5],p=e[6],m=e[7],_=e[8],v=e[9],g=e[10],b=e[11],A=e[12],D=e[13],E=e[14],M=e[15],z=i*h-s*d,F=i*p-l*d,C=i*m-c*d,I=s*p-l*h,L=s*m-c*h,H=l*m-c*p,w=_*D-v*A,O=_*E-g*A,V=_*M-b*A,k=v*E-g*D,$=v*M-b*D,me=g*M-b*E,fe=z*me-F*$+C*k+I*V-L*O+H*w;if(fe===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const te=1/fe;return e[0]=(h*me-p*$+m*k)*te,e[1]=(l*$-s*me-c*k)*te,e[2]=(D*H-E*L+M*I)*te,e[3]=(g*L-v*H-b*I)*te,e[4]=(p*V-d*me-m*O)*te,e[5]=(i*me-l*V+c*O)*te,e[6]=(E*C-A*H-M*F)*te,e[7]=(_*H-g*C+b*F)*te,e[8]=(d*$-h*V+m*w)*te,e[9]=(s*V-i*$-c*w)*te,e[10]=(A*L-D*C+M*z)*te,e[11
vendor: 57,520 bytes, line 39
39]=(v*C-_*L-b*z)*te,e[12]=(h*O-d*k-p*w)*te,e[13]=(i*k-s*O+l*w)*te,e[14]=(D*F-A*I-E*z)*te,e[15]=(_*I-v*F+g*z)*te,this}scale(e){const i=this.elements,s=e.x,l=e.y,c=e.z;return i[0]*=s,i[4]*=l,i[8]*=c,i[1]*=s,i[5]*=l,i[9]*=c,i[2]*=s,i[6]*=l,i[10]*=c,i[3]*=s,i[7]*=l,i[11]*=c,this}getMaxScaleOnAxis(){const e=this.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],l=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(i,s,l))}makeTranslation(e,i,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,i,0,0,1,s,0,0,0,1),this}makeRotationX(e){const i=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,i,-s,0,0,s,i,0,0,0,0,1),this}makeRotationY(e){const i=Math.cos(e),s=Math.sin(e);return this.set(i,0,s,0,0,1,0,0,-s,0,i,0,0,0,0,1),this}makeRotationZ(e){const i=Math.cos(e),s=Math.sin(e);return this.set(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,i){const s=Math.cos(i),l=Math.sin(i),c=1-s,d=e.x,h=e.y,p=e.z,m=c*d,_=c*h;return this.set(m*d+s,m*h-l*p,m*p+l*h,0,m*h+l*p,_*h+s,_*p-l*d,0,m*p-l*h,_*p+l*d,c*p*p+s,0,0,0,0,1),this}makeScale(e,i,s){return this.set(e,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,i,s,l,c,d){return this.set(1,s,c,0,e,1,d,0,i,l,1,0,0,0,0,1),this}compose(e,i,s){const l=this.elements,c=i._x,d=i._y,h=i._z,p=i._w,m=c+c,_=d+d,v=h+h,g=c*m,b=c*_,A=c*v,D=d*_,E=d*v,M=h*v,z=p*m,F=p*_,C=p*v,I=s.x,L=s.y,H=s.z;return l[0]=(1-(D+M))*I,l[1]=(b+C)*I,l[2]=(A-F)*I,l[3]=0,l[4]=(b-C)*L,l[5]=(1-(g+M))*L,l[6]=(E+z)*L,l[7]=0,l[8]=(A+F)*H,l[9]=(E-z)*H,l[10]=(1-(g+D))*H,l[11]=0,l[12]=e.x,l[13]=e.y,l[14]=e.z,l[15]=1,this}decompose(e,i,s){const l=this.elements;e.x=l[12],e.y=l[13],e.z=l[14];const c=this.determinantAffine();if(c===0)return s.set(1,1,1),i.identity(),this;let d=bo.set(l[0],l[1],l[2]).length();const h=bo.set(l[4],l[5],l[6]).length(),p=bo.set(l[8],l[9],l[10]).length();c<0&&(d=-d),Qi.copy(this);const m=1/d,_=1/h,v=1/p;return Qi.elements[0]*=m,Qi.elements[1]*=m,Qi.elements[2]*=m,Qi.elements[4]*=_,Qi.elements[5]*=_,Qi.elements[6]*=_,Qi.elements[8]*=v,Qi.elements[9]*=v,Qi.elements[10]*=v,i.setFromRotationMatrix(Qi),s.x=d,s.y=h,s.z=p,this}makePerspective(e,i,s,l,c,d,h=ya,p=!1){const m=this.elements,_=2*c/(i-e),v=2*c/(s-l),g=(i+e)/(i-e),b=(s+l)/(s-l);let A,D;if(p)A=c/(d-c),D=d*c/(d-c);else if(h===ya)A=-(d+c)/(d-c),D=-2*d*c/(d-c);else if(h===sf)A=-d/(d-c),D=-d*c/(d-c);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return m[0]=_,m[4]=0,m[8]=g,m[12]=0,m[1]=0,m[5]=v,m[9]=b,m[13]=0,m[2]=0,m[6]=0,m[10]=A,m[14]=D,m[3]=0,m[7]=0,m[11]=-1,m[15]=0,this}makeOrthographic(e,i,s,l,c,d,h=ya,p=!1){const m=this.elements,_=2/(i-e),v=2/(s-l),g=-(i+e)/(i-e),b=-(s+l)/(s-l);let A,D;if(p)A=1/(d-c),D=d/(d-c);else if(h===ya)A=-2/(d-c),D=-(d+c)/(d-c);else if(h===sf)A=-1/(d-c),D=-c/(d-c);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return m[0]=_,m[4]=0,m[8]=0,m[12]=g,m[1]=0,m[5]=v,m[9]=0,m[13]=b,m[2]=0,m[6]=0,m[10]=A,m[14]=D,m[3]=0,m[7]=0,m[11]=0,m[15]=1,this}equals(e){const i=this.elements,s=e.elements;for(let l=0;l<16;l++)if(i[l]!==s[l])return!1;return!0}fromArray(e,i=0){for(let s=0;s<16;s++)this.elements[s]=e[s+i];return this}toArray(e=[],i=0){const s=this.elements;return e[i]=s[0],e[i+1]=s[1],e[i+2]=s[2],e[i+3]=s[3],e[i+4]=s[4],e[i+5]=s[5],e[i+6]=s[6],e[i+7]=s[7],e[i+8]=s[8],e[i+9]=s[9],e[i+10]=s[10],e[i+11]=s[11],e[i+12]=s[12],e[i+13]=s[13],e[i+14]=s[14],e[i+15]=s[15],e}};lf.prototype.isMatrix4=!0;let Dn=lf;const bo=new le,Qi=new Dn,eM=new le(0,0,0),tM=new le(1,1,1),Ps=new le,Tu=new le,Mi=new le,Tv=new Dn,Av=new $o;class zr{constructor(e=0,i=0,s=0,l=zr.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=i,this._z=s,this._order=l}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,i,s,l=this._order){return this._x=e,this._y=i,this._z=s,this._order=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,i=this._order,s=!0){const l=e.elements,c=l[0],d=l[4],h=l[8],p=l[1],m=l[5],_=l[9],v=l[2],g=l[6],b=l[10];switch(i){case"XYZ":this._y=Math.asin(It(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-_,b),this._z=Math.atan2(-d,c)):(this._x=Math.atan2(g,m),this._z=0);break;case"YXZ":this._x=Math.asin(-It(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(h,b),this._z=Math.atan2(p,m)):(this._y=Math.atan2(-v,c),this._z=0);break;case"ZXY":this._x=Math.asin(It(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-v,b),this._z=Math.atan2(-d,m)):(this._y=0,this._z=Math.atan2(p,c));break;case"ZYX":this._y=Math.asin(-It(v,-1,1)),Math.abs(v)<.9999999?(this._x=Math.atan2(g,b),this._z=Math.atan2(p,c)):(this._x=0,this._z=Math.atan2(-d,m));break;case"YZX":this._z=Math.asin(It(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(-_,m),this._y=Math.atan2(-v,c)):(this._x=0,this._y=Math.atan2(h,b));break;case"XZY":this._z=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(g,m),this._y=Math.atan2(h,c)):(this._x=Math.atan2(-_,b),this._y=0);break;default:ut("Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,i,s){return Tv.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Tv,i,s)}setFromVector3(e,i=this._order){return this.set(e.x,e.y,e.z,i)}reorder(e){return Av.setFromEuler(this),this.setFromQuaternion(Av,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],i=0){return e[i]=this._x,e[i+1]=this._y,e[i+2]=this._z,e[i+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}zr.DEFAULT_ORDER="XYZ";class ey{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let nM=0;const wv=new le,So=new $o,Xa=new Dn,Au=new le,Xl=new le,iM=new le,aM=new $o,Cv=new le(1,0,0),Rv=new le(0,1,0),Nv=new le(0,0,1),Dv={type:"added"},sM={type:"removed"},Mo={type:"childadded",child:null},Rh={type:"childremoved",child:null};class Ai extends Br{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nM++}),this.uuid=uc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ai.DEFAULT_UP.clone();const e=new le,i=new zr,s=new $o,l=new le(1,1,1);function c(){s.setFromEuler(i,!1)}function d(){i.setFromQuaternion(s,void 0,!1)}i._onChange(c),s._onChange(d),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new Dn},normalMatrix:{value:new xt}}),this.matrix=new Dn,this.matrixWorld=new Dn,this.matrixAutoUpdate=Ai.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ai.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ey,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,i){this.quaternion.setFromAxisAngle(e,i)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,i){return So.setFromAxisAngle(e,i),this.quaternion.multiply(So),this}rotateOnWorldAxis(e,i){return So.setFromAxisAngle(e,i),this.quaternion.premultiply(So),this}rotateX(e){return this.rotateOnAxis(Cv,e)}rotateY(e){return this.rotateOnAxis(Rv,e)}rotateZ(e){return this.rotateOnAxis(Nv,e)}translateOnAxis(e,i){return wv.copy(e).applyQuaternion(this.quaternion),this.position.add(wv.multiplyScalar(i)),this}translateX(e){return this.translateOnAxis(Cv,e)}translateY(e){return this.translateOnAxis(Rv,e)}translateZ(e){return this.translateOnAxis(Nv,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Xa.copy(this.matrixWorld).invert())}lookAt(e,i,s){e.isVector3?Au.copy(e):Au.set(e,i,s);const l=this.parent;this.updateWorldMatrix(!0,!1),Xl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xa.lookAt(Xl,Au,this.up):Xa.lookAt(Au,Xl,this.up),this.quaternion.setFromRotationMatrix(Xa),l&&(Xa.extractRotation(l.matrixWorld),So.setFromRotationMatrix(Xa),this.quaternion.premultiply(So.invert()))}add(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return e===this?(Bt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Dv),Mo.child=e,this.dispatchEvent(Mo),Mo.child=null):Bt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const i=this.children.indexOf(e);return i!==-1&&(e.parent=null,this.children.splice(i,1),e.dispatchEvent(sM),Rh.child=e,this.dispatchEvent(Rh),Rh.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Xa.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Xa.multiply(e.parent.matrixWorld)),e.applyMatrix4(Xa),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Dv),Mo.child=e,this.dispatchEvent(Mo),Mo.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,i){if(this[e]===i)return this;for(let s=0,l=this.children.length;s<l;s++){const d=this.children[s].getObjectByProperty(e,i);if(d!==void 0)return d}}getObjectsByProperty(e,i,s=[]){this[e]===i&&s.push(this);const l=this.children;for(let c=0,d=l.length;c<d;c++)l[c].getObjectsByProperty(e,i,s);return s}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xl,e,iM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xl,aM,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const i=this.matrixWorld.elements;return e.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(e){e(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(e)}traverseAncestors(e){const i=this.parent;i!==null&&(e(i),i.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const i=e.x,s=e.y,l=e.z,c=this.matrix.elements;c[12]+=i-c[0]*i-c[4]*s-c[8]*l,c[13]+=s-c[1]*i-c[5]*s-c[9]*l,c[14]+=l-c[2]*i-c[6]*s-c[10]*l}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].updateMatrixWorld(e)}updateWorldMatrix(e,i,s=!1){const l=this.parent;if(e===!0&&l!==null&&l.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||s)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,s=!0),i===!0){const c=this.children;for(let d=0,h=c.length;d<h;d++)c[d].updateWorldMatrix(!1,!0,s)}}toJSON(e){const i=e===void 0||typeof e=="string",s={};i&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const l={};l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===!0&&(l.castShadow=!0),this.receiveShadow===!0&&(l.receiveShadow=!0),this.visible===!1&&(l.visible=!1),this.frustumCulled===!1&&(l.frustumCulled=!1),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),this.static!==!1&&(l.static=this.static),Object.keys(this.userData).length>0&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),l.up=this.up.toArray(),this.pivot!==null&&(l.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(l.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(l.type="InstancedMesh",l.count=this.count,l.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(l.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(l.type="BatchedMesh",l.perObjectFrustumCulled=this.perObjectFrustumCulled,l.sortObjects=this.sortObjects,l.drawRanges=this._drawRanges,l.reservedRanges=this._reservedRanges,l.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),l.instanceInfo=this._instanceInfo.map(h=>({...h})),l.availableInstanceIds=this._availableInstanceIds.slice(),l.availableGeometryIds=this._availableGeometryIds.slice(),l.nextIndexStart=this._nextIndexStart,l.nextVertexStart=this._nextVertexStart,l.geometryCount=this._geometryCount,l.maxInstanceCount=this._maxInstanceCount,l.maxVertexCount=this._maxVertexCount,l.maxIndexCount=this._maxIndexCount,l.geometryInitialized=this._geometryInitialized,l.matricesTexture=this._matricesTexture.toJSON(e),l.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(l.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(l.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(l.boundingBox=this.boundingBox.toJSON()));function c(h,p){return h[p.uuid]===void 0&&(h[p.uuid]=p.toJSON(e)),p.uuid}if(this.isScene)this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(l.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){l.geometry=c(e.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const p=h.shapes;if(Array.isArray(p))for(let m=0,_=p.length;m<_;m++){const v=p[m];c(e.shapes,v)}else c(e.shapes,p)}}if(this.isSkinnedMesh&&(l.bindMode=this.bindMode,l.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(c(e.skeletons,this.skeleton),l.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let p=0,m=this.material.length;p<m;p++)h.push(c(e.materials,this.material[p]));l.material=h}else l.material=c(e.materials,this.material);if(this.children.length>0){l.children=[];for(let h=0;h<this.children.length;h++)l.children.push(this.children[h].toJSON(e).object)}if(this.animations.length>0){l.animations=[];for(let h=0;h<this.animations.length;h++){const p=this.animations[h];l.animations.push(c(e.animations,p))}}if(i){const h=d(e.geometries),p=d(e.materials),m=d(e.textures),_=d(e.images),v=d(e.shapes),g=d(e.skeletons),b=d(e.animations),A=d(e.nodes);h.length>0&&(s.geometries=h),p.length>0&&(s.materials=p),m.length>0&&(s.textures=m),_.length>0&&(s.images=_),v.length>0&&(s.shapes=v),g.length>0&&(s.skeletons=g),b.length>0&&(s.animations=b),A.length>0&&(s.nodes=A)}return s.object=l,s;function d(h){const p=[];for(const m in h){const _=h[m];delete _.metadata,p.push(_)}return p}}clone(e){return new this.constructor().copy(this,e)}copy(e,i=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),i===!0)for(let s=0;s<e.children.length;s++){const l=e.children[s];this.add(l.clone())}return this}}Ai.DEFAULT_UP=new le(0,1,0);Ai.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ai.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class wu extends Ai{constructor(){super(),this.isGroup=!0,this.type="Group"}}const rM={type:"move"};class Nh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new wu,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new wu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new le,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new le),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new wu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new le,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new le,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const i=this._hand;if(i)for(const s of e.hand.values())this._getHandJoint(i,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,i,s){let l=null,c=null,d=null;const h=this._targetRay,p=this._grip,m=this._hand;if(e&&i.session.visibilityState!=="visible-blurred"){if(m&&e.hand){d=!0;for(const D of e.hand.values()){const E=i.getJointPose(D,s),M=this._getHandJoint(m,D);E!==null&&(M.matrix.fromArray(E.transform.matrix),M.matrix.decompose(M.position,M.rotation,M.scale),M.matrixWorldNeedsUpdate=!0,M.jointRadius=E.radius),M.visible=E!==null}const _=m.joints["index-finger-tip"],v=m.joints["thumb-tip"],g=_.position.distanceTo(v.position),b=.02,A=.005;m.inputState.pinching&&g>b+A?(m.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!m.inputState.pinching&&g<=b-A&&(m.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else p!==null&&e.gripSpace&&(c=i.getPose(e.gripSpace,s),c!==null&&(p.matrix.fromArray(c.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,c.linearVelocity?(p.hasLinearVelocity=!0,p.linearVelocity.copy(c.linearVelocity)):p.hasLinearVelocity=!1,c.angularVelocity?(p.hasAngularVelocity=!0,p.angularVelocity.copy(c.angularVelocity)):p.hasAngularVelocity=!1,p.eventsEnabled&&p.dispatchEvent({type:"gripUpdated",data:e,target:this})));h!==null&&(l=i.getPose(e.targetRaySpace,s),l===null&&c!==null&&(l=c),l!==null&&(h.matrix.fromArray(l.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,l.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(l.linearVelocity)):h.hasLinearVelocity=!1,l.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(l.angularVelocity)):h.hasAngularVelocity=!1,this.dispatchEvent(rM)))}return h!==null&&(h.visible=l!==null),p!==null&&(p.visible=c!==null),m!==null&&(m.visible=d!==null),this}_getHandJoint(e,i){if(e.joints[i.jointName]===void 0){const s=new wu;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[i.jointName]=s,e.add(s)}return e.joints[i.jointName]}}const ty={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Is={h:0,s:0,l:0},Cu={h:0,s:0,l:0};function Dh(r,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?r+(e-r)*6*i:i<1/2?e:i<2/3?r+(e-r)*6*(2/3-i):r}class Vt{constructor(e,i,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,i,s)}set(e,i,s){if(i===void 0&&s===void 0){const l=e;l&&l.isColor?this.copy(l):typeof l=="number"?this.setHex(l):typeof l=="string"&&this.setStyle(l)}else this.setRGB(e,i,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,i=Bi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Pt.colorSpaceToWorking(this,i),this}setRGB(e,i,s,l=Pt.workingColorSpace){return this.r=e,this.g=i,this.b=s,Pt.colorSpaceToWorking(this,l),this}setHSL(e,i,s,l=Pt.workingColorSpace){if(e=q1(e,1),i=It(i,0,1),s=It(s,0,1),i===0)this.r=this.g=this.b=s;else{const c=s<=.5?s*(1+i):s+i-s*i,d=2*s-c;this.r=Dh(d,c,e+1/3),this.g=Dh(d,c,e),this.b=Dh(d,c,e-1/3)}return Pt.colorSpaceToWorking(this,l),this}setStyle(e,i=Bi){function s(c){c!==void 0&&parseFloat(c)<1&&ut("Color: Alpha component of "+e+" will be ignored.")}let l;if(l=/^(\w+)\(([^\)]*)\)/.exec(e)){let c;const d=l[1],h=l[2];switch(d){case"rgb":case"rgba":if(c=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(c[4]),this.setRGB(Math.min(255,parseInt(c[1],10))/255,Math.min(255,parseInt(c[2],10))/255,Math.min(255,parseInt(c[3],10))/255,i);if(c=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(c[4]),this.setRGB(Math.min(100,parseInt(c[1],10))/100,Math.min(100,parseInt(c[2],10))/100,Math.min(100,parseInt(c[3],10))/100,i);break;case"hsl":case"hsla":if(c=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(c[4]),this.setHSL(parseFloat(c[1])/360,parseFloat(c[2])/100,parseFloat(c[3])/100,i);break;default:ut("Color: Unknown color model "+e)}}else if(l=/^\#([A-Fa-f\d]+)$/.exec(e)){const c=l[1],d=c.length;if(d===3)return this.setRGB(parseInt(c.charAt(0),16)/15,parseInt(c.charAt(1),16)/15,parseInt(c.charAt(2),16)/15,i);if(d===6)return this.setHex(parseInt(c,16),i);ut("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,i);return this}setColorName(e,i=Bi){const s=ty[e.toLowerCase()];return s!==void 0?this.setHex(s,i):ut("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=is(e.r),this.g=is(e.g),this.b=is(e.b),this}copyLinearToSRGB(e){return this.r=Po(e.r),this.g=Po(e.g),this.b=Po(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Bi){return Pt.workingToColorSpace(Yn.copy(this),e),Math.round(It(Yn.r*255,0,255))*65536+Math.round(It(Yn.g*255,0,255))*256+Math.round(It(Yn.b*255,0,255))}getHexString(e=Bi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,i=Pt.workingColorSpace){Pt.workingToColorSpace(Yn.copy(this),i);const s=Yn.r,l=Yn.g,c=Yn.b,d=Math.max(s,l,c),h=Math.min(s,l,c);let p,m;const _=(h+d)/2;if(h===d)p=0,m=0;else{const v=d-h;switch(m=_<=.5?v/(d+h):v/(2-d-h),d){case s:p=(l-c)/v+(l<c?6:0);break;case l:p=(c-s)/v+2;break;case c:p=(s-l)/v+4;break}p/=6}return e.h=p,e.s=m,e.l=_,e}getRGB(e,i=Pt.workingColorSpace){return Pt.workingToColorSpace(Yn.copy(this),i),e.r=Yn.r,e.g=Yn.g,e.b=Yn.b,e}getStyle(e=Bi){Pt.workingToColorSpace(Yn.copy(this),e);const i=Yn.r,s=Yn.g,l=Yn.b;return e!==Bi?`color(${e} ${i.toFixed(3)} ${s.toFixed(3)} ${l.toFixed(3)})`:`rgb(${Math.round(i*255)},${Math.round(s*255)},${Math.round(l*255)})`}offsetHSL(e,i,s){return this.getHSL(Is),this.setHSL(Is.h+e,Is.s+i,Is.l+s)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,i){return this.r=e.r+i.r,this.g=e.g+i.g,this.b=e.b+i.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,i){return this.r+=(e.r-this.r)*i,this.g+=(e.g-this.g)*i,this.b+=(e.b-this.b)*i,this}lerpColors(e,i,s){return this.r=e.r+(i.r-e.r)*s,this.g=e.g+(i.g-e.g)*s,this.b=e.b+(i.b-e.b)*s,this}lerpHSL(e,i){this.getHSL(Is),e.getHSL(Cu);const s=Eh(Is.h,Cu.h,i),l=Eh(Is.s,Cu.s,i),c=Eh(Is.l,Cu.l,i);return this.setHSL(s,l,c),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const i=this.r,s=this.g,l=this.b,c=e.elements;return this.r=c[0]*i+c[3]*s+c[6]*l,this.g=c[1]*i+c[4]*s+c[7]*l,this.b=c[2]*i+c[5]*s+c[8]*l,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,i=0){return this.r=e[i],this.g=e[i+1],this.b=e[i+2],this}toArray(e=[],i=0){return e[i]=this.r,e[i+1]=this.g,e[i+2]=this.b,e}fromBufferAttribute(e,i){return this.r=e.getX(i),this.g=e.getY(i),this.b=e.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Yn=new Vt;Vt.NAMES=ty;class oM extends Ai{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new zr,this.environmentIntensity=1,this.environmentRotation=new zr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,i){return super.copy(e,i),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const i=super.toJSON(e);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(i.object.environmentIntensity=this.environmentIntensity),i.object.environmentRotation=this.environmentRotation.toArray(),i}}const Ki=new le,Wa=new le,Uh=new le,qa=new le,Eo=new le,To=new le,Uv=new le,Lh=new le,Oh=new le,Ph=new le,Ih=new Sn,Fh=new Sn,zh=new Sn;class ea{constructor(e=new le,i=new le,s=new le){this.a=e,this.b=i,this.c=s}static getNormal(e,i,s,l){l.subVectors(s,i),Ki.subVectors(e,i),l.cross(Ki);const c=l.lengthSq();return c>0?l.multiplyScalar(1/Math.sqrt(c)):l.set(0,0,0)}static getBarycoord(e,i,s,l,c){Ki.subVectors(l,i),Wa.subVectors(s,i),Uh.subVectors(e,i);const d=Ki.dot(Ki),h=Ki.dot(Wa),p=Ki.dot(Uh),m=Wa.dot(Wa),_=Wa.dot(Uh),v=d*m-h*h;if(v===0)return c.set(0,0,0),null;const g=1/v,b=(m*p-h*_)*g,A=(d*_-h*p)*g;return c.set(1-b-A,A,b)}static containsPoint(e,i,s,l){return this.getBarycoord(e,i,s,l,qa)===null?!1:qa.x>=0&&qa.y>=0&&qa.x+qa.y<=1}static getInterpolation(e,i,s,l,c,d,h,p){return this.getBarycoord(e,i,s,l,qa)===null?(p.x=0,p.y=0,"z"in p&&(p.z=0),"w"in p&&(p.w=0),null):(p.setScalar(0),p.addScaledVector(c,qa.x),p.addScaledVector(d,qa.y),p.addScaledVector(h,qa.z),p)}static getInterpolatedAttribute(e,i,s,l,c,d){return Ih.setScalar(0),Fh.setScalar(0),zh.setScalar(0),Ih.fromBufferAttribute(e,i),Fh.fromBufferAttribute(e,s),zh.fromBufferAttribute(e,l),d.setScalar(0),d.addScaledVector(Ih,c.x),d.addScaledVector(Fh,c.y),d.addScaledVector(zh,c.z),d}static isFrontFacing(e,i,s,l){return Ki.subVectors(s,i),Wa.subVectors(e,i),Ki.cross(Wa).dot(l)<0}set(e,i,s){return this.a.copy(e),this.b.copy(i),this.c.copy(s),this}setFromPointsAndIndices(e,i,s,l){return this.a.copy(e[i]),this.b.copy(e[s]),this.c.copy(e[l]),this}setFromAttributeAndIndices(e,i,s,l){return this.a.fromBufferAttribute(e,i),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,l),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ki.subVectors(this.c,this.b),Wa.subVectors(this.a,this.b),Ki.cross(Wa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ea.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,i){return ea.getBarycoord(e,this.a,this.b,this.c,i)}getInterpolation(e,i,s,l,c){return ea.getInterpolation(e,this.a,this.b,this.c,i,s,l,c)}containsPoint(e){return ea.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ea.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,i){const s=this.a,l=this.b,c=this.c;let d,h;Eo.subVectors(l,s),To.subVectors(c,s),Lh.subVectors(e,s);const p=Eo.dot(Lh),m=To.dot(Lh);if(p<=0&&m<=0)return i.copy(s);Oh.subVectors(e,l);const _=Eo.dot(Oh),v=To.dot(Oh);if(_>=0&&v<=_)return i.copy(l);const g=p*v-_*m;if(g<=0&&p>=0&&_<=0)return d=p/(p-_),i.copy(s).addScaledVector(Eo,d);Ph.subVectors(e,c);const b=Eo.dot(Ph),A=To.dot(Ph);if(A>=0&&b<=A)return i.copy(c);const D=b*m-p*A;if(D<=0&&m>=0&&A<=0)return h=m/(m-A),i.copy(s).addScaledVector(To,h);const E=_*A-b*v;if(E<=0&&v-_>=0&&b-A>=0)return Uv.subVectors(c,l),h=(v-_)/(v-_+(b-A)),i.copy(l).addScaledVector(Uv,h);const M=1/(E+D+g);return d=D*M,h=g*M,i.copy(s).addScaledVector(Eo,d).addScaledVector(To,h)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class fc{constructor(e=new le(1/0,1/0,1/0),i=new le(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=i}set(e,i){return this.min.copy(e),this.max.copy(i),this}setFromArray(e){this.makeEmpty();for(let i=0,s=e.length;i<s;i+=3)this.expandByPoint(Zi.fromArray(e,i));return this}setFromBufferAttribute(e){this.makeEmpty();for(let i=0,s=e.count;i<s;i++)this.expandByPoint(Zi.fromBufferAttribute(e,i));return this}setFromPoints(e){this.makeEmpty();for(let i=0,s=e.length;i<s;i++)this.expandByPoint(e[i]);return this}setFromCenterAndSize(e,i){const s=Zi.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),this}setFromObject(e,i=!1){return this.makeEmpty(),this.expandByObject(e,i)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,i=!1){e.updateWorldMatrix(!1,!1);const s=e.geometry;if(s!==void 0){const c=s.getAttribute("position");if(i===!0&&c!==void 0&&e.isInstancedMesh!==!0)for(let d=0,h=c.count;d<h;d++)e.isMesh===!0?e.getVertexPosition(d,Zi):Zi.fromBufferAttribute(c,d),Zi.applyMatrix4(e.matrixWorld),this.expandByPoint(Zi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ru.copy(e.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ru.copy(s.boundingBox)),Ru.applyMatrix4(e.matrixWorld),this.union(Ru)}const l=e.children;for(let c=0,d=l.length;c<d;c++)this.expandByObject(l[c],i);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,i){return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Zi),Zi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let i,s;return e.normal.x>0?(i=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(i=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(i+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(i+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(i+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(i+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),i<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wl),Nu.subVectors(this.max,Wl),Ao.subVectors(e.a,Wl),wo.subVectors(e.b,Wl),Co.subVectors(e.c,Wl),Fs.subVectors(wo,Ao),zs.subVectors(Co,wo),xr.subVectors(Ao,Co);let i=[0,-Fs.z,Fs.y,0,-zs.z,zs.y,0,-xr.z,xr.y,Fs.z,0,-Fs.x,zs.z,0,-zs.x,xr.z,0,-xr.x,-Fs.y,Fs.x,0,-zs.y,zs.x,0,-xr.y,xr.x,0];return!Bh(i,Ao,wo,Co,Nu)||(i=[1,0,0,0,1,0,0,0,1],!Bh(i,Ao,wo,Co,Nu))?!1:(Du.crossVectors(Fs,zs),i=[Du.x,Du.y,Du.z],Bh(i,Ao,wo,Co,Nu))}clampPoint(e,i){return i.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Zi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Zi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ya[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ya[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ya[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ya[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ya[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ya[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ya[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ya[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ya),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ya=[new le,new le,new le,new le,new le,new le,new le,new le],Zi=new le,Ru=new fc,Ao=new le,wo=new le,Co=new le,Fs=new le,zs=new le,xr=new le,Wl=new le,Nu=new le,Du=new le,vr=new le;function Bh(r,e,i,s,l){for(let c=0,d=r.length-3;c<=d;c+=3){vr.fromArray(r,c);const h=l.x*Math.abs(vr.x)+l.y*Math.abs(vr.y)+l.z*Math.abs(vr.z),p=e.dot(vr),m=i.dot(vr),_=s.dot(vr);if(Math.max(-Math.max(p,m,_),Math.min(p,m,_))>h)return!1}return!0}const Nn=new le,Uu=new Xt;let lM=0;class Ma extends Br{constructor(e,i,s=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:lM++}),this.name="",this.array=e,this.itemSize=i,this.count=e!==void 0?e.length/i:0,this.normalized=s,this.usage=vv,this.updateRanges=[],this.gpuType=_a,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,i){this.updateRanges.push({start:e,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,i,s){e*=this.itemSize,s*=i.itemSize;for(let l=0,c=this.itemSize;l<c;l++)this.array[e+l]=i.array[s+l];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let i=0,s=this.count;i<s;i++)Uu.fromBufferAttribute(this,i),Uu.applyMatrix3(e),this.setXY(i,Uu.x,Uu.y);else if(this.itemSize===3)for(let i=0,s=this.count;i<s;i++)Nn.fromBufferAttribute(this,i),Nn.applyMatrix3(e),this.setXYZ(i,Nn.x,Nn.y,Nn.z);return this}applyMatrix4(e){for(let i=0,s=this.count;i<s;i++)Nn.fromBufferAttribute(this,i),Nn.applyMatrix4(e),this.setXYZ(i,Nn.x,Nn.y,Nn.z);return this}applyNormalMatrix(e){for(let i=0,s=this.count;i<s;i++)Nn.fromBufferAttribute(this,i),Nn.applyNormalMatrix(e),this.setXYZ(i,Nn.x,Nn.y,Nn.z);return this}transformDirection(e){for(let i=0,s=this.count;i<s;i++)Nn.fromBufferAttribute(this,i),Nn.transformDirection(e),this.setXYZ(i,Nn.x,Nn.y,Nn.z);return this}set(e,i=0){return this.array.set(e,i),this}getComponent(e,i){let s=this.array[e*this.itemSize+i];return this.normalized&&(s=jl(s,this.array)),s}setComponent(e,i,s){return this.normalized&&(s=ui(s,this.array)),this.array[e*this.itemSize+i]=s,this}getX(e){let i=this.array[e*this.itemSize];return this.normalized&&(i=jl(i,this.array)),i}setX(e,i){return this.normalized&&(i=ui(i,this.array)),this.array[e*this.itemSize]=i,this}getY(e){let i=this.array[e*this.itemSize+1];return this.normalized&&(i=jl(i,this.array)),i}setY(e,i){return this.normalized&&(i=ui(i,this.array)),this.array[e*this.itemSize+1]=i,this}getZ(e){let i=this.array[e*this.itemSize+2];return this.normalized&&(i=jl(i,this.array)),i}setZ(e,i){return this.normalized&&(i=ui(i,this.array)),this.array[e*this.itemSize+2]=i,this}getW(e){let i=this.array[e*this.itemSize+3];return this.normalized&&(i=jl(i,this.array)),i}setW(e,i){return this.normalized&&(i=ui(i,this.array)),this.array[e*this.itemSize+3]=i,this}setXY(e,i,s){return e*=this.itemSize,this.normalized&&(i=ui(i,this.array),s=ui(s,this.array)),this.array[e+0]=i,this.array[e+1]=s,this}setXYZ(e,i,s,l){return e*=this.itemSize,this.normalized&&(i=ui(i,this.array),s=ui(s,this.array),l=ui(l,this.array)),this.array[e+0]=i,this.array[e+1]=s,this.array[e+2]=l,this}setXYZW(e,i,s,l,c){return e*=this.itemSize,this.normalized&&(i=ui(i,this.array),s=ui(s,this.array),l=ui(l,this.array),c=ui(c,this.array)),this.array[e+0]=i,this.array[e+1]=s,this.array[e+2]=l,this.array[e+3]=c,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==vv&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class ny extends Ma{constructor(e,i,s){super(new Uint16Array(e),i,s)}}class iy extends Ma{constructor(e,i,s){super(new Uint32Array(e),i,s)}}class as extends Ma{constructor(e,i,s){super(new Float32Array(e),i,s)}}const cM=new fc,ql=new le,Hh=new le;class gm{constructor(e=new le,i=-1){this.isSphere=!0,this.center=e,this.radius=i}set(e,i){return this.center.copy(e),this.radius=i,this}setFromPoints(e,i){const s=this.center;i!==void 0?s.copy(i):cM.setFromPoints(e).getCenter(s);let l=0;for(let c=0,d=e.length;c<d;c++)l=Math.max(l,s.distanceToSquared(e[c]));return this.radius=Math.sqrt(l),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const i=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=i*i}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,i){const s=this.center.distanceToSquared(e);return i.copy(e),s>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ql.subVectors(e,this.center);const i=ql.lengthSq();if(i>this.radius*this.radius){const s=Math.sqrt(i),l=(s-this.radius)*.5;this.center.addScaledVector(ql,l/s),this.radius+=l}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Hh.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ql.copy(e.center).add(Hh)),this.expandByPoint(ql.copy(e.center).sub(Hh))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let uM=0;const Fi=new Dn,Gh=new Ai,Ro=new le,Ei=new fc,Yl=new fc,zn=new le;class os extends Br{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:uM++}),this.uuid=uc(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(V1(e)?iy:ny)(e,1):this.index=e,this}setIndirect(e,i=0){return this.indirect=e,this.indirectOffset=i,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,i){return this.attributes[e]=i,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,i,s=0){this.groups.push({start:e,count:i,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(e,i){this.drawRange.start=e,this.drawRange.count=i}applyMatrix4(e){const i=this.attributes.position;i!==void 0&&(i.applyMatrix4(e),i.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const c=new xt().getNormalMatrix(e);s.applyNormalMatrix(c),s.needsUpdate=!0}const l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(e),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Fi.makeRotationFromQuaternion(e),this.applyMatrix4(Fi),this}rotateX(e){return Fi.makeRotationX(e),this.applyMatrix4(Fi),this}rotateY(e){return Fi.makeRotationY(e),this.applyMatrix4(Fi),this}rotateZ(e){return Fi.makeRotationZ(e),this.applyMatrix4(Fi),this}translate(e,i,s){return Fi.makeTranslation(e,i,s),this.applyMatrix4(Fi),this}scale(e,i,s){return Fi.makeScale(e,i,s),this.applyMatrix4(Fi),this}lookAt(e){return Gh.lookAt(e),Gh.updateMatrix(),this.applyMatrix4(Gh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ro).negate(),this.translate(Ro.x,Ro.y,Ro.z),this}setFromPoints(e){const i=this.getAttribute("position");if(i===void 0){const s=[];for(let l=0,c=e.length;l<c;l++){const d=e[l];s.push(d.x,d.y,d.z||0)}this.setAttribute("position",new as(s,3))}else{const s=Math.min(e.length,i.count);for(let l=0;l<s;l++){const c=e[l];i.setXYZ(l,c.x,c.y,c.z||0)}e.length>i.count&&ut("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),i.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new fc);const e=this.attributes.position,i=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new le(-1/0,-1/0,-1/0),new le(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),i)for(let s=0,l=i.length;s<l;s++){const c=i[s];Ei.setFromBufferAttribute(c),this.morphTargetsRelative?(zn.addVectors(this.boundingBox.min,Ei.min),this.boundingBox.expandByPoint(zn),zn.addVectors(this.boundingBox.max,Ei.max),this.boundingBox.expandByPoint(zn)):(this.boundingBox.expandByPoint(Ei.min),this.boundingBox.expandByPoint(Ei.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Bt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new gm);const e=this.attributes.position,i=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Bt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new le,1/0);return}if(e){const s=this.boundingSphere.center;if(Ei.setFromBufferAttribute(e),i)for(let c=0,d=i.length;c<d;c++){const h=i[c];Yl.setFromBufferAttribute(h),this.morphTargetsRelative?(zn.addVectors(Ei.min,Yl.min),Ei.expandByPoint(zn),zn.addVectors(Ei.max,Yl.max),Ei.expandByPoint(zn)):(Ei.expandByPoint(Yl.min),Ei.expandByPoint(Yl.max))}Ei.getCenter(s);let l=0;for(let c=0,d=e.count;c<d;c++)zn.fromBufferAttribute(e,c),l=Math.max(l,s.distanceToSquared(zn));if(i)for(let c=0,d=i.length;c<d;c++){const h=i[c],p=this.morphTargetsRelative;for(let m=0,_=h.count;m<_;m++)zn.fromBufferAttribute(h,m),p&&(Ro.fromBufferAttribute(e,m),zn.add(Ro)),l=Math.max(l,s.distanceToSquared(zn))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&Bt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,i=this.attributes;if(e===null||i.position===void 0||i.normal===void 0||i.uv===void 0){Bt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=i.position,l=i.normal,c=i.uv;let d=this.getAttribute("tangent");(d===void 0||d.count!==s.count)&&(d=new Ma(new Float32Array(4*s.count),4),this.setAttribute("tangent",d));const h=[],p=[];for(let w=0;w<s.count;w++)h[w]=new le,p[w]=new le;const m=new le,_=new le,v=new le,g=new Xt,b=new Xt,A=new Xt,D=new le,E=new le;function M(w,O,V){m.fromBufferAttribute(s,w),_.fromBufferAttribute(s,O),v.fromBufferAttribute(s,V),g.fromBufferAttribute(c,w),b.fromBufferAttribute(c,O),A.fromBufferAttribute(c,V),_.sub(m),v.sub(m),b.sub(g),A.sub(g);const k=1/(b.x*A.y-A.x*b.y);isFinite(k)&&(D.copy(_).multiplyScalar(A.y).addScaledVector(v,-b.y).multiplyScalar(k),E.copy(v).multiplyScalar(b.x).addScaledVector(_,-A.x).multiplyScalar(k),h[w].add(D),h[O].add(D),h[V].add(D),p[w].add(E),p[O].add(E),p[V].add(E))}let z=this.groups;z.length===0&&(z=[{start:0,count:e.count}]);for(let w=0,O=z.length;w<O;++w){const V=z[w],k=V.start,$=V.count;for(let me=k,fe=k+$;me<fe;me+=3)M(e.getX(me+0),e.getX(me+1),e.getX(me+2))}const F=new le,C=new le,I=new le,L=new le;function H(w){I.fromBufferAttribute(l,w),L.copy(I);const O=h[w];F.copy(O),F.sub(I.multiplyScalar(I.dot(O))).normalize(),C.crossVectors(L,O);const k=C.dot(p[w])<0?-1:1;d.setXYZW(w,F.x,F.y,F.z,k)}for(let w=0,O=z.length;w<O;++w){const V=z[w],k=V.start,$=V.count;for(let me=k,fe=k+$;me<fe;me+=3)H(e.getX(me+0)),H(e.getX(me+1)),H(e.getX(me+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,i=this.getAttribute("position");if(i!==void 0){let s=this.getAttribute("normal");if(s===void 0||s.count!==i.count)s=new Ma(new Float32Array(i.count*3),3),this.setAttribute("normal",s);else for(let g=0,b=s.count;g<b;g++)s.setXYZ(g,0,0,0);const l=new le,c=new le,d=new le,h=new le,p=new le,m=new le,_=new le,v=new le;if(e)for(let g=0,b=e.count;g<b;g+=3){const A=e.getX(g+0),D=e.getX(g+1),E=e.getX(g+2);l.fromBufferAttribute(i,A),c.fromBufferAttribute(i,D),d.fromBufferAttribute(i,E),_.subVectors(d,c),v.subVectors(l,c),_.cross(v),h.fromBufferAttribute(s,A),p.fromBufferAttribute(s,D),m.fromBufferAttribute(s,E),h.add(_),p.add(_),m.add(_),s.setXYZ(A,h.x,h.y,h.z),s.setXYZ(D,p.x,p.y,p.z),s.setXYZ(E,m.x,m.y,m.z)}else for(let g=0,b=i.count;g<b;g+=3)l.fromBufferAttribute(i,g+0),c.fromBufferAttribute(i,g+1),d.fromBufferAttribute(i,g+2),_.subVectors(d,c),v.subVectors(l,c),_.cross(v),s.setXYZ(g+0,_.x,_.y,_.z),s.setXYZ(g+1,_.x,_.y,_.z),s.setXYZ(g+2,_.x,_.y,_.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let i=0,s=e.count;i<s;i++)zn.fromBufferAttribute(e,i),zn.normalize(),e.setXYZ(i,zn.x,zn.y,zn.z)}toNonIndexed(){function e(h,p){const m=h.array,_=h.itemSize,v=h.normalized,g=new m.constructor(p.length*_);let b=0,A=0;for(let D=0,E=p.length;D<E;D++){h.isInterleavedBufferAttribute?b=p[D]*h.data.stride+h.offset:b=p[D]*_;for(let M=0;M<_;M++)g[A++]=m[b++]}return new Ma(g,_,v)}if(this.index===null)return ut("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const i=new os,s=this.index.array,l=this.attributes;for(const h in l){const p=l[h],m=e(p,s);i.setAttribute(h,m)}const c=this.morphAttributes;for(const h in c){const p=[],m=c[h];for(let _=0,v=m.length;_<v;_++){const g=m[_],b=e(g,s);p.push(b)}i.morphAttributes[h]=p}i.morphTargetsRelative=this.morphTargetsRelative;const d=this.groups;for(let h=0,p=d.length;h<p;h++){const m=d[h];i.addGroup(m.start,m.count,m.materialIndex)}return i}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const p=this.parameters;for(const m in p)p[m]!==void 0&&(e[m]=p[m]);return e}e.data={attributes:{}};const i=this.index;i!==null&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const s=this.attributes;for(const p in s){const m=s[p];e.data.attributes[p]=m.toJSON(e.data)}const l={};let c=!1;for(const p in this.morphAttributes){const m=this.morphAttributes[p],_=[];for(let v=0,g=m.length;v<g;v++){const b=m[v];_.push(b.toJSON(e.data))}_.length>0&&(l[p]=_,c=!0)}c&&(e.data.morphAttributes=l,e.data.morphTargetsRelative=this.morphTargetsRelative);const d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));const h=this.boundingSphere;return h!==null&&(e.data.boundingSphere=h.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone());const l=e.attributes;for(const m in l){const _=l[m];this.setAttribute(m,_.clone(i))}const c=e.morphAttributes;for(const m in c){const _=[],v=c[m];for(let g=0,b=v.length;g<b;g++)_.push(v[g].clone(i));this.morphAttributes[m]=_}this.morphTargetsRelative=e.morphTargetsRelative;const d=e.groups;for(let m=0,_=d.length;m<_;m++){const v=d[m];this.addGroup(v.start,v.count,v.materialIndex)}const h=e.boundingBox;h!==null&&(this.boundingBox=h.clone());const p=e.boundingSphere;return p!==null&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let fM=0;class uf extends Br{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fM++}),this.uuid=uc(),this.name="",this.type="Material",this.blending=Lo,this.side=$s,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=$h,this.blendDst=ep,this.blendEquation=Sr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Vt(0,0,0),this.blendAlpha=0,this.depthFunc=Qo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=xv,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=_o,this.stencilZFail=_o,this.stencilZPass=_o,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const i in e){const s=e[i];if(s===void 0){ut(`Material: parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ut(`Material: '${i}' is not a property of THREE.${this.type}.`);continue}l&&l.isColor?l.set(s):l&&l.isVector2&&s&&s.isVector2||l&&l.isEuler&&s&&s.isEuler||l&&l.isVector3&&s&&s.isVector3?l.copy(s):this[i]=s}}toJSON(e){const i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 16,661 bytes, line 39
39s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(s.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(s.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Lo&&(s.blending=this.blending),this.side!==$s&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==$h&&(s.blendSrc=this.blendSrc),this.blendDst!==ep&&(s.blendDst=this.blendDst),this.blendEquation!==Sr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Qo&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==xv&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==_o&&(s.stencilFail=this.stencilFail),this.stencilZFail!==_o&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==_o&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.allowOverride===!1&&(s.allowOverride=!1),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function l(c){const d=[];for(const h in c){const p=c[h];delete p.metadata,d.push(p)}return d}if(i){const c=l(e.textures),d=l(e.images);c.length>0&&(s.textures=c),d.length>0&&(s.images=d)}return s}fromJSON(e,i){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Vt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=i[e.map]||null),e.matcap!==void 0&&(this.matcap=i[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=i[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=i[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=i[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),this.normalScale=new Xt().fromArray(s)}return e.displacementMap!==void 0&&(this.displacementMap=i[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=i[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=i[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=i[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=i[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=i[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=i[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=i[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=i[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=i[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=i[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=i[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=i[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=i[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Xt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=i[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=i[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=i[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=i[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=i[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=i[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=i[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const i=e.clippingPlanes;let s=null;if(i!==null){const l=i.length;s=new Array(l);for(let c=0;c!==l;++c)s[c]=i[c].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 20,518 bytes, lines 39-43
39adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const Qa=new le,kh=new le,Lu=new le,Bs=new le,Vh=new le,Ou=new le,jh=new le;class dM{constructor(e=new le,i=new le(0,0,-1)){this.origin=e,this.direction=i}set(e,i){return this.origin.copy(e),this.direction.copy(i),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,i){return i.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Qa)),this}closestPointToPoint(e,i){i.subVectors(e,this.origin);const s=i.dot(this.direction);return s<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const i=Qa.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(Qa.copy(this.origin).addScaledVector(this.direction,i),Qa.distanceToSquared(e))}distanceSqToSegment(e,i,s,l){kh.copy(e).add(i).multiplyScalar(.5),Lu.copy(i).sub(e).normalize(),Bs.copy(this.origin).sub(kh);const c=e.distanceTo(i)*.5,d=-this.direction.dot(Lu),h=Bs.dot(this.direction),p=-Bs.dot(Lu),m=Bs.lengthSq(),_=Math.abs(1-d*d);let v,g,b,A;if(_>0)if(v=d*p-h,g=d*h-p,A=c*_,v>=0)if(g>=-A)if(g<=A){const D=1/_;v*=D,g*=D,b=v*(v+d*g+2*h)+g*(d*v+g+2*p)+m}else g=c,v=Math.max(0,-(d*g+h)),b=-v*v+g*(g+2*p)+m;else g=-c,v=Math.max(0,-(d*g+h)),b=-v*v+g*(g+2*p)+m;else g<=-A?(v=Math.max(0,-(-d*c+h)),g=v>0?-c:Math.min(Math.max(-c,-p),c),b=-v*v+g*(g+2*p)+m):g<=A?(v=0,g=Math.min(Math.max(-c,-p),c),b=g*(g+2*p)+m):(v=Math.max(0,-(d*c+h)),g=v>0?c:Math.min(Math.max(-c,-p),c),b=-v*v+g*(g+2*p)+m);else g=d>0?-c:c,v=Math.max(0,-(d*g+h)),b=-v*v+g*(g+2*p)+m;return s&&s.copy(this.origin).addScaledVector(this.direction,v),l&&l.copy(kh).addScaledVector(Lu,g),b}intersectSphere(e,i){Qa.subVectors(e.center,this.origin);const s=Qa.dot(this.direction),l=Qa.dot(Qa)-s*s,c=e.radius*e.radius;if(l>c)return null;const d=Math.sqrt(c-l),h=s-d,p=s+d;return p<0?null:h<0?this.at(p,i):this.at(h,i)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const i=e.normal.dot(this.direction);if(i===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/i;return s>=0?s:null}intersectPlane(e,i){const s=this.distanceToPlane(e);return s===null?null:this.at(s,i)}intersectsPlane(e){const i=e.distanceToPoint(this.origin);return i===0||e.normal.dot(this.direction)*i<0}intersectBox(e,i){let s,l,c,d,h,p;const m=1/this.direction.x,_=1/this.direction.y,v=1/this.direction.z,g=this.origin;return m>=0?(s=(e.min.x-g.x)*m,l=(e.max.x-g.x)*m):(s=(e.max.x-g.x)*m,l=(e.min.x-g.x)*m),_>=0?(c=(e.min.y-g.y)*_,d=(e.max.y-g.y)*_):(c=(e.max.y-g.y)*_,d=(e.min.y-g.y)*_),s>d||c>l||((c>s||isNaN(s))&&(s=c),(d<l||isNaN(l))&&(l=d),v>=0?(h=(e.min.z-g.z)*v,p=(e.max.z-g.z)*v):(h=(e.max.z-g.z)*v,p=(e.min.z-g.z)*v),s>p||h>l)||((h>s||s!==s)&&(s=h),(p<l||l!==l)&&(l=p),l<0)?null:this.at(s>=0?s:l,i)}intersectsBox(e){return this.intersectBox(e,Qa)!==null}intersectTriangle(e,i,s,l,c){Vh.subVectors(i,e),Ou.subVectors(s,e),jh.crossVectors(Vh,Ou);let d=this.direction.dot(jh),h;if(d>0){if(l)return null;h=1}else if(d<0)h=-1,d=-d;else return null;Bs.subVectors(this.origin,e);const p=h*this.direction.dot(Ou.crossVectors(Bs,Ou));if(p<0)return null;const m=h*this.direction.dot(Vh.cross(Bs));if(m<0||p+m>d)return null;const _=-h*Bs.dot(jh);return _<0?null:this.at(_/d,c)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ay extends uf{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new zr,this.combine=I_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Lv=new Dn,_r=new dM,Pu=new gm,Ov=new le,Iu=new le,Fu=new le,zu=new le,Xh=new le,Bu=new le,Pv=new le,Hu=new le;class Ta extends Ai{constructor(e=new os,i=new ay){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,i){return super.copy(e,i),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,d=l.length;c<d;c++){const h=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=c}}}}getVertexPosition(e,i){const s=this.geometry,l=s.attributes.position,c=s.morphAttributes.position,d=s.morphTargetsRelative;i.fromBufferAttribute(l,e);const h=this.morphTargetInfluences;if(c&&h){Bu.set(0,0,0);for(let p=0,m=c.length;p<m;p++){const _=h[p],v=c[p];_!==0&&(Xh.fromBufferAttribute(v,e),d?Bu.addScaledVector(Xh,_):Bu.addScaledVector(Xh.sub(i),_))}i.add(Bu)}return i}raycast(e,i){const s=this.geometry,l=this.material,c=this.matrixWorld;l!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),Pu.copy(s.boundingSphere),Pu.applyMatrix4(c),_r.copy(e.ray).recast(e.near),!(Pu.containsPoint(_r.origin)===!1&&(_r.intersectSphere(Pu,Ov)===null||_r.origin.distanceToSquared(Ov)>(e.far-e.near)**2))&&(Lv.copy(c).invert(),_r.copy(e.ray).applyMatrix4(Lv),!(s.boundingBox!==null&&_r.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,i,_r)))}_computeIntersections(e,i,s){let l;const c=this.geometry,d=this.material,h=c.index,p=c.attributes.position,m=c.attributes.uv,_=c.attributes.uv1,v=c.attributes.normal,g=c.groups,b=c.drawRange;if(h!==null)if(Array.isArray(d))for(let A=0,D=g.length;A<D;A++){const E=g[A],M=d[E.materialIndex],z=Math.max(E.start,b.start),F=Math.min(h.count,Math.min(E.start+E.count,b.start+b.count));for(let C=z,I=F;C<I;C+=3){const L=h.getX(C),H=h.getX(C+1),w=h.getX(C+2);l=Gu(this,M,e,s,m,_,v,L,H,w),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=E.materialIndex,i.push(l))}}else{const A=Math.max(0,b.start),D=Math.min(h.count,b.start+b.count);for(let E=A,M=D;E<M;E+=3){const z=h.getX(E),F=h.getX(E+1),C=h.getX(E+2);l=Gu(this,d,e,s,m,_,v,z,F,C),l&&(l.faceIndex=Math.floor(E/3),i.push(l))}}else if(p!==void 0)if(Array.isArray(d))for(let A=0,D=g.length;A<D;A++){const E=g[A],M=d[E.materialIndex],z=Math.max(E.start,b.start),F=Math.min(p.count,Math.min(E.start+E.count,b.start+b.count));for(let C=z,I=F;C<I;C+=3){const L=C,H=C+1,w=C+2;l=Gu(this,M,e,s,m,_,v,L,H,w),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=E.materialIndex,i.push(l))}}else{const A=Math.max(0,b.start),D=Math.min(p.count,b.start+b.count);for(let E=A,M=D;E<M;E+=3){const z=E,F=E+1,C=E+2;l=Gu(this,d,e,s,m,_,v,z,F,C),l&&(l.faceIndex=Math.floor(E/3),i.push(l))}}}}function hM(r,e,i,s,l,c,d,h){let p;if(e.side===hi?p=s.intersectTriangle(d,c,l,!0,h):p=s.intersectTriangle(l,c,d,e.side===$s,h),p===null)return null;Hu.copy(h),Hu.applyMatrix4(r.matrixWorld);const m=i.ray.origin.distanceTo(Hu);return m<i.near||m>i.far?null:{distance:m,point:Hu.clone(),object:r}}function Gu(r,e,i,s,l,c,d,h,p,m){r.getVertexPosition(h,Iu),r.getVertexPosition(p,Fu),r.getVertexPosition(m,zu);const _=hM(r,e,i,s,Iu,Fu,zu,Pv);if(_){const v=new le;ea.getBarycoord(Pv,Iu,Fu,zu,v),l&&(_.uv=ea.getInterpolatedAttribute(l,h,p,m,v,new Xt)),c&&(_.uv1=ea.getInterpolatedAttribute(c,h,p,m,v,new Xt)),d&&(_.normal=ea.getInterpolatedAttribute(d,h,p,m,v,new le),_.normal.dot(s.direction)>0&&_.normal.multiplyScalar(-1));const g={a:h,b:p,c:m,normal:new le,materialIndex:0};ea.getNormal(Iu,Fu,zu,g.normal),_.face=g,_.barycoord=v}return _}class pM extends ii{constructor(e=null,i=1,s=1,l,c,d,h,p,m=Xn,_=Xn,v,g){super(null,d,h,p,m,_,l,c,v,g),this.isDataTexture=!0,this.image={data:e,width:i,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Wh=new le,mM=new le,gM=new xt;class br{constructor(e=new le(1,0,0),i=0){this.isPlane=!0,this.normal=e,this.constant=i}set(e,i){return this.normal.copy(e),this.constant=i,this}setComponents(e,i,s,l){return this.normal.set(e,i,s),this.constant=l,this}setFromNormalAndCoplanarPoint(e,i){return this.normal.copy(e),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(e,i,s){const l=Wh.subVectors(s,i).cross(mM.subVectors(e,i)).normalize();return this.setFromNormalAndCoplanarPoint(l,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,i){return i.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,i,s=!0){const l=e.delta(Wh),c=this.normal.dot(l);if(c===0)return this.distanceToPoint(e.start)===0?i.copy(e.start):null;const d=-(e.start.dot(this.normal)+this.constant)/c;return s===!0&&(d<0||d>1)?null:i.copy(e.start).addScaledVector(l,d)}intersectsLine(e){const i=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return i<0&&s>0||s<0&&i>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,i){const s=i||gM.getNormalMatrix(e),l=this.coplanarPoint(Wh).applyMatrix4(e),c=this.normal.applyMatrix3(s).normalize();return this.constant=-l.dot(c),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 yr=new gm,xM=new Xt(.5,.5),ku=new le;class sy{constructor(e=new br,i=new br,s=new br,l=new br,c=new br,d=new br){this.planes=[e,i,s,l,c,d]}set(e,i,s,l,c,d){const h=this.planes;return h[0].copy(e),h[1].copy(i),h[2].copy(s),h[3].copy(l),h[4].copy(c),h[5].copy(d),this}copy(e){const i=this.planes;for(let s=0;s<6;s++)i[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,i=ya,s=!1){const l=this.planes,c=e.elements,d=c[0],h=c[1],p=c[2],m=c[3],_=c[4],v=c[5],g=c[6],b=c[7],A=c[8],D=c[9],E=c[10],M=c[11],z=c[12],F=c[13],C=c[14],I=c[15];if(l[0].setComponents(m-d,b-_,M-A,I-z).normalize(),l[1].setComponents(m+d,b+_,M+A,I+z).normalize(),l[2].setComponents(m+h,b+v,M+D,I+F).normalize(),l[3].setComponents(m-h,b-v,M-D,I-F).normalize(),s)l[4].setComponents(p,g,E,C).normalize(),l[5].setComponents(m-p,b-g,M-E,I-C).normalize();else if(l[4].setComponents(m-p,b-g,M-E,I-C).normalize(),i===ya)l[5].setComponents(m+p,b+g,M+E,I+C).normalize();else if(i===sf)l[5].setComponents(p,g,E,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),yr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const i=e.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),yr.copy(i.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(yr)}intersectsSprite(e){yr.center.set(0,0,0);const i=xM.distanceTo(e.center);return yr.radius=.7071067811865476+i,yr.applyMatrix4(e.matrixWorld),this.intersectsSphere(yr)}intersectsSphere(e){const i=this.planes,s=e.center,l=-e.radius;for(let c=0;c<6;c++)if(i[c].distanceToPoint(s)<l)return!1;return!0}intersectsBox(e){const i=this.planes;for(let s=0;s<6;s++){const l=i[s];if(ku.x=l.normal.x>0?e.max.x:e.min.x,ku.y=l.normal.y>0?e.max.y:e.min.y,ku.z=l.normal.z>0?e.max.z:e.min.z,l.distanceToPoint(ku)<0)return!1}return!0}containsPoint(e){const i=this.planes;for(let s=0;s<6;s++)if(i[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class ry extends ii{constructor(e=[],i=Ir,s,l,c,d,h,p,m,_){super(e,i,s,l,c,d,h,p,m,_),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Zo extends ii{constructor(e,i,s=Ea,l,c,d,h=Xn,p=Xn,m,_=rs,v=1){if(_!==rs&&_!==Tr)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const g={width:e,height:i,depth:v};super(g,l,c,d,h,p,_,s,m),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new mm(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const i=super.toJSON(e);return this.compareFunction!==null&&(i.compareFunction=this.compareFunction),i}}class vM extends Zo{constructor(e,i=Ea,s=Ir,l,c,d=Xn,h=Xn,p,m=rs){const _={width:e,height:e,depth:1},v=[_,_,_,_,_,_];super(e,e,i,s,l,c,d,h,p,m),this.image=v,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class oy extends ii{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class dc extends os{constructor(e=1,i=1,s=1,l=1,c=1,d=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:i,depth:s,widthSegments:l,heightSegments:c,depthSegments:d};const h=this;l=Math.floor(l),c=Math.floor(c),d=Math.floor(d);const p=[],m=[],_=[],v=[];let g=0,b=0;A("z","y","x",-1,-1,s,i,e,d,c,0),A("z","y","x",1,-1,s,i,-e,d,c,1),A("x","z","y",1,1,e,s,i,l,d,2),A("x","z","y",1,-1,e,s,-i,l,d,3),A("x","y","z",1,-1,e,i,s,l,c,4),A("x","y","z",-1,-1,e,i,-s,l,c,5),this.setIndex(p),this.setAttribute("position",new as(m,3)),this.setAttribute("normal",new as(_,3)),this.setAttribute("uv",new as(v,2));function A(D,E,M,z,F,C,I,L,H,w,O){const V=C/H,k=I/w,$=C/2,me=I/2,fe=L/2,te=H+1,B=w+1;let j=0,Y=0;const ce=new le;for(let Se=0;Se<B;Se++){const Ce=Se*k-me;for(let Ae=0;Ae<te;Ae++){const je=Ae*V-$;ce[D]=je*z,ce[E]=Ce*F,ce[M]=fe,m.push(ce.x,ce.y,ce.z),ce[D]=0,ce[E]=0,ce[M]=L>0?1:-1,_.push(ce.x,ce.y,ce.z),v.push(Ae/H),v.push(1-Se/w),j+=1}}for(let Se=0;Se<w;Se++)for(let Ce=0;Ce<H;Ce++){const Ae=g+Ce+te*Se,je=g+Ce+te*(Se+1),dt=g+(Ce+1)+te*(Se+1),ft=g+(Ce+1)+te*Se;p.push(Ae,je,ft),p.push(je,dt,ft),Y+=6}h.addGroup(b,Y,O),b+=Y,g+=j}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new dc(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class hc extends os{constructor(e=1,i=1,s=1,l=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:i,widthSegments:s,heightSegments:l};const c=e/2,d=i/2,h=Math.floor(s),p=Math.floor(l),m=h+1,_=p+1,v=e/h,g=i/p,b=[],A=[],D=[],E=[];for(let M=0;M<_;M++){const z=M*g-d;for(let F=0;F<m;F++){const C=F*v-c;A.push(C,-z,0),D.push(0,0,1),E.push(F/h),E.push(1-M/p)}}for(let M=0;M<p;M++)for(let z=0;z<h;z++){const F=z+m*M,C=z+m*(M+1),I=z+1+m*(M+1),L=z+1+m*M;b.push(F,C,L),b.push(C,I,L)}this.setIndex(b),this.setAttribute("position",new as(A,3)),this.setAttribute("normal",new as(D,3)),this.setAttribute("uv",new as(E,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hc(e.width,e.height,e.widthSegments,e.heightSegments)}}function Jo(r){const e={};for(const i in r){e[i]={};for(const s in r[i]){const l=r[i][s];if(Iv(l))l.isRenderTargetTexture?(ut("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=l.clone();else if(Array.isArray(l))if(Iv(l[0])){const c=[];for(let d=0,h=l.length;d<h;d++)c[d]=l[d].clone();e[i][s]=c}else e[i][s]=l.slice();else e[i][s]=l}}return e}function ti(r){const e={};for(let i=0;i<r.length;i++){const s=Jo(r[i]);for(const l in s)e[l]=s[l]}return e}function Iv(r){return r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)}function _M(r){const e=[];for(let i=0;i<r.length;i++)e.push(r[i].clone());return e}function ly(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Pt.workingColorSpace}const yM={clone:Jo,merge:ti};var bM=`void main() {
40	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
41}`,SM=`void main() {
42	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
43}`;class ia extends uf{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bM,this.fragmentShader=SM,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Jo(e.uniforms),this.uniformsGroups=_M(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const i=super.toJSON(e);i.glslVersion=this.glslVersion,i.uniforms={};for(const l in this.uniforms){const d=this.uniforms[l].value;d&&d.isTexture?i.uniforms[l]={type:"t",value:d.toJSON(e).uuid}:d&&d.isColor?i.uniforms[l]={type:"c",value:d.getHex()}:d&&d.isVector2?i.uniforms[l]={type:"v2",value:d.toArray()}:d&&d.isVector3?i.uniforms[l]={type:"v3",value:d.toArray()}:d&&d.isVector4?i.uniforms[l]={type:"v4",value:d.toArray()}:d&&d.isMatrix3?i.uniforms[l]={type:"m3",value:d.toArray()}:d&&d.isMatrix4?i.uniforms[l]={type:"m4",value:d.toArray()}:i.uniforms[l]={value:d}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const s={};for(const l in this.extensions)this.extensions[l]===!0&&(s[l]=!0);return Object.keys(s).length>0&&(i.extensions=s),i}fromJSON(e,i){if(super.fromJSON(e,i),e.uniforms!==void 0)for(const s in e.uniforms){const l=e.uniforms[s];switch(this.uniforms[s]={},l.type){case"t":this.uniforms[s].value=i[l.value]||null;break;case"c":this.uniforms[s].value=new Vt().setHex(l.value);break;case"v2":this.uniforms[s].value=new Xt().fromArray(l.value);break;case"v3":this.uniforms[s].value=new le().fromArray(l.value);break;case"v4":this.uniforms[s].value=new Sn().fromArray(l.value);break;case"m3":this.uniforms[s].value=new xt().fromArray(l.value);break;
vendor: 5,381 bytes, line 43
43case"m4":this.uniforms[s].value=new Dn().fromArray(l.value);break;default:this.uniforms[s].value=l.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)this.extensions[s]=e.extensions[s];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class MM extends ia{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class EM extends uf{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=P1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class TM extends uf{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Vu=new le,ju=new $o,da=new le;class cy extends Ai{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dn,this.projectionMatrix=new Dn,this.projectionMatrixInverse=new Dn,this.coordinateSystem=ya,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,i){return super.copy(e,i),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.matrixWorld.decompose(Vu,ju,da),da.x===1&&da.y===1&&da.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Vu,ju,da.set(1,1,1)).invert()}updateWorldMatrix(e,i,s=!1){super.updateWorldMatrix(e,i,s),this.matrixWorld.decompose(Vu,ju,da),da.x===1&&da.y===1&&da.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Vu,ju,da.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const Hs=new le,Fv=new Xt,zv=new Xt;class $i extends cy{constructor(e=50,i=1,s=.1,l=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=l,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,i){return super.copy(e,i),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 i=.5*this.getFilmHeight()/e;this.fov=Hp*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Mh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Hp*2*Math.atan(Math.tan(Mh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,i,s){Hs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Hs.x,Hs.y).multiplyScalar(-e/Hs.z),Hs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(Hs.x,Hs.y).multiplyScalar(-e/Hs.z)}getViewSize(e,i){return this.getViewBounds(e,Fv,zv),i.subVectors(zv,Fv)}setViewOffset(e,i,s,l,c,d){this.aspect=e/i,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=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=d,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let i=e*Math.tan(Mh*.5*this.fov)/this.zoom,s=2*i,l=this.aspect*s,c=-.5*l;const d=this.view;if(this.view!==null&&this.view.enabled){const p=d.fullWidth,m=d.fullHeight;c+=d.offsetX*l/p,i-=d.offsetY*s/m,l*=d.width/p,s*=d.height/m}const h=this.filmOffset;h!==0&&(c+=e*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(c,c+l,i,i-s,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const i=super.toJSON(e);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}class xm extends cy{constructor(e=-1,i=1,s=1,l=-1,c=.1,d=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
43phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=i,this.top=s,this.bottom=l,this.near=c,this.far=d,this.updateProjectionMatrix()}copy(e,i){return super.copy(e,i),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,i,s,l,c,d){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=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=d,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,l=(this.top+this.bottom)/2;let c=s-e,d=s+e,h=l+i,p=l-i;if(this.view!==null&&this.view.enabled){const m=(this.right-this.left)/this.view.fullWidth/this.zoom,_=(this.top-this.bottom)/this.view.fullHeight/this.zoom;c+=m*this.view.offsetX,d=c+m*this.view.width,h-=_*this.view.offsetY,p=h-_*this.view.height}this.projectionMatrix.makeOrthographic(c,d,h,p,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const i=super.toJSON(e);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}const No=-90,Do=1;class AM extends Ai{constructor(e,i,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const l=new $i(No,Do,e,i);l.layers=this.layers,this.add(l);const c=new $i(No,Do,e,i);c.layers=this.layers,this.add(c);const d=new $i(No,Do,e,i);d.layers=this.layers,this.add(d);const h=new $i(No,Do,e,i);h.layers=this.layers,this.add(h);const p=new $i(No,Do,e,i);p.layers=this.layers,this.add(p);const m=new $i(No,Do,e,i);m.layers=this.layers,this.add(m)}updateCoordinateSystem(){const e=this.coordinateSystem,i=this.children.concat(),[s,l,c,d,h,p]=i;for(const m of i)this.remove(m);if(e===ya)s.up.set(0,1,0),s.lookAt(1,0,0),l.up.set(0,1,0),l.lookAt(-1,0,0),c.up.set(0,0,-1),c.lookAt(0,1,0),d.up.set(0,0,1),d.lookAt(0,-1,0),h.up.set(0,1,0),h.lookAt(0,0,1),p.up.set(0,1,0),p.lookAt(0,0,-1);else if(e===sf)s.up.set(0,-1,0),s.lookAt(-1,0,0),l.up.set(0,-1,0),l.lookAt(1,0,0),c.up.set(0,0,1),c.lookAt(0,1,0),d.up.set(0,0,-1),d.lookAt(0,-1,0),h.up.set(0,-1,0),h.lookAt(0,0,1),p.up.set(0,-1,0),p.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const m of i)this.add(m),m.updateMatrixWorld()}update(e,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:l}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[c,d,h,p,m,_]=this.children,v=e.getRenderTarget(),g=e.getActiveCubeFace(),b=e.getActiveMipmapLevel(),A=e.xr.enabled;e.xr.enabled=!1;const D=s.texture.generateMipmaps;s.texture.generateMipmaps=!1;let E=!1;e.isWebGLRenderer===!0?E=e.state.buffers.depth.getReversed():E=e.reversedDepthBuffer,e.setRenderTarget(s,0,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,c),e.setRenderTarget(s,1,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,d),e.setRenderTarget(s,2,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,h),e.setRenderTarget(s,3,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,p),e.setRenderTarget(s,4,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,m),s.texture.generateMipmaps=D,e.setRenderTarget(s,5,l),E&&e.autoClear===!1&&e.clearDepth(),e.render(i,_),e.setRenderTarget(v,g,b),e.xr.enabled=A,s.texture.needsPMREMUpdate=!0}}class wM extends $i{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class CM{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,ut("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const i=performance.now();e=(i-this.oldTime)/1e3,this.oldTime=i,this.elapsedTime+=e}return e}}const wm=class wm{constructor(e,i,s,l){this.elements=[1,0,0,1],e!==void 0&&this.set(e,i,s,l)}identity(){return this.set(1,0,0,1),this}fromArray(e,i=0){for(let s=0;s<4;s++)this.elements[s]=e[s+i];return this}set(e,i,s,l){const c=this.elements;return c[0]=e,c[2]=i,c[1]=s,c[3]=l,this}};wm.prototype.isMatrix2=!0;let Bv=wm;
vendor: 4,423 bytes, lines 43-47
43function Hv(r,e,i,s){const l=RM(s);switch(i){case Q_:return r*e;case Z_:return r*e/l.components*l.byteLength;case um:return r*e/l.components*l.byteLength;case Fr:return r*e*2/l.components*l.byteLength;case fm:return r*e*2/l.components*l.byteLength;case K_:return r*e*3/l.components*l.byteLength;case ta:return r*e*4/l.components*l.byteLength;case dm:return r*e*4/l.components*l.byteLength;case Qu:case Ku:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case Zu:case Ju:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case fp:case hp:return Math.max(r,16)*Math.max(e,8)/4;case up:case dp:return Math.max(r,8)*Math.max(e,8)/2;case pp:case mp:case xp:case vp:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case gp:case ef:case _p:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case yp:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case bp:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case Sp:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case Mp:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case Ep:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case Tp:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case Ap:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case wp:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case Cp:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case Rp:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case Np:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case Dp:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case Up:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case Lp:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case Op:case Pp:case Ip:return Math.ceil(r/4)*Math.ceil(e/4)*16;case Fp:case zp:return Math.ceil(r/4)*Math.ceil(e/4)*8;case tf:case Bp:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}function RM(r){switch(r){case Gi:case X_:return{byteLength:1,components:1};case ec:case W_:case ss:return{byteLength:2,components:1};case lm:case cm:return{byteLength:2,components:4};case Ea:case om:case _a:return{byteLength:4,components:1};case q_:case Y_:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:rm}}));typeof window<"u"&&(window.__THREE__?ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=rm);/**
44 * @license
45 * Copyright 2010-2026 Three.js Authors
46 * SPDX-License-Identifier: MIT
47 */function uy(){let r=null,e=!1,i=null,s=null;function l(c,d){i(c,d),s=r.requestAnimationFrame(l)}return{start:function(){e!==!0&&i!==null&&r!==null&&(s=r.requestAnimationFrame(l),e=!0)},stop:function(){r!==null&&r.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(c){i=c},setContext:function(c){r=c}}}function NM(r){const e=new WeakMap;function i(h,p){const m=h.array,_=h.usage,v=m.byteLength,g=r.createBuffer();r.bindBuffer(p,g),r.bufferData(p,m,_),h.onUploadCallback();let b;if(m instanceof Float32Array)b=r.FLOAT;else if(typeof Float16Array<"u"&&m instanceof Float16Array)b=r.HALF_FLOAT;else if(m instanceof Uint16Array)h.isFloat16BufferAttribute?b=r.HALF_FLOAT:b=r.UNSIGNED_SHORT;else if(m instanceof Int16Array)b=r.SHORT;else if(m instanceof Uint32Array)b=r.UNSIGNED_INT;else if(m instanceof Int32Array)b=r.INT;else if(m instanceof Int8Array)b=r.BYTE;else if(m instanceof Uint8Array)b=r.UNSIGNED_BYTE;else if(m instanceof Uint8ClampedArray)b=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+m);return{buffer:g,type:b,bytesPerElement:m.BYTES_PER_ELEMENT,version:h.version,size:v}}function s(h,p,m){const _=p.array,v=p.updateRanges;if(r.bindBuffer(m,h),v.length===0)r.bufferSubData(m,0,_);else{v.sort((b,A)=>b.start-A.start);let g=0;for(let b=1;b<v.length;b++){const A=v[g],D=v[b];D.start<=A.start+A.count+1?A.count=Math.max(A.count,D.start+D.count-A.start):(++g,v[g]=D)}v.length=g+1;for(let b=0,A=v.length;b<A;b++){const D=v[b];r.bufferSubData(m,D.start*_.BYTES_PER_ELEMENT,_,D.start,D.count)}p.clearUpdateRanges()}p.onUploadCallback()}function l(h){return h.isInterleavedBufferAttribute&&(h=h.data),e.get(h)}function c(h){h.isInterleavedBufferAttribute&&(h=h.data);const p=e.get(h);p&&(r.deleteBuffer(p.buffer),e.delete(h))}function d(h,p){if(h.isInterleavedBufferAttribute&&(h=h.data),h.isGLBufferAttribute){const _=e.get(h);
vendor: 4,611 bytes, lines 47-160
47(!_||_.version<h.version)&&e.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}const m=e.get(h);if(m===void 0)e.set(h,i(h,p));else if(m.version<h.version){if(m.size!==h.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");s(m.buffer,h,p),m.version=h.version}}return{get:l,remove:c,update:d}}var DM=`#ifdef USE_ALPHAHASH
48	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
49#endif`,UM=`#ifdef USE_ALPHAHASH
50	const float ALPHA_HASH_SCALE = 0.05;
51	float hash2D( vec2 value ) {
52		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
53	}
54	float hash3D( vec3 value ) {
55		return hash2D( vec2( hash2D( value.xy ), value.z ) );
56	}
57	float getAlphaHashThreshold( vec3 position ) {
58		float maxDeriv = max(
59			length( dFdx( position.xyz ) ),
60			length( dFdy( position.xyz ) )
61		);
62		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
63		vec2 pixScales = vec2(
64			exp2( floor( log2( pixScale ) ) ),
65			exp2( ceil( log2( pixScale ) ) )
66		);
67		vec2 alpha = vec2(
68			hash3D( floor( pixScales.x * position.xyz ) ),
69			hash3D( floor( pixScales.y * position.xyz ) )
70		);
71		float lerpFactor = fract( log2( pixScale ) );
72		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
73		float a = min( lerpFactor, 1.0 - lerpFactor );
74		vec3 cases = vec3(
75			x * x / ( 2.0 * a * ( 1.0 - a ) ),
76			( x - 0.5 * a ) / ( 1.0 - a ),
77			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
78		);
79		float threshold = ( x < ( 1.0 - a ) )
80			? ( ( x < a ) ? cases.x : cases.y )
81			: cases.z;
82		return clamp( threshold , 1.0e-6, 1.0 );
83	}
84#endif`,LM=`#ifdef USE_ALPHAMAP
85	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
86#endif`,OM=`#ifdef USE_ALPHAMAP
87	uniform sampler2D alphaMap;
88#endif`,PM=`#ifdef USE_ALPHATEST
89	#ifdef ALPHA_TO_COVERAGE
90	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
91	if ( diffuseColor.a == 0.0 ) discard;
92	#else
93	if ( diffuseColor.a < alphaTest ) discard;
94	#endif
95#endif`,IM=`#ifdef USE_ALPHATEST
96	uniform float alphaTest;
97#endif`,FM=`#ifdef USE_AOMAP
98	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
99	reflectedLight.indirectDiffuse *= ambientOcclusion;
100	#if defined( USE_CLEARCOAT ) 
101		clearcoatSpecularIndirect *= ambientOcclusion;
102	#endif
103	#if defined( USE_SHEEN ) 
104		sheenSpecularIndirect *= ambientOcclusion;
105	#endif
106	#if defined( USE_ENVMAP ) && defined( STANDARD )
107		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
108		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
109	#endif
110#endif`,zM=`#ifdef USE_AOMAP
111	uniform sampler2D aoMap;
112	uniform float aoMapIntensity;
113#endif`,BM=`#ifdef USE_BATCHING
114	#if ! defined( GL_ANGLE_multi_draw )
115	#define gl_DrawID _gl_DrawID
116	uniform int _gl_DrawID;
117	#endif
118	uniform highp sampler2D batchingTexture;
119	uniform highp usampler2D batchingIdTexture;
120	mat4 getBatchingMatrix( const in float i ) {
121		int size = textureSize( batchingTexture, 0 ).x;
122		int j = int( i ) * 4;
123		int x = j % size;
124		int y = j / size;
125		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
126		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
127		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
128		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
129		return mat4( v1, v2, v3, v4 );
130	}
131	float getIndirectIndex( const in int i ) {
132		int size = textureSize( batchingIdTexture, 0 ).x;
133		int x = i % size;
134		int y = i / size;
135		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
136	}
137#endif
138#ifdef USE_BATCHING_COLOR
139	uniform sampler2D batchingColorTexture;
140	vec4 getBatchingColor( const in float i ) {
141		int size = textureSize( batchingColorTexture, 0 ).x;
142		int j = int( i );
143		int x = j % size;
144		int y = j / size;
145		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
146	}
147#endif`,HM=`#ifdef USE_BATCHING
148	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
149#endif`,GM=`vec3 transformed = vec3( position );
150#ifdef USE_ALPHAHASH
151	vPosition = vec3( position );
152#endif`,kM=`vec3 objectNormal = vec3( normal );
153#ifdef USE_TANGENT
154	vec3 objectTangent = vec3( tangent.xyz );
155#endif`,VM=`float G_BlinnPhong_Implicit( ) {
156	return 0.25;
157}
158float D_BlinnPhong( const in float shininess, const in float dotNH ) {
159	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
160}
161vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
162	vec3 halfDir = normalize( lightDir + viewDir );
163	float dotNH = saturate( dot( normal, halfDir ) );
164	float dotVH = saturate( dot( viewDir, halfDir ) );
165	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
166	float G = G_BlinnPhong_Implicit( );
167	float D = D_BlinnPhong( shininess, dotNH );
168	return F * ( G * D );
169} // validated`,jM=`#ifdef USE_IRIDESCENCE
170	const mat3 XYZ_TO_REC709 = mat3(
171		 3.2404542, -0.9692660,  0.0556434,
172		-1.5371385,  1.8760108, -0.2040259,
173		-0.4985314,  0.0415560,  1.0572252
174	);
175	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
176		vec3 sqrtF0 = sqrt( fresnel0 );
177		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
178	}
179	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
180		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
181	}
182	float IorToFresnel0( float transmittedIor, float incidentIor ) {
183		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
184	}
185	vec3 evalSensitivity( float OPD, vec3 shift ) {
186		float phase = 2.0 * PI * OPD * 1.0e-9;
187		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
188		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
189		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
190		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
191		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
192		xyz /= 1.0685e-7;
193		vec3 rgb = XYZ_TO_REC709 * xyz;
194		return rgb;
195	}
196	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
197		vec3 I;
198		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
199		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
200		float cosTheta2Sq = 1.0 - sinTheta2Sq;
201		if ( cosTheta2Sq < 0.0 ) {
202			return vec3( 1.0 );
203		}
204		float cosTheta2 = sqrt( cosTheta2Sq );
205		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
206		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
207		float T121 = 1.0 - R12;
208		float phi12 = 0.0;
209		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
210		float phi21 = PI - phi12;
211		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
212		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
213		vec3 phi23 = vec3( 0.0 );
214		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
215		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
216		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
217		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
218		vec3 phi = vec3( phi21 ) + phi23;
219		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
220		vec3 r123 = sqrt( R123 );
221		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
222		vec3 C0 = R12 + Rs;
223		I = C0;
224		vec3 Cm = Rs - T121;
225		for ( int m = 1; m <= 2; ++ m ) {
226			Cm *= r123;
227			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
228			I += Cm * Sm;
229		}
230		return max( I, vec3( 0.0 ) );
231	}
232#endif`,XM=`#ifdef USE_BUMPMAP
233	uniform sampler2D bumpMap;
234	uniform float bumpScale;
235	vec2 dHdxy_fwd() {
236		vec2 dSTdx = dFdx( vBumpMapUv );
237		vec2 dSTdy = dFdy( vBumpMapUv );
238		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
239		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
240		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
241		return vec2( dBx, dBy );
242	}
243	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
244		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
245		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
246		vec3 vN = surf_norm;
247		vec3 R1 = cross( vSigmaY, vN );
248		vec3 R2 = cross( vN, vSigmaX );
249		float fDet = dot( vSigmaX, R1 ) * faceDirection;
250		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
251		return normalize( abs( fDet ) * surf_norm - vGrad );
252	}
253#endif`,WM=`#if NUM_CLIPPING_PLANES > 0
254	vec4 plane;
255	#ifdef ALPHA_TO_COVERAGE
256		float distanceToPlane, distanceGradient;
257		float clipOpacity = 1.0;
258		#pragma unroll_loop_start
259		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
260			plane = clippingPlanes[ i ];
261			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
262			distanceGradient = fwidth( distanceToPlane ) / 2.0;
263			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
264			if ( clipOpacity == 0.0 ) discard;
265		}
266		#pragma unroll_loop_end
267		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
268			float unionClipOpacity = 1.0;
269			#pragma unroll_loop_start
270			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
271				plane = clippingPlanes[ i ];
272				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
273				distanceGradient = fwidth( distanceToPlane ) / 2.0;
274				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
275			}
276			#pragma unroll_loop_end
277			clipOpacity *= 1.0 - unionClipOpacity;
278		#endif
279		diffuseColor.a *= clipOpacity;
280		if ( diffuseColor.a == 0.0 ) discard;
281	#else
282		#pragma unroll_loop_start
283		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
284			plane = clippingPlanes[ i ];
285			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
286		}
287		#pragma unroll_loop_end
288		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
289			bool clipped = true;
290			#pragma unroll_loop_start
291			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
292				plane = clippingPlanes[ i ];
293				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
294			}
295			#pragma unroll_loop_end
296			if ( clipped ) discard;
297		#endif
298	#endif
299#endif`,qM=`#if NUM_CLIPPING_PLANES > 0
300	varying vec3 vClipPosition;
301	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
302#endif`,YM=`#if NUM_CLIPPING_PLANES > 0
303	varying vec3 vClipPosition;
304#endif`,QM=`#if NUM_CLIPPING_PLANES > 0
305	vClipPosition = - mvPosition.xyz;
306#endif`,KM=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
307	diffuseColor *= vColor;
308#endif`,ZM=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
309	varying vec4 vColor;
310#endif`,JM=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
311	varying vec4 vColor;
312#endif`,$M=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
313	vColor = vec4( 1.0 );
314#endif
315#ifdef USE_COLOR_ALPHA
316	vColor *= color;
317#elif defined( USE_COLOR )
318	vColor.rgb *= color;
319#endif
320#ifdef USE_INSTANCING_COLOR
321	vColor.rgb *= instanceColor.rgb;
322#endif
323#ifdef USE_BATCHING_COLOR
324	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
325#endif`,eE=`#define PI 3.141592653589793
326#define PI2 6.283185307179586
327#define PI_HALF 1.5707963267948966
328#define RECIPROCAL_PI 0.3183098861837907
329#define RECIPROCAL_PI2 0.15915494309189535
330#define EPSILON 1e-6
331#ifndef saturate
332#define saturate( a ) clamp( a, 0.0, 1.0 )
333#endif
334#define whiteComplement( a ) ( 1.0 - saturate( a ) )
335float pow2( const in float x ) { return x*x; }
336vec3 pow2( const in vec3 x ) { return x*x; }
337float pow3( const in float x ) { return x*x*x; }
338float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
339float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
340float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
341highp float rand( const in vec2 uv ) {
342	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
343	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
344	return fract( sin( sn ) * c );
345}
346#ifdef HIGH_PRECISION
347	float precisionSafeLength( vec3 v ) { return length( v ); }
348#else
349	float precisionSafeLength( vec3 v ) {
350		float maxComponent = max3( abs( v ) );
351		return length( v / maxComponent ) * maxComponent;
352	}
353#endif
354struct IncidentLight {
355	vec3 color;
356	vec3 direction;
357	bool visible;
358};
359struct ReflectedLight {
360	vec3 directDiffuse;
361	vec3 directSpecular;
362	vec3 indirectDiffuse;
363	vec3 indirectSpecular;
364};
365#ifdef USE_ALPHAHASH
366	varying vec3 vPosition;
367#endif
368vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
369	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
370}
371#define inverseTransformDirection transformDirectionByInverseViewMatrix
372vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {
373	return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );
374}
375vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {
376	return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );
377}
378bool isPerspectiveMatrix( mat4 m ) {
379	return m[ 2 ][ 3 ] == - 1.0;
380}
381vec2 equirectUv( in vec3 dir ) {
382	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
383	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
384	return vec2( u, v );
385}
386vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
387	return RECIPROCAL_PI * diffuseColor;
388}
389vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
390	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
391	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
392}
393float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
394	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
395	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
396} // validated`,tE=`#ifdef ENVMAP_TYPE_CUBE_UV
397	#define cubeUV_minMipLevel 4.0
398	#define cubeUV_minTileSize 16.0
399	float getFace( vec3 direction ) {
400		vec3 absDirection = abs( direction );
401		float face = - 1.0;
402		if ( absDirection.x > absDirection.z ) {
403			if ( absDirection.x > absDirection.y )
404				face = direction.x > 0.0 ? 0.0 : 3.0;
405			else
406				face = direction.y > 0.0 ? 1.0 : 4.0;
407		} else {
408			if ( absDirection.z > absDirection.y )
409				face = direction.z > 0.0 ? 2.0 : 5.0;
410			else
411				face = direction.y > 0.0 ? 1.0 : 4.0;
412		}
413		return face;
414	}
415	vec2 getUV( vec3 direction, float face ) {
416		vec2 uv;
417		if ( face == 0.0 ) {
418			uv = vec2( direction.z, direction.y ) / abs( direction.x );
419		} else if ( face == 1.0 ) {
420			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
421		} else if ( face == 2.0 ) {
422			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
423		} else if ( face == 3.0 ) {
424			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
425		} else if ( face == 4.0 ) {
426			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
427		} else {
428			uv = vec2( direction.x, direction.y ) / abs( direction.z );
429		}
430		return 0.5 * ( uv + 1.0 );
431	}
432	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
433		float face = getFace( direction );
434		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
435		mipInt = max( mipInt, cubeUV_minMipLevel );
436		float faceSize = exp2( mipInt );
437		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
438		if ( face > 2.0 ) {
439			uv.y += faceSize;
440			face -= 3.0;
441		}
442		uv.x += face * faceSize;
443		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
444		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
445		uv.x *= CUBEUV_TEXEL_WIDTH;
446		uv.y *= CUBEUV_TEXEL_HEIGHT;
447		#ifdef texture2DGradEXT
448			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
449		#else
450			return texture2D( envMap, uv ).rgb;
451		#endif
452	}
453	#define cubeUV_r0 1.0
454	#define cubeUV_m0 - 2.0
455	#define cubeUV_r1 0.8
456	#define cubeUV_m1 - 1.0
457	#define cubeUV_r4 0.4
458	#define cubeUV_m4 2.0
459	#define cubeUV_r5 0.305
460	#define cubeUV_m5 3.0
461	#define cubeUV_r6 0.21
462	#define cubeUV_m6 4.0
463	float roughnessToMip( float roughness ) {
464		float mip = 0.0;
465		if ( roughness >= cubeUV_r1 ) {
466			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
467		} else if ( roughness >= cubeUV_r4 ) {
468			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
469		} else if ( roughness >= cubeUV_r5 ) {
470			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
471		} else if ( roughness >= cubeUV_r6 ) {
472			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
473		} else {
474			mip = - 2.0 * log2( 1.16 * roughness );		}
475		return mip;
476	}
477	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
478		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
479		float mipF = fract( mip );
480		float mipInt = floor( mip );
481		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
482		if ( mipF == 0.0 ) {
483			return vec4( color0, 1.0 );
484		} else {
485			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
486			return vec4( mix( color0, color1, mipF ), 1.0 );
487		}
488	}
489#endif`,nE=`vec3 transformedNormal = objectNormal;
490#ifdef USE_TANGENT
491	vec3 transformedTangent = objectTangent;
492#endif
493#ifdef USE_BATCHING
494	mat3 bm = mat3( batchingMatrix );
495	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
496	transformedNormal = bm * transformedNormal;
497	#ifdef USE_TANGENT
498		transformedTangent = bm * transformedTangent;
499	#endif
500#endif
501#ifdef USE_INSTANCING
502	mat3 im = mat3( instanceMatrix );
503	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
504	transformedNormal = im * transformedNormal;
505	#ifdef USE_TANGENT
506		transformedTangent = im * transformedTangent;
507	#endif
508#endif
509transformedNormal = normalMatrix * transformedNormal;
510#ifdef FLIP_SIDED
511	transformedNormal = - transformedNormal;
512#endif
513#ifdef USE_TANGENT
514	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
515#endif`,iE=`#ifdef USE_DISPLACEMENTMAP
516	uniform sampler2D displacementMap;
517	uniform float displacementScale;
518	uniform float displacementBias;
519#endif`,aE=`#ifdef USE_DISPLACEMENTMAP
520	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
520placementBias );
521#endif`,sE=`#ifdef USE_EMISSIVEMAP
522	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
523	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
524		emissiveColor = sRGBTransferEOTF( emissiveColor );
525	#endif
526	totalEmissiveRadiance *= emissiveColor.rgb;
527#endif`,rE=`#ifdef USE_EMISSIVEMAP
528	uniform sampler2D emissiveMap;
529#endif`,oE="gl_FragColor = linearToOutputTexel( gl_FragColor );",lE=`vec4 LinearTransferOETF( in vec4 value ) {
530	return value;
531}
532vec4 sRGBTransferEOTF( in vec4 value ) {
533	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
534}
535vec4 sRGBTransferOETF( in vec4 value ) {
536	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 );
537}`,cE=`#ifdef USE_ENVMAP
538	#ifdef ENV_WORLDPOS
539		vec3 cameraToFrag;
540		if ( isOrthographic ) {
541			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
542		} else {
543			cameraToFrag = normalize( vWorldPosition - cameraPosition );
544		}
545		vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
546		#ifdef ENVMAP_MODE_REFLECTION
547			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
548		#else
549			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
550		#endif
551	#else
552		vec3 reflectVec = vReflect;
553	#endif
554	#ifdef ENVMAP_TYPE_CUBE
555		vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );
556		#ifdef ENVMAP_BLENDING_MULTIPLY
557			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
558		#elif defined( ENVMAP_BLENDING_MIX )
559			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
560		#elif defined( ENVMAP_BLENDING_ADD )
561			outgoingLight += envColor.xyz * specularStrength * reflectivity;
562		#endif
563	#endif
564#endif`,uE=`#ifdef USE_ENVMAP
565	uniform float envMapIntensity;
566	uniform mat3 envMapRotation;
567	#ifdef ENVMAP_TYPE_CUBE
568		uniform samplerCube envMap;
569	#else
570		uniform sampler2D envMap;
571	#endif
572#endif`,fE=`#ifdef USE_ENVMAP
573	uniform float reflectivity;
574	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
575		#define ENV_WORLDPOS
576	#endif
577	#ifdef ENV_WORLDPOS
578		varying vec3 vWorldPosition;
579		uniform float refractionRatio;
580	#else
581		varying vec3 vReflect;
582	#endif
583#endif`,dE=`#ifdef USE_ENVMAP
584	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
585		#define ENV_WORLDPOS
586	#endif
587	#ifdef ENV_WORLDPOS
588		
589		varying vec3 vWorldPosition;
590	#else
591		varying vec3 vReflect;
592		uniform float refractionRatio;
593	#endif
594#endif`,hE=`#ifdef USE_ENVMAP
595	#ifdef ENV_WORLDPOS
596		vWorldPosition = worldPosition.xyz;
597	#else
598		vec3 cameraToVertex;
599		if ( isOrthographic ) {
600			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
601		} else {
602			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
603		}
604		vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
605		#ifdef ENVMAP_MODE_REFLECTION
606			vReflect = reflect( cameraToVertex, worldNormal );
607		#else
608			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
609		#endif
610	#endif
611#endif`,pE=`#ifdef USE_FOG
612	vFogDepth = - mvPosition.z;
613#endif`,mE=`#ifdef USE_FOG
614	varying float vFogDepth;
615#endif`,gE=`#ifdef USE_FOG
616	#ifdef FOG_EXP2
617		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
618	#else
619		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
620	#endif
621	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
622#endif`,xE=`#ifdef USE_FOG
623	uniform vec3 fogColor;
624	varying float vFogDepth;
625	#ifdef FOG_EXP2
626		uniform float fogDensity;
627	#else
628		uniform float fogNear;
629		uniform float fogFar;
630	#endif
631#endif`,vE=`#ifdef USE_GRADIENTMAP
632	uniform sampler2D gradientMap;
633#endif
634vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
635	float dotNL = dot( normal, lightDirection );
636	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
637	#ifdef USE_GRADIENTMAP
638		return vec3( texture2D( gradientMap, coord ).r );
639	#else
640		vec2 fw = fwidth( coord ) * 0.5;
641		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
642	#endif
643}`,_E=`#ifdef USE_LIGHTMAP
644	uniform sampler2D lightMap;
645	uniform float lightMapIntensity;
646#endif`,yE=`LambertMaterial material;
647material.diffuseColor = diffuseColor.rgb;
648material.specularStrength = specularStrength;`,bE=`varying vec3 vViewPosition;
649struct LambertMaterial {
650	vec3 diffuseColor;
651	float specularStrength;
652};
653void 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 ) {
654	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
655	vec3 irradiance = dotNL * directLight.color;
656	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
657}
658void 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 ) {
659	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
660}
661#define RE_Direct				RE_Direct_Lambert
662#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,SE=`uniform bool receiveShadow;
663uniform vec3 ambientLightColor;
664#if defined( USE_LIGHT_PROBES )
665	uniform vec3 lightProbe[ 9 ];
666#endif
667vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
668	float x = normal.x, y = normal.y, z = normal.z;
669	vec3 result = shCoefficients[ 0 ] * 0.886227;
670	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
671	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
672	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
673	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
674	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
675	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
676	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
677	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
678	return result;
679}
680vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
681	vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
682	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
683	return irradiance;
684}
685vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
686	vec3 irradiance = ambientLightColor;
687	return irradiance;
688}
689float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
690	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
691	if ( cutoffDistance > 0.0 ) {
692		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
693	}
694	return distanceFalloff;
695}
696float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
697	return smoothstep( coneCosine, penumbraCosine, angleCosine );
698}
699#if NUM_DIR_LIGHTS > 0
700	struct DirectionalLight {
701		vec3 direction;
702		vec3 color;
703	};
704	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
705	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
706		light.color = directionalLight.color;
707		light.direction = directionalLight.direction;
708		light.visible = true;
709	}
710#endif
711#if NUM_POINT_LIGHTS > 0
712	struct PointLight {
713		vec3 position;
714		vec3 color;
715		float distance;
716		float decay;
717	};
718	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
719	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
720		vec3 lVector = pointLight.position - geometryPosition;
721		light.direction = normalize( lVector );
722		float lightDistance = length( lVector );
723		light.color = pointLight.color;
724		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
725		light.visible = ( light.color != vec3( 0.0 ) );
726	}
727#endif
728#if NUM_SPOT_LIGHTS > 0
729	struct SpotLight {
730		vec3 position;
731		vec3 direction;
732		vec3 color;
733		float distance;
734		float decay;
735		float coneCos;
736		float penumbraCos;
737	};
738	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
739	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
740		vec3 lVector = spotLight.position - geometryPosition;
741		light.direction = normalize( lVector );
742		float angleCos = dot( light.direction, spotLight.direction );
743		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
744		if ( spotAttenuation > 0.0 ) {
745			float lightDistance = length( lVector );
746			light.color = spotLight.color * spotAttenuation;
747			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
748			light.visible = ( light.color != vec3( 0.0 ) );
749		} else {
750			light.color = vec3( 0.0 );
751			light.visible = false;
752		}
753	}
754#endif
755#if NUM_RECT_AREA_LIGHTS > 0
756	struct RectAreaLight {
757		vec3 color;
758		vec3 position;
759		vec3 halfWidth;
760		vec3 halfHeight;
761	};
762	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
763	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
764#endif
765#if NUM_HEMI_LIGHTS > 0
766	struct HemisphereLight {
767		vec3 direction;
768		vec3 skyColor;
769		vec3 groundColor;
770	};
771	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
772	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
773		float dotNL = dot( normal, hemiLight.direction );
774		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
775		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
776		return irradiance;
777	}
778#endif
779#include <lightprobes_pars_fragment>`,ME=`#ifdef USE_ENVMAP
780	vec3 getIBLIrradiance( const in vec3 normal ) {
781		#ifdef ENVMAP_TYPE_CUBE_UV
782			vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
783			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
784			return PI * envMapColor.rgb * envMapIntensity;
785		#else
786			return vec3( 0.0 );
787		#endif
788	}
789	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
790		#ifdef ENVMAP_TYPE_CUBE_UV
791			vec3 reflectVec = reflect( - viewDir, normal );
792			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
793			reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );
794			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
795			return envMapColor.rgb * envMapIntensity;
796		#else
797			return vec3( 0.0 );
798		#endif
799	}
800	#ifdef USE_ANISOTROPY
801		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
802			#ifdef ENVMAP_TYPE_CUBE_UV
803				vec3 bentNormal = cross( bitangent, viewDir );
804				bentNormal = normalize( cross( bentNormal, bitangent ) );
805				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
806				return getIBLRadiance( viewDir, bentNormal, roughness );
807			#else
808				return vec3( 0.0 );
809			#endif
810		}
811	#endif
812#endif`,EE=`ToonMaterial material;
813material.diffuseColor = diffuseColor.rgb;`,TE=`varying vec3 vViewPosition;
814struct ToonMaterial {
815	vec3 diffuseColor;
816};
817void 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 ) {
818	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
819	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
820}
821void 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 ) {
822	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
823}
824#define RE_Direct				RE_Direct_Toon
825#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,AE=`BlinnPhongMaterial material;
826material.diffuseColor = diffuseColor.rgb;
827material.specularColor = specular;
828material.specularShininess = shininess;
829material.specularStrength = specularStrength;`,wE=`varying vec3 vViewPosition;
830struct BlinnPhongMaterial {
831	vec3 diffuseColor;
832	vec3 specularColor;
833	float specularShininess;
834	float specularStrength;
835};
836void 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 ) {
837	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
838	vec3 irradiance = dotNL * directLight.color;
839	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
840	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
841}
842void 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 ) {
843	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
844}
845#define RE_Direct				RE_Direct_BlinnPhong
846#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,CE=`PhysicalMaterial material;
847material.diffuseColor = diffuseColor.rgb;
848material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
849material.metalness = metalnessFactor;
850vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
851float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
852material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
853material.roughness = min( material.roughness, 1.0 );
854#ifdef IOR
855	material.ior = ior;
856	#ifdef USE_SPECULAR
857		float specularIntensityFactor = specularIntensity;
858		vec3 specularColorFactor = specularColor;
859		#ifdef USE_SPECULAR_COLORMAP
860			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
861		#endif
862		#ifdef USE_SPECULAR_INTENSITYMAP
863			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
864		#endif
865		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
866	#else
867		float specularIntensityFactor = 1.0;
868		vec3 specularColorFactor = vec3( 1.0 );
869		material.specularF90 = 1.0;
870	#endif
871	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
872	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
873#else
874	material.specularColor = vec3( 0.04 );
875	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
876	material.specularF90 = 1.0;
877#endif
878#ifdef USE_CLEARCOAT
879	material.clearcoat = clearcoat;
880	material.clearcoatRoughness = clearcoatRoughness;
881	material.clearcoatF0 = vec3( 0.04 );
882	material.clearcoatF90 = 1.0;
883	#ifdef USE_CLEARCOATMAP
884		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
885	#endif
886	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
887		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
888	#endif
889	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
890	material.clearcoatRoughness += geometryRoughness;
891	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
892#endif
893#ifdef USE_DISPERSION
894	material.dispersion = dispersion;
895#endif
896#ifdef USE_IRIDESCENCE
897	material.iridescence = iridescence;
898	material.iridescenceIOR = iridescenceIOR;
899	#ifdef USE_IRIDESCENCEMAP
900		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
901	#endif
902	#ifdef USE_IRIDESCENCE_THICKNESSMAP
903		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
904	#else
905		material.iridescenceThickness = iridescenceThicknessMaximum;
906	#endif
907#endif
908#ifdef USE_SHEEN
909	material.sheenColor = sheenColor;
910	#ifdef USE_SHEEN_COLORMAP
911		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
912	#endif
913	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
914	#ifdef USE_SHEEN_ROUGHNESSMAP
915		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
916	#endif
917#endif
918#ifdef USE_ANISOTROPY
919	#ifdef USE_ANISOTROPYMAP
920		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
921		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
922		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
923	#else
924		vec2 anisotropyV = anisotropyVector;
925	#endif
926	material.anisotropy = length( anisotropyV );
927	if( material.anisotropy == 0.0 ) {
928		anisotropyV = vec2( 1.0, 0.0 );
929	} else {
930		anisotropyV /= material.anisotropy;
931		material.anisotropy = saturate( material.anisotropy );
932	}
933	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
934	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
935	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
936#endif`,RE=`uniform sampler2D dfgLUT;
937struct PhysicalMaterial {
938	vec3 diffuseColor;
939	vec3 diffuseContribution;
940	vec3 specularColor;
941	vec3 specularColorBlended;
942	float roughness;
943	float metalness;
944	float specularF90;
945	float dispersion;
946	#ifdef USE_CLEARCOAT
947		float clearcoat;
948		float clearcoatRoughness;
949		vec3 clearcoatF0;
950		float clearcoatF90;
951	#endif
952	#ifdef USE_IRIDESCENCE
953		float iridescence;
954		float iridescenceIOR;
955		float iridescenceThickness;
956		vec3 iridescenceFresnel;
957		vec3 iridescenceF0;
958		vec3 iridescenceFresnelDielectric;
959		vec3 iridescenceFresnelMetallic;
960	#endif
961	#ifdef USE_SHEEN
962		vec3 sheenColor;
963		float sheenRoughness;
964	#endif
965	#ifdef IOR
966		float ior;
967	#endif
968	#ifdef USE_TRANSMISSION
969		float transmission;
970		float transmissionAlpha;
971		float thickness;
972		float attenuationDistance;
973		vec3 attenuationColor;
974	#endif
975	#ifdef USE_ANISOTROPY
976		float anisotropy;
977		float alphaT;
978		vec3 anisotropyT;
979		vec3 anisotropyB;
980	#endif
981};
982vec3 clearcoatSpecularDirect = vec3( 0.0 );
983vec3 clearcoatSpecularIndirect = vec3( 0.0 );
984vec3 sheenSpecularDirect = vec3( 0.0 );
985vec3 sheenSpecularIndirect = vec3(0.0 );
986vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
987    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
988    float x2 = x * x;
989    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
990    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
991}
992float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
993	float a2 = pow2( alpha );
994	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
995	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
996	return 0.5 / max( gv + gl, EPSILON );
997}
998float D_GGX( const in float alpha, const in float dotNH ) {
999	float a2 = pow2( alpha );
1000	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1001	return RECIPROCAL_PI * a2 / pow2( denom );
1002}
1003#ifdef USE_ANISOTROPY
1004	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 ) {
1005		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1006		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1007		return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 1007-1166
1007;
1008	}
1009	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1010		float a2 = alphaT * alphaB;
1011		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1012		highp float v2 = dot( v, v );
1013		float w2 = a2 / v2;
1014		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1015	}
1016#endif
1017#ifdef USE_CLEARCOAT
1018	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1019		vec3 f0 = material.clearcoatF0;
1020		float f90 = material.clearcoatF90;
1021		float roughness = material.clearcoatRoughness;
1022		float alpha = pow2( roughness );
1023		vec3 halfDir = normalize( lightDir + viewDir );
1024		float dotNL = saturate( dot( normal, lightDir ) );
1025		float dotNV = saturate( dot( normal, viewDir ) );
1026		float dotNH = saturate( dot( normal, halfDir ) );
1027		float dotVH = saturate( dot( viewDir, halfDir ) );
1028		vec3 F = F_Schlick( f0, f90, dotVH );
1029		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1030		float D = D_GGX( alpha, dotNH );
1031		return F * ( V * D );
1032	}
1033#endif
1034vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1035	vec3 f0 = material.specularColorBlended;
1036	float f90 = material.specularF90;
1037	float roughness = material.roughness;
1038	float alpha = pow2( roughness );
1039	vec3 halfDir = normalize( lightDir + viewDir );
1040	float dotNL = saturate( dot( normal, lightDir ) );
1041	float dotNV = saturate( dot( normal, viewDir ) );
1042	float dotNH = saturate( dot( normal, halfDir ) );
1043	float dotVH = saturate( dot( viewDir, halfDir ) );
1044	vec3 F = F_Schlick( f0, f90, dotVH );
1045	#ifdef USE_IRIDESCENCE
1046		F = mix( F, material.iridescenceFresnel, material.iridescence );
1047	#endif
1048	#ifdef USE_ANISOTROPY
1049		float dotTL = dot( material.anisotropyT, lightDir );
1050		float dotTV = dot( material.anisotropyT, viewDir );
1051		float dotTH = dot( material.anisotropyT, halfDir );
1052		float dotBL = dot( material.anisotropyB, lightDir );
1053		float dotBV = dot( material.anisotropyB, viewDir );
1054		float dotBH = dot( material.anisotropyB, halfDir );
1055		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1056		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1057	#else
1058		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1059		float D = D_GGX( alpha, dotNH );
1060	#endif
1061	return F * ( V * D );
1062}
1063vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1064	const float LUT_SIZE = 64.0;
1065	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1066	const float LUT_BIAS = 0.5 / LUT_SIZE;
1067	float dotNV = saturate( dot( N, V ) );
1068	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1069	uv = uv * LUT_SCALE + LUT_BIAS;
1070	return uv;
1071}
1072float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1073	float l = length( f );
1074	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1075}
1076vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1077	float x = dot( v1, v2 );
1078	float y = abs( x );
1079	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1080	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1081	float v = a / b;
1082	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1083	return cross( v1, v2 ) * theta_sintheta;
1084}
1085vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1086	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1087	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1088	vec3 lightNormal = cross( v1, v2 );
1089	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1090	vec3 T1, T2;
1091	T1 = normalize( V - N * dot( V, N ) );
1092	T2 = - cross( N, T1 );
1093	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1094	vec3 coords[ 4 ];
1095	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1096	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1097	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1098	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1099	coords[ 0 ] = normalize( coords[ 0 ] );
1100	coords[ 1 ] = normalize( coords[ 1 ] );
1101	coords[ 2 ] = normalize( coords[ 2 ] );
1102	coords[ 3 ] = normalize( coords[ 3 ] );
1103	vec3 vectorFormFactor = vec3( 0.0 );
1104	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1105	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1106	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1107	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1108	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1109	return vec3( result );
1110}
1111#if defined( USE_SHEEN )
1112float D_Charlie( float roughness, float dotNH ) {
1113	float alpha = pow2( roughness );
1114	float invAlpha = 1.0 / alpha;
1115	float cos2h = dotNH * dotNH;
1116	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1117	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1118}
1119float V_Neubelt( float dotNV, float dotNL ) {
1120	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1121}
1122vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1123	vec3 halfDir = normalize( lightDir + viewDir );
1124	float dotNL = saturate( dot( normal, lightDir ) );
1125	float dotNV = saturate( dot( normal, viewDir ) );
1126	float dotNH = saturate( dot( normal, halfDir ) );
1127	float D = D_Charlie( sheenRoughness, dotNH );
1128	float V = V_Neubelt( dotNV, dotNL );
1129	return sheenColor * ( D * V );
1130}
1131#endif
1132float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1133	float dotNV = saturate( dot( normal, viewDir ) );
1134	float r2 = roughness * roughness;
1135	float rInv = 1.0 / ( roughness + 0.1 );
1136	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1137	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1138	float DG = exp( a * dotNV + b );
1139	return saturate( DG );
1140}
1141vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1142	float dotNV = saturate( dot( normal, viewDir ) );
1143	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1144	return specularColor * fab.x + specularF90 * fab.y;
1145}
1146#ifdef USE_IRIDESCENCE
1147void 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 ) {
1148#else
1149void 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 ) {
1150#endif
1151	float dotNV = saturate( dot( normal, viewDir ) );
1152	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1153	#ifdef USE_IRIDESCENCE
1154		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1155	#else
1156		vec3 Fr = specularColor;
1157	#endif
1158	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1159	float Ess = fab.x + fab.y;
1160	float Ems = 1.0 - Ess;
1161	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1162	singleScatter += FssEss;
1163	multiScatter += Fms * Ems;
1164}
1165vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1166	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1167-1296
1167	float dotNL = saturate( dot( normal, lightDir ) );
1168	float dotNV = saturate( dot( normal, viewDir ) );
1169	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1170	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1171	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1172	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1173	float Ess_V = dfgV.x + dfgV.y;
1174	float Ess_L = dfgL.x + dfgL.y;
1175	float Ems_V = 1.0 - Ess_V;
1176	float Ems_L = 1.0 - Ess_L;
1177	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1178	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1179	float compensationFactor = Ems_V * Ems_L;
1180	vec3 multiScatter = Fms * compensationFactor;
1181	return singleScatter + multiScatter;
1182}
1183#if NUM_RECT_AREA_LIGHTS > 0
1184	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 ) {
1185		vec3 normal = geometryNormal;
1186		vec3 viewDir = geometryViewDir;
1187		vec3 position = geometryPosition;
1188		vec3 lightPos = rectAreaLight.position;
1189		vec3 halfWidth = rectAreaLight.halfWidth;
1190		vec3 halfHeight = rectAreaLight.halfHeight;
1191		vec3 lightColor = rectAreaLight.color;
1192		float roughness = material.roughness;
1193		vec3 rectCoords[ 4 ];
1194		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1195		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1196		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1197		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1198		vec4 t1 = texture2D( ltc_1, uv );
1199		vec4 t2 = texture2D( ltc_2, uv );
1200		mat3 mInv = mat3(
1201			vec3( t1.x, 0, t1.y ),
1202			vec3(    0, 1,    0 ),
1203			vec3( t1.z, 0, t1.w )
1204		);
1205		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1206		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1207		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1208		#ifdef USE_CLEARCOAT
1209			vec3 Ncc = geometryClearcoatNormal;
1210			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1211			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1212			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1213			mat3 mInvClearcoat = mat3(
1214				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1215				vec3(             0, 1,             0 ),
1216				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1217			);
1218			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1219			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1220		#endif
1221	}
1222#endif
1223void 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 ) {
1224	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1225	vec3 irradiance = dotNL * directLight.color;
1226	#ifdef USE_CLEARCOAT
1227		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1228		vec3 ccIrradiance = dotNLcc * directLight.color;
1229		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1230	#endif
1231	#ifdef USE_SHEEN
1232 
1233 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1234 
1235 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1236 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1237 
1238 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1239 
1240 		irradiance *= sheenEnergyComp;
1241 
1242 	#endif
1243	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1244	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1245}
1246void 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 ) {
1247	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1248	#ifdef USE_SHEEN
1249		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1250		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1251		diffuse *= sheenEnergyComp;
1252	#endif
1253	reflectedLight.indirectDiffuse += diffuse;
1254}
1255void 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) {
1256	#ifdef USE_CLEARCOAT
1257		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1258	#endif
1259	#ifdef USE_SHEEN
1260		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1261 	#endif
1262	vec3 singleScatteringDielectric = vec3( 0.0 );
1263	vec3 multiScatteringDielectric = vec3( 0.0 );
1264	vec3 singleScatteringMetallic = vec3( 0.0 );
1265	vec3 multiScatteringMetallic = vec3( 0.0 );
1266	#ifdef USE_IRIDESCENCE
1267		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1268		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1269	#else
1270		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1271		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1272	#endif
1273	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1274	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1275	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1276	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1277	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1278	vec3 indirectSpecular = radiance * singleScattering;
1279	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1280	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1281	#ifdef USE_SHEEN
1282		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1283		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1284		indirectSpecular *= sheenEnergyComp;
1285		indirectDiffuse *= sheenEnergyComp;
1286	#endif
1287	reflectedLight.indirectSpecular += indirectSpecular;
1288	reflectedLight.indirectDiffuse += indirectDiffuse;
1289}
1290#define RE_Direct				RE_Direct_Physical
1291#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1292#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1293#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1294float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1295	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1296}`,
1296NE=`
1297vec3 geometryPosition = - vViewPosition;
1298vec3 geometryNormal = normal;
1299vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1300vec3 geometryClearcoatNormal = vec3( 0.0 );
1301#ifdef USE_CLEARCOAT
1302	geometryClearcoatNormal = clearcoatNormal;
1303#endif
1304#ifdef USE_IRIDESCENCE
1305	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1306	if ( material.iridescenceThickness == 0.0 ) {
1307		material.iridescence = 0.0;
1308	} else {
1309		material.iridescence = saturate( material.iridescence );
1310	}
1311	if ( material.iridescence > 0.0 ) {
1312		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1313		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1314		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1315		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1316	}
1317#endif
1318IncidentLight directLight;
1319#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1320	PointLight pointLight;
1321	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1322	PointLightShadow pointLightShadow;
1323	#endif
1324	#pragma unroll_loop_start
1325	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1326		pointLight = pointLights[ i ];
1327		getPointLightInfo( pointLight, geometryPosition, directLight );
1328		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1329		pointLightShadow = pointLightShadows[ i ];
1330		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1331		#endif
1332		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1333	}
1334	#pragma unroll_loop_end
1335#endif
1336#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1337	SpotLight spotLight;
1338	vec4 spotColor;
1339	vec3 spotLightCoord;
1340	bool inSpotLightMap;
1341	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1342	SpotLightShadow spotLightShadow;
1343	#endif
1344	#pragma unroll_loop_start
1345	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1346		spotLight = spotLights[ i ];
1347		getSpotLightInfo( spotLight, geometryPosition, directLight );
1348		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1349		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1350		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1351		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1352		#else
1353		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1354		#endif
1355		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1356			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1357			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1358			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1359			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1360		#endif
1361		#undef SPOT_LIGHT_MAP_INDEX
1362		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1363		spotLightShadow = spotLightShadows[ i ];
1364		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1365		#endif
1366		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1367	}
1368	#pragma unroll_loop_end
1369#endif
1370#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1371	DirectionalLight directionalLight;
1372	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1373	DirectionalLightShadow directionalLightShadow;
1374	#endif
1375	#pragma unroll_loop_start
1376	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1377		directionalLight = directionalLights[ i ];
1378		getDirectionalLightInfo( directionalLight, directLight );
1379		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1380		directionalLightShadow = directionalLightShadows[ i ];
1381		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1382		#endif
1383		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1384	}
1385	#pragma unroll_loop_end
1386#endif
1387#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1388	RectAreaLight rectAreaLight;
1389	#pragma unroll_loop_start
1390	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1391		rectAreaLight = rectAreaLights[ i ];
1392		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1393	}
1394	#pragma unroll_loop_end
1395#endif
1396#if defined( RE_IndirectDiffuse )
1397	vec3 iblIrradiance = vec3( 0.0 );
1398	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1399	#if defined( USE_LIGHT_PROBES )
1400		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1401	#endif
1402	#if ( NUM_HEMI_LIGHTS > 0 )
1403		#pragma unroll_loop_start
1404		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1405			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1406		}
1407		#pragma unroll_loop_end
1408	#endif
1409	#ifdef USE_LIGHT_PROBES_GRID
1410		vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
1411		vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );
1412		irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
1413	#endif
1414#endif
1415#if defined( RE_IndirectSpecular )
1416	vec3 radiance = vec3( 0.0 );
1417	vec3 clearcoatRadiance = vec3( 0.0 );
1418#endif`,DE=`#if defined( RE_IndirectDiffuse )
1419	#ifdef USE_LIGHTMAP
1420		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1421		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1422		irradiance += lightMapIrradiance;
1423	#endif
1424	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1425		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1426			iblIrradiance += getIBLIrradiance( geometryNormal );
1427		#endif
1428	#endif
1429#endif
1430#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1431	#ifdef USE_ANISOTROPY
1432		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1433	#else
1434		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1435	#endif
1436	#ifdef USE_CLEARCOAT
1437		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1438	#endif
1439#endif`,UE=`#if defined( RE_IndirectDiffuse )
1440	#if defined( LAMBERT ) || defined( PHONG )
1441		irradiance += iblIrradiance;
1442	#endif
1443	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1444#endif
1445#if defined( RE_IndirectSpecular )
1446	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1447#endif`,LE=`#ifdef USE_LIGHT_PROBES_GRID
1448uniform highp sampler3D probesSH;
1449uniform vec3 probesMin;
1450uniform vec3 probesMax;
1451uniform vec3 probesResolution;
1452vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1453	vec3 res = probesResolution;
1454	vec3 gridRange = probesMax - probesMin;
1455	vec3 resMinusOne = res - 1.0;
1456	vec3 probeSpacing = gridRange / resMinusOne;
1457	vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
1458	vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
1459	uvw = uvw * resMinusOne / res + 0.5 / res;
1460	float nz          = res.z;
1461	float paddedSlices = nz + 2.0;
1462	float atlasDepth  = 7.0 * paddedSlices;
1463	float uvZBase     = uvw.z * nz + 1.0;
1464	vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );
1465	vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );
1466	vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );
1467	vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );
1468	vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );
1469	vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );
1470	vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );
1471	vec3 c0 = s0.xyz;
1472	vec3 c1 = vec3( s0.w, s1.xy );
1473	vec3 c2 = vec3( s1.zw, s2.x );
1474	vec3 c3 = s2.yzw;
1475	vec3 c4 = s3.xyz;
1476	vec3 c5 = vec3( s3.w, s4.xy );
1477	vec3 c6 = vec3( s4.zw, s5.x );
1478	vec3 c7 = s5.yzw;
1479	vec3 c8 = s6.xyz;
1480	float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
1481	vec3 result = c0 * 0.886227;
1482	result += c1 * 2.0 * 0.511664 * y;
1483	result += c2 * 2.0 * 0.511664 * z;
1484	result += c3 * 2.0 * 0.511664 * x;
1485	result += c4 * 2.0 * 0.429043 * x * y;
1486	result += c5 * 2.0 * 0.429043 * y * z;
1487	result += c6 * ( 0.743125 * z * z - 0.247708 );
1488	result += c7 * 2.0 * 0.429043 * x * z;
1489	result += c8 * 0.429043 * ( x * x - y * y );
1490	return max( result, vec3( 0.0 ) );
1491}
1492#endif`,OE=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1493	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1494#endif`,PE=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1495	uniform float logDepthBufFC;
1496	varying float vFragDepth;
1497	varying float vIsPerspective;
1498#endif`,IE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1499	varying float vFragDepth;
1500	varying float vIsPerspective;
1501#endif`,FE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1502	vFragDepth = 1.0 + gl_Position.w;
1503	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1504#endif`,zE=`#ifdef USE_MAP
1505	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1506	#ifdef DECODE_VIDEO_TEXTURE
1507		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1508	#endif
1509	diffuseColor *= sampledDiffuseColor;
1510#endif`,BE=`#ifdef USE_MAP
1511	uniform sampler2D map;
1512#endif`,HE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1513	#if defined( USE_POINTS_UV )
1514		vec2 uv = vUv;
1515	#else
1516		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1517	#endif
1518#endif
1519#ifdef USE_MAP
1520	diffuseColor *= texture2D( map, uv );
1521#endif
1522#ifdef USE_ALPHAMAP
1523	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1524#endif`,GE=`#if defined( USE_POINTS_UV )
1525	varying vec2 vUv;
1526#else
1527	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1528		uniform mat3 uvTransform;
1529	#endif
1530#endif
1531#ifdef USE_MAP
1532	uniform sampler2D map;
1533#endif
1534#ifdef USE_ALPHAMAP
1535	uniform sampler2D alphaMap;
1536#endif`,kE=`float metalnessFactor = metalness;
1537#ifdef USE_METALNESSMAP
1538	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1539	metalnessFactor *= texelMetalness.b;
1540#endif`,VE=`#ifdef USE_METALNESSMAP
1541	uniform sampler2D metalnessMap;
1542#endif`,jE=`#ifdef USE_INSTANCING_MORPH
1543	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1544	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1545	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1546		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1547	}
1548#endif`,XE=`#if defined( USE_MORPHCOLORS )
1549	vColor *= morphTargetBaseInfluence;
1550	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1551		#if defined( USE_COLOR_ALPHA )
1552			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1553		#elif defined( USE_COLOR )
1554			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1555		#endif
1556	}
1557#endif`,WE=`#ifdef USE_MORPHNORMALS
1558	objectNormal *= morphTargetBaseInfluence;
1559	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1560		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1561	}
1562#endif`,qE=`#ifdef USE_MORPHTARGETS
1563	#ifndef USE_INSTANCING_MORPH
1564		uniform float morphTargetBaseInfluence;
1565		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1566	#endif
1567	uniform sampler2DArray morphTargetsTexture;
1568	uniform ivec2 morphTargetsTextureSize;
1569	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1570		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1571		int y = texelIndex / morphTargetsTextureSize.x;
1572		int x = texelIndex - y * morphTargetsTextureSize.x;
1573		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1574		return texelFetch( morphTargetsTexture, morphUV, 0 );
1575	}
1576#endif`,YE=`#ifdef USE_MORPHTARGETS
1577	transformed *= morphTargetBaseInfluence;
1578	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1579		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1580	}
1581#endif`,QE=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1582#ifdef FLAT_SHADED
1583	vec3 fdx = dFdx( vViewPosition );
1584	vec3 fdy = dFdy( vViewPosition );
1585	vec3 normal = normalize( cross( fdx, fdy ) );
1586#else
1587	vec3 normal = normalize( vNormal );
1588	#ifdef DOUBLE_SIDED
1589		normal *= faceDirection;
1590	#endif
1591#endif
1592#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1593	#ifdef USE_TANGENT
1594		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1595	#else
1596		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1597		#if defined( USE_NORMALMAP )
1598			vNormalMapUv
1599		#elif defined( USE_CLEARCOAT_NORMALMAP )
1600			vClearcoatNormalMapUv
1601		#else
1602			vUv
1603		#endif
1604		);
1605	#endif
1606	#ifdef DOUBLE_SIDED
1607		tbn[0] *= faceDirection;
1608		tbn[1] *= faceDirection;
1609	#endif
1610#endif
1611#ifdef USE_CLEARCOAT_NORMALMAP
1612	#ifdef USE_TANGENT
1613		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1614	#else
1615		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1616	#endif
1617	#ifdef DOUBLE_SIDED
1618		tbn2[0] *= faceDirection;
1619		tbn2[1] *= faceDirection;
1620	#endif
1621#endif
1622vec3 nonPerturbedNormal = normal;`,KE=`#ifdef USE_NORMALMAP_OBJECTSPACE
1623	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1624	#ifdef FLIP_SIDED
1625		normal = - normal;
1626	#endif
1627	#ifdef DOUBLE_SIDED
1628		normal = normal * faceDirection;
1629	#endif
1630	normal = normalize( normalMatrix * normal );
1631#elif defined( USE_NORMALMAP_TANGENTSPACE )
1632	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1633	#if defined( USE_PACKED_NORMALMAP )
1634		mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
1635	#endif
1636	mapN.xy *= normalScale;
1637	normal = normalize( tbn * mapN );
1638#elif defined( USE_BUMPMAP )
1639	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1640#endif`,ZE=`#ifndef FLAT_SHADED
1641	varying vec3 vNormal;
1642	#ifdef USE_TANGENT
1643		varying vec3 vTangent;
1644		varying vec3 vBitangent;
1645	#endif
1646#endif`,JE=`#ifndef FLAT_SHADED
1647	varying vec3 vNormal;
1648	#ifdef USE_TANGENT
1649		varying vec3 vTangent;
1650		varying vec3 vBitangent;
1651	#endif
1652#endif`,$E=`#ifndef FLAT_SHADED
1653	vNormal = normalize( transformedNormal );
1654	#ifdef USE_TANGENT
1655		vTangent = normalize( transformedTangent );
1656		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1657		#ifdef FLIP_SIDED
1658			vBitangent = - vBitangent;
1659		#endif
1660	#endif
1661#endif`,eT=`#ifdef USE_NORMALMAP
1662	uniform sampler2D normalMap;
1663	uniform vec2 normalScale;
1664#endif
1665#ifdef USE_NORMALMAP_OBJECTSPACE
1666	uniform mat3 normalMatrix;
1667#endif
1668#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1669	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1670		vec3 q0 = dFdx( eye_pos.xyz );
1671		vec3 q1 = dFdy( eye_pos.xyz );
1672		vec2 st0 = dFdx( uv.st );
1673		vec2 st1 = dFdy( uv.st );
1674		vec3 N = surf_norm;
1675		vec3 q1perp = cross( q1, N );
1676		vec3 q0perp = cross( N, q0 );
1677		vec3 T = q1perp * st0.x + q0perp * st1.x;
1678		vec3 B = q1perp * st0.y + q0perp * st1.y;
1679		float det = max( dot( T, T ), dot( B, B ) );
1680		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1681		return mat3( T * scale, B * scale, N );
1682	}
1683#endif`,tT=`#ifdef USE_CLEARCOAT
1684	vec3 clearcoatNormal = nonPerturbedNormal;
1685#endif`,nT=`#ifdef USE_CLEARCOAT_NORMALMAP
1686	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1687	clearcoatMapN.xy *= clearcoatNormalScale;
1688	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1689#endif`,iT=`#ifdef USE_CLEARCOATMAP
1690	uniform sampler2D clearcoatMap;
1691#endif
1692#ifdef USE_CLEARCOAT_NORMALMAP
1693	uniform sampler2D clearcoatNormalMap;
1694	uniform vec2 clearcoatNormalScale;
1695#endif
1696#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1697	uniform sampler2D clearcoatRoughnessMap;
1698#endif`,aT=`#ifdef USE_IRIDESCENCEMAP
1699	uniform sampler2D iridescenceMap;
1700#endif
1701#ifdef USE_IRIDESCENCE_THICKNESSMAP
1702	uniform sampler2D iridescenceThicknessMap;
1703#endif`,sT=`#ifdef OPAQUE
1704diffuseColor.a = 1.0;
1705#endif
1706#ifdef USE_TRANSMISSION
1707diffuseColor.a *= material.transmissionAlpha;
1708#endif
1709gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rT=`vec3 packNormalToRGB( const in vec3 normal ) {
1710	return normalize( normal ) * 0.5 + 0.5;
1711}
1712vec3 unpackRGBToNormal( const in vec3 rgb ) {
1713	return 2.0 * rgb.xyz - 1.0;
1714}
1715const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1716const float Inv255 = 1. / 255.;
1717const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1718const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1719const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1720const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1721vec4 packDepthToRGBA( const in float v ) {
1722	if( v <= 0.0 )
1723		return vec4( 0., 0., 0., 0. );
1724	if( v >= 1.0 )
1725		return vec4( 1., 1., 1., 1. );
1726	float vuf;
1727	float af = modf( v * PackFactors.a, vuf );
1728	float bf = modf( vuf * ShiftRight8, vuf );
1729	float gf = modf( vuf * ShiftRight8, vuf );
1730	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1731}
1732vec3 packDepthToRGB( const in float v ) {
1733	if( v <= 0.0 )
1734		return vec3( 0., 0., 0. );
1735	if( v >= 1.0 )
1736		return vec3( 1., 1., 1. );
1737	float vuf;
1738	float bf = modf( v * PackFactors.b, vuf );
1739	float gf = modf( vuf * ShiftRight8, vuf );
1740	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1741}
1742vec2 packDepthToRG( const in float v ) {
1743	if( v <= 0.0 )
1744		return vec2( 0., 0. );
1745	if( v >= 1.0 )
1746		return vec2( 1., 1. );
1747	float vuf;
1748	float gf = modf( v * 256., vuf );
1749	return vec2( vuf * Inv255, gf );
1750}
1751float unpackRGBAToDepth( const in vec4 v ) {
1752	return dot( v, UnpackFactors4 );
1753}
1754float unpackRGBToDepth( const in vec3 v ) {
1755	return dot( v, UnpackFactors3 );
1756}
1757float unpackRGToDepth( const in vec2 v ) {
1758	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1759}
1760vec4 pack2HalfToRGBA( const in vec2 v ) {
1761	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1762	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1763}
1764vec2 unpackRGBATo2Half( const in vec4 v ) {
1765	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1766}
1767float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1768	return ( viewZ + near ) / ( near - far );
1769}
1770float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1771	#ifdef USE_REVERSED_DEPTH_BUFFER
1772	
1773		return depth * ( far - near ) - far;
1774	#else
1775		return depth * ( near - far ) - near;
1776	#endif
1777}
1778float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1779	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1780}
1781float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1782	
1783	#ifdef USE_REVERSED_DEPTH_BUFFER
1784		return ( near * far ) / ( ( near - far ) * depth - near );
1785	#else
1786		return ( near * far ) / ( ( far - near ) * depth - far );
1787	#endif
1788}`,oT=`#ifdef PREMULTIPLIED_ALPHA
1789	gl_FragColor.rgb *= gl_FragColor.a;
1790#endif`,lT=`vec4 mvPosition = vec4( transformed, 1.0 );
1791#ifdef USE_BATCHING
1792	mvPosition = batchingMatrix * mvPosition;
1793#endif
1794#ifdef USE_INSTANCING
1795	mvPosition = instanceMatrix * mvPosition;
1796#endif
1797mvPosition = modelViewMatrix * mvPosition;
1798gl_Position = projectionMatrix * mvPosition;`,cT=`#ifdef DITHERING
1799	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1800#endif`,uT=`#ifdef DITHERING
1801	vec3 dithering( vec3 color ) {
1802		float grid_position = rand( gl_FragCoord.xy );
1803		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1804		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1805		return color + dither_shift_RGB;
1806	}
1807#endif`,fT=`float roughnessFactor = roughness;
1808#ifdef USE_ROUGHNESSMAP
1809	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1810	roughnessFactor *= texelRoughness.g;
1811#endif`,dT=`#ifdef USE_ROUGHNESSMAP
1812	uniform sampler2D roughnessMap;
1813#endif`,hT=`#if NUM_SPOT_LIGHT_COORDS > 0
1814	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1815#endif
1816#if NUM_SPOT_LIGHT_MAPS > 0
1817	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1818#endif
1819#ifdef USE_SHADOWMAP
1820	#if NUM_DIR_LIGHT_SHADOWS > 0
1821		#if defined( SHADOWMAP_TYPE_PCF )
1822			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1823		#else
1824			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1825		#endif
1826		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1827		struct DirectionalLightShadow {
1828			float shadowIntensity;
1829			float shadowBias;
1830			float shadowNormalBias;
1831			float shadowRadius;
1832			vec2 shadowMapSize;
1833		};
1834		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1835	#endif
1836	#if NUM_SPOT_LIGHT_SHADOWS > 0
1837		#if defined( SHADOWMAP_TYPE_PCF )
1838			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1839		#else
1840			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1841		#endif
1842		struct SpotLightShadow {
1843			float shadowIntensity;
1844			float shadowBias;
1845			float shadowNormalBias;
1846			float shadowRadius;
1847			vec2 shadowMapSize;
1848		};
1849		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1850	#endif
1851	#if NUM_POINT_LIGHT_SHADOWS > 0
1852		#if defined( SHADOWMAP_TYPE_PCF )
1853			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1854		#elif defined( SHADOWMAP_TYPE_BASIC )
1855			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1856		#endif
1857		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1858		struct PointLightShadow {
1859			float shadowIntensity;
1860			float shadowBias;
1861			float shadowNormalBias;
1862			float shadowRadius;
1863			vec2 shadowMapSize;
1864			float shadowCameraNear;
1865			float shadowCameraFar;
1866		};
1867		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1868	#endif
1869	#if defined( SHADOWMAP_TYPE_PCF )
1870		float interleavedGradientNoise( vec2 position ) {
1871			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
1872		}
1873		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
1874			const float goldenAngle = 2.399963229728653;
1875			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
1876			float theta = float( sampleIndex ) * goldenAngle + phi;
1877			return vec2( cos( theta ), sin( theta ) ) * r;
1878		}
1879	#endif
1880	#if defined( SHADOWMAP_TYPE_PCF )
1881		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1882			float shadow = 1.0;
1883			shadowCoord.xyz /= shadowCoord.w;
1884			shadowCoord.z += shadowBias;
1885			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1886			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1887			if ( frustumTest ) {
1888				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1889				float radius = shadowRadius * texelSize.x;
1890				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1891				shadow = (
1892					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
1893					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
1894					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
1895					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
1896					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
1897				) * 0.2;
1898			}
1899			return mix( 1.0, shadow, shadowIntensity );
1900		}
1901	#elif defined( SHADOWMAP_TYPE_VSM )
1902		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1903			float shadow = 1.0;
1904			shadowCoord.xyz /= shadowCoord.w;
1905			#ifdef USE_REVERSED_DEPTH_BUFFER
1906				shadowCoord.z -= shadowBias;
1907			#else
1908				shadowCoord.z += shadowBias;
1909			#endif
1910			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1911			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1912			if ( frustumTest ) {
1913				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
1914				float mean = distribution.x;
1915				float variance = distribution.y * distribution.y;
1916				#ifdef USE_REVERSED_DEPTH_BUFFER
1917					float hard_shadow = step( mean, shadowCoord.z );
1918				#else
1919					float hard_shadow = step( shadowCoord.z, mean );
1920				#endif
1921				
1922				if ( hard_shadow == 1.0 ) {
1923					shadow = 1.0;
1924				} else {
1925					variance = max( variance, 0.0000001 );
1926					float d = shadowCoord.z - mean;
1927					float p_max = variance / ( variance + d * d );
1928					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
1929					shadow = max( hard_shadow, p_max );
1930				}
1931			}
1932			return mix( 1.0, shadow, shadowIntensity );
1933		}
1934	#else
1935		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1936			float shadow = 1.0;
1937			shadowCoord.xyz /= shadowCoord.w;
1938			#ifdef USE_REVERSED_DEPTH_BUFFER
1939				shadowCoord.z -= shadowBias;
1940			#else
1941				shadowCoord.z += shadowBias;
1942			#endif
1943			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1944			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1945			if ( frustumTest ) {
1946				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
1947				#ifdef USE_REVERSED_DEPTH_BUFFER
1948					shadow = step( depth, shadowCoord.z );
1949				#else
1950					shadow = step( shadowCoord.z, depth );
1951				#endif
1952			}
1953			return mix( 1.0, shadow, shadowIntensity );
1954		}
1955	#endif
1956	#if NUM_POINT_LIGHT_SHADOWS > 0
1957	#if defined( SHADOWMAP_TYPE_PCF )
1958	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1959		float shadow = 1.0;
1960		vec3 lightToPosition = shadowCoord.xyz;
1961		vec3 bd3D = normalize( lightToPosition );
1962		vec3 absVec = abs( lightToPosition );
1963		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1964		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1965			#ifdef USE_REVERSED_DEPTH_BUFFER
1966				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1967				dp -= shadowBias;
1968			#else
1969				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1970				dp += shadowBias;
1971			#endif
1972			float texelSize = shadowRadius / shadowMapSize.x;
1973			vec3 absDir = abs( bd3D );
1974			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
1975			tangent = normalize( cross( bd3D, tangent ) );
1976			vec3 bitangent = cross( bd3D, tangent );
1977			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1978			vec2 sample0 = vogelDiskSample( 0, 5, phi );
1979			vec2 sample1 = vogelDiskSample( 1, 5, phi );
1980			vec2 sample2 = vogelDiskSample( 2, 5, phi );
1981			vec2 sample3 = vogelDiskSample( 3, 5, phi );
1982			vec2 sample4 = vogelDiskSample( 4, 5, phi );
1983			shadow = (
1984				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
1985				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
1986				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
1987				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
1988				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
1989			) * 0.2;
1990		}
1991		return mix( 1.0, shadow, shadowIntensity );
1992	}
1993	#elif defined( SHADOWMAP_TYPE_BASIC )
1994	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1995		float shadow = 1.0;
1996		vec3 lightToPosition = shadowCoord.xyz;
1997		vec3 absVec = abs( lightToPosition );
1998		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1999		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
2000			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2001			dp += shadowBias;
2002			vec3 bd3D = normalize( lightToPosition );
2003			float depth = textureCube( shadowMap, bd3D ).r;
2004			#ifdef USE_REVERSED_DEPTH_BUFFER
2005				depth = 1.0 - depth;
2006			#endif
2007			shadow = step( dp, depth );
2008		}
2009		return mix( 1.0, shadow, shadowIntensity );
2010	}
2011	#endif
2012	#endif
2013#endif`,pT=`#if NUM_SPOT_LIGHT_COORDS > 0
2014	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
2015	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2016#endif
2017#ifdef USE_SHADOWMAP
2018	#if NUM_DIR_LIGHT_SHADOWS > 0
2019		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
2020		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2021		struct DirectionalLightShadow {
2022			float shadowIntensity;
2023			float shadowBias;
2024			float shadowNormalBias;
2025			float shadowRadius;
2026			vec2 shadowMapSize;
2027		};
2028		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2029	#endif
2030	#if NUM_SPOT_LIGHT_SHADOWS > 0
2031		struct SpotLightShadow {
2032			float shadowIntensity;
2033			float shadowBias;
2034			float shadowNormalBias;
2035			float shadowRadius;
2036			vec2 shadowMapSize;
2037		};
2038		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2039	#endif
2040	#if NUM_POINT_LIGHT_SHADOWS > 0
2041		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
2042		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2043		struct PointLightShadow {
2044			float shadowIntensity;
2045			float shadowBias;
2046			float shadowNormalBias;
2047			float shadowRadius;
2048			vec2 shadowMapSize;
2049			float shadowCameraNear;
2050			float shadowCameraFar;
2051		};
2052		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2053	#endif
2054#endif`,mT=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2055	#ifdef HAS_NORMAL
2056		vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
2057	#else
2058		vec3 shadowWorldNormal = vec3( 0.0 );
2059	#endif
2060	vec4 shadowWorldPosition;
2061#endif
2062#if defined( USE_SHADOWMAP )
2063	#if NUM_DIR_LIGHT_SHADOWS > 0
2064		#pragma unroll_loop_start
2065		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2066			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2067			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2068		}
2069		#pragma unroll_loop_end
2070	#endif
2071	#if NUM_POINT_LIGHT_SHADOWS > 0
2072		#pragma unroll_loop_start
2073		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2074			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2075			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2076		}
2077		#pragma unroll_loop_end
2078	#endif
2079#endif
2080#if NUM_SPOT_LIGHT_COORDS > 0
2081	#pragma unroll_loop_start
2082	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2083		shadowWorldPosition = worldPosition;
2084		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2085			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2086		#endif
2087		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2088	}
2089	#pragma unroll_loop_end
2090#endif`,gT=`float getShadowMask() {
2091	float shadow = 1.0;
2092	#ifdef USE_SHADOWMAP
2093	#if NUM_DIR_LIGHT_SHADOWS > 0
2094	DirectionalLightShadow directionalLight;
2095	#pragma unroll_loop_start
2096	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2097		directionalLight = directionalLightShadows[ i ];
2098		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2099	}
2100	#pragma unroll_loop_end
2101	#endif
2102	#if NUM_SPOT_LIGHT_SHADOWS > 0
2103	SpotLightShadow spotLight;
2104	#pragma unroll_loop_start
2105	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2106		spotLight = spotLightShadows[ i ];
2107		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2108	}
2109	#pragma unroll_loop_end
2110	#endif
2111	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2112	PointLightShadow pointLight;
2113	#pragma unroll_loop_start
2114	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2115		pointLight = pointLightShadows[ i ];
2116		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2117	}
2118	#pragma unroll_loop_end
2119	#endif
2120	#endif
2121	return shadow;
2122}`,xT=`#ifdef USE_SKINNING
2123	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2124	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2125	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2126	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2127#endif`,vT=`#ifdef USE_SKINNING
2128	uniform mat4 bindMatrix;
2129	uniform mat4 bindMatrixInverse;
2130	uniform highp sampler2D boneTexture;
2131	mat4 getBoneMatrix( const in float i ) {
2132		int size = textureSize( boneTexture, 0 ).x;
2133		int j = int( i ) * 4;
2134		int x = j % size;
2135		int y = j / size;
2136		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2137		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2138		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2139		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2140		return mat4( v1, v2, v3, v4 );
2141	}
2142#endif`,_T=`#ifdef USE_SKINNING
2143	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2144	vec4 skinned = vec4( 0.0 );
2145	skinned += boneMatX * skinVertex * skinWeight.x;
2146	skinned += boneMatY * skinVertex * skinWeight.y;
2147	skinned += boneMatZ * skinVertex * skinWeight.z;
2148	skinned += boneMatW * skinVertex * skinWeight.w;
2149	transformed = ( bindMatrixInverse * skinned ).xyz;
2150#endif`,yT=`#ifdef USE_SKINNING
2151	mat4 skinMatrix = mat4( 0.0 );
2152	skinMatrix += skinWeight.x * boneMatX;
2153	skinMatrix += skinWeight.y * boneMatY;
2154	skinMatrix += skinWeight.z * boneMatZ;
2155	skinMatrix += skinWeight.w * boneMatW;
2156	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2157	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2158	#ifdef USE_TANGENT
2159		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2160	#endif
2161#endif`,bT=`float specularStrength;
2162#ifdef USE_SPECULARMAP
2163	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2164	specularStrength = texelSpecular.r;
2165#else
2166	specularStrength = 1.0;
2167#endif`,ST=`#ifdef USE_SPECULARMAP
2168	uniform sampler2D specularMap;
2169#endif`,MT=`#if defined( TONE_MAPPING )
2170	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2171#endif`,ET=`#ifndef saturate
2172#define saturate( a ) clamp( a, 0.0, 1.0 )
2173#endif
2174uniform float toneMappingExposure;
2175vec3 LinearToneMapping( vec3 color ) {
2176	return saturate( toneMappingExposure * color );
2177}
2178vec3 ReinhardToneMapping( vec3 color ) {
2179	color *= toneMappingExposure;
2180	return saturate( color / ( vec3( 1.0 ) + color ) );
2181}
2182vec3 CineonToneMapping( vec3 color ) {
2183	color *= toneMappingExposure;
2184	color = max( vec3( 0.0 ), color - 0.004 );
2185	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2186}
2187vec3 RRTAndODTFit( vec3 v ) {
2188	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2189	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2190	return a / b;
2191}
2192vec3 ACESFilmicToneMapping( vec3 color ) {
2193	const mat3 ACESInputMat = mat3(
2194		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2195		vec3( 0.04823, 0.01566, 0.83777 )
2196	);
2197	const mat3 ACESOutputMat = mat3(
2198		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2199		vec3( -0.07367, -0.00605,  1.07602 )
2200	);
2201	color *= toneMappingExposure / 0.6;
2202	color = ACESInputMat * color;
2203	color = RRTAndODTFit( color );
2204	color = ACESOutputMat * color;
2205	return saturate( color );
2206}
2207const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2208	vec3( 1.6605, - 0.1246, - 0.0182 ),
2209	vec3( - 0.5876, 1.1329, - 0.1006 ),
2210	vec3( - 0.0728, - 0.0083, 1.1187 )
2211);
2212const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2213	vec3( 0.6274, 0.0691, 0.0164 ),
2214	vec3( 0.3293, 0.9195, 0.0880 ),
2215	vec3( 0.0433, 0.0113, 0.8956 )
2216);
2217vec3 agxDefaultContrastApprox( vec3 x ) {
2218	vec3 x2 = x * x;
2219	vec3 x4 = x2 * x2;
2220	return + 15.5 * x4 * x2
2221		- 40.14 * x4 * x
2222		+ 31.96 * x4
2223		- 6.868 * x2 * x
2224		+ 0.4298 * x2
2225		+ 0.1191 * x
2226		- 0.00232;
2227}
2228vec3 AgXToneMapping( vec3 color ) {
2229	const mat3 AgXInsetMatrix = mat3(
2230		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2231		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2232		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2233	);
2234	const mat3 AgXOutsetMatrix = mat3(
2235		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2236		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2237		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2238	);
2239	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2240	color *= toneMappingExposure;
2241	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2242	color = AgXInsetMatrix * color;
2243	color = max( color, 1e-10 );	color = log2( color );
2244	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2245	color = clamp( color, 0.0, 1.0 );
2246	color = agxDefaultContrastApprox( color );
2247	color = AgXOutsetMatrix * color;
2248	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2249	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2250	color = clamp( color, 0.0, 1.0 );
2251	return color;
2252}
2253vec3 NeutralToneMapping( vec3 color ) {
2254	const float StartCompression = 0.8 - 0.04;
2255	const float Desaturation = 0.15;
2256	color *= toneMappingExposure;
2257	float x = min( color.r, min( color.g, color.b ) );
2258	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2259	color -= offset;
2260	float peak = max( color.r, max( color.g, color.b ) );
2261	if ( peak < StartCompression ) return color;
2262	float d = 1. - StartCompression;
2263	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2264	color *= newPeak / peak;
2265	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2266	return mix( color, vec3( newPeak ), g );
2267}
2268vec3 CustomToneMapping( vec3 color ) { return color; }`,TT=`#ifdef USE_TRANSMISSION
2269	material.transmission = transmission;
2270	material.transmissionAlpha = 1.0;
2271	material.thickness = thickness;
2272	material.attenuationDistance = attenuationDistance;
2273	material.attenuationColor = attenuationColor;
2274	#ifdef USE_TRANSMISSIONMAP
2275		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2276	#endif
2277	#ifdef USE_THICKNESSMAP
2278		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2279	#endif
2280	vec3 pos = vWorldPosition;
2281	vec3 v = normalize( cameraPosition - pos );
2282	vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );
2283	vec4 transmitted = getIBLVolumeRefraction(
2284		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
2285		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2286		material.attenuationColor, material.attenuationDistance );
2287	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2288	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2289#endif`,AT=`#ifdef USE_TRANSMISSION
2290	uniform float transmission;
2291	uniform float thickness;
2292	uniform float attenuationDistance;
2293	uniform vec3 attenuationColor;
2294	#ifdef USE_TRANSMISSIONMAP
2295		uniform sampler2D transmissionMap;
2296	#endif
2297	#ifdef USE_THICKNESSMAP
2298		uniform sampler2D thicknessMap;
2299	#endif
2300	uniform vec2 transmissionSamplerSize;
2301	uniform sampler2D transmissionSamplerMap;
2302	uniform mat4 modelMatrix;
2303	uniform mat4 projectionMatrix;
2304	varying vec3 vWorldPosition;
2305	float w0( float a ) {
2306		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2307	}
2308	float w1( float a ) {
2309		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2310	}
2311	float w2( float a ){
2312		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2313	}
2314	float w3( float a ) {
2315		return ( 1.0 / 6.0 ) * ( a * a * a );
2316	}
2317	float g0( float a ) {
2318		return w0( a ) + w1( a );
2319	}
2320	float g1( float a ) {
2321		return w2( a ) + w3( a );
2322	}
2323	float h0( float a ) {
2324		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2325	}
2326	float h1( float a ) {
2327		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2328	}
2329	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2330		uv = uv * texelSize.zw + 0.5;
2331		vec2 iuv = floor( uv );
2332		vec2 fuv = fract( uv );
2333		float g0x = g0( fuv.x );
2334		float g1x = g1( fuv.x );
2335		float h0x = h0( fuv.x );
2336		float h1x = h1( fuv.x );
2337		float h0y = h0( fuv.y );
2338		float h1y = h1( fuv.y );
2339		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2340		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2341		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2342		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2343		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2344			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2345	}
2346	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2347		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2348		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2349		vec2 fLodSizeInv = 1.0 / fLodSize;
2350		vec2 cLodSizeInv = 1.0 / cLodSize;
2351		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2352		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2353		return mix( fSample, cSample, fract( lod ) );
2354	}
2355	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2356		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2357		vec3 modelScale;
2358		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2359		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2360		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2361		return normalize( refractionVector ) * thickness * modelScale;
2362	}
2363	float applyIorToRoughness( const in float roughness, const in float ior ) {
2364		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2365	}
2366	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2367		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2368		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2369	}
2370	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2371		if ( isinf( attenuationDistance ) ) {
2372			return vec3( 1.0 );
2373		} else {
2374			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2375			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2376		}
2377	}
2378	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2379		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2380		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2381		const in vec3 attenuationColor, const in float attenuationDistance ) {
2382		vec4 transmittedLight;
2383		vec3 transmittance;
2384		#ifdef USE_DISPERSION
2385			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2386			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2387			for ( int i = 0; i < 3; i ++ ) {
2388				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2389				vec3 refractedRayExit = position + transmissionRay;
2390				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2391				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2392				refractionCoords += 1.0;
2393				refractionCoords /= 2.0;
2394				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2395				transmittedLight[ i ] = transmissionSample[ i ];
2396				transmittedLight.a += transmissionSample.a;
2397				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2398			}
2399			transmittedLight.a /= 3.0;
2400		#else
2401			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2402			vec3 refractedRayExit = position + transmissionRay;
2403			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2404			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2405			refractionCoords += 1.0;
2406			refractionCoords /= 2.0;
2407			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2408			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2409		#endif
2410		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2411		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2412		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2413		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2414	}
2415#endif`,wT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2416	varying vec2 vUv;
2417#endif
2418#ifdef USE_MAP
2419	varying vec2 vMapUv;
2420#endif
2421#ifdef USE_ALPHAMAP
2422	varying vec2 vAlphaMapUv;
2423#endif
2424#ifdef USE_LIGHTMAP
2425	varying vec2 vLightMapUv;
2426#endif
2427#ifdef USE_AOMAP
2428	varying vec2 vAoMapUv;
2429#endif
2430#ifdef USE_BUMPMAP
2431	varying vec2 vBumpMapUv;
2432#endif
2433#ifdef USE_NORMALMAP
2434	varying vec2 vNormalMapUv;
2435#endif
2436#ifdef USE_EMISSIVEMAP
2437	varying vec2 vEmissiveMapUv;
2438#endif
2439#ifdef USE_METALNESSMAP
2440	varying vec2 vMetalnessMapUv;
2441#endif
2442#ifdef USE_ROUGHNESSMAP
2443	varying vec2 vRoughnessMapUv;
2444#endif
2445#ifdef USE_ANISOTROPYMAP
2446	varying vec2 vAnisotropyMapUv;
2447#endif
2448#ifdef USE_CLEARCOATMAP
2449	varying vec2 vClearcoatMapUv;
2450#endif
2451#ifdef USE_CLEARCOAT_NORMALMAP
2452	varying vec2 vClearcoatNormalMapUv;
2453#endif
2454#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2455	varying vec2 vClearcoatRoughnessMapUv;
2456#endif
2457#ifdef USE_IRIDESCENCEMAP
2458	varying vec2 vIridescenceMapUv;
2459#endif
2460#ifdef USE_IRIDESCENCE_THICKNESSMAP
2461	varying vec2 vIridescenceThicknessMapUv;
2462#endif
2463#ifdef USE_SHEEN_COLORMAP
2464	varying vec2 vSheenColorMapUv;
2465#endif
2466#ifdef USE_SHEEN_ROUGHNESSMAP
2467	varying vec2 vSheenRoughnessMapUv;
2468#endif
2469#ifdef USE_SPECULARMAP
2470	varying vec2 vSpecularMapUv;
2471#endif
2472#ifdef USE_SPECULAR_COLORMAP
2473	varying vec2 vSpecularColorMapUv;
2474#endif
2475#ifdef USE_SPECULAR_INTENSITYMAP
2476	varying vec2 vSpecularIntensityMapUv;
2477#endif
2478#ifdef USE_TRANSMISSIONMAP
2479	uniform mat3 transmissionMapTransform;
2480	varying vec2 vTransmissionMapUv;
2481#endif
2482#ifdef USE_THICKNESSMAP
2483	uniform mat3 thicknessMapTransform;
2484	varying vec2 vThicknessMapUv;
2485#endif`,CT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2486	varying vec2 vUv;
2487#endif
2488#ifdef USE_MAP
2489	uniform mat3 mapTransform;
2490	varying vec2 vMapUv;
2491#endif
2492#ifdef USE_ALPHAMAP
2493	uniform mat3 alphaMapTransform;
2494	varying vec2 vAlphaMapUv;
2495#endif
2496#ifdef USE_LIGHTMAP
2497	uniform mat3 lightMapTransform;
2498	varying vec2 vLightMapUv;
2499#endif
2500#ifdef USE_AOMAP
2501	uniform mat3 aoMapTransform;
2502	varying vec2 vAoMapUv;
2503#endif
2504#ifdef USE_BUMPMAP
2505	uniform mat3 bumpMapTransform;
2506	varying vec2 vBumpMapUv;
2507#endif
2508#ifdef USE_NORMALMAP
2509	uniform mat3 normalMapTransform;
2510	varying vec2 vNormalMapUv;
2511#endif
2512#ifdef USE_DISPLACEMENTMAP
2513	uniform mat3 displacementMapTransform;
2514	varying vec2 vDisplacementMapUv;
2515#endif
2516#ifdef USE_EMISSIVEMAP
2517	uniform mat3 emissiveMapTransform;
2518	varying vec2 vEmissiveMapUv;
2519#endif
2520#ifdef USE_METALNESSMAP
2521	uniform mat3 metalnessMapTransform;
2522	varying vec2 vMetalnessMapUv;
2523#endif
2524#ifdef USE_ROUGHNESSMAP
2525	uniform mat3 roughnessMapTransform;
2526	varying vec2 vRoughnessMapUv;
2527#endif
2528#ifdef USE_ANISOTROPYMAP
2529	uniform mat3 anisotropyMapTransform;
2530	varying vec2 vAnisotropyMapUv;
2531#endif
2532#ifdef USE_CLEARCOATMAP
2533	uniform mat3 clearcoatMapTransform;
2534	varying vec2 vClearcoatMapUv;
2535#endif
2536#ifdef USE_CLEARCOAT_NORMALMAP
2537	uniform mat3 clearcoatNormalMapTransform;
2538	varying vec2 vClearcoatNormalMapUv;
2539#endif
2540#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2541	uniform mat3 clearcoatRoughnessMapTransform;
2542	varying vec2 vClearcoatRoughnessMapUv;
2543#endif
2544#ifdef USE_SHEEN_COLORMAP
2545	uniform mat3 sheenColorMapTransform;
2546	varying vec2 vSheenColorMapUv;
2547#endif
2548#ifdef USE_SHEEN_ROUGHNESSMAP
2549	uniform mat3 sheenRoughnessMapTransform;
2550	varying vec2 vSheenRoughnessMapUv;
2551#endif
2552#ifdef USE_IRIDESCENCEMAP
2553	uniform mat3 iridescenceMapTransform;
2554	varying vec2 vIridescenceMapUv;
2555#endif
2556#ifdef USE_IRIDESCENCE_THICKNESSMAP
2557	uniform mat3 iridescenceThicknessMapTransform;
2558	varying vec2 vIridescenceThicknessMapUv;
2559#endif
2560#ifdef USE_SPECULARMAP
2561	uniform mat3 specularMapTransform;
2562	varying vec2 vSpecularMapUv;
2563#endif
2564#ifdef USE_SPECULAR_COLORMAP
2565	uniform mat3 specularColorMapTransform;
2566	varying vec2 vSpecularColorMapUv;
2567#endif
2568#ifdef USE_SPECULAR_INTENSITYMAP
2569	uniform mat3 specularIntensityMapTransform;
2570	varying vec2 vSpecularIntensityMapUv;
2571#endif
2572#ifdef USE_TRANSMISSIONMAP
2573	uniform mat3 transmissionMapTransform;
2574	varying vec2 vTransmissionMapUv;
2575#endif
2576#ifdef USE_THICKNESSMAP
2577	uniform mat3 thicknessMapTransform;
2578	varying vec2 vThicknessMapUv;
2579#endif`,RT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2580	vUv = vec3( uv, 1 ).xy;
2581#endif
2582#ifdef USE_MAP
2583	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2584#endif
2585#ifdef USE_ALPHAMAP
2586	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2587#endif
2588#ifdef USE_LIGHTMAP
2589	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2590#endif
2591#ifdef USE_AOMAP
2592	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2593#endif
2594#ifdef USE_BUMPMAP
2595	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2596#endif
2597#ifdef USE_NORMALMAP
2598	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2599#endif
2600#ifdef USE_DISPLACEMENTMAP
2601	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2602#endif
2603#ifdef USE_EMISSIVEMAP
2604	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2605#endif
2606#ifdef USE_METALNESSMAP
2607	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2608#endif
2609#ifdef USE_ROUGHNESSMAP
2610	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2611#endif
2612#ifdef USE_ANISOTROPYMAP
2613	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2614#endif
2615#ifdef USE_CLEARCOATMAP
2616	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2617#endif
2618#ifdef USE_CLEARCOAT_NORMALMAP
2619	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2620#endif
2621#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2622	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2623#endif
2624#ifdef USE_IRIDESCENCEMAP
2625	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2626#endif
2627#ifdef USE_IRIDESCENCE_THICKNESSMAP
2628	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2629#endif
2630#ifdef USE_SHEEN_COLORMAP
2631	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2632#endif
2633#ifdef USE_SHEEN_ROUGHNESSMAP
2634	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2635#endif
2636#ifdef USE_SPECULARMAP
2637	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2638#endif
2639#ifdef USE_SPECULAR_COLORMAP
2640	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2641#endif
2642#ifdef USE_SPECULAR_INTENSITYMAP
2643	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2644#endif
2645#ifdef USE_TRANSMISSIONMAP
2646	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2647#endif
2648#ifdef USE_THICKNESSMAP
2649	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2650#endif`,NT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2651	vec4 worldPosition = vec4( transformed, 1.0 );
2652	#ifdef USE_BATCHING
2653		worldPosition = batchingMatrix * worldPosition;
2654	#endif
2655	#ifdef USE_INSTANCING
2656		worldPosition = instanceMatrix * worldPosition;
2657	#endif
2658	worldPosition = modelMatrix * worldPosition;
2659#endif`;const DT=`varying vec2 vUv;
2660uniform mat3 uvTransform;
2661void main() {
2662	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2663	gl_Position = vec4( position.xy, 1.0, 1.0 );
2664}`,UT=`uniform sampler2D t2D;
2665uniform float backgroundIntensity;
2666varying vec2 vUv;
2667void main() {
2668	vec4 texColor = texture2D( t2D, vUv );
2669	#ifdef DECODE_VIDEO_TEXTURE
2670		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 );
2671	#endif
2672	texColor.rgb *= backgroundIntensity;
2673	gl_FragColor = texColor;
2674	#include <tonemapping_fragment>
2675	#include <colorspace_fragment>
2676}`,LT=`varying vec3 vWorldDirection;
2677#include <common>
2678void main() {
2679	vWorldDirection = transformDirection( position, modelMatrix );
2680	#include <begin_vertex>
2681	#include <project_vertex>
2682	gl_Position.z = gl_Position.w;
2683}`,OT=`#ifdef ENVMAP_TYPE_CUBE
2684	uniform samplerCube envMap;
2685#elif defined( ENVMAP_TYPE_CUBE_UV )
2686	uniform sampler2D envMap;
2687#endif
2688uniform float backgroundBlurriness;
2689uniform float backgroundIntensity;
2690uniform mat3 backgroundRotation;
2691varying vec3 vWorldDirection;
2692#include <cube_uv_reflection_fragment>
2693void main() {
2694	#ifdef ENVMAP_TYPE_CUBE
2695		vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
2696	#elif defined( ENVMAP_TYPE_CUBE_UV )
2697		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2698	#else
2699		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2700	#endif
2701	texColor.rgb *= backgroundIntensity;
2702	gl_FragColor = texColor;
2703	#include <tonemapping_fragment>
2704	#include <colorspace_fragment>
2705}`,PT=`varying vec3 vWorldDirection;
2706#include <common>
2707void main() {
2708	vWorldDirection = transformDirection( position, modelMatrix );
2709	#include <begin_vertex>
2710	#include <project_vertex>
2711	gl_Position.z = gl_Position.w;
2712}`,IT=`uniform samplerCube tCube;
2713uniform float tFlip;
2714uniform float opacity;
2715varying vec3 vWorldDirection;
2716void main() {
2717	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2718	gl_FragColor = texColor;
2719	gl_FragColor.a *= opacity;
2720	#include <tonemapping_fragment>
2721	#include <colorspace_fragment>
2722}`,FT=`#include <common>
2723#include <batching_pars_vertex>
2724#include <uv_pars_vertex>
2725#include <displacementmap_pars_vertex>
2726#include <morphtarget_pars_vertex>
2727#include <skinning_pars_vertex>
2728#include <logdepthbuf_pars_vertex>
2729#include <clipping_planes_pars_vertex>
2730varying vec2 vHighPrecisionZW;
2731void main() {
2732	#include <uv_vertex>
2733	#include <batching_vertex>
2734	#include <skinbase_vertex>
2735	#include <morphinstance_vertex>
2736	#ifdef USE_DISPLACEMENTMAP
2737		#include <beginnormal_vertex>
2738		#include <morphnormal_vertex>
2739		#include <skinnormal_vertex>
2740	#endif
2741	#include <begin_vertex>
2742	#include <morphtarget_vertex>
2743	#include <skinning_vertex>
2744	#include <displacementmap_vertex>
2745	#include <project_vertex>
2746	#include <logdepthbuf_vertex>
2747	#include <clipping_planes_vertex>
2748	vHighPrecisionZW = gl_Position.zw;
2749}`,zT=`#if DEPTH_PACKING == 3200
2750	uniform float opacity;
2751#endif
2752#include <common>
2753#include <packing>
2754#include <uv_pars_fragment>
2755#include <map_pars_fragment>
2756#include <alphamap_pars_fragment>
2757#include <alphatest_pars_fragment>
2758#include <alphahash_pars_fragment>
2759#include <logdepthbuf_pars_fragment>
2760#include <clipping_planes_pars_fragment>
2761varying vec2 vHighPrecisionZW;
2762void main() {
2763	vec4 diffuseColor = vec4( 1.0 );
2764	#include <clipping_planes_fragment>
2765	#if DEPTH_PACKING == 3200
2766		diffuseColor.a = opacity;
2767	#endif
2768	#include <map_fragment>
2769	#include <alphamap_fragment>
2770	#include <alphatest_fragment>
2771	#include <alphahash_fragment>
2772	#include <logdepthbuf_fragment>
2773	#ifdef USE_REVERSED_DEPTH_BUFFER
2774		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2775	#else
2776		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2777	#endif
2778	#if DEPTH_PACKING == 3200
2779		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2780	#elif DEPTH_PACKING == 3201
2781		gl_FragColor = packDepthToRGBA( fragCoordZ );
2782	#elif DEPTH_PACKING == 3202
2783		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2784	#elif DEPTH_PACKING == 3203
2785		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2786	#endif
2787}`,BT=`#define DISTANCE
2788varying vec3 vWorldPosition;
2789#include <common>
2790#include <batching_pars_vertex>
2791#include <uv_pars_vertex>
2792#include <displacementmap_pars_vertex>
2793#include <morphtarget_pars_vertex>
2794#include <skinning_pars_vertex>
2795#include <clipping_planes_pars_vertex>
2796void main() {
2797	#include <uv_vertex>
2798	#include <batching_vertex>
2799	#include <skinbase_vertex>
2800	#include <morphinstance_vertex>
2801	#ifdef USE_DISPLACEMENTMAP
2802		#include <beginnormal_vertex>
2803		#include <morphnormal_vertex>
2804		#include <skinnormal_vertex>
2805	#endif
2806	#include <begin_vertex>
2807	#include <morphtarget_vertex>
2808	#include <skinning_vertex>
2809	#include <displacementmap_vertex>
2810	#include <project_vertex>
2811	#include <worldpos_vertex>
2812	#include <clipping_planes_vertex>
2813	vWorldPosition = worldPosition.xyz;
2814}`,HT=`#define DISTANCE
2815uniform vec3 referencePosition;
2816uniform float nearDistance;
2817uniform float farDistance;
2818varying vec3 vWorldPosition;
2819#include <common>
2820#include <uv_pars_fragment>
2821#include <map_pars_fragment>
2822#include <alphamap_pars_fragment>
2823#include <alphatest_pars_fragment>
2824#include <alphahash_pars_fragment>
2825#include <clipping_planes_pars_fragment>
2826void main() {
2827	vec4 diffuseColor = vec4( 1.0 );
2828	#include <clipping_planes_fragment>
2829	#include <map_fragment>
2830	#include <alphamap_fragment>
2831	#include <alphatest_fragment>
2832	#include <alphahash_fragment>
2833	float dist = length( vWorldPosition - referencePosition );
2834	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2835	dist = saturate( dist );
2836	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2837}`,GT=`varying vec3 vWorldDirection;
2838#include <common>
2839void main() {
2840	vWorldDirection = transformDirection( position, modelMatrix );
2841	#include <begin_vertex>
2842	#include <project_vertex>
2843}`,kT=`uniform sampler2D tEquirect;
2844varying vec3 vWorldDirection;
2845#include <common>
2846void main() {
2847	vec3 direction = normalize( vWorldDirection );
2848	vec2 sampleUV = equirectUv( direction );
2849	gl_FragColor = texture2D( tEquirect, sampleUV );
2850	#include <tonemapping_fragment>
2851	#include <colorspace_fragment>
2852}`,VT=`uniform float scale;
2853attribute float lineDistance;
2854varying float vLineDistance;
2855#include <common>
2856#include <uv_pars_vertex>
2857#include <color_pars_vertex>
2858#include <fog_pars_vertex>
2859#include <morphtarget_pars_vertex>
2860#include <logdepthbuf_pars_vertex>
2861#include <clipping_planes_pars_vertex>
2862void main() {
2863	vLineDistance = scale * lineDistance;
2864	#include <uv_vertex>
2865	#include <color_vertex>
2866	#include <morphinstance_vertex>
2867	#include <morphcolor_vertex>
2868	#include <begin_vertex>
2869	#include <morphtarget_vertex>
2870	#include <project_vertex>
2871	#include <logdepthbuf_vertex>
2872	#include <clipping_planes_vertex>
2873	#include <fog_vertex>
2874}`,jT=`uniform vec3 diffuse;
2875uniform float opacity;
2876uniform float dashSize;
2877uniform float totalSize;
2878varying float vLineDistance;
2879#include <common>
2880#include <color_pars_fragment>
2881#include <uv_pars_fragment>
2882#include <map_pars_fragment>
2883#include <fog_pars_fragment>
2884#include <logdepthbuf_pars_fragment>
2885#include <clipping_planes_pars_fragment>
2886void main() {
2887	vec4 diffuseColor = vec4( diffuse, opacity );
2888	#include <clipping_planes_fragment>
2889	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2890		discard;
2891	}
2892	vec3 outgoingLight = vec3( 0.0 );
2893	#include <logdepthbuf_fragment>
2894	#include <map_fragment>
2895	#include <color_fragment>
2896	outgoingLight = diffuseColor.rgb;
2897	#include <opaque_fragment>
2898	#include <tonemapping_fragment>
2899	#include <colorspace_fragment>
2900	#include <fog_fragment>
2901	#include <premultiplied_alpha_fragment>
2902}`,XT=`#include <common>
2903#include <batching_pars_vertex>
2904#include <uv_pars_vertex>
2905#include <envmap_pars_vertex>
2906#include <color_pars_vertex>
2907#include <fog_pars_vertex>
2908#include <morphtarget_pars_vertex>
2909#include <skinning_pars_vertex>
2910#include <logdepthbuf_pars_vertex>
2911#include <clipping_planes_pars_vertex>
2912void main() {
2913	#include <uv_vertex>
2914	#include <color_vertex>
2915	#include <morphinstance_vertex>
2916	#include <morphcolor_vertex>
2917	#include <batching_vertex>
2918	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2919		#include <beginnormal_vertex>
2920		#include <morphnormal_vertex>
2921		#include <skinbase_vertex>
2922		#include <skinnormal_vertex>
2923		#include <defaultnormal_vertex>
2924	#endif
2925	#include <begin_vertex>
2926	#include <morphtarget_vertex>
2927	#include <skinning_vertex>
2928	#include <project_vertex>
2929	#include <logdepthbuf_vertex>
2930	#include <clipping_planes_vertex>
2931	#include <worldpos_vertex>
2932	#include <envmap_vertex>
2933	#include <fog_vertex>
2934}`,WT=`uniform vec3 diffuse;
2935uniform float opacity;
2936#ifndef FLAT_SHADED
2937	varying vec3 vNormal;
2938#endif
2939#include <common>
2940#include <dithering_pars_fragment>
2941#include <color_pars_fragment>
2942#include <uv_pars_fragment>
2943#include <map_pars_fragment>
2944#include <alphamap_pars_fragment>
2945#include <alphatest_pars_fragment>
2946#include <alphahash_pars_fragment>
2947#include <aomap_pars_fragment>
2948#include <lightmap_pars_fragment>
2949#include <envmap_common_pars_fragment>
2950#include <envmap_pars_fragment>
2951#include <fog_pars_fragment>
2952#include <specularmap_pars_fragment>
2953#include <logdepthbuf_pars_fragment>
2954#include <clipping_planes_pars_fragment>
2955void main() {
2956	vec4 diffuseColor = vec4( diffuse, opacity );
2957	#include <clipping_planes_fragment>
2958	#include <logdepthbuf_fragment>
2959	#include <map_fragment>
2960	#include <color_fragment>
2961	#include <alphamap_fragment>
2962	#include <alphatest_fragment>
2963	#include <alphahash_fragment>
2964	#include <specularmap_fragment>
2965	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2966	#ifdef USE_LIGHTMAP
2967		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2968		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2969	#else
2970		reflectedLight.indirectDiffuse += vec3( 1.0 );
2971	#endif
2972	#include <aomap_fragment>
2973	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2974	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2975	#include <envmap_fragment>
2976	#include <opaque_fragment>
2977	#include <tonemapping_fragment>
2978	#include <colorspace_fragment>
2979	#include <fog_fragment>
2980	#include <premultiplied_alpha_fragment>
2981	#include <dithering_fragment>
2982}`,qT=`#define LAMBERT
2983varying vec3 vViewPosition;
2984#include <common>
2985#include <batching_pars_vertex>
2986#include <uv_pars_vertex>
2987#include <displacementmap_pars_vertex>
2988#include <envmap_pars_vertex>
2989#include <color_pars_vertex>
2990#include <fog_pars_vertex>
2991#include <normal_pars_vertex>
2992#include <morphtarget_pars_vertex>
2993#include <skinning_pars_vertex>
2994#include <shadowmap_pars_vertex>
2995#include <logdepthbuf_pars_vertex>
2996#include <clipping_planes_pars_vertex>
2997void main() {
2998	#include <uv_vertex>
2999	#include <color_vertex>
3000	#include <morphinstance_vertex>
3001	#include <morphcolor_vertex>
3002	#include <batching_vertex>
3003	#include <beginnormal_vertex>
3004	#include <morphnormal_vertex>
3005	#include <skinbase_vertex>
3006	#include <skinnormal_vertex>
3007	#include <defaultnormal_vertex>
3008	#include <normal_vertex>
3009	#include <begin_vertex>
3010	#include <morphtarget_vertex>
3011	#include <skinning_vertex>
3012	#include <displacementmap_vertex>
3013	#include <project_vertex>
3014	#include <logdepthbuf_vertex>
3015	#include <clipping_planes_vertex>
3016	vViewPosition = - mvPosition.xyz;
3017	#include <worldpos_vertex>
3018	#include <envmap_vertex>
3019	#include <shadowmap_vertex>
3020	#include <fog_vertex>
3021}`,YT=`#define LAMBERT
3022uniform vec3 diffuse;
3023uniform vec3 emissive;
3024uniform float opacity;
3025#include <common>
3026#include <dithering_pars_fragment>
3027#include <color_pars_fragment>
3028#include <uv_pars_fragment>
3029#include <map_pars_fragment>
3030#include <alphamap_pars_fragment>
3031#include <alphatest_pars_fragment>
3032#include <alphahash_pars_fragment>
3033#include <aomap_pars_fragment>
3034#include <lightmap_pars_fragment>
3035#include <emissivemap_pars_fragment>
3036#include <cube_uv_reflection_fragment>
3037#include <envmap_common_pars_fragment>
3038#include <envmap_pars_fragment>
3039#include <envmap_physical_pars_fragment>
3040#include <fog_pars_fragment>
3041#include <bsdfs>
3042#include <lights_pars_begin>
3043#include <normal_pars_fragment>
3044#include <lights_lambert_pars_fragment>
3045#include <shadowmap_pars_fragment>
3046#include <bumpmap_pars_fragment>
3047#include <normalmap_pars_fragment>
3048#include <specularmap_pars_fragment>
3049#include <logdepthbuf_pars_fragment>
3050#include <clipping_planes_pars_fragment>
3051void main() {
3052	vec4 diffuseColor = vec4( diffuse, opacity );
3053	#include <clipping_planes_fragment>
3054	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3055	vec3 totalEmissiveRadiance = emissive;
3056	#include <logdepthbuf_fragment>
3057	#include <map_fragment>
3058	#include <color_fragment>
3059	#include <alphamap_fragment>
3060	#include <alphatest_fragment>
3061	#include <alphahash_fragment>
3062	#include <specularmap_fragment>
3063	#include <normal_fragment_begin>
3064	#include <normal_fragment_maps>
3065	#include <emissivemap_fragment>
3066	#include <lights_lambert_fragment>
3067	#include <lights_fragment_begin>
3068	#include <lights_fragment_maps>
3069	#include <lights_fragment_end>
3070	#include <aomap_fragment>
3071	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3072	#include <envmap_fragment>
3073	#include <opaque_fragment>
3074	#include <tonemapping_fragment>
3075	#include <colorspace_fragment>
3076	#include <fog_fragment>
3077	#include <premultiplied_alpha_fragment>
3078	#include <dithering_fragment>
3079}`,QT=`#define MATCAP
3080varying vec3 vViewPosition;
3081#include <common>
3082#include <batching_pars_vertex>
3083#include <uv_pars_vertex>
3084#include <color_pars_vertex>
3085#include <displacementmap_pars_vertex>
3086#include <fog_pars_vertex>
3087#include <normal_pars_vertex>
3088#include <morphtarget_pars_vertex>
3089#include <skinning_pars_vertex>
3090#include <logdepthbuf_pars_vertex>
3091#include <clipping_planes_pars_vertex>
3092void main() {
3093	#include <uv_vertex>
3094	#include <color_vertex>
3095	#include <morphinstance_vertex>
3096	#include <morphcolor_vertex>
3097	#include <batching_vertex>
3098	#include <beginnormal_vertex>
3099	#include <morphnormal_vertex>
3100	#include <skinbase_vertex>
3101	#include <skinnormal_vertex>
3102	#include <defaultnormal_vertex>
3103	#include <normal_vertex>
3104	#include <begin_vertex>
3105	#include <morphtarget_vertex>
3106	#include <skinning_vertex>
3107	#include <displacementmap_vertex>
3108	#include <project_vertex>
3109	#include <logdepthbuf_vertex>
3110	#include <clipping_planes_vertex>
3111	#include <fog_vertex>
3112	vViewPosition = - mvPosition.xyz;
3113}`,KT=`#define MATCAP
3114uniform vec3 diffuse;
3115uniform float opacity;
3116uniform sampler2D matcap;
3117varying vec3 vViewPosition;
3118#include <common>
3119#include <dithering_pars_fragment>
3120#include <color_pars_fragment>
3121#include <uv_pars_fragment>
3122#include <map_pars_fragment>
3123#include <alphamap_pars_fragment>
3124#include <alphatest_pars_fragment>
3125#include <alphahash_pars_fragment>
3126#include <fog_pars_fragment>
3127#include <normal_pars_fragment>
3128#include <bumpmap_pars_fragment>
3129#include <normalmap_pars_fragmen
3129t>
3130#include <logdepthbuf_pars_fragment>
3131#include <clipping_planes_pars_fragment>
3132void main() {
3133	vec4 diffuseColor = vec4( diffuse, opacity );
3134	#include <clipping_planes_fragment>
3135	#include <logdepthbuf_fragment>
3136	#include <map_fragment>
3137	#include <color_fragment>
3138	#include <alphamap_fragment>
3139	#include <alphatest_fragment>
3140	#include <alphahash_fragment>
3141	#include <normal_fragment_begin>
3142	#include <normal_fragment_maps>
3143	vec3 viewDir = normalize( vViewPosition );
3144	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3145	vec3 y = cross( viewDir, x );
3146	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3147	#ifdef USE_MATCAP
3148		vec4 matcapColor = texture2D( matcap, uv );
3149	#else
3150		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3151	#endif
3152	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3153	#include <opaque_fragment>
3154	#include <tonemapping_fragment>
3155	#include <colorspace_fragment>
3156	#include <fog_fragment>
3157	#include <premultiplied_alpha_fragment>
3158	#include <dithering_fragment>
3159}`,ZT=`#define NORMAL
3160#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3161	varying vec3 vViewPosition;
3162#endif
3163#include <common>
3164#include <batching_pars_vertex>
3165#include <uv_pars_vertex>
3166#include <displacementmap_pars_vertex>
3167#include <normal_pars_vertex>
3168#include <morphtarget_pars_vertex>
3169#include <skinning_pars_vertex>
3170#include <logdepthbuf_pars_vertex>
3171#include <clipping_planes_pars_vertex>
3172void main() {
3173	#include <uv_vertex>
3174	#include <batching_vertex>
3175	#include <beginnormal_vertex>
3176	#include <morphinstance_vertex>
3177	#include <morphnormal_vertex>
3178	#include <skinbase_vertex>
3179	#include <skinnormal_vertex>
3180	#include <defaultnormal_vertex>
3181	#include <normal_vertex>
3182	#include <begin_vertex>
3183	#include <morphtarget_vertex>
3184	#include <skinning_vertex>
3185	#include <displacementmap_vertex>
3186	#include <project_vertex>
3187	#include <logdepthbuf_vertex>
3188	#include <clipping_planes_vertex>
3189#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3190	vViewPosition = - mvPosition.xyz;
3191#endif
3192}`,JT=`#define NORMAL
3193uniform float opacity;
3194#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3195	varying vec3 vViewPosition;
3196#endif
3197#include <uv_pars_fragment>
3198#include <normal_pars_fragment>
3199#include <bumpmap_pars_fragment>
3200#include <normalmap_pars_fragment>
3201#include <logdepthbuf_pars_fragment>
3202#include <clipping_planes_pars_fragment>
3203void main() {
3204	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3205	#include <clipping_planes_fragment>
3206	#include <logdepthbuf_fragment>
3207	#include <normal_fragment_begin>
3208	#include <normal_fragment_maps>
3209	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3210	#ifdef OPAQUE
3211		gl_FragColor.a = 1.0;
3212	#endif
3213}`,$T=`#define PHONG
3214varying vec3 vViewPosition;
3215#include <common>
3216#include <batching_pars_vertex>
3217#include <uv_pars_vertex>
3218#include <displacementmap_pars_vertex>
3219#include <envmap_pars_vertex>
3220#include <color_pars_vertex>
3221#include <fog_pars_vertex>
3222#include <normal_pars_vertex>
3223#include <morphtarget_pars_vertex>
3224#include <skinning_pars_vertex>
3225#include <shadowmap_pars_vertex>
3226#include <logdepthbuf_pars_vertex>
3227#include <clipping_planes_pars_vertex>
3228void main() {
3229	#include <uv_vertex>
3230	#include <color_vertex>
3231	#include <morphcolor_vertex>
3232	#include <batching_vertex>
3233	#include <beginnormal_vertex>
3234	#include <morphinstance_vertex>
3235	#include <morphnormal_vertex>
3236	#include <skinbase_vertex>
3237	#include <skinnormal_vertex>
3238	#include <defaultnormal_vertex>
3239	#include <normal_vertex>
3240	#include <begin_vertex>
3241	#include <morphtarget_vertex>
3242	#include <skinning_vertex>
3243	#include <displacementmap_vertex>
3244	#include <project_vertex>
3245	#include <logdepthbuf_vertex>
3246	#include <clipping_planes_vertex>
3247	vViewPosition = - mvPosition.xyz;
3248	#include <worldpos_vertex>
3249	#include <envmap_vertex>
3250	#include <shadowmap_vertex>
3251	#include <fog_vertex>
3252}`,e2=`#define PHONG
3253uniform vec3 diffuse;
3254uniform vec3 emissive;
3255uniform vec3 specular;
3256uniform float shininess;
3257uniform float opacity;
3258#include <common>
3259#include <dithering_pars_fragment>
3260#include <color_pars_fragment>
3261#include <uv_pars_fragment>
3262#include <map_pars_fragment>
3263#include <alphamap_pars_fragment>
3264#include <alphatest_pars_fragment>
3265#include <alphahash_pars_fragment>
3266#include <aomap_pars_fragment>
3267#include <lightmap_pars_fragment>
3268#include <emissivemap_pars_fragment>
3269#include <cube_uv_reflection_fragment>
3270#include <envmap_common_pars_fragment>
3271#include <envmap_pars_fragment>
3272#include <envmap_physical_pars_fragment>
3273#include <fog_pars_fragment>
3274#include <bsdfs>
3275#include <lights_pars_begin>
3276#include <normal_pars_fragment>
3277#include <lights_phong_pars_fragment>
3278#include <shadowmap_pars_fragment>
3279#include <bumpmap_pars_fragment>
3280#include <normalmap_pars_fragment>
3281#include <specularmap_pars_fragment>
3282#include <logdepthbuf_pars_fragment>
3283#include <clipping_planes_pars_fragment>
3284void main() {
3285	vec4 diffuseColor = vec4( diffuse, opacity );
3286	#include <clipping_planes_fragment>
3287	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3288	vec3 totalEmissiveRadiance = emissive;
3289	#include <logdepthbuf_fragment>
3290	#include <map_fragment>
3291	#include <color_fragment>
3292	#include <alphamap_fragment>
3293	#include <alphatest_fragment>
3294	#include <alphahash_fragment>
3295	#include <specularmap_fragment>
3296	#include <normal_fragment_begin>
3297	#include <normal_fragment_maps>
3298	#include <emissivemap_fragment>
3299	#include <lights_phong_fragment>
3300	#include <lights_fragment_begin>
3301	#include <lights_fragment_maps>
3302	#include <lights_fragment_end>
3303	#include <aomap_fragment>
3304	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3305	#include <envmap_fragment>
3306	#include <opaque_fragment>
3307	#include <tonemapping_fragment>
3308	#include <colorspace_fragment>
3309	#include <fog_fragment>
3310	#include <premultiplied_alpha_fragment>
3311	#include <dithering_fragment>
3312}`,t2=`#define STANDARD
3313varying vec3 vViewPosition;
3314#ifdef USE_TRANSMISSION
3315	varying vec3 vWorldPosition;
3316#endif
3317#include <common>
3318#include <batching_pars_vertex>
3319#include <uv_pars_vertex>
3320#include <displacementmap_pars_vertex>
3321#include <color_pars_vertex>
3322#include <fog_pars_vertex>
3323#include <normal_pars_vertex>
3324#include <morphtarget_pars_vertex>
3325#include <skinning_pars_vertex>
3326#include <shadowmap_pars_vertex>
3327#include <logdepthbuf_pars_vertex>
3328#include <clipping_planes_pars_vertex>
3329void main() {
3330	#include <uv_vertex>
3331	#include <color_vertex>
3332	#include <morphinstance_vertex>
3333	#include <morphcolor_vertex>
3334	#include <batching_vertex>
3335	#include <beginnormal_vertex>
3336	#include <morphnormal_vertex>
3337	#include <skinbase_vertex>
3338	#include <skinnormal_vertex>
3339	#include <defaultnormal_vertex>
3340	#include <normal_vertex>
3341	#include <begin_vertex>
3342	#include <morphtarget_vertex>
3343	#include <skinning_vertex>
3344	#include <displacementmap_vertex>
3345	#include <project_vertex>
3346	#include <logdepthbuf_vertex>
3347	#include <clipping_planes_vertex>
3348	vViewPosition = - mvPosition.xyz;
3349	#include <worldpos_vertex>
3350	#include <shadowmap_vertex>
3351	#include <fog_vertex>
3352#ifdef USE_TRANSMISSION
3353	vWorldPosition = worldPosition.xyz;
3354#endif
3355}`,n2=`#define STANDARD
3356#ifdef PHYSICAL
3357	#define IOR
3358	#define USE_SPECULAR
3359#endif
3360uniform vec3 diffuse;
3361uniform vec3 emissive;
3362uniform float roughness;
3363uniform float metalness;
3364uniform float opacity;
3365#ifdef IOR
3366	uniform float ior;
3367#endif
3368#ifdef USE_SPECULAR
3369	uniform float specularIntensity;
3370	uniform vec3 specularColor;
3371	#ifdef USE_SPECULAR_COLORMAP
3372		uniform sampler2D specularColorMap;
3373	#endif
3374	#ifdef USE_SPECULAR_INTENSITYMAP
3375		uniform sampler2D specularIntensityMap;
3376	#endif
3377#endif
3378#ifdef USE_CLEARCOAT
3379	uniform float clearcoat;
3380	uniform float clearcoatRoughness;
3381#endif
3382#ifdef USE_DISPERSION
3383	uniform float dispersion;
3384#endif
3385#ifdef USE_IRIDESCENCE
3386	uniform float iridescence;
3387	uniform float iridescenceIOR;
3388	uniform float iridescenceThicknessMinimum;
3389	uniform float iridescenceThicknessMaximum;
3390#endif
3391#ifdef USE_SHEEN
3392	uniform vec3 sheenColor;
3393	uniform float sheenRoughness;
3394	#ifdef USE_SHEEN_COLORMAP
3395		uniform sampler2D sheenColorMap;
3396	#endif
3397	#ifdef USE_SHEEN_ROUGHNESSMAP
3398		uniform sampler2D sheenRoughnessMap;
3399	#endif
3400#endif
3401#ifdef USE_ANISOTROPY
3402	uniform vec2 anisotropyVector;
3403	#ifdef USE_ANISOTROPYMAP
3404		uniform sampler2D anisotropyMap;
3405	#endif
3406#endif
3407varying vec3 vViewPosition;
3408#include <common>
3409#include <dithering_pars_fragment>
3410#include <color_pars_fragment>
3411#include <uv_pars_fragment>
3412#include <map_pars_fragment>
3413#include <alphamap_pars_fragment>
3414#include <alphatest_pars_fragment>
3415#include <alphahash_pars_fragment>
3416#include <aomap_pars_fragment>
3417#include <lightmap_pars_fragment>
3418#include <emissivemap_pars_fragment>
3419#include <iridescence_fragment>
3420#include <cube_uv_reflection_fragment>
3421#include <envmap_common_pars_fragment>
3422#include <envmap_physical_pars_fragment>
3423#include <fog_pars_fragment>
3424#include <lights_pars_begin>
3425#include <normal_pars_fragment>
3426#include <lights_physical_pars_fragment>
3427#include <transmission_pars_fragment>
3428#include <shadowmap_pars_fragment>
3429#include <bumpmap_pars_fragment>
3430#include <normalmap_pars_fragment>
3431#include <clearcoat_pars_fragment>
3432#include <iridescence_pars_fragment>
3433#include <roughnessmap_pars_fragment>
3434#include <metalnessmap_pars_fragment>
3435#include <logdepthbuf_pars_fragment>
3436#include <clipping_planes_pars_fragment>
3437void main() {
3438	vec4 diffuseColor = vec4( diffuse, opacity );
3439	#include <clipping_planes_fragment>
3440	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3441	vec3 totalEmissiveRadiance = emissive;
3442	#include <logdepthbuf_fragment>
3443	#include <map_fragment>
3444	#include <color_fragment>
3445	#include <alphamap_fragment>
3446	#include <alphatest_fragment>
3447	#include <alphahash_fragment>
3448	#include <roughnessmap_fragment>
3449	#include <metalnessmap_fragment>
3450	#include <normal_fragment_begin>
3451	#include <normal_fragment_maps>
3452	#include <clearcoat_normal_fragment_begin>
3453	#include <clearcoat_normal_fragment_maps>
3454	#include <emissivemap_fragment>
3455	#include <lights_physical_fragment>
3456	#include <lights_fragment_begin>
3457	#include <lights_fragment_maps>
3458	#include <lights_fragment_end>
3459	#include <aomap_fragment>
3460	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3461	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3462	#include <transmission_fragment>
3463	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3464	#ifdef USE_SHEEN
3465 
3466		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3467 
3468 	#endif
3469	#ifdef USE_CLEARCOAT
3470		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3471		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3472		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3473	#endif
3474	#include <opaque_fragment>
3475	#include <tonemapping_fragment>
3476	#include <colorspace_fragment>
3477	#include <fog_fragment>
3478	#include <premultiplied_alpha_fragment>
3479	#include <dithering_fragment>
3480}`,i2=`#define TOON
3481varying vec3 vViewPosition;
3482#include <common>
3483#include <batching_pars_vertex>
3484#include <uv_pars_vertex>
3485#include <displacementmap_pars_vertex>
3486#include <color_pars_vertex>
3487#include <fog_pars_vertex>
3488#include <normal_pars_vertex>
3489#include <morphtarget_pars_vertex>
3490#include <skinning_pars_vertex>
3491#include <shadowmap_pars_vertex>
3492#include <logdepthbuf_pars_vertex>
3493#include <clipping_planes_pars_vertex>
3494void main() {
3495	#include <uv_vertex>
3496	#include <color_vertex>
3497	#include <morphinstance_vertex>
3498	#include <morphcolor_vertex>
3499	#include <batching_vertex>
3500	#include <beginnormal_vertex>
3501	#include <morphnormal_vertex>
3502	#include <skinbase_vertex>
3503	#include <skinnormal_vertex>
3504	#include <defaultnormal_vertex>
3505	#include <normal_vertex>
3506	#include <begin_vertex>
3507	#include <morphtarget_vertex>
3508	#include <skinning_vertex>
3509	#include <displacementmap_vertex>
3510	#include <project_vertex>
3511	#include <logdepthbuf_vertex>
3512	#include <clipping_planes_vertex>
3513	vViewPosition = - mvPosition.xyz;
3514	#include <worldpos_vertex>
3515	#include <shadowmap_vertex>
3516	#include <fog_vertex>
3517}`,a2=`#define TOON
3518uniform vec3 diffuse;
3519uniform vec3 emissive;
3520uniform float opacity;
3521#include <common>
3522#include <dithering_pars_fragment>
3523#include <color_pars_fragment>
3524#include <uv_pars_fragment>
3525#include <map_pars_fragment>
3526#include <alphamap_pars_fragment>
3527#include <alphatest_pars_fragment>
3528#include <alphahash_pars_fragment>
3529#include <aomap_pars_fragment>
3530#include <lightmap_pars_fragment>
3531#include <emissivemap_pars_fragment>
3532#include <gradientmap_pars_fragment>
3533#include <fog_pars_fragment>
3534#include <bsdfs>
3535#include <lights_pars_begin>
3536#include <normal_pars_fragment>
3537#include <lights_toon_pars_fragment>
3538#include <shadowmap_pars_fragment>
3539#include <bumpmap_pars_fragment>
3540#include <normalmap_pars_fragment>
3541#include <logdepthbuf_pars_fragment>
3542#include <clipping_planes_pars_fragment>
3543void main() {
3544	vec4 diffuseColor = vec4( diffuse, opacity );
3545	#include <clipping_planes_fragment>
3546	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3547	vec3 totalEmissiveRadiance = emissive;
3548	#include <logdepthbuf_fragment>
3549	#include <map_fragment>
3550	#include <color_fragment>
3551	#include <alphamap_fragment>
3552	#include <alphatest_fragment>
3553	#include <alphahash_fragment>
3554	#include <normal_fragment_begin>
3555	#include <normal_fragment_maps>
3556	#include <emissivemap_fragment>
3557	#include <lights_toon_fragment>
3558	#include <lights_fragment_begin>
3559	#include <lights_fragment_maps>
3560	#include <lights_fragment_end>
3561	#include <aomap_fragment>
3562	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3563	#include <opaque_fragment>
3564	#include <tonemapping_fragment>
3565	#include <colorspace_fragment>
3566	#include <fog_fragment>
3567	#include <premultiplied_alpha_fragment>
3568	#include <dithering_fragment>
3569}`,s2=`uniform float size;
3570uniform float scale;
3571#include <common>
3572#include <color_pars_vertex>
3573#include <fog_pars_vertex>
3574#include <morphtarget_pars_vertex>
3575#include <logdepthbuf_pars_vertex>
3576#include <clipping_planes_pars_vertex>
3577#ifdef USE_POINTS_UV
3578	varying vec2 vUv;
3579	uniform mat3 uvTransform;
3580#endif
3581void main() {
3582	#ifdef USE_POINTS_UV
3583		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3584	#endif
3585	#include <color_vertex>
3586	#include <morphinstance_vertex>
3587	#include <morphcolor_vertex>
3588	#include <begin_vertex>
3589	#include <morphtarget_vertex>
3590	#include <project_vertex>
3591	gl_PointSize = size;
3592	#ifdef USE_SIZEATTENUATION
3593		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3594		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3595	#endif
3596	#include <logdepthbuf_vertex>
3597	#include <clipping_planes_vertex>
3598	#include <worldpos_vertex>
3599	#include <fog_vertex>
3600}`,r2=`uniform vec3 diffuse;
3601uniform float opacity;
3602#include <common>
3603#include <color_pars_fragment>
3604#include <map_particle_pars_fragment>
3605#include <alphatest_pars_fragment>
3606#include <alphahash_pars_fragment>
3607#include <fog_pars_fragment>
3608#include <logdepthbuf_pars_fragment>
3609#include <clipping_planes_pars_fragment>
3610void main() {
3611	vec4 diffuseColor = vec4( diffuse, opacity );
3612	#include <clipping_planes_fragment>
3613	vec3 outgoingLight = vec3( 0.0 );
3614	#include <logdepthbuf_fragment>
3615	#include <map_particle_fragment>
3616	#include <color_fragment>
3617	#include <alphatest_fragment>
3618	#include <alphahash_fragment>
3619	outgoingLight = diffuseColor.rgb;
3620	#include <opaque_fragment>
3621	#include <tonemapping_fragment>
3622	#include <colorspace_fragment>
3623	#include <fog_fragment>
3624	#include <premultiplied_alpha_fragment>
3625}`,o2=`#include <common>
3626#include <batching_pars_vertex>
3627#include <fog_pars_vertex>
3628#include <morphtarget_pars_vertex>
3629#include <skinning_pars_vertex>
3630#include <logdepthbuf_pars_vertex>
3631#include <shadowmap_pars_vertex>
3632void main() {
3633	#include <batching_vertex>
3634	#include <beginnormal_vertex>
3635	#include <morphinstance_vertex>
3636	#include <morphnormal_vertex>
3637	#include <skinbase_vertex>
3638	#include <skinnormal_vertex>
3639	#include <defaultnormal_vertex>
3640	#include <begin_vertex>
3641	#include <morphtarget_vertex>
3642	#include <skinning_vertex>
3643	#include <project_vertex>
3644	#include <logdepthbuf_vertex>
3645	#include <worldpos_vertex>
3646	#include <shadowmap_vertex>
3647	#include <fog_vertex>
3648}`,l2=`uniform vec3 color;
3649uniform float opacity;
3650#include <common>
3651#include <fog_pars_fragment>
3652#include <bsdfs>
3653#include <lights_pars_begin>
3654#include <logdepthbuf_pars_fragment>
3655#include <shadowmap_pars_fragment>
3656#include <shadowmask_pars_fragment>
3657void main() {
3658	#include <logdepthbuf_fragment>
3659	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3660	#include <tonemapping_fragment>
3661	#include <colorspace_fragment>
3662	#include <fog_fragment>
3663	#include <premultiplied_alpha_fragment>
3664}`,c2=`uniform float rotation;
3665uniform vec2 center;
3666#include <common>
3667#include <uv_pars_vertex>
3668#include <fog_pars_vertex>
3669#include <logdepthbuf_pars_vertex>
3670#include <clipping_planes_pars_vertex>
3671void main() {
3672	#include <uv_vertex>
3673	vec4 mvPosition = modelViewMatrix[ 3 ];
3674	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3675	#ifndef USE_SIZEATTENUATION
3676		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3677		if ( isPerspective ) scale *= - mvPosition.z;
3678	#endif
3679	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3680	vec2 rotatedPosition;
3681	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3682	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3683	mvPosition.xy += rotatedPosition;
3684	gl_Position = projectionMatrix * mvPosition;
3685	#include <logdepthbuf_vertex>
3686	#include <clipping_planes_vertex>
3687	#include <fog_vertex>
3688}`,u2=`uniform vec3 diffuse;
3689uniform float opacity;
3690#include <common>
3691#include <uv_pars_fragment>
3692#include <map_pars_fragment>
3693#include <alphamap_pars_fragment>
3694#include <alphatest_pars_fragment>
3695#include <alphahash_pars_fragment>
3696#include <fog_pars_fragment>
3697#include <logdepthbuf_pars_fragment>
3698#include <clipping_planes_pars_fragment>
3699void main() {
3700	vec4 diffuseColor = vec4( diffuse, opacity );
3701	#include <clipping_planes_fragment>
3702	vec3 outgoingLight = vec3( 0.0 );
3703	#include <logdepthbuf_fragment>
3704	#include <map_fragment>
3705	#include <alphamap_fragment>
3706	#include <alphatest_fragment>
3707	#include <alphahash_fragment>
3708	outgoingLight = diffuseColor.rgb;
3709	#include <opaque_fragment>
3710	#include <tonemapping_fragment>
3711	#include <colorspace_fragment>
3712	#include <fog_fragment>
3713}
3713`,Mt={alphahash_fragment:DM,alphahash_pars_fragment:UM,alphamap_fragment:LM,alphamap_pars_fragment:OM,alphatest_fragment:PM,alphatest_pars_fragment:IM,aomap_fragment:FM,aomap_pars_fragment:zM,batching_pars_vertex:BM,batching_vertex:HM,begin_vertex:GM,beginnormal_vertex:kM,bsdfs:VM,iridescence_fragment:jM,bumpmap_pars_fragment:XM,clipping_planes_fragment:WM,clipping_planes_pars_fragment:qM,clipping_planes_pars_vertex:YM,clipping_planes_vertex:QM,color_fragment:KM,color_pars_fragment:ZM,color_pars_vertex:JM,color_vertex:$M,common:eE,cube_uv_reflection_fragment:tE,defaultnormal_vertex:nE,displacementmap_pars_vertex:iE,displacementmap_vertex:aE,emissivemap_fragment:sE,emissivemap_pars_fragment:rE,colorspace_fragment:oE,colorspace_pars_fragment:lE,envmap_fragment:cE,envmap_common_pars_fragment:uE,envmap_pars_fragment:fE,envmap_pars_vertex:dE,envmap_physical_pars_fragment:ME,envmap_vertex:hE,fog_vertex:pE,fog_pars_vertex:mE,fog_fragment:gE,fog_pars_fragment:xE,gradientmap_pars_fragment:vE,lightmap_pars_fragment:_E,lights_lambert_fragment:yE,lights_lambert_pars_fragment:bE,lights_pars_begin:SE,lights_toon_fragment:EE,lights_toon_pars_fragment:TE,lights_phong_fragment:AE,lights_phong_pars_fragment:wE,lights_physical_fragment:CE,lights_physical_pars_fragment:RE,lights_fragment_begin:NE,lights_fragment_maps:DE,lights_fragment_end:UE,lightprobes_pars_fragment:LE,logdepthbuf_fragment:OE,logdepthbuf_pars_fragment:PE,logdepthbuf_pars_vertex:IE,logdepthbuf_vertex:FE,map_fragment:zE,map_pars_fragment:BE,map_particle_fragment:HE,map_particle_pars_fragment:GE,metalnessmap_fragment:kE,metalnessmap_pars_fragment:VE,morphinstance_vertex:jE,morphcolor_vertex:XE,morphnormal_vertex:WE,morphtarget_pars_vertex:qE,morphtarget_vertex:YE,normal_fragment_begin:QE,normal_fragment_maps:KE,normal_pars_fragment:ZE,normal_pars_vertex:JE,normal_vertex:$E,normalmap_pars_fragment:eT,clearcoat_normal_fragment_begin:tT,clearcoat_normal_fragment_maps:nT,clearcoat_pars_fragment:iT,iridescence_pars_fragment:aT,opaque_fragment:sT,packing:rT,premultiplied_alpha_fragment:oT,project_vertex:lT,dithering_fragment:cT,dithering_pars_fragment:uT,roughnessmap_fragment:fT,roughnessmap_pars_fragment:dT,shadowmap_pars_fragment:hT,shadowmap_pars_vertex:pT,shadowmap_vertex:mT,shadowmask_pars_fragment:gT,skinbase_vertex:xT,skinning_pars_vertex:vT,skinning_vertex:_T,skinnormal_vertex:yT,specularmap_fragment:bT,specularmap_pars_fragment:ST,tonemapping_fragment:MT,tonemapping_pars_fragment:ET,transmission_fragment:TT,transmission_pars_fragment:AT,uv_pars_fragment:wT,uv_pars_vertex:CT,uv_vertex:RT,worldpos_vertex:NT,background_vert:DT,background_frag:UT,backgroundCube_vert:LT,backgroundCube_frag:OT,cube_vert:PT,cube_frag:IT,depth_vert:FT,depth_frag:zT,distance_vert:BT,distance_frag:HT,equirect_vert:GT,equirect_frag:kT,linedashed_vert:VT,linedashed_frag:jT,meshbasic_vert:XT,meshbasic_frag:WT,meshlambert_vert:qT,meshlambert_frag:YT,meshmatcap_vert:QT,meshmatcap_frag:KT,meshnormal_vert:ZT,meshnormal_frag:JT,meshphong_vert:$T,meshphong_frag:e2,meshphysical_vert:t2,meshphysical_frag:n2,meshtoon_vert:i2,meshtoon_frag:a2,points_vert:s2,points_frag:r2,shadow_vert:o2,shadow_frag:l2,sprite_vert:c2,sprite_frag:u2},He={common:{diffuse:{value:new Vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new xt},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new xt}},envmap:{envMap:{value:null},envMapRotation:{value:new xt},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new xt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new xt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new xt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new xt},normalScale:{value:new Xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new xt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new xt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new xt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new xt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new le},probesMax:{value:new le},probesResolution:{value:new le}},points:{diffuse:{value:new Vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0},uvTransform:{value:new xt}},sprite:{diffuse:{value:new Vt(16777215)},opacity:{value:1},center:{value:new Xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new xt},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0}}},va={basic:{uniforms:ti([He.common,He.specularmap,He.envmap,He.aomap,He.lightmap,He.fog]),vertexShader:Mt.meshbasic_vert,fragmentShader:Mt.meshbasic_frag},lambert:{uniforms:ti([He.common,He.specularmap,He.envmap,He.aomap,He.lightmap,He.emissivemap,He.bumpmap,He.normalmap,He.displacementmap,He.fog,He.lights,{emissive:{value:new Vt(0)},envMapIntensity:{value:1}}]),vertexShader:Mt.meshlambert_vert,fragmentShader:Mt.meshlambert_frag},phong:{uniforms:ti([He.common,He.specularmap,He.envmap,He.aomap,He.lightmap,He.emissivemap,He.bumpmap,He.normalmap,He.displacementmap,He.fog,He.lights,{emissive:{value:new Vt(0)},specular:{value:new Vt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Mt.meshphong_vert,fragmentShader:Mt.meshphong_frag},standard:{uniforms:ti([He.common,He.envmap,He.aomap,He.lightmap,He.emissivemap,He.bumpmap,He.normalmap,He.displacementmap,He.roughnessmap,He.metalnessmap,He.fog,He.lights,{emissive:{value:new Vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag},toon:{uniforms:ti([He.common,He.aomap,He.lightmap,He.emissivemap,He.bumpmap,He.normalmap,He.displacementmap,He.gradientmap,He.fog,He.lights,{emissive:{value:new Vt(0)}}]),vertexShader:Mt.meshtoon_vert,fragmentShader:Mt.meshtoon_frag},matcap:{uniforms:ti([He.common,He.bumpmap,He.normalmap,He.displacementmap,He.fog,{matc
vendor: 5,205 bytes, line 3713
3713ap:{value:null}}]),vertexShader:Mt.meshmatcap_vert,fragmentShader:Mt.meshmatcap_frag},points:{uniforms:ti([He.points,He.fog]),vertexShader:Mt.points_vert,fragmentShader:Mt.points_frag},dashed:{uniforms:ti([He.common,He.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Mt.linedashed_vert,fragmentShader:Mt.linedashed_frag},depth:{uniforms:ti([He.common,He.displacementmap]),vertexShader:Mt.depth_vert,fragmentShader:Mt.depth_frag},normal:{uniforms:ti([He.common,He.bumpmap,He.normalmap,He.displacementmap,{opacity:{value:1}}]),vertexShader:Mt.meshnormal_vert,fragmentShader:Mt.meshnormal_frag},sprite:{uniforms:ti([He.sprite,He.fog]),vertexShader:Mt.sprite_vert,fragmentShader:Mt.sprite_frag},background:{uniforms:{uvTransform:{value:new xt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Mt.background_vert,fragmentShader:Mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new xt}},vertexShader:Mt.backgroundCube_vert,fragmentShader:Mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Mt.cube_vert,fragmentShader:Mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Mt.equirect_vert,fragmentShader:Mt.equirect_frag},distance:{uniforms:ti([He.common,He.displacementmap,{referencePosition:{value:new le},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Mt.distance_vert,fragmentShader:Mt.distance_frag},shadow:{uniforms:ti([He.lights,He.fog,{color:{value:new Vt(0)},opacity:{value:1}}]),vertexShader:Mt.shadow_vert,fragmentShader:Mt.shadow_frag}};va.physical={uniforms:ti([va.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new xt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new xt},clearcoatNormalScale:{value:new Xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new xt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new xt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new xt},sheen:{value:0},sheenColor:{value:new Vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new xt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new xt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new xt},transmissionSamplerSize:{value:new Xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new xt},attenuationDistance:{value:0},attenuationColor:{value:new Vt(0)},specularColor:{value:new Vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new xt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new xt},anisotropyVector:{value:new Xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new xt}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag};const Xu={r:0,b:0,g:0},f2=new Dn,fy=new xt;fy.set(-1,0,0,0,1,0,0,0,1);function d2(r,e,i,s,l,c){const d=new Vt(0);let h=l===!0?0:1,p,m,_=null,v=0,g=null;function b(z){let F=z.isScene===!0?z.background:null;if(F&&F.isTexture){const C=z.backgroundBlurriness>0;F=e.get(F,C)}return F}function A(z){let F=!1;const C=b(z);C===null?E(d,h):C&&C.isColor&&(E(C,1),F=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?i.buffers.color.setClear(0,0,0,1,c):I==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,c),(r.autoClear||F)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function D(z,F){const C=b(F);C&&(C.isCubeTexture||C.mapping===cf)?(m===void 0&&(m=new Ta(new dc(1,1,1),new ia({name:"BackgroundCubeMaterial",uniforms:Jo(va.backgroundCube.uniforms),vertexShader:va.backgroundCube.vertexShader,fragmentShader:va.backgroundCube.fragmentShader,side:hi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),m.geometry.deleteAttribute("uv"),m.onBeforeRender=function(I,L,H){this.matrixWorld.copyPosition(H.matrixWorld)},Object.defineProperty(m.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(m)),m.material.uniforms.envMap.value=C,m.material.uniforms.backgroundBlurriness.value=F.backgroundBlurriness,m.material.uniforms.backgroundIntensity.value=F.backgroundIntensity,m.material.uniforms.backgroundRotation.value.setFromMatrix4(f2.makeRotationFromEuler(F.backgroundRotation)).transpose(),C.isCubeTexture&&C.isRenderTargetTexture===!1&&m.material.uniforms.backgroundRotation.value.premultiply(fy),m.material.toneMapped=Pt.getTransfer(C.colorSpace)!==$t,(_!==C||v!==C.version||g!==r.toneMapping)&&(m.material.needsUpdate=!0,_=C,v=C.version,g=r.toneMapping),m.layers.enableAll(),z.unshift(m,m.geometry,m.material,0,0,null)):C&&C.isTexture&&(p===void 0&&(p=new Ta(new hc(2,2),new ia({name:"Backgroun
3713dMaterial",uniforms:Jo(va.background.uniforms),vertexShader:va.background.vertexShader,fragmentShader:va.background.fragmentShader,side:$s,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),Object.defineProperty(p.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(p)),p.material.uniforms.t2D.value=C,p.material.uniforms.backgroundIntensity.value=F.backgroundIntensity,p.material.toneMapped=Pt.getTransfer(C.colorSpace)!==$t,C.matrixAutoUpdate===!0&&C.updateMatrix(),p.material.uniforms.uvTransform.value.copy(C.matrix),(_!==C||v!==C.version||g!==r.toneMapping)&&(p.material.needsUpdate=!0,_=C,v=C.version,g=r.toneMapping),p.layers.enableAll(),z.unshift(p,p.geometry,p.material,0,0,null))}function E(z,F){z.getRGB(Xu,ly(r)),i.buffers.color.setClear(Xu.r,Xu.g,Xu.b,F,c)}function M(){m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0),p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0)}return{getClearColor:function(){return d},setClearColor:function(z,F=1){d.set(z),h=F,E(d,h)},getClearAlpha:function(){return h},setClearAlpha:function(z){h=z,E(d,h)},render:A,addToRenderList:D,dispose:M}}function h2(r,e){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s={},l=g(null);let c=l,d=!1;function h(k,$,me,fe,te){let B=!1;const j=v(k,fe,me,$);c!==j&&(c=j,m(c.object)),B=b(k,fe,me,te),B&&A(k,fe,me,te),te!==null&&e.update(te,r.ELEMENT_ARRAY_BUFFER),(B||d)&&(d=!1,C(k,$,me,fe),te!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(te).buffer))}function p(){return r.createVertexArray()}function m(k){return r.bindVertexArray(k)}function _(k){return r.deleteVertexArray(k)}function v(k,$,me,fe){const te=fe.wireframe===!0;let B=s[$.id];B===void 0&&(B={},s[$.id]=B);const j=k.isInstancedMesh===!0?k.id:0;let Y=B[j];Y===void 0&&(Y={},B[j]=Y);let ce=Y[me.id];ce===void 0&&(ce={},Y[me.id]=ce);let Se=ce[te];return Se===void 0&&(Se=g(p()),ce[te]=Se),Se}function g(k){const $=[],me=[],fe=[];for(let te=0;te<i;te++)$[te]=0,me[te]=0,fe[te]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:$,enabledAttributes:me,attributeDivisors:fe,object:k,attributes:{},index:null}}function b(k,$,me,fe){const te=c.attributes,B=$.attributes;let j=0;const Y=me.getAttributes();for(const ce in Y)if(Y[ce].location>=0){const Ce=te[ce];let Ae=B[ce];if(Ae===void 0&&(ce==="instanceMatrix"&&k.instanceMatrix&&(Ae=k.instanceMatrix),ce==="instanceColor"&&k.instanceColor&&(Ae=k.instanceColor)),Ce===void 0||Ce.attribute!==Ae||Ae&&Ce.data!==Ae.data)return!0;j++}return c.attributesNum!==j||c.index!==fe}function A(k,$,me,fe){const te={},B=$.attributes;let j=0;const Y=me.getAttributes();for(const ce in Y)if(Y[ce].location>=0){let Ce=B[ce];Ce===void 0&&(ce==="instanceMatrix"&&k.instanceMatrix&&(Ce=k.instanceMatrix),ce==="instanceColor"&&k.instanceColor&&(Ce=k.instanceColor));const Ae={};Ae.attribute=Ce,Ce&&Ce.data&&(Ae.data=Ce.data),te[ce]=Ae,j++}c.attributes=te,c.attributesNum=j,c.index=fe}function D(){const k=c.newAttributes;for(let $=0,me=k.length;$<me;$++)k[$]=0}function E(k){M(k,0)}function M(k,$){const me=c.newAttributes,fe=c.enabledAttributes,te=c.attributeDivisors;me[k]=1,fe[k]===0&&(r.enableVertexAttribArray(k),fe[k]=1),te[k]!==$&&(r.vertexAttribDivisor(k,$),te[k]=$)}function z(){const k=c.newAttributes,$=c.enabledAttributes;for(let me=0,fe=$.length;me<fe;me++)$[me]!==k[me]&&(r.disableVertexAttribArray(me),$[me]=0)}function F(k,$,me,fe,te,B,j){j===!0?r.vertexAttribIPointer(k,$,me,te,B):r.vertexAttribPointer(k,$,me,fe,te,B)}function C(k,$,me,fe){D();const te=fe.attributes,B=me.getAttributes(),j=$.defaultAttributeValues;for(const Y in B){const ce=B[Y];if(ce.location>=0){let Se=te[Y];if(Se===void 0&&(Y==="instanceMatrix"&&k.instanceMatrix&&(Se=k.instanceMatrix),Y==="instanceColor"&&k.instanceColor&&(Se=k.instanceColor)),Se!==void 0){const Ce=Se.normalized,Ae=Se.itemSize,je=e.get(Se);if(je===void 0)continue;const dt=je.buffer,ft=je.type,Z=je.bytesPerElement,we=ft===r.INT||ft===r.UNSIGNED_INT||Se.gpuType===om;if(Se.isInterleavedBufferAttribute){const Te=Se.data,ke=Te.stride,rt=Se.offset;if(Te.isInstancedInterleavedBuffer){for(let Ze=0;Ze<ce.locationSize;Ze++)M(ce.location+Ze,Te.meshPerAttribute);k.isInstancedMesh!==!0&&fe._maxInstanceCount===void 0&&(fe._maxInstanceCount=Te.meshPerAttribute*Te.count)}else for(let Ze=0;Ze<ce.locationSize;Ze++)E(ce.location+Ze);r.bindBuffer(r.ARRAY_BUFFER,dt);for(let Ze=0;Ze<ce.locationSize;Ze++)F(ce.location+Ze,Ae/ce.locationSize,ft,Ce,ke*Z,(rt+Ae/ce.locationSize*Ze)*Z,we)}else{if(Se.isInstancedBufferAttribute){for(let Te=0;Te<ce.locationSize;Te++)M(ce.location+Te,Se.meshPerAttribute);k.isInstancedMesh!==!0&&fe._maxInstanceCount===void 0&&(fe._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let Te=0;Te<ce.locationSize;Te++)E(ce.location+Te);r.bindBuffer(r.ARRAY_BUFFER,dt);for(let Te=0;Te<ce.locationSize;Te++)F(ce.location+Te,Ae/ce.locationSize,ft,Ce,Ae*Z,Ae/ce.locationSize*Te*Z,we)}}else if(j!==void 0){const Ce=j[Y];
vendor: 8,347 bytes, line 3713
3713if(Ce!==void 0)switch(Ce.length){case 2:r.vertexAttrib2fv(ce.location,Ce);break;case 3:r.vertexAttrib3fv(ce.location,Ce);break;case 4:r.vertexAttrib4fv(ce.location,Ce);break;default:r.vertexAttrib1fv(ce.location,Ce)}}}}z()}function I(){O();for(const k in s){const $=s[k];for(const me in $){const fe=$[me];for(const te in fe){const B=fe[te];for(const j in B)_(B[j].object),delete B[j];delete fe[te]}}delete s[k]}}function L(k){if(s[k.id]===void 0)return;const $=s[k.id];for(const me in $){const fe=$[me];for(const te in fe){const B=fe[te];for(const j in B)_(B[j].object),delete B[j];delete fe[te]}}delete s[k.id]}function H(k){for(const $ in s){const me=s[$];for(const fe in me){const te=me[fe];if(te[k.id]===void 0)continue;const B=te[k.id];for(const j in B)_(B[j].object),delete B[j];delete te[k.id]}}}function w(k){for(const $ in s){const me=s[$],fe=k.isInstancedMesh===!0?k.id:0,te=me[fe];if(te!==void 0){for(const B in te){const j=te[B];for(const Y in j)_(j[Y].object),delete j[Y];delete te[B]}delete me[fe],Object.keys(me).length===0&&delete s[$]}}}function O(){V(),d=!0,c!==l&&(c=l,m(c.object))}function V(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:O,resetDefaultState:V,dispose:I,releaseStatesOfGeometry:L,releaseStatesOfObject:w,releaseStatesOfProgram:H,initAttributes:D,enableAttribute:E,disableUnusedAttributes:z}}function p2(r,e,i){let s;function l(p){s=p}function c(p,m){r.drawArrays(s,p,m),i.update(m,s,1)}function d(p,m,_){_!==0&&(r.drawArraysInstanced(s,p,m,_),i.update(m,s,_))}function h(p,m,_){if(_===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,p,0,m,0,_);let g=0;for(let b=0;b<_;b++)g+=m[b];i.update(g,s,1)}this.setMode=l,this.render=c,this.renderInstances=d,this.renderMultiDraw=h}function m2(r,e,i,s){let l;function c(){if(l!==void 0)return l;if(e.has("EXT_texture_filter_anisotropic")===!0){const H=e.get("EXT_texture_filter_anisotropic");l=r.getParameter(H.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else l=0;return l}function d(H){return!(H!==ta&&s.convert(H)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(H){const w=H===ss&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(H!==Gi&&s.convert(H)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&H!==_a&&!w)}function p(H){if(H==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";H="mediump"}return H==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let m=i.precision!==void 0?i.precision:"highp";const _=p(m);_!==m&&(ut("WebGLRenderer:",m,"not supported, using",_,"instead."),m=_);const v=i.logarithmicDepthBuffer===!0,g=i.reversedDepthBuffer===!0&&e.has("EXT_clip_control");i.reversedDepthBuffer===!0&&g===!1&&ut("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const b=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),D=r.getParameter(r.MAX_TEXTURE_SIZE),E=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),M=r.getParameter(r.MAX_VERTEX_ATTRIBS),z=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),F=r.getParameter(r.MAX_VARYING_VECTORS),C=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),I=r.getParameter(r.MAX_SAMPLES),L=r.getParameter(r.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:c,getMaxPrecision:p,textureFormatReadable:d,textureTypeReadable:h,precision:m,logarithmicDepthBuffer:v,reversedDepthBuffer:g,maxTextures:b,maxVertexTextures:A,maxTextureSize:D,maxCubemapSize:E,maxAttributes:M,maxVertexUniforms:z,maxVaryings:F,maxFragmentUniforms:C,maxSamples:I,samples:L}}function g2(r){const e=this;let i=null,s=0,l=!1,c=!1;const d=new br,h=new xt,p={value:null,needsUpdate:!1};this.uniform=p,this.numPlanes=0,this.numIntersection=0,this.init=function(v,g){const b=v.length!==0||g||s!==0||l;return l=g,s=v.length,b},this.beginShadows=function(){c=!0,_(null)},this.endShadows=function(){c=!1},this.setGlobalState=function(v,g){i=_(v,g,0)},this.setState=function(v,g,b){const A=v.clippingPlanes,D=v.clipIntersection,E=v.clipShadows,M=r.get(v);if(!l||A===null||A.length===0||c&&!E)c?_(null):m();else{const z=c?0:s,F=z*4;let C=M.clippingState||null;p.value=C,C=_(A,g,F,b);for(let I=0;I!==F;++I)C[I]=i[I];M.clippingState=C,this.numIntersection=D?this.numPlanes:0,this.numPlanes+=z}};function m(){p.value!==i&&(p.value=i,p.needsUpdate=s>0),e.numPlanes=s,e.numIntersection=0}function _(v,g,b,A){const D=v!==null?v.length:0;let E=null;if(D!==0){if(E=p.value,A!==!0||E===null){const M=b+D*4,z=g.matrixWorldInverse;h.getNormalMatrix(z),(E===null||E.length<M)&&(E=new Float32Array(M));for(let F=0,C=b;F!==D;++F,C+=4)d.copy(v[F]).applyMatrix4(z,h),d.normal.toArray(E,C),E[C+3]=d.constant}p.value=E,p.needsUpdate=!0}return e.numPlanes=D,e.numIntersection=0,E}}const Zs=4,Gv=[.125,.215,.35,.446,.526,.582],Mr=20,x2=256,Ql=new xm,kv=new Vt;let qh=null,Yh=0,Qh=0,Kh=!1;const v2=new le;class Vv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,i=0,s=.1,l=100,c={}){const{size:d=256,position:h=v2}=c;qh=this._renderer.getRenderTarget(),Yh=this._renderer.getActiveCubeFace(),Qh=this._renderer.getActiveMipmapLevel(),Kh=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(d);const p=this._allocateTargets();return p.depthBuffer=!0,this._sceneToCubeUV(e,s,l,p,h),i>0&&this._blur(p,0,0,i),this._applyPMREM(p),this._cleanup(p),p}fromEquirectangular(e,i=null){return this._fromTexture(e,i)}fromCubemap(e,i=null){return this._fromTexture(e,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Wv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Xv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(qh,Yh,Qh),this._renderer.xr.enabled=Kh,e.scissorTest=!1,Uo(e,0,0,e.width,e.height)}_fromTexture(e,i){e.mapping===Ir||e.mapping===Ko?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),qh=this._renderer.getRenderTarget(),Yh=this._renderer.getActiveCubeFace(),Qh=this._renderer.getActiveMipmapLevel(),Kh=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=i||this._allocateTargets();return this._textureToCubeUV(e,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,s={magFilter:Kn,minFilter:Kn,generateMipmaps:!1,type:ss,format:ta,colorSpace:nf,depthBuffer:!1},l=jv(e,i,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=jv(e,i,s);const{_lodMax:c}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=_2(c)),this._blurMaterial=b2(c,e,i),this._ggxMaterial=y2(c,e,i)}return l}_compileMaterial(e){const i=new Ta(new os,e);this._renderer.compile(i,Ql)}_sceneToCubeUV(e,i,s,l,c){const p=new $i(90,1,i,s),m=[1,-1,1,1,1,1],_=[1,1,1,-1,-1,-1],v=this._renderer,g=v.autoClear,b=v.toneMapping;v.getClearColor(kv),v.toneMapping=ba,v.autoClear=!1,v.state.buffers.depth.getReversed()&&(v.setRenderTarget(l),v.clearDepth(),v.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Ta(new dc,new ay({name:"PMREM.Backgroun
3713d",side:hi,depthWrite:!1,depthTest:!1})));const D=this._backgroundBox,E=D.material;let M=!1;const z=e.background;z?z.isColor&&(E.color.copy(z),e.background=null,M=!0):(E.color.copy(kv),M=!0);for(let F=0;F<6;F++){const C=F%3;C===0?(p.up.set(0,m[F],0),p.position.set(c.x,c.y,c.z),p.lookAt(c.x+_[F],c.y,c.z)):C===1?(p.up.set(0,0,m[F]),p.position.set(c.x,c.y,c.z),p.lookAt(c.x,c.y+_[F],c.z)):(p.up.set(0,m[F],0),p.position.set(c.x,c.y,c.z),p.lookAt(c.x,c.y,c.z+_[F]));const I=this._cubeSize;Uo(l,C*I,F>2?I:0,I,I),v.setRenderTarget(l),M&&v.render(D,p),v.render(e,p)}v.toneMapping=b,v.autoClear=g,e.background=z}_textureToCubeUV(e,i){const s=this._renderer,l=e.mapping===Ir||e.mapping===Ko;l?(this._cubemapMaterial===null&&(this._cubemapMaterial=Wv()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Xv());const c=l?this._cubemapMaterial:this._equirectMaterial,d=this._lodMeshes[0];d.material=c;const h=c.uniforms;h.envMap.value=e;const p=this._cubeSize;Uo(i,0,0,3*p,2*p),s.setRenderTarget(i),s.render(d,Ql)}_applyPMREM(e){const i=this._renderer,s=i.autoClear;i.autoClear=!1;const l=this._lodMeshes.length;for(let c=1;c<l;c++)this._applyGGXFilter(e,c-1,c);i.autoClear=s}_applyGGXFilter(e,i,s){const l=this._renderer,c=this._pingPongRenderTarget,d=this._ggxMaterial,h=this._lodMeshes[s];h.material=d;const p=d.uniforms,m=s/(this._lodMeshes.length-1),_=i/(this._lodMeshes.length-1),v=Math.sqrt(m*m-_*_),g=0+m*1.25,b=v*g,{_lodMax:A}=this,D=this._sizeLods[s],E=3*D*(s>A-Zs?s-A+Zs:0),M=4*(this._cubeSize-D);p.envMap.value=e.texture,p.roughness.value=b,p.mipInt.value=A-i,Uo(c,E,M,3*D,2*D),l.setRenderTarget(c),l.render(h,Ql),p.envMap.value=c.texture,p.roughness.value=0,p.mipInt.value=A-s,Uo(e,E,M,3*D,2*D),l.setRenderTarget(e),l.render(h,Ql)}_blur(e,i,s,l,c){const d=this._pingPongRenderTarget;this._halfBlur(e,d,i,s,l,"latitudinal",c),this._halfBlur(d,e,s,s,l,"longitudinal",c)}_halfBlur(e,i,s,l,c,d,h){const p=this._renderer,m=this._blurMaterial;d!=="latitudinal"&&d!=="longitudinal"&&Bt("blur direction must be either latitudinal or longitudinal!");const _=3,v=this._lodMeshes[l];v.material=m;const g=m.uniforms,b=this._sizeLods[s]-1,A=isFinite(c)?Math.PI/(2*b):2*Math.PI/(2*Mr-1),D=c/A,E=isFinite(c)?1+Math.floor(_*D):Mr;E>Mr&&ut(`sigmaRadians, ${c}, is too large and will clip, as it requested ${E} samples when the maximum is set to ${Mr}`);const M=[];let z=0;for(let H=0;H<Mr;++H){const w=H/D,O=Math.exp(-w*w/2);M.push(O),H===0?z+=O:H<E&&(z+=2*O)}for(let H=0;H<M.length;H++)M[H]=M[H]/z;g.envMap.value=e.texture,g.samples.value=E,g.weights.value=M,g.latitudinal.value=d==="latitudinal",h&&(g.poleAxis.value=h);const{_lodMax:F}=this;g.dTheta.value=A,g.mipInt.value=F-s;const C=this._sizeLods[l],I=3*C*(l>F-Zs?l-F+Zs:0),L=4*(this._cubeSize-C);Uo(i,I,L,3*C,2*C),p.setRenderTarget(i),p.render(v,Ql)}}function _2(r){const e=[],i=[],s=[];let l=r;const c=r-Zs+1+Gv.length;for(let d=0;d<c;d++){const h=Math.pow(2,l);e.push(h);let p=1/h;d>r-Zs?p=Gv[d-r+Zs-1]:d===0&&(p=0),i.push(p);const m=1/(h-2),_=-m,v=1+m,g=[_,_,v,_,v,v,_,_,v,v,_,v],b=6,A=6,D=3,E=2,M=1,z=new Float32Array(D*A*b),F=new Float32Array(E*A*b),C=new Float32Array(M*A*b);for(let L=0;L<b;L++){const H=L%3*2/3-1,w=L>2?0:-1,O=[H,w,0,H+2/3,w,0,H+2/3,w+1,0,H,w,0,H+2/3,w+1,0,H,w+1,0];z.set(O,D*A*L),F.set(g,E*A*L);const V=[L,L,L,L,L,L];C.set(V,M*A*L)}const I=new os;I.setAttribute("position",new Ma(z,D)),I.setAttribute("uv",new Ma(F,E)),I.setAttribute("faceIndex",new Ma(C,M)),s.push(new Ta(I,null)),l>Zs&&l--}return{lodMeshes:s,sizeLods:e,sigmas:i}}function jv(r,e,i){const s=new Sa(r,e,i);return s.texture.mapping=cf,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Uo(r,e,i,s,l){r.viewport.set(e,i,s,l),r.scissor.set(e,i,s,l)}function y2(r,e,i){return new ia({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:x2,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ff(),fragmentShader:`
3714
3715			precision highp float;
3716			precision highp int;
3717
3718			varying vec3 vOutputDirection;
3719
3720			uniform sampler2D envMap;
3721			uniform float roughness;
3722			uniform float mipInt;
3723
3724			#define ENVMAP_TYPE_CUBE_UV
3725			#include <cube_uv_reflection_fragment>
3726
3727			#define PI 3.14159265359
3728
3729			// Van der Corput radical inverse
3730			float radicalInverse_VdC(uint bits) {
3731				bits = (bits << 16u) | (bits >> 16u);
3732				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3733				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3734				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3735				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3736				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3737			}
3738
3739			// Hammersley sequence
3740			vec2 hammersley(uint i, uint N) {
3741				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3742			}
3743
3744			// GGX VNDF importance sampling (Eric Heitz 2018)
3745			// "Sampling the GGX Distribution of Visible Normals"
3746			// https://jcgt.org/published/0007/04/01/
3747			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3748				float alpha = roughness * roughness;
3749
3750				// Section 4.1: Orthonormal basis
3751				vec3 T1 = vec3(1.0, 0.0, 0.0);
3752				vec3 T2 = cross(V, T1);
3753
3754				// Section 4.2: Parameterization of projected area
3755				float r = sqrt(Xi.x);
3756				float phi = 2.0 * PI * Xi.y;
3757				float t1 = r * cos(phi);
3758				float t2 = r * sin(phi);
3759				float s = 0.5 * (1.0 + V.z);
3760				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3761
3762				// Section 4.3: Reprojection onto hemisphere
3763				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
3764
3765				// Section 3.4: Transform back to ellipsoid configuration
3766				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3767			}
3768
3769			void main() {
3770				vec3 N = normalize(vOutputDirection);
3771				vec3 V = N; // Assume view direction equals normal for pre-filtering
3772
3773				vec3 prefilteredColor = vec3(0.0);
3774				float totalWeight = 0.0;
3775
3776				// For very low roughness, just sample the environment directly
3777				if (roughness < 0.001) {
3778					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3779					return;
3780				}
3781
3782				// Tangent space basis for VNDF sampling
3783				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3784				vec3 tangent = normalize(cross(up, N));
3785				vec3 bitangent = cross(N, tangent);
3786
3787				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3788					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3789
3790					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3791					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3792
3793					// Transform H back to world space
3794					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3795					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3796
3797					float NdotL = max(dot(N, L), 0.0);
3798
3799					if(NdotL > 0.0) {
3800						// Sample environment at fixed mip level
3801						// VNDF importance sampling handles the distribution filtering
3802						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3803
3804						// Weight by NdotL for the split-sum approximation
3805						// VNDF PDF naturally accounts for the visible microfacet distribution
3806						prefilteredColor += sampleColor * NdotL;
3807						totalWeight += NdotL;
3808					}
3809				}
3810
3811				if (totalWeight > 0.0) {
3812					prefilteredColor = prefilteredColor / totalWeight;
3813				}
3814
3815				gl_FragColor = vec4(prefilteredColor, 1.0);
3816			}
3817		`,blending:ns,depthTest:!1,depthWrite:!1})}function b2(r,e,i){const s=new Float32Array(Mr),l=new le(0,1,0);return new ia({name:"SphericalGaussianBlur",defines:{n:Mr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:l}},vertexShader:ff(),fragmentShader:`
3818
3819			precision mediump float;
3820			precision mediump int;
3821
3822			varying vec3 vOutputDirection;
3823
3824			uniform sampler2D envMap;
3825			uniform int samples;
3826			uniform float weights[ n ];
3827			uniform bool latitudinal;
3828			uniform float dTheta;
3829			uniform float mipInt;
3830			uniform vec3 poleAxis;
3831
3832			#define ENVMAP_TYPE_CUBE_UV
3833			#include <cube_uv_reflection_fragment>
3834
3835			vec3 getSample( float theta, vec3 axis ) {
3836
3837				float cosTheta = cos( theta );
3838				// Rodrigues' axis-angle rotation
3839				vec3 sampleDirection = vOutputDirection * cosTheta
3840					+ cross( axis, vOutputDirection ) * sin( theta )
3841					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3842
3843				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3844
3845			}
3846
3847			void main() {
3848
3849				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3850
3851				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3852
3853					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3854
3855				}
3856
3857				axis = normalize( axis );
3858
3859				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3860				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3861
3862				for ( int i = 1; i < n; i++ ) {
3863
3864					if ( i >= samples ) {
3865
3866						break;
3867
3868					}
3869
3870					float theta = dTheta * float( i );
3871					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3872					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3873
3874				}
3875
3876			}
3877		`,blending:ns,depthTest:!1,depthWrite:!1})}function Xv(){return new ia({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ff(),fragmentShader:`
3878
3879			precision mediump float;
3880			precision mediump int;
3881
3882			varying vec3 vOutputDirection;
3883
3884			uniform sampler2D envMap;
3885
3886			#include <common>
3887
3888			void main() {
3889
3890				vec3 outputDirection = normalize( vOutputDirection );
3891				vec2 uv = equirectUv( outputDirection );
3892
3893				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3894
3895			}
3896		`,blending:ns,depthTest:!1,depthWrite:!1})}function Wv(){return new ia({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ff(),fragmentShader:`
3897
3898			precision mediump float;
3899			precision mediump int;
3900
3901			uniform float flipEnvMap;
3902
3903			varying vec3 vOutputDirection;
3904
3905			uniform samplerCube envMap;
3906
3907			void main() {
3908
3909				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3910
3911			}
3912		`,blending:ns,depthTest:!1,depthWrite:!1})}function ff(){return`
3913
3914		precision mediump float;
3915		precision mediump int;
3916
3917		attribute float faceIndex;
3918
3919		varying vec3 vOutputDirection;
3920
3921		// RH coordinate system; PMREM face-indexing convention
3922		vec3 getDirection( vec2 uv, float face ) {
3923
3924			uv = 2.0 * uv - 1.0;
3925
3926			vec3 direction = vec3( uv, 1.0 );
3927
3928			if ( face == 0.0 ) {
3929
3930				direction = direction.zyx; // ( 1, v, u ) pos x
3931
3932			} else if ( face == 1.0 ) {
3933
3934				direction = direction.xzy;
3935				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3936
3937			} else if ( face == 2.0 ) {
3938
3939				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3940
3941			} else if ( face == 3.0 ) {
3942
3943				direction = direction.zyx;
3944				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3945
3946			} else if ( face == 4.0 ) {
3947
3948				direction = direction.xzy;
3949				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3950
3951			} else if ( face == 5.0 ) {
3952
3953				direction.z *= -1.0; // ( u, v, -1 ) neg z
3954
3955			}
3956
3957			return direction;
3958
3959		}
3960
3961		void main() {
3962
3963			vOutputDirection = getDirection( uv, faceIndex );
3964			gl_Position = vec4( position, 1.0 );
3965
3966		}
3967	`}class dy extends Sa{constructor(e=1,i={}
vendor: 25,813 bytes, lines 3967-4083
3967){super(e,e,i),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},l=[s,s,s,s,s,s];this.texture=new ry(l),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
3968
3969				varying vec3 vWorldDirection;
3970
3971				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
3972
3973					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
3974
3975				}
3976
3977				void main() {
3978
3979					vWorldDirection = transformDirection( position, modelMatrix );
3980
3981					#include <begin_vertex>
3982					#include <project_vertex>
3983
3984				}
3985			`,fragmentShader:`
3986
3987				uniform sampler2D tEquirect;
3988
3989				varying vec3 vWorldDirection;
3990
3991				#include <common>
3992
3993				void main() {
3994
3995					vec3 direction = normalize( vWorldDirection );
3996
3997					vec2 sampleUV = equirectUv( direction );
3998
3999					gl_FragColor = texture2D( tEquirect, sampleUV );
4000
4001				}
4002			`},l=new dc(5,5,5),c=new ia({name:"CubemapFromEquirect",uniforms:Jo(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:hi,blending:ns});c.uniforms.tEquirect.value=i;const d=new Ta(l,c),h=i.minFilter;return i.minFilter===Er&&(i.minFilter=Kn),new AM(1,10,this).update(e,d),i.minFilter=h,d.geometry.dispose(),d.material.dispose(),this}clear(e,i=!0,s=!0,l=!0){const c=e.getRenderTarget();for(let d=0;d<6;d++)e.setRenderTarget(this,d),e.clear(i,s,l);e.setRenderTarget(c)}}function S2(r){let e=new WeakMap,i=new WeakMap,s=null;function l(g,b=!1){return g==null?null:b?d(g):c(g)}function c(g){if(g&&g.isTexture){const b=g.mapping;if(b===yh||b===bh)if(e.has(g)){const A=e.get(g).texture;return h(A,g.mapping)}else{const A=g.image;if(A&&A.height>0){const D=new dy(A.height);return D.fromEquirectangularTexture(r,g),e.set(g,D),g.addEventListener("dispose",m),h(D.texture,g.mapping)}else return null}}return g}function d(g){if(g&&g.isTexture){const b=g.mapping,A=b===yh||b===bh,D=b===Ir||b===Ko;if(A||D){let E=i.get(g);const M=E!==void 0?E.texture.pmremVersion:0;if(g.isRenderTargetTexture&&g.pmremVersion!==M)return s===null&&(s=new Vv(r)),E=A?s.fromEquirectangular(g,E):s.fromCubemap(g,E),E.texture.pmremVersion=g.pmremVersion,i.set(g,E),E.texture;if(E!==void 0)return E.texture;{const z=g.image;return A&&z&&z.height>0||D&&z&&p(z)?(s===null&&(s=new Vv(r)),E=A?s.fromEquirectangular(g):s.fromCubemap(g),E.texture.pmremVersion=g.pmremVersion,i.set(g,E),g.addEventListener("dispose",_),E.texture):null}}}return g}function h(g,b){return b===yh?g.mapping=Ir:b===bh&&(g.mapping=Ko),g}function p(g){let b=0;const A=6;for(let D=0;D<A;D++)g[D]!==void 0&&b++;return b===A}function m(g){const b=g.target;b.removeEventListener("dispose",m);const A=e.get(b);A!==void 0&&(e.delete(b),A.dispose())}function _(g){const b=g.target;b.removeEventListener("dispose",_);const A=i.get(b);A!==void 0&&(i.delete(b),A.dispose())}function v(){e=new WeakMap,i=new WeakMap,s!==null&&(s.dispose(),s=null)}return{get:l,dispose:v}}function M2(r){const e={};function i(s){if(e[s]!==void 0)return e[s];const l=r.getExtension(s);return e[s]=l,l}return{has:function(s){return i(s)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(s){const l=i(s);return l===null&&Oo("WebGLRenderer: "+s+" extension not supported."),l}}}function E2(r,e,i,s){const l={},c=new WeakMap;function d(v){const g=v.target;g.index!==null&&e.remove(g.index);for(const A in g.attributes)e.remove(g.attributes[A]);g.removeEventListener("dispose",d),delete l[g.id];const b=c.get(g);b&&(e.remove(b),c.delete(g)),s.releaseStatesOfGeometry(g),g.isInstancedBufferGeometry===!0&&delete g._maxInstanceCount,i.memory.geometries--}function h(v,g){return l[g.id]===!0||(g.addEventListener("dispose",d),l[g.id]=!0,i.memory.geometries++),g}function p(v){const g=v.attributes;for(const b in g)e.update(g[b],r.ARRAY_BUFFER)}function m(v){const g=[],b=v.index,A=v.attributes.position;let D=0;if(A===void 0)return;if(b!==null){const z=b.array;D=b.version;for(let F=0,C=z.length;F<C;F+=3){const I=z[F+0],L=z[F+1],H=z[F+2];g.push(I,L,L,H,H,I)}}else{const z=A.array;D=A.version;for(let F=0,C=z.length/3-1;F<C;F+=3){const I=F+0,L=F+1,H=F+2;g.push(I,L,L,H,H,I)}}const E=new(A.count>=65535?iy:ny)(g,1);E.version=D;const M=c.get(v);M&&e.remove(M),c.set(v,E)}function _(v){const g=c.get(v);if(g){const b=v.index;b!==null&&g.version<b.version&&m(v)}else m(v);return c.get(v)}return{get:h,update:p,getWireframeAttribute:_}}function T2(r,e,i){let s;function l(v){s=v}let c,d;function h(v){c=v.type,d=v.bytesPerElement}function p(v,g){r.drawElements(s,g,c,v*d),i.update(g,s,1)}function m(v,g,b){b!==0&&(r.drawElementsInstanced(s,g,c,v*d,b),i.update(g,s,b))}function _(v,g,b){if(b===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,g,0,c,v,0,b);let D=0;for(let E=0;E<b;E++)D+=g[E];i.update(D,s,1)}this.setMode=l,this.setIndex=h,this.render=p,this.renderInstances=m,this.renderMultiDraw=_}function A2(r){const e={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function s(c,d,h){switch(i.calls++,d){case r.TRIANGLES:i.triangles+=h*(c/3);break;case r.LINES:i.lines+=h*(c/2);break;case r.LINE_STRIP:i.lines+=h*(c-1);break;case r.LINE_LOOP:i.lines+=h*c;break;case r.POINTS:i.points+=h*c;break;default:Bt("WebGLInfo: Unknown draw mode:",d);break}}function l(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:e,render:i,programs:null,autoReset:!0,reset:l,update:s}}function w2(r,e,i){const s=new WeakMap,l=new Sn;function c(d,h,p){const m=d.morphTargetInfluences,_=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,v=_!==void 0?_.length:0;let g=s.get(h);if(g===void 0||g.count!==v){let O=function(){H.dispose(),s.delete(h),h.removeEventListener("dispose",O)};g!==void 0&&g.texture.dispose();const b=h.morphAttributes.position!==void 0,A=h.morphAttributes.normal!==void 0,D=h.morphAttributes.color!==void 0,E=h.morphAttributes.position||[],M=h.morphAttributes.normal||[],z=h.morphAttributes.color||[];let F=0;b===!0&&(F=1),A===!0&&(F=2),D===!0&&(F=3);let C=h.attributes.position.count*F,I=1;C>e.maxTextureSize&&(I=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const L=new Float32Array(C*I*4*v),H=new $_(L,C,I,v);H.type=_a,H.needsUpdate=!0;const w=F*4;for(let V=0;V<v;V++){const k=E[V],$=M[V],me=z[V],fe=C*I*4*V;for(let te=0;te<k.count;te++){const B=te*w;b===!0&&(l.fromBufferAttribute(k,te),L[fe+B+0]=l.x,L[fe+B+1]=l.y,L[fe+B+2]=l.z,L[fe+B+3]=0),A===!0&&(l.fromBufferAttribute($,te),L[fe+B+4]=l.x,L[fe+B+5]=l.y,L[fe+B+6]=l.z,L[fe+B+7]=0),D===!0&&(l.fromBufferAttribute(me,te),L[fe+B+8]=l.x,L[fe+B+9]=l.y,L[fe+B+10]=l.z,L[fe+B+11]=me.itemSize===4?l.w:1)}}g={count:v,texture:H,size:new Xt(C,I)},s.set(h,g),h.addEventListener("dispose",O)}if(d.isInstancedMesh===!0&&d.morphTexture!==null)p.getUniforms().setValue(r,"morphTexture",d.morphTexture,i);else{let b=0;for(let D=0;D<m.length;D++)b+=m[D];const A=h.morphTargetsRelative?1:1-b;p.getUniforms().setValue(r,"morphTargetBaseInfluence",A),p.getUniforms().setValue(r,"morphTargetInfluences",m)}p.getUniforms().setValue(r,"morphTargetsTexture",g.texture,i),p.getUniforms().setValue(r,"morphTargetsTextureSize",g.size)}return{update:c}}function C2(r,e,i,s,l){let c=new WeakMap;function d(m){const _=l.render.frame,v=m.geometry,g=e.get(m,v);if(c.get(g)!==_&&(e.update(g),c.set(g,_)),m.isInstancedMesh&&(m.hasEventListener("dispose",p)===!1&&m.addEventListener("dispose",p),c.get(m)!==_&&(i.update(m.instanceMatrix,r.ARRAY_BUFFER),m.instanceColor!==null&&i.update(m.instanceColor,r.ARRAY_BUFFER),c.set(m,_))),m.isSkinnedMesh){const b=m.skeleton;c.get(b)!==_&&(b.update(),c.set(b,_))}return g}function h(){c=new WeakMap}function p(m){const _=m.target;_.removeEventListener("dispose",p),s.releaseStatesOfObject(_),i.remove(_.instanceMatrix),_.instanceColor!==null&&i.remove(_.instanceColor)}return{update:d,dispose:h}}const R2={[F_]:"LINEAR_TONE_MAPPING",[z_]:"REINHARD_TONE_MAPPING",[B_]:"CINEON_TONE_MAPPING",[H_]:"ACES_FILMIC_TONE_MAPPING",[k_]:"AGX_TONE_MAPPING",[V_]:"NEUTRAL_TONE_MAPPING",[G_]:"CUSTOM_TONE_MAPPING"};function N2(r,e,i,s,l,c){const d=new Sa(e,i,{type:r,depthBuffer:l,stencilBuffer:c,samples:s?4:0,depthTexture:l?new Zo(e,i):void 0}),h=new Sa(e,i,{type:ss,depthBuffer:!1,stencilBuffer:!1}),p=new os;p.setAttribute("position",new as([-1,3,0,-1,-1,0,3,-1,0],3)),p.setAttribute("uv",new as([0,2,0,0,2,0],2));const m=new MM({uniforms:{tDiffuse:{value:null}},vertexShader:`
4003			precision highp float;
4004
4005			uniform mat4 modelViewMatrix;
4006			uniform mat4 projectionMatrix;
4007
4008			attribute vec3 position;
4009			attribute vec2 uv;
4010
4011			varying vec2 vUv;
4012
4013			void main() {
4014				vUv = uv;
4015				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4016			}`,fragmentShader:`
4017			precision highp float;
4018
4019			uniform sampler2D tDiffuse;
4020
4021			varying vec2 vUv;
4022
4023			#include <tonemapping_pars_fragment>
4024			#include <colorspace_pars_fragment>
4025
4026			void main() {
4027				gl_FragColor = texture2D( tDiffuse, vUv );
4028
4029				#ifdef LINEAR_TONE_MAPPING
4030					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
4031				#elif defined( REINHARD_TONE_MAPPING )
4032					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
4033				#elif defined( CINEON_TONE_MAPPING )
4034					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
4035				#elif defined( ACES_FILMIC_TONE_MAPPING )
4036					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
4037				#elif defined( AGX_TONE_MAPPING )
4038					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
4039				#elif defined( NEUTRAL_TONE_MAPPING )
4040					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
4041				#elif defined( CUSTOM_TONE_MAPPING )
4042					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
4043				#endif
4044
4045				#ifdef SRGB_TRANSFER
4046					gl_FragColor = sRGBTransferOETF( gl_FragColor );
4047				#endif
4048			}`,depthTest:!1,depthWrite:!1}),_=new Ta(p,m),v=new xm(-1,1,1,-1,0,1);let g=null,b=null,A=!1,D,E=null,M=[],z=!1;this.setSize=function(F,C){d.setSize(F,C),h.setSize(F,C);for(let I=0;I<M.length;I++){const L=M[I];L.setSize&&L.setSize(F,C)}},this.setEffects=function(F){M=F,z=M.length>0&&M[0].isRenderPass===!0;const C=d.width,I=d.height;for(let L=0;L<M.length;L++){const H=M[L];H.setSize&&H.setSize(C,I)}},this.begin=function(F,C){if(A||F.toneMapping===ba&&M.length===0)return!1;if(E=C,C!==null){const I=C.width,L=C.height;(d.width!==I||d.height!==L)&&this.setSize(I,L)}return z===!1&&F.setRenderTarget(d),D=F.toneMapping,F.toneMapping=ba,!0},this.hasRenderPass=function(){return z},this.end=function(F,C){F.toneMapping=D,A=!0;let I=d,L=h;for(let H=0;H<M.length;H++){const w=M[H];if(w.enabled!==!1&&(w.render(F,L,I,C),w.needsSwap!==!1)){const O=I;I=L,L=O}}if(g!==F.outputColorSpace||b!==F.toneMapping){g=F.outputColorSpace,b=F.toneMapping,m.defines={},Pt.getTransfer(g)===$t&&(m.defines.SRGB_TRANSFER="");const H=R2[b];H&&(m.defines[H]=""),m.needsUpdate=!0}m.uniforms.tDiffuse.value=I.texture,F.setRenderTarget(E),F.render(_,v),E=null,A=!1},this.isCompositing=function(){return A},this.dispose=function(){d.depthTexture&&d.depthTexture.dispose(),d.dispose(),h.dispose(),p.dispose(),m.dispose()}}const hy=new ii,Gp=new Zo(1,1),py=new $_,my=new $1,gy=new ry,qv=[],Yv=[],Qv=new Float32Array(16),Kv=new Float32Array(9),Zv=new Float32Array(4);function el(r,e,i){const s=r[0];if(s<=0||s>0)return r;const l=e*i;let c=qv[l];if(c===void 0&&(c=new Float32Array(l),qv[l]=c),e!==0){s.toArray(c,0);for(let d=1,h=0;d!==e;++d)h+=i,r[d].toArray(c,h)}return c}function Pn(r,e){if(r.length!==e.length)return!1;for(let i=0,s=r.length;i<s;i++)if(r[i]!==e[i])return!1;return!0}function In(r,e){for(let i=0,s=e.length;i<s;i++)r[i]=e[i]}function df(r,e){let i=Yv[e];i===void 0&&(i=new Int32Array(e),Yv[e]=i);for(let s=0;s!==e;++s)i[s]=r.allocateTextureUnit();return i}function D2(r,e){const i=this.cache;i[0]!==e&&(r.uniform1f(this.addr,e),i[0]=e)}function U2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Pn(i,e))return;r.uniform2fv(this.addr,e),In(i,e)}}function L2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(e.r!==void 0)(i[0]!==e.r||i[1]!==e.g||i[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(Pn(i,e))return;r.uniform3fv(this.addr,e),In(i,e)}}function O2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z||i[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Pn(i,e))return;r.uniform4fv(this.addr,e),In(i,e)}}function P2(r,e){const i=this.cache,s=e.elements;if(s===void 0){if(Pn(i,e))return;r.uniformMatrix2fv(this.addr,!1,e),In(i,e)}else{if(Pn(i,s))return;Zv.set(s),r.uniformMatrix2fv(this.addr,!1,Zv),In(i,s)}}function I2(r,e){const i=this.cache,s=e.elements;if(s===void 0){if(Pn(i,e))return;r.uniformMatrix3fv(this.addr,!1,e),In(i,e)}else{if(Pn(i,s))return;Kv.set(s),r.uniformMatrix3fv(this.addr,!1,Kv),In(i,s)}}function F2(r,e){const i=this.cache,s=e.elements;if(s===void 0){if(Pn(i,e))return;r.uniformMatrix4fv(this.addr,!1,e),In(i,e)}else{if(Pn(i,s))return;Qv.set(s),r.uniformMatrix4fv(this.addr,!1,Qv),In(i,s)}}function z2(r,e){const i=this.cache;i[0]!==e&&(r.uniform1i(this.addr,e),i[0]=e)}function B2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Pn(i,e))return;r.uniform2iv(this.addr,e),In(i,e)}}function H2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(Pn(i,e))return;r.uniform3iv(this.addr,e),In(i,e)}}function G2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z||i[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Pn(i,e))return;r.uniform4iv(this.addr,e),In(i,e)}}function k2(r,e){const i=this.cache;i[0]!==e&&(r.uniform1ui(this.addr,e),i[0]=e)}function V2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Pn(i,e))return;r.uniform2uiv(this.addr,e),In(i,e)}}function j2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(Pn(i,e))return;r.uniform3uiv(this.addr,e),In(i,e)}}function X2(r,e){const i=this.cache;if(e.x!==void 0)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z||i[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Pn(i,e))return;r.uniform4uiv(this.addr,e),In(i,e)}}function W2(r,e,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l);let c;this.type===r.SAMPLER_2D_SHADOW?(Gp.compareFunction=i.isReversedDepthBuffer()?pm:hm,c=Gp):c=hy,i.setTexture2D(e||c,l)}function q2(r,e,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture3D(e||my,l)}function Y2(r,e,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTextureCube(e||gy,l)}function Q2(r,e,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture2DArray(e||py,l)}function K2(r){switch(r){case 5126:return D2;case 35664:return U2;case 35665:return L2;case 35666:return O2;case 35674:return P2;case 35675:return I2;case 35676:return F2;case 5124:case 35670:return z2;case 35667:case 35671:return B2;case 35668:case 35672:return H2;case 35669:case 35673:return G2;case 5125:return k2;case 36294:return V2;case 36295:return j2;case 36296:return X2;case 35678:case 36198:case 36298:case 36306:case 35682:return W2;case 35679:case 36299:case 36307:return q2;case 35680:case 36300:case 36308:case 36293:return Y2;case 36289:case 36303:case 36311:case 36292:return Q2}}function Z2(r,e){r.uniform1fv(this.addr,e)}function J2(r,e){const i=el(e,this.size,2);r.uniform2fv(this.addr,i)}function $2(r,e){const i=el(e,this.size,3);r.uniform3fv(this.addr,i)}function eA(r,e){const i=el(e,this.size,4);r.uniform4fv(this.addr,i)}function tA(r,e){const i=el(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,i)}function nA(r,e){const i=el(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,i)}function iA(r,e){const i=el(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,i)}function aA(r,e){r.uniform1iv(this.addr,e)}function sA(r,e){r.uniform2iv(this.addr,e)}function rA(r,e){r.uniform3iv(this.addr,e)}function oA(r,e){r.uniform4iv(this.addr,e)}function lA(r,e){r.uniform1uiv(this.addr,e)}function cA(r,e){r.uniform2uiv(this.addr,e)}function uA(r,e){r.uniform3uiv(this.addr,e)}function fA(r,e){r.uniform4uiv(this.addr,e)}function dA(r,e,i){const s=this.cache,l=e.length,c=df(i,l);Pn(s,c)||(r.uniform1iv(this.addr,c),In(s,c));let d;this.type===r.SAMPLER_2D_SHADOW?d=Gp:d=hy;for(let h=0;h!==l;++h)i.setTexture2D(e[h]||d,c[h])}function hA(r,e,i){const s=this.cache,l=e.length,c=df(i,l);Pn(s,c)||(r.uniform1iv(this.addr,c),In(s,c));for(let d=0;d!==l;++d)i.setTexture3D(e[d]||my,c[d])}function pA(r,e,i){const s=this.cache,l=e.length,c=df(i,l);Pn(s,c)||(r.uniform1iv(this.addr,c),In(s,c));for(let d=0;d!==l;++d)i.setTextureCube(e[d]||gy,c[d])}function mA(r,e,i){const s=this.cache,l=e.length,c=df(i,l);Pn(s,c)||(r.uniform1iv(this.addr,c),In(s,c));for(let d=0;d!==l;++d)i.setTexture2DArray(e[d]||py,c[d])}function gA(r){switch(r){case 5126:return Z2;case 35664:return J2;case 35665:return $2;case 35666:return eA;case 35674:return tA;case 35675:return nA;case 35676:return iA;case 5124:case 35670:return aA;case 35667:case 35671:return sA;case 35668:case 35672:return rA;case 35669:case 35673:return oA;case 5125:return lA;case 36294:return cA;case 36295:return uA;case 36296:return fA;case 35678:case 36198:case 36298:case 36306:case 35682:return dA;case 35679:case 36299:case 36307:return hA;case 35680:case 36300:case 36308:case 36293:return pA;case 36289:case 36303:case 36311:case 36292:return mA}}class xA{constructor(e,i,s){this.id=e,this.addr=s,this.cache=[],this.type=i.type,this.setValue=K2(i.type)}}class vA{constructor(e,i,s){this.id=e,this.addr=s,this.cache=[],this.type=i.type,this.size=i.size,this.setValue=gA(i.type)}}class _A{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,i,s){const l=this.seq;for(let c=0,d=l.length;c!==d;++c){const h=l[c];h.setValue(e,i[h.id],s)}}}const Zh=/(\w+)(\])?(\[|\.)?/g;function Jv(r,e){r.seq.push(e),r.map[e.id]=e}function yA(r,e,i){const s=r.name,l=s.length;for(Zh.lastIndex=0;;){const c=Zh.exec(s),d=Zh.lastIndex;let h=c[1];const p=c[2]==="]",m=c[3];if(p&&(h=h|0),m===void 0||m==="["&&d+2===l){Jv(i,m===void 0?new xA(h,r,e):new vA(h,r,e));break}else{let v=i.map[h];v===void 0&&(v=new _A(h),Jv(i,v)),i=v}}}class $u{constructor(e,i){this.seq=[],this.map={};const s=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let d=0;d<s;++d){const h=e.getActiveUniform(i,d),p=e.getUniformLocation(i,h.name);yA(h,p,this)}const l=[],c=[];for(const d of this.seq)d.type===e.SAMPLER_2D_SHADOW||d.type===e.SAMPLER_CUBE_SHADOW||d.type===e.SAMPLER_2D_ARRAY_SHADOW?l.push(d):c.push(d);l.length>0&&(this.seq=l.concat(c))}setValue(e,i,s,l){const c=this.map[i];c!==void 0&&c.setValue(e,s,l)}setOptional(e,i,s){const l=i[s];l!==void 0&&this.setValue(e,s,l)}static upload(e,i,s,l){for(let c=0,d=i.length;c!==d;++c){const h=i[c],p=s[h.id];p.needsUpdate!==!1&&h.setValue(e,p.value,l)}}static seqWithValue(e,i){const s=[];for(let l=0,c=e.length;l!==c;++l){const d=e[l];d.id in i&&s.push(d)}return s}}function $v(r,e,i){const s=r.createShader(e);return r.shaderSource(s,i),r.compileShader(s),s}const bA=37297;let SA=0;function MA(r,e){const i=r.split(`
4049`),s=[],l=Math.max(e-6,0),c=Math.min(e+6,i.length);for(let d=l;d<c;d++){const h=d+1;s.push(`${h===e?">":" "} ${h}: ${i[d]}`)}return s.join(`
4050`)}const e_=new xt;function EA(r){Pt._getMatrix(e_,Pt.workingColorSpace,r);const e=`mat3( ${e_.elements.map(i=>i.toFixed(4))} )`;switch(Pt.getTransfer(r)){case af:return[e,"LinearTransferOETF"];case $t:return[e,"sRGBTransferOETF"];default:return ut("WebGLProgram: Unsupported color space: ",r),[e,"LinearTransferOETF"]}}function t_(r,e,i){const s=r.getShaderParameter(e,r.COMPILE_STATUS),c=(r.getShaderInfoLog(e)||"").trim();if(s&&c==="")return"";const d=/ERROR: 0:(\d+)/.exec(c);if(d){const h=parseInt(d[1]);return i.toUpperCase()+`
4051
4052`+c+`
4053
4054`+MA(r.getShaderSource(e),h)}else return c}function TA(r,e){const i=EA(e);return[`vec4 ${r}( vec4 value ) {`,`	return ${i[1]}( vec4( value.rgb * ${i[0]}, value.a ) );`,"}"].join(`
4055`)}const AA={[F_]:"Linear",[z_]:"Reinhard",[B_]:"Cineon",[H_]:"ACESFilmic",[k_]:"AgX",[V_]:"Neutral",[G_]:"Custom"};function wA(r,e){const i=AA[e];return i===void 0?(ut("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}const Wu=new le;function CA(){Pt.getLuminanceCoefficients(Wu);const r=Wu.x.toFixed(4),e=Wu.y.toFixed(4),i=Wu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${r}, ${e}, ${i} );`,"	return dot( weights, rgb );","}"].join(`
4056`)}function RA(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Jl).join(`
4057`)}function NA(r){const e=[];for(const i in r){const s=r[i];s!==!1&&e.push("#define "+i+" "+s)}return e.join(`
4058`)}function DA(r,e){const i={},s=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let l=0;l<s;l++){const c=r.getActiveAttrib(e,l),d=c.name;let h=1;c.type===r.FLOAT_MAT2&&(h=2),c.type===r.FLOAT_MAT3&&(h=3),c.type===r.FLOAT_MAT4&&(h=4),i[d]={type:c.type,location:r.getAttribLocation(e,d),locationSize:h}}return i}function Jl(r){return r!==""}function n_(r,e){const i=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.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,i).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 i_(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const UA=/^[ \t]*#include +<([\w\d./]+)>/gm;function kp(r){return r.replace(UA,OA)}const LA=new Map;function OA(r,e){let i=Mt[e];if(i===void 0){const s=LA.get(e);if(s!==void 0)i=Mt[s],ut('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return kp(i)}const PA=/#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 a_(r){return r.replace(PA,IA)}function IA(r,e,i,s){let l="";for(let c=parseInt(e);c<parseInt(i);c++)l+=s.replace(/\[\s*i\s*\]/g,"[ "+c+" ]").replace(/UNROLLED_LOOP_INDEX/g,c);return l}function s_(r){let e=`precision ${r.precision} float;
4059	precision ${r.precision} int;
4060	precision ${r.precision} sampler2D;
4061	precision ${r.precision} samplerCube;
4062	precision ${r.precision} sampler3D;
4063	precision ${r.precision} sampler2DArray;
4064	precision ${r.precision} sampler2DShadow;
4065	precision ${r.precision} samplerCubeShadow;
4066	precision ${r.precision} sampler2DArrayShadow;
4067	precision ${r.precision} isampler2D;
4068	precision ${r.precision} isampler3D;
4069	precision ${r.precision} isamplerCube;
4070	precision ${r.precision} isampler2DArray;
4071	precision ${r.precision} usampler2D;
4072	precision ${r.precision} usampler3D;
4073	precision ${r.precision} usamplerCube;
4074	precision ${r.precision} usampler2DArray;
4075	`;return r.precision==="highp"?e+=`
4076#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
4077#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
4078#define LOW_PRECISION`),e}const FA={[Yu]:"SHADOWMAP_TYPE_PCF",[Zl]:"SHADOWMAP_TYPE_VSM"};function zA(r){return FA[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const BA={[Ir]:"ENVMAP_TYPE_CUBE",[Ko]:"ENVMAP_TYPE_CUBE",[cf]:"ENVMAP_TYPE_CUBE_UV"};function HA(r){return r.envMap===!1?"ENVMAP_TYPE_CUBE":BA[r.envMapMode]||"ENVMAP_TYPE_CUBE"}const GA={[Ko]:"ENVMAP_MODE_REFRACTION"};function kA(r){return r.envMap===!1?"ENVMAP_MODE_REFLECTION":GA[r.envMapMode]||"ENVMAP_MODE_REFLECTION"}const VA={[I_]:"ENVMAP_BLENDING_MULTIPLY",[U1]:"ENVMAP_BLENDING_MIX",[L1]:"ENVMAP_BLENDING_ADD"};function jA(r){return r.envMap===!1?"ENVMAP_BLENDING_NONE":VA[r.combine]||"ENVMAP_BLENDING_NONE"}function XA(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const i=Math.log2(e)-2,s=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:s,maxMip:i}}function WA(r,e,i,s){const l=r.getContext(),c=i.defines;let d=i.vertexShader,h=i.fragmentShader;const p=zA(i),m=HA(i),_=kA(i),v=jA(i),g=XA(i),b=RA(i),A=NA(c),D=l.createProgram();let E,M,z=i.glslVersion?"#version "+i.glslVersion+`
4079`:"";i.isRawShaderMaterial?(E=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,A].filter(Jl).join(`
4080`),E.length>0&&(E+=`
4081`),M=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,A].filter(Jl).join(`
4082`),M.length>0&&(M+=`
4083`)):(E=[s_(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,A,i.extensionCl
vendor: 9,832 bytes, lines 4083-4092
4083ipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.batchingColor?"#define USE_BATCHING_COLOR":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+_:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexNormals?"#define HAS_NORMAL":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+p:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
4084`].filter(Jl).join(`
4085`),M=[s_(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,A,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+m:"",i.envMap?"#define "+_:"",i.envMap?"#define "+v:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.dispersion?"#define USE_DISPERSION":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas||i.batchingColor?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+p:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==ba?"#define TONE_MAPPING":"",i.toneMapping!==ba?Mt.tonemapping_pars_fragment:"",i.toneMapping!==ba?wA("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",Mt.colorspace_pars_fragment,TA("linearToOutputTexel",i.outputColorSpace),CA(),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
4086`].filter(Jl).join(`
4087`)),d=kp(d),d=n_(d,i),d=i_(d,i),h=kp(h),h=n_(h,i),h=i_(h,i),d=a_(d),h=a_(h),i.isRawShaderMaterial!==!0&&(z=`#version 300 es
4088`,E=[b,"#define attribute in","#define varying out","#define texture2D texture"].join(`
4089`)+`
4090`+E,M=["#define varying in",i.glslVersion===_v?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===_v?"":"#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(`
4091`)+`
4092`+M);const F=z+E+d,C=z+M+h,I=$v(l,l.VERTEX_SHADER,F),L=$v(l,l.FRAGMENT_SHADER,C);l.attachShader(D,I),l.attachShader(D,L),i.index0AttributeName!==void 0?l.bindAttribLocation(D,0,i.index0AttributeName):i.hasPositionAttribute===!0&&l.bindAttribLocation(D,0,"position"),l.linkProgram(D);
vendor: 4,222 bytes, lines 4092-4099
4092function H(k){if(r.debug.checkShaderErrors){const $=l.getProgramInfoLog(D)||"",me=l.getShaderInfoLog(I)||"",fe=l.getShaderInfoLog(L)||"",te=$.trim(),B=me.trim(),j=fe.trim();let Y=!0,ce=!0;if(l.getProgramParameter(D,l.LINK_STATUS)===!1)if(Y=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(l,D,I,L);else{const Se=t_(l,I,"vertex"),Ce=t_(l,L,"fragment");Bt("WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(D,l.VALIDATE_STATUS)+`
4093
4094Material Name: `+k.name+`
4095Material Type: `+k.type+`
4096
4097Program Info Log: `+te+`
4098`+Se+`
4099`+Ce)}else te!==""?ut("WebGLProgram: Program Info Log:",te):(B===""||j==="")&&(ce=!1);ce&&(k.diagnostics={runnable:Y,programLog:te,vertexShader:{log:B,prefix:E},fragmentShader:{log:j,prefix:M}})}l.deleteShader(I),l.deleteShader(L),w=new $u(l,D),O=DA(l,D)}let w;this.getUniforms=function(){return w===void 0&&H(this),w};let O;this.getAttributes=function(){return O===void 0&&H(this),O};let V=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return V===!1&&(V=l.getProgramParameter(D,bA)),V},this.destroy=function(){s.releaseStatesOfProgram(this),l.deleteProgram(D),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=SA++,this.cacheKey=e,this.usedTimes=1,this.program=D,this.vertexShader=I,this.fragmentShader=L,this}let qA=0;class YA{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,i,s){const l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(s)===!1&&(l.add(s),s.usedTimes++),this}remove(e){const i=this.materialCache.get(e);for(const s of i)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const i=this.materialCache;let s=i.get(e);return s===void 0&&(s=new Set,i.set(e,s)),s}_getShaderStage(e){const i=this.shaderCache;let s=i.get(e);return s===void 0&&(s=new QA(e),i.set(e,s)),s}}class QA{constructor(e){this.id=qA++,this.code=e,this.usedTimes=0}}function KA(r){return r===Fr||r===ef||r===tf}function ZA(r,e,i,s,l,c){const d=new ey,h=new YA,p=new Set,m=[],_=new Map,v=s.logarithmicDepthBuffer;let g=s.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 A(w){return p.add(w),w===0?"uv":`uv${w}`}function D(w,O,V,k,$,me){const fe=k.fog,te=$.geometry,B=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?k.environment:null,j=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap,Y=e.get(w.envMap||B,j),ce=Y&&Y.mapping===cf?Y.image.height:null,Se=b[w.type];w.precision!==null&&(g=s.getMaxPrecision(w.precision),g!==w.precision&&ut("WebGLProgram.getParameters:",w.precision,"not supported, using",g,"instead."));const Ce=te.morphAttributes.position||te.morphAttributes.normal||te.morphAttributes.color,Ae=Ce!==void 0?Ce.length:0;let je=0;te.morphAttributes.position!==void 0&&(je=1),te.morphAttributes.normal!==void 0&&(je=2),te.morphAttributes.color!==void 0&&(je=3);let dt,ft,Z,we;if(Se){const Ve=va[Se];dt=Ve.vertexShader,ft=Ve.fragmentShader}else{dt=w.vertexShader,ft=w.fragmentShader;const Ve=h.getVertexShaderStage(w),cn=h.getFragmentShaderStage(w);h.update(w,Ve,cn),Z=Ve.id,we=cn.id}const Te=r.getRenderTarget(),ke=r.state.buffers.depth.getReversed(),rt=$.isInstancedMesh===!0,Ze=$.isBatchedMesh===!0,en=!!w.map,yt=!!w.matcap,Et=!!Y,vt=!!w.aoMap,ht=!!w.lightMap,sn=!!w.bumpMap&&w.wireframe===!1,pn=!!w.normalMap,Wt=!!w.displacementMap,rn=!!w.emissiveMap,qt=!!w.metalnessMap,un=!!w.roughnessMap,Q=w.anisotropy>0,Ht=w.clearcoat>0,zt=w.dispersion>0,P=w.iridescence>0,T=w.sheen>0,ee=w.transmission>
vendor: 4,852 bytes, line 4099
40990,se=Q&&!!w.anisotropyMap,he=Ht&&!!w.clearcoatMap,Re=Ht&&!!w.clearcoatNormalMap,Oe=Ht&&!!w.clearcoatRoughnessMap,de=P&&!!w.iridescenceMap,pe=P&&!!w.iridescenceThicknessMap,De=T&&!!w.sheenColorMap,Ge=T&&!!w.sheenRoughnessMap,Ie=!!w.specularMap,Pe=!!w.specularColorMap,Je=!!w.specularIntensityMap,$e=ee&&!!w.transmissionMap,ot=ee&&!!w.thicknessMap,q=!!w.gradientMap,Ne=!!w.alphaMap,xe=w.alphaTest>0,Ue=!!w.alphaHash,Fe=!!w.extensions;let be=ba;w.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(be=r.toneMapping);const qe={shaderID:Se,shaderType:w.type,shaderName:w.name,vertexShader:dt,fragmentShader:ft,defines:w.defines,customVertexShaderID:Z,customFragmentShaderID:we,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:g,batching:Ze,batchingColor:Ze&&$._colorsTexture!==null,instancing:rt,instancingColor:rt&&$.instanceColor!==null,instancingMorph:rt&&$.morphTexture!==null,outputColorSpace:Te===null?r.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:Pt.workingColorSpace,alphaToCoverage:!!w.alphaToCoverage,map:en,matcap:yt,envMap:Et,envMapMode:Et&&Y.mapping,envMapCubeUVHeight:ce,aoMap:vt,lightMap:ht,bumpMap:sn,normalMap:pn,displacementMap:Wt,emissiveMap:rn,normalMapObjectSpace:pn&&w.normalMapType===I1,normalMapTangentSpace:pn&&w.normalMapType===gv,packedNormalMap:pn&&w.normalMapType===gv&&KA(w.normalMap.format),metalnessMap:qt,roughnessMap:un,anisotropy:Q,anisotropyMap:se,clearcoat:Ht,clearcoatMap:he,clearcoatNormalMap:Re,clearcoatRoughnessMap:Oe,dispersion:zt,iridescence:P,iridescenceMap:de,iridescenceThicknessMap:pe,sheen:T,sheenColorMap:De,sheenRoughnessMap:Ge,specularMap:Ie,specularColorMap:Pe,specularIntensityMap:Je,transmission:ee,transmissionMap:$e,thicknessMap:ot,gradientMap:q,opaque:w.transparent===!1&&w.blending===Lo&&w.alphaToCoverage===!1,alphaMap:Ne,alphaTest:xe,alphaHash:Ue,combine:w.combine,mapUv:en&&A(w.map.channel),aoMapUv:vt&&A(w.aoMap.channel),lightMapUv:ht&&A(w.lightMap.channel),bumpMapUv:sn&&A(w.bumpMap.channel),normalMapUv:pn&&A(w.normalMap.channel),displacementMapUv:Wt&&A(w.displacementMap.channel),emissiveMapUv:rn&&A(w.emissiveMap.channel),metalnessMapUv:qt&&A(w.metalnessMap.channel),roughnessMapUv:un&&A(w.roughnessMap.channel),anisotropyMapUv:se&&A(w.anisotropyMap.channel),clearcoatMapUv:he&&A(w.clearcoatMap.channel),clearcoatNormalMapUv:Re&&A(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Oe&&A(w.clearcoatRoughnessMap.channel),iridescenceMapUv:de&&A(w.iridescenceMap.channel),iridescenceThicknessMapUv:pe&&A(w.iridescenceThicknessMap.channel),sheenColorMapUv:De&&A(w.sheenColorMap.channel),sheenRoughnessMapUv:Ge&&A(w.sheenRoughnessMap.channel),specularMapUv:Ie&&A(w.specularMap.channel),specularColorMapUv:Pe&&A(w.specularColorMap.channel),specularIntensityMapUv:Je&&A(w.specularIntensityMap.channel),transmissionMapUv:$e&&A(w.transmissionMap.channel),thicknessMapUv:ot&&A(w.thicknessMap.channel),alphaMapUv:Ne&&A(w.alphaMap.channel),vertexTangents:!!te.attributes.tangent&&(pn||Q),vertexNormals:!!te.attributes.normal,vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!te.attributes.color&&te.attributes.color.itemSize===4,pointsUvs:$.isPoints===!0&&!!te.attributes.uv&&(en||Ne),fog:!!fe,useFog:w.fog===!0,fogExp2:!!fe&&fe.isFogExp2,flatShading:w.wireframe===!1&&(w.flatShading===!0||te.attributes.normal===void 0&&pn===!1&&(w.isMeshLambertMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isMeshPhysicalMaterial)),sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:v,reversedDepthBuffer:ke,skinning:$.isSkinnedMesh===!0,hasPositionAttribute:te.attributes.position!==void 0,morphTargets:te.morphAttributes.position!==void 0,morphNormals:te.morphAttributes.normal!==void 0,morphColors:te.morphAttributes.color!==void 0,morphTargetsCount:Ae,morphTextureStride:je,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numSpotLightMaps:O.spotLightMap.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numSpotLightShadowsWithMaps:O.numSpotLightShadowsWithMaps,numLightProbes:O.numLightProbes,numLightProbeGrids:me.length,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:w.dithering,shadowMapEnabled:r.shadowMap.enabled&&V.length>0,shadowMapType:r.shadowMap.type,toneMapping:be,decodeVideoTexture:en&&w.map.isVideoTexture===!0&&Pt.getTransfer(w.map.colorSpace)===$t,decodeVideoTextureEmissive:rn&&w.emissiveMap.isVideoTexture===!0&&Pt.getTransfer(w.emissiveMap.colorSpace)===$t,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===es,flipSided:w.side===hi,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionCl
vendor: 14,453 bytes, lines 4099-4126
4099ipCullDistance:Fe&&w.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Fe&&w.extensions.multiDraw===!0||Ze)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return qe.vertexUv1s=p.has(1),qe.vertexUv2s=p.has(2),qe.vertexUv3s=p.has(3),p.clear(),qe}function E(w){const O=[];if(w.shaderID?O.push(w.shaderID):(O.push(w.customVertexShaderID),O.push(w.customFragmentShaderID)),w.defines!==void 0)for(const V in w.defines)O.push(V),O.push(w.defines[V]);return w.isRawShaderMaterial===!1&&(M(O,w),z(O,w),O.push(r.outputColorSpace)),O.push(w.customProgramCacheKey),O.join()}function M(w,O){w.push(O.precision),w.push(O.outputColorSpace),w.push(O.envMapMode),w.push(O.envMapCubeUVHeight),w.push(O.mapUv),w.push(O.alphaMapUv),w.push(O.lightMapUv),w.push(O.aoMapUv),w.push(O.bumpMapUv),w.push(O.normalMapUv),w.push(O.displacementMapUv),w.push(O.emissiveMapUv),w.push(O.metalnessMapUv),w.push(O.roughnessMapUv),w.push(O.anisotropyMapUv),w.push(O.clearcoatMapUv),w.push(O.clearcoatNormalMapUv),w.push(O.clearcoatRoughnessMapUv),w.push(O.iridescenceMapUv),w.push(O.iridescenceThicknessMapUv),w.push(O.sheenColorMapUv),w.push(O.sheenRoughnessMapUv),w.push(O.specularMapUv),w.push(O.specularColorMapUv),w.push(O.specularIntensityMapUv),w.push(O.transmissionMapUv),w.push(O.thicknessMapUv),w.push(O.combine),w.push(O.fogExp2),w.push(O.sizeAttenuation),w.push(O.morphTargetsCount),w.push(O.morphAttributeCount),w.push(O.numDirLights),w.push(O.numPointLights),w.push(O.numSpotLights),w.push(O.numSpotLightMaps),w.push(O.numHemiLights),w.push(O.numRectAreaLights),w.push(O.numDirLightShadows),w.push(O.numPointLightShadows),w.push(O.numSpotLightShadows),w.push(O.numSpotLightShadowsWithMaps),w.push(O.numLightProbes),w.push(O.shadowMapType),w.push(O.toneMapping),w.push(O.numClippingPlanes),w.push(O.numClipIntersection),w.push(O.depthPacking)}function z(w,O){d.disableAll(),O.instancing&&d.enable(0),O.instancingColor&&d.enable(1),O.instancingMorph&&d.enable(2),O.matcap&&d.enable(3),O.envMap&&d.enable(4),O.normalMapObjectSpace&&d.enable(5),O.normalMapTangentSpace&&d.enable(6),O.clearcoat&&d.enable(7),O.iridescence&&d.enable(8),O.alphaTest&&d.enable(9),O.vertexColors&&d.enable(10),O.vertexAlphas&&d.enable(11),O.vertexUv1s&&d.enable(12),O.vertexUv2s&&d.enable(13),O.vertexUv3s&&d.enable(14),O.vertexTangents&&d.enable(15),O.anisotropy&&d.enable(16),O.alphaHash&&d.enable(17),O.batching&&d.enable(18),O.dispersion&&d.enable(19),O.batchingColor&&d.enable(20),O.gradientMap&&d.enable(21),O.packedNormalMap&&d.enable(22),O.vertexNormals&&d.enable(23),w.push(d.mask),d.disableAll(),O.fog&&d.enable(0),O.useFog&&d.enable(1),O.flatShading&&d.enable(2),O.logarithmicDepthBuffer&&d.enable(3),O.reversedDepthBuffer&&d.enable(4),O.skinning&&d.enable(5),O.morphTargets&&d.enable(6),O.morphNormals&&d.enable(7),O.morphColors&&d.enable(8),O.premultipliedAlpha&&d.enable(9),O.shadowMapEnabled&&d.enable(10),O.doubleSided&&d.enable(11),O.flipSided&&d.enable(12),O.useDepthPacking&&d.enable(13),O.dithering&&d.enable(14),O.transmission&&d.enable(15),O.sheen&&d.enable(16),O.opaque&&d.enable(17),O.pointsUvs&&d.enable(18),O.decodeVideoTexture&&d.enable(19),O.decodeVideoTextureEmissive&&d.enable(20),O.alphaToCoverage&&d.enable(21),O.numLightProbeGrids>0&&d.enable(22),O.hasPositionAttribute&&d.enable(23),w.push(d.mask)}function F(w){const O=b[w.type];let V;if(O){const k=va[O];V=yM.clone(k.uniforms)}else V=w.uniforms;return V}function C(w,O){let V=_.get(O);return V!==void 0?++V.usedTimes:(V=new WA(r,O,w,l),m.push(V),_.set(O,V)),V}function I(w){if(--w.usedTimes===0){const O=m.indexOf(w);m[O]=m[m.length-1],m.pop(),_.delete(w.cacheKey),w.destroy()}}function L(w){h.remove(w)}function H(){h.dispose()}return{getParameters:D,getProgramCacheKey:E,getUniforms:F,acquireProgram:C,releaseProgram:I,releaseShaderCache:L,programs:m,dispose:H}}function JA(){let r=new WeakMap;function e(d){return r.has(d)}function i(d){let h=r.get(d);return h===void 0&&(h={},r.set(d,h)),h}function s(d){r.delete(d)}function l(d,h,p){r.get(d)[h]=p}function c(){r=new WeakMap}return{has:e,get:i,remove:s,update:l,dispose:c}}function $A(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.materialVariant!==e.materialVariant?r.materialVariant-e.materialVariant:r.z!==e.z?r.z-e.z:r.id-e.id}function r_(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function o_(){const r=[];let e=0;const i=[],s=[],l=[];function c(){e=0,i.length=0,s.length=0,l.length=0}function d(g){let b=0;return g.isInstancedMesh&&(b+=2),g.isSkinnedMesh&&(b+=1),b}function h(g,b,A,D,E,M){let z=r[e];return z===void 0?(z={id:g.id,object:g,geometry:b,material:A,materialVariant:d(g),groupOrder:D,renderOrder:g.renderOrder,z:E,group:M},r[e]=z):(z.id=g.id,z.object=g,z.geometry=b,z.material=A,z.materialVariant=d(g),z.groupOrder=D,z.renderOrder=g.renderOrder,z.z=E,z.group=M),e++,z}function p(g,b,A,D,E,M){const z=h(g,b,A,D,E,M);A.transmission>0?s.push(z):A.transparent===!0?l.push(z):i.push(z)}function m(g,b,A,D,E,M){const z=h(g,b,A,D,E,M);A.transmission>0?s.unshift(z):A.transparent===!0?l.unshift(z):i.unshift(z)}function _(g,b,A){i.length>1&&i.sort(g||$A),s.length>1&&s.sort(b||r_),l.length>1&&l.sort(b||r_),A&&(i.reverse(),s.reverse(),l.reverse())}function v(){for(let g=e,b=r.length;g<b;g++){const A=r[g];if(A.id===null)break;A.id=null,A.object=null,A.geometry=null,A.material=null,A.group=null}}return{opaque:i,transmissive:s,transparent:l,init:c,push:p,unshift:m,finish:v,sort:_}}function e3(){let r=new WeakMap;function e(s,l){const c=r.get(s);let d;return c===void 0?(d=new o_,r.set(s,[d])):l>=c.length?(d=new o_,c.push(d)):d=c[l],d}function i(){r=new WeakMap}return{get:e,dispose:i}}function t3(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new le,color:new Vt};break;case"SpotLight":i={position:new le,direction:new le,color:new Vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new le,color:new Vt,distance:0,decay:0};break;case"HemisphereLight":i={direction:new le,skyColor:new Vt,groundColor:new Vt};break;case"RectAreaLight":i={color:new Vt,position:new le,halfWidth:new le,halfHeight:new le};break}return r[e.id]=i,i}}}function n3(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let i;switch(e.type){case"DirectionalLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=i,i}}}let i3=0;function a3(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function s3(r){const e=new t3,i=n3(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let m=0;m<9;m++)s.probe.push(new le);const l=new le,c=new Dn,d=new Dn;function h(m){let _=0,v=0,g=0;for(let O=0;O<9;O++)s.probe[O].set(0,0,0);let b=0,A=0,D=0,E=0,M=0,z=0,F=0,C=0,I=0,L=0,H=0;m.sort(a3);for(let O=0,V=m.length;O<V;O++){const k=m[O],$=k.color,me=k.intensity,fe=k.distance;let te=null;if(k.shadow&&k.shadow.map&&(k.shadow.map.texture.format===Fr?te=k.shadow.map.texture:te=k.shadow.map.depthTexture||k.shadow.map.texture),k.isAmbientLight)_+=$.r*me,v+=$.g*me,g+=$.b*me;else if(k.isLightProbe){for(let B=0;B<9;B++)s.probe[B].addScaledVector(k.sh.coefficients[B],me);H++}else if(k.isDirectionalLight){const B=e.get(k);if(B.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const j=k.shadow,Y=i.get(k);Y.shadowIntensity=j.intensity,Y.shadowBias=j.bias,Y.shadowNormalBias=j.normalBias,Y.shadowRadius=j.radius,Y.shadowMapSize=j.mapSize,s.directionalShadow[b]=Y,s.directionalShadowMap[b]=te,s.directionalShadowMatrix[b]=k.shadow.matrix,z++}s.directional[b]=B,b++}else if(k.isSpotLight){const B=e.get(k);B.position.setFromMatrixPosition(k.matrixWorld),B.color.copy($).multiplyScalar(me),B.distance=fe,B.coneCos=Math.cos(k.angle),B.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),B.decay=k.decay,s.spot[D]=B;const j=k.shadow;if(k.map&&(s.spotLightMap[I]=k.map,I++,j.updateMatrices(k),k.castShadow&&L++),s.spotLightMatrix[D]=j.matrix,k.castShadow){const Y=i.get(k);Y.shadowIntensity=j.intensity,Y.shadowBias=j.bias,Y.shadowNormalBias=j.normalBias,Y.shadowRadius=j.radius,Y.shadowMapSize=j.mapSize,s.spotShadow[D]=Y,s.spotShadowMap[D]=te,C++}D++}else if(k.isRectAreaLight){const B=e.get(k);B.color.copy($).multiplyScalar(me),B.halfWidth.set(k.width*.5,0,0),B.halfHeight.set(0,k.height*.5,0),s.rectArea[E]=B,E++}else if(k.isPointLight){const B=e.get(k);if(B.color.copy(k.color).multiplyScalar(k.intensity),B.distance=k.distance,B.decay=k.decay,k.castShadow){const j=k.shadow,Y=i.get(k);Y.shadowIntensity=j.intensity,Y.shadowBias=j.bias,Y.shadowNormalBias=j.normalBias,Y.shadowRadius=j.radius,Y.shadowMapSize=j.mapSize,Y.shadowCameraNear=j.camera.near,Y.shadowCameraFar=j.camera.far,s.pointShadow[A]=Y,s.pointShadowMap[A]=te,s.pointShadowMatrix[A]=k.shadow.matrix,F++}s.point[A]=B,A++}else if(k.isHemisphereLight){const B=e.get(k);B.skyColor.copy(k.color).multiplyScalar(me),B.groundColor.copy(k.groundColor).multiplyScalar(me),s.hemi[M]=B,M++}}E>0&&(r.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=He.LTC_FLOAT_1,s.rectAreaLTC2=He.LTC_FLOAT_2):(s.rectAreaLTC1=He.LTC_HALF_1,s.rectAreaLTC2=He.LTC_HALF_2)),s.ambient[0]=_,s.ambient[1]=v,s.ambient[2]=g;const w=s.hash;(w.directionalLength!==b||w.pointLength!==A||w.spotLength!==D||w.rectAreaLength!==E||w.hemiLength!==M||w.numDirectionalShadows!==z||w.numPointShadows!==F||w.numSpotShadows!==C||w.numSpotMaps!==I||w.numLightProbes!==H)&&(s.directional.length=b,s.spot.length=D,s.rectArea.length=E,s.point.length=A,s.hemi.length=M,s.directionalShadow.length=z,s.directionalShadowMap.length=z,s.pointShadow.length=F,s.pointShadowMap.length=F,s.spotShadow.length=C,s.spotShadowMap.length=C,s.directionalShadowMatrix.length=z,s.pointShadowMatrix.length=F,s.spotLightMatrix.length=C+I-L,s.spotLightMap.length=I,s.numSpotLightShadowsWithMaps=L,s.numLightProbes=H,w.directionalLength=b,w.pointLength=A,w.spotLength=D,w.rectAreaLength=E,w.hemiLength=M,w.numDirectionalShadows=z,w.numPointShadows=F,w.numSpotShadows=C,w.numSpotMaps=I,w.numLightProbes=H,s.version=i3++)}function p(m,_){let v=0,g=0,b=0,A=0,D=0;const E=_.matrixWorldInverse;for(let M=0,z=m.length;M<z;M++){const F=m[M];if(F.isDirectionalLight){const C=s.directional[v];C.direction.setFromMatrixPosition(F.matrixWorld),l.setFromMatrixPosition(F.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(E),v++}else if(F.isSpotLight){const C=s.spot[b];C.position.setFromMatrixPosition(F.matrixWorld),C.position.applyMatrix4(E),C.direction.setFromMatrixPosition(F.matrixWorld),l.setFromMatrixPosition(F.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(E),b++}else if(F.isRectAreaLight){const C=s.rectArea[A];C.position.setFromMatrixPosition(F.matrixWorld),C.position.applyMatrix4(E),d.identity(),c.copy(F.matrixWorld),c.premultiply(E),d.extractRotation(c),C.halfWidth.set(F.width*.5,0,0),C.halfHeight.set(0,F.height*.5,0),C.halfWidth.applyMatrix4(d),C.halfHeight.applyMatrix4(d),A++}else if(F.isPointLight){const C=s.point[g];C.position.setFromMatrixPosition(F.matrixWorld),C.position.applyMatrix4(E),g++}else if(F.isHemisphereLight){const C=s.hemi[D];C.direction.setFromMatrixPosition(F.matrixWorld),C.direction.transformDirection(E),D++}}}return{setup:h,setupView:p,state:s}}function l_(r){const e=new s3(r),i=[],s=[],l=[];function c(g){v.camera=g,i.length=0,s.length=0,l.length=0}function d(g){i.push(g)}function h(g){s.push(g)}function p(g){l.push(g)}function m(){e.setup(i)}function _(g){e.setupView(i,g)}const v={lightsArray:i,shadowsArray:s,lightProbeGridArray:l,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:c,state:v,setupLights:m,setupLightsView:_,pushLight:d,pushShadow:h,pushLightProbeGrid:p}}function r3(r){let e=new WeakMap;function i(l,c=0){const d=e.get(l);let h;return d===void 0?(h=new l_(r),e.set(l,[h])):c>=d.length?(h=new l_(r),d.push(h)):h=d[c],h}function s(){e=new WeakMap}return{get:i,dispose:s}}const o3=`void main() {
4100	gl_Position = vec4( position, 1.0 );
4101}`,l3=`uniform sampler2D shadow_pass;
4102uniform vec2 resolution;
4103uniform float radius;
4104void main() {
4105	const float samples = float( VSM_SAMPLES );
4106	float mean = 0.0;
4107	float squared_mean = 0.0;
4108	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4109	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4110	for ( float i = 0.0; i < samples; i ++ ) {
4111		float uvOffset = uvStart + i * uvStride;
4112		#ifdef HORIZONTAL_PASS
4113			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4114			mean += distribution.x;
4115			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4116		#else
4117			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4118			mean += depth;
4119			squared_mean += depth * depth;
4120		#endif
4121	}
4122	mean = mean / samples;
4123	squared_mean = squared_mean / samples;
4124	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4125	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4126}`,c3=[new le(1,0,0),new le(-1,0,0),new le(0,1,0),new le(0,-1,0),new le(0,0,1),new le(0,0,-1)],u3=[new le(0,-1,0),new le(0,-1,0),new le(0,0,1),new le(0,0,-1),new le(0,-1,0),new le(0,-1,0)],c_=new Dn,Kl=new le,Jh=new le;function f3(r,e,i){let s=new sy;const l=new Xt,c=new Xt,d=new Sn,h=new EM,p=new TM,m={},_=i.maxTextureSize,v={[$s]:hi,[hi]:$s,[es]:es}
vendor: 4,215 bytes, line 4126
4126,g=new ia({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xt},radius:{value:4}},vertexShader:o3,fragmentShader:l3}),b=g.clone();b.defines.HORIZONTAL_PASS=1;const A=new os;A.setAttribute("position",new Ma(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const D=new Ta(A,g),E=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Yu;let M=this.type;this.render=function(L,H,w){if(E.enabled===!1||E.autoUpdate===!1&&E.needsUpdate===!1||L.length===0)return;this.type===h1&&(ut("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Yu);const O=r.getRenderTarget(),V=r.getActiveCubeFace(),k=r.getActiveMipmapLevel(),$=r.state;$.setBlending(ns),$.buffers.depth.getReversed()===!0?$.buffers.color.setClear(0,0,0,0):$.buffers.color.setClear(1,1,1,1),$.buffers.depth.setTest(!0),$.setScissorTest(!1);const me=M!==this.type;me&&H.traverse(function(fe){fe.material&&(Array.isArray(fe.material)?fe.material.forEach(te=>te.needsUpdate=!0):fe.material.needsUpdate=!0)});for(let fe=0,te=L.length;fe<te;fe++){const B=L[fe],j=B.shadow;if(j===void 0){ut("WebGLShadowMap:",B,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;l.copy(j.mapSize);const Y=j.getFrameExtents();l.multiply(Y),c.copy(j.mapSize),(l.x>_||l.y>_)&&(l.x>_&&(c.x=Math.floor(_/Y.x),l.x=c.x*Y.x,j.mapSize.x=c.x),l.y>_&&(c.y=Math.floor(_/Y.y),l.y=c.y*Y.y,j.mapSize.y=c.y));const ce=r.state.buffers.depth.getReversed();if(j.camera._reversedDepth=ce,j.map===null||me===!0){if(j.map!==null&&(j.map.depthTexture!==null&&(j.map.depthTexture.dispose(),j.map.depthTexture=null),j.map.dispose()),this.type===Zl){if(B.isPointLight){ut("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}j.map=new Sa(l.x,l.y,{format:Fr,type:ss,minFilter:Kn,magFilter:Kn,generateMipmaps:!1}),j.map.texture.name=B.name+".shadowMap",j.map.depthTexture=new Zo(l.x,l.y,_a),j.map.depthTexture.name=B.name+".shadowMapDepth",j.map.depthTexture.format=rs,j.map.depthTexture.compareFunction=null,j.map.depthTexture.minFilter=Xn,j.map.depthTexture.magFilter=Xn}else B.isPointLight?(j.map=new dy(l.x),j.map.depthTexture=new vM(l.x,Ea)):(j.map=new Sa(l.x,l.y),j.map.depthTexture=new Zo(l.x,l.y,Ea)),j.map.depthTexture.name=B.name+".shadowMap",j.map.depthTexture.format=rs,this.type===Yu?(j.map.depthTexture.compareFunction=ce?pm:hm,j.map.depthTexture.minFilter=Kn,j.map.depthTexture.magFilter=Kn):(j.map.depthTexture.compareFunction=null,j.map.depthTexture.minFilter=Xn,j.map.depthTexture.magFilter=Xn);j.camera.updateProjectionMatrix()}const Se=j.map.isWebGLCubeRenderTarget?6:1;for(let Ce=0;Ce<Se;Ce++){if(j.map.isWebGLCubeRenderTarget)r.setRenderTarget(j.map,Ce),r.clear();else{Ce===0&&(r.setRenderTarget(j.map),r.clear());const Ae=j.getViewport(Ce);d.set(c.x*Ae.x,c.y*Ae.y,c.x*Ae.z,c.y*Ae.w),$.viewport(d)}if(B.isPointLight){const Ae=j.camera,je=j.matrix,dt=B.distance||Ae.far;dt!==Ae.far&&(Ae.far=dt,Ae.updateProjectionMatrix()),Kl.setFromMatrixPosition(B.matrixWorld),Ae.position.copy(Kl),Jh.copy(Ae.position),Jh.add(c3[Ce]),Ae.up.copy(u3[Ce]),Ae.lookAt(Jh),Ae.updateMatrixWorld(),je.makeTranslation(-Kl.x,-Kl.y,-Kl.z),c_.multiplyMatrices(Ae.projectionMatrix,Ae.matrixWorldInverse),j._frustum.setFromProjectionMatrix(c_,Ae.coordinateSystem,Ae.reversedDepth)}else j.updateMatrices(B);s=j.getFrustum(),C(H,w,j.camera,B,this.type)}j.isPointLightShadow!==!0&&this.type===Zl&&z(j,w),j.needsUpdate=!1}M=this.type,E.needsUpdate=!1,r.setRenderTarget(O,V,k)};function z(L,H){const w=e.update(D);g.defines.VSM_SAMPLES!==L.blurSamples&&(g.defines.VSM_SAMPLES=L.blurSamples,b.defines.VSM_SAMPLES=L.blurSamples,g.needsUpdate=!0,b.needsUpdate=!0),L.mapPass===null&&(L.mapPass=new Sa(l.x,l.y,{format:Fr,type:ss})),g.uniforms.shadow_pass.value=L.map.depthTexture,g.uniforms.resolution.value=L.mapSize,g.uniforms.radius.value=L.radius,r.setRenderTarget(L.mapPass),r.clear(),r.renderBufferDirect(H,null,w,g,D,null),b.uniforms.shadow_pass.value=L.mapPass.texture,b.uniforms.resolution.value=L.mapSize,b.uniforms.radius.value=L.radius,r.setRenderTarget(L.map),r.clear(),r.renderBufferDirect(H,null,w,b,D,null)}function F(L,H,w,O){let V=null;
vendor: 9,109 bytes, line 4126
4126const k=w.isPointLight===!0?L.customDistanceMaterial:L.customDepthMaterial;if(k!==void 0)V=k;else if(V=w.isPointLight===!0?p:h,r.localClippingEnabled&&H.clipShadows===!0&&Array.isArray(H.clippingPlanes)&&H.clippingPlanes.length!==0||H.displacementMap&&H.displacementScale!==0||H.alphaMap&&H.alphaTest>0||H.map&&H.alphaTest>0||H.alphaToCoverage===!0){const $=V.uuid,me=H.uuid;let fe=m[$];fe===void 0&&(fe={},m[$]=fe);let te=fe[me];te===void 0&&(te=V.clone(),fe[me]=te,H.addEventListener("dispose",I)),V=te}if(V.visible=H.visible,V.wireframe=H.wireframe,O===Zl?V.side=H.shadowSide!==null?H.shadowSide:H.side:V.side=H.shadowSide!==null?H.shadowSide:v[H.side],V.alphaMap=H.alphaMap,V.alphaTest=H.alphaToCoverage===!0?.5:H.alphaTest,V.map=H.map,V.clipShadows=H.clipShadows,V.clippingPlanes=H.clippingPlanes,V.clipIntersection=H.clipIntersection,V.displacementMap=H.displacementMap,V.displacementScale=H.displacementScale,V.displacementBias=H.displacementBias,V.wireframeLinewidth=H.wireframeLinewidth,V.linewidth=H.linewidth,w.isPointLight===!0&&V.isMeshDistanceMaterial===!0){const $=r.properties.get(V);$.light=w}return V}function C(L,H,w,O,V){if(L.visible===!1)return;if(L.layers.test(H.layers)&&(L.isMesh||L.isLine||L.isPoints)&&(L.castShadow||L.receiveShadow&&V===Zl)&&(!L.frustumCulled||s.intersectsObject(L))){L.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,L.matrixWorld);const me=e.update(L),fe=L.material;if(Array.isArray(fe)){const te=me.groups;for(let B=0,j=te.length;B<j;B++){const Y=te[B],ce=fe[Y.materialIndex];if(ce&&ce.visible){const Se=F(L,ce,O,V);L.onBeforeShadow(r,L,H,w,me,Se,Y),r.renderBufferDirect(w,null,me,Se,L,Y),L.onAfterShadow(r,L,H,w,me,Se,Y)}}}else if(fe.visible){const te=F(L,fe,O,V);L.onBeforeShadow(r,L,H,w,me,te,null),r.renderBufferDirect(w,null,me,te,L,null),L.onAfterShadow(r,L,H,w,me,te,null)}}const $=L.children;for(let me=0,fe=$.length;me<fe;me++)C($[me],H,w,O,V)}function I(L){L.target.removeEventListener("dispose",I);for(const w in m){const O=m[w],V=L.target.uuid;V in O&&(O[V].dispose(),delete O[V])}}}function d3(r,e){function i(){let q=!1;const Ne=new Sn;let xe=null;const Ue=new Sn(0,0,0,0);return{setMask:function(Fe){xe!==Fe&&!q&&(r.colorMask(Fe,Fe,Fe,Fe),xe=Fe)},setLocked:function(Fe){q=Fe},setClear:function(Fe,be,qe,Ve,cn){cn===!0&&(Fe*=Ve,be*=Ve,qe*=Ve),Ne.set(Fe,be,qe,Ve),Ue.equals(Ne)===!1&&(r.clearColor(Fe,be,qe,Ve),Ue.copy(Ne))},reset:function(){q=!1,xe=null,Ue.set(-1,0,0,0)}}}function s(){let q=!1,Ne=!1,xe=null,Ue=null,Fe=null;return{setReversed:function(be){if(Ne!==be){const qe=e.get("EXT_clip_control");be?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Ne=be;const Ve=Fe;Fe=null,this.setClear(Ve)}},getReversed:function(){return Ne},setTest:function(be){be?Te(r.DEPTH_TEST):ke(r.DEPTH_TEST)},setMask:function(be){xe!==be&&!q&&(r.depthMask(be),xe=be)},setFunc:function(be){if(Ne&&(be=W1[be]),Ue!==be){switch(be){case tp:r.depthFunc(r.NEVER);break;case np:r.depthFunc(r.ALWAYS);break;case ip:r.depthFunc(r.LESS);break;case Qo:r.depthFunc(r.LEQUAL);break;case ap:r.depthFunc(r.EQUAL);break;case sp:r.depthFunc(r.GEQUAL);break;case rp:r.depthFunc(r.GREATER);break;case op:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}Ue=be}},setLocked:function(be){q=be},setClear:function(be){Fe!==be&&(Fe=be,Ne&&(be=1-be),r.clearDepth(be))},reset:function(){q=!1,xe=null,Ue=null,Fe=null,Ne=!1}}}function l(){let q=!1,Ne=null,xe=null,Ue=null,Fe=null,be=null,qe=null,Ve=null,cn=null;return{setTest:function(At){q||(At?Te(r.STENCIL_TEST):ke(r.STENCIL_TEST))},setMask:function(At){Ne!==At&&!q&&(r.stencilMask(At),Ne=At)},setFunc:function(At,Zn,Jn){(xe!==At||Ue!==Zn||Fe!==Jn)&&(r.stencilFunc(At,Zn,Jn),xe=At,Ue=Zn,Fe=Jn)},setOp:function(At,Zn,Jn){(be!==At||qe!==Zn||Ve!==Jn)&&(r.stencilOp(At,Zn,Jn),be=At,qe=Zn,Ve=Jn)},setLocked:function(At){q=At},setClear:function(At){cn!==At&&(r.clearStencil(At),cn=At)},reset:function(){q=!1,Ne=null,xe=null,Ue=null,Fe=null,be=null,qe=null,Ve=null,cn=null}}}const c=new i,d=new s,h=new l,p=new WeakMap,m=new WeakMap;let _={},v={},g={},b=new WeakMap,A=[],D=null,E=!1,M=null,z=null,F=null,C=null,I=null,L=null,H=null,w=new Vt(0,0,0),O=0,V=!1,k=null,$=null,me=null,fe=null,te=null;const B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let j=!1,Y=0;const ce=r.getParameter(r.VERSION);ce.indexOf("WebGL")!==-1?(Y=parseFloat(/^WebGL (\d)/.exec(ce)[1]),j=Y>=1):ce.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),j=Y>=2);let Se=null,Ce={};const Ae=r.getParameter(r.SCISSOR_BOX),je=r.getParameter(r.VIEWPORT),dt=new Sn().fromArray(Ae),ft=new Sn().fromArray(je);function Z(q,Ne,xe,Ue){const Fe=new Uint8Array(4),be=r.createTexture();r.bindTexture(q,be),r.texParameteri(q,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(q,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let qe=0;qe<xe;qe++)q===r.TEXTURE_3D||q===r.TEXTURE_2D_ARRAY?r.texImage3D(Ne,0,r.RGBA,1,1,Ue,0,r.RGBA,r.UNSIGNED_BYTE,Fe):r.texImage2D(Ne+qe,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Fe);return be}const we={};we[r.TEXTURE_2D]=Z(r.TEXTURE_2D,r.TEXTURE_2D,1),we[r.TEXTURE_CUBE_MAP]=Z(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),we[r.TEXTURE_2D_ARRAY]=Z(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),we[r.TEXTURE_3D]=Z(r.TEXTURE_3D,r.TEXTURE_3D,1,1),c.setClear(0,0,0,1),d.setClear(1),h.setClear(0),Te(r.DEPTH_TEST),d.setFunc(Qo),sn(!1),pn(dv),Te(r.CULL_FACE),vt(ns);function Te(q){_[q]!==!0&&(r.enable(q),_[q]=!0)}function ke(q){_[q]!==!1&&(r.disable(q),_[q]=!1)}function rt(q,Ne){return g[q]!==Ne?(r.bindFramebuffer(q,Ne),g[q]=Ne,q===r.DRAW_FRAMEBUFFER&&(g[r.FRAMEBUFFER]=Ne),q===r.FRAMEBUFFER&&(g[r.DRAW_FRAMEBUFFER]=Ne),!0):!1}function Ze(q,Ne){let xe=A,Ue=!1;if(q){xe=b.get(Ne),xe===void 0&&(xe=[],b.set(Ne,xe));const Fe=q.textures;if(xe.length!==Fe.length||xe[0]!==r.COLOR_ATTACHMENT0){for(let be=0,qe=Fe.length;be<qe;be++)xe[be]=r.COLOR_ATTACHMENT0+be;xe.length=Fe.length,Ue=!0}}else xe[0]!==r.BACK&&(xe[0]=r.BACK,Ue=!0);Ue&&r.drawBuffers(xe)}function en(q){return D!==q?(r.useProgram(q),D=q,!0):!1}const yt={[Sr]:r.FUNC_ADD,[m1]:r.FUNC_SUBTRACT,[g1]:r.FUNC_REVERSE_SUBTRACT};yt[x1]=r.MIN,yt[v1]=r.MAX;const Et={[_1]:r.ZERO,[y1]:r.ONE,[b1]:r.SRC_COLOR,[$h]:r.SRC_ALPHA,[w1]:r.SRC_ALPHA_SATURATE,[T1]:r.DST_COLOR,[M1]:r.DST_ALPHA,[S1]:r.ONE_MINUS_SRC_COLOR,[ep]:r.ONE_MINUS_SRC_ALPHA,[A1]:r.ONE_MINUS_DST_COLOR,[E1]:r.ONE_MINUS_DST_ALPHA,[C1]:r.CONSTANT_COLOR,[R1]:r.ONE_MINUS_CONSTANT_COLOR,[N1]:r.CONSTANT_ALPHA,[D1]:r.ONE_MINUS_CONSTANT_ALPHA};function vt(q,Ne,xe,Ue,Fe,be,qe,Ve,cn,At){if(q===ns){E===!0&&(ke(r.BLEND),E=!1);return}if(E===!1&&(Te(r.BLEND),E=!0),q!==p1){if(q!==M||At!==V){if((z!==Sr||I!==Sr)&&(r.blendEquation(r.FUNC_ADD),z=Sr,I=Sr),At)switch(q){case Lo:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case hv:r.blendFunc(r.ONE,r.ONE);break;case pv:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case mv:r.blendFuncSeparate(r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:Bt("WebGLState: Invalid blending: ",q);break}else switch(q){case Lo:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case hv:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case pv:Bt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case mv:Bt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Bt("WebGLState: Invalid blending: ",q);break}F=null,C=null,L=null,H=null,w.set(0,0,0),O=0,M=q,V=At}return}Fe=Fe||Ne,be=be||xe,qe=qe||Ue,(Ne!==z||Fe!==I)&&(r.blendEquationSeparate(yt[Ne],yt[Fe]),z=Ne,I=Fe),(xe!==F||Ue!==C||be!==L||qe!==H)&&(r.blendFuncSeparate(Et[xe],Et[Ue],Et[be],Et[qe]),F=xe,C=Ue,L=be,H=qe),(Ve.equals(w)===!1||cn!==O)&&(r.blendColor(Ve.r,Ve.g,Ve.b,cn),w.copy(Ve),O=cn),M=q,V=!1}function ht(q,Ne){q.side===es?ke(r.CULL_FACE):Te(r.CULL_FACE);let xe=q.side===hi;Ne&&(xe=!xe),sn(xe),q.blending===Lo&&q.transparent===!1?vt(ns):vt(q.blending,q.blendEquation,q.blendSrc,q.blendDst,q.blendEquationAlpha,q.blendSrcAlpha,q.blendDstAlpha,q.blendColor,q.blendAlpha,q.premultipliedAlpha),d.setFunc(q.depthFunc),d.setTest(q.depthTest),d.setMask(q.depthWrite),c.setMask(q.colorWrite);const Ue=q.stencilWrite;h.setTest(Ue),Ue&&(h.setMask(q.stencilWriteMask),h.setFunc(q.stencilFunc,q.stencilRef,q.stencilFuncMask),h.setOp(q.stencilFail,q.stencilZFail,q.stencilZPass)),rn(q.polygonOffset,q.polygonOffsetFactor,q.polygonOffsetUnits),q.alphaToCoverage===!0?Te(r.SAMPLE_ALPHA_TO_COVERAGE):ke(r.SAMPLE_ALPHA_TO_COVERAGE)}function sn(q){k!==q&&(q?r.frontFace(r.CW):r.frontFace(r.CCW),k=q)}function pn(q){q!==f1?(Te(r.CULL_FACE),q!==$&&(q===dv?r.cullFace(r.BACK):q===d1?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ke(r.CULL_FACE),$=q}function Wt(q){q!==me&&(j&&r.lineWidth(q),me=q)}function rn(q,Ne,xe){q?(Te(r.POLYGON_OFFSET_FILL),(fe!==Ne||te!==xe)&&(fe=Ne,te=xe,d.getReversed()&&(Ne=-Ne),r.polygonOffset(Ne,xe))):ke(r.POLYGON_OFFSET_FILL)}function qt(q){q?Te(r.SCISSOR_TEST):ke(r.SCISSOR_TEST)}function un(q){q===void 0&&(q=r.TEXTURE0+B-1),Se!==q&&(r.activeTexture(q),Se=q)}
vendor: 8,935 bytes, line 4126
4126function Q(q,Ne,xe){xe===void 0&&(Se===null?xe=r.TEXTURE0+B-1:xe=Se);let Ue=Ce[xe];Ue===void 0&&(Ue={type:void 0,texture:void 0},Ce[xe]=Ue),(Ue.type!==q||Ue.texture!==Ne)&&(Se!==xe&&(r.activeTexture(xe),Se=xe),r.bindTexture(q,Ne||we[q]),Ue.type=q,Ue.texture=Ne)}function Ht(){const q=Ce[Se];q!==void 0&&q.type!==void 0&&(r.bindTexture(q.type,null),q.type=void 0,q.texture=void 0)}function zt(){try{r.compressedTexImage2D(...arguments)}catch(q){Bt("WebGLState:",q)}}function P(){try{r.compressedTexImage3D(...arguments)}catch(q){Bt("WebGLState:",q)}}function T(){try{r.texSubImage2D(...arguments)}catch(q){Bt("WebGLState:",q)}}function ee(){try{r.texSubImage3D(...arguments)}catch(q){Bt("WebGLState:",q)}}function se(){try{r.compressedTexSubImage2D(...arguments)}catch(q){Bt("WebGLState:",q)}}function he(){try{r.compressedTexSubImage3D(...arguments)}catch(q){Bt("WebGLState:",q)}}function Re(){try{r.texStorage2D(...arguments)}catch(q){Bt("WebGLState:",q)}}function Oe(){try{r.texStorage3D(...arguments)}catch(q){Bt("WebGLState:",q)}}function de(){try{r.texImage2D(...arguments)}catch(q){Bt("WebGLState:",q)}}function pe(){try{r.texImage3D(...arguments)}catch(q){Bt("WebGLState:",q)}}function De(q){return v[q]!==void 0?v[q]:r.getParameter(q)}function Ge(q,Ne){v[q]!==Ne&&(r.pixelStorei(q,Ne),v[q]=Ne)}function Ie(q){dt.equals(q)===!1&&(r.scissor(q.x,q.y,q.z,q.w),dt.copy(q))}function Pe(q){ft.equals(q)===!1&&(r.viewport(q.x,q.y,q.z,q.w),ft.copy(q))}function Je(q,Ne){let xe=m.get(Ne);xe===void 0&&(xe=new WeakMap,m.set(Ne,xe));let Ue=xe.get(q);Ue===void 0&&(Ue=r.getUniformBlockIndex(Ne,q.name),xe.set(q,Ue))}function $e(q,Ne){const Ue=m.get(Ne).get(q);p.get(Ne)!==Ue&&(r.uniformBlockBinding(Ne,Ue,q.__bindingPointIndex),p.set(Ne,Ue))}function ot(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),d.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),r.pixelStorei(r.PACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL),r.pixelStorei(r.PACK_ROW_LENGTH,0),r.pixelStorei(r.PACK_SKIP_PIXELS,0),r.pixelStorei(r.PACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_ROW_LENGTH,0),r.pixelStorei(r.UNPACK_IMAGE_HEIGHT,0),r.pixelStorei(r.UNPACK_SKIP_PIXELS,0),r.pixelStorei(r.UNPACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_SKIP_IMAGES,0),_={},v={},Se=null,Ce={},g={},b=new WeakMap,A=[],D=null,E=!1,M=null,z=null,F=null,C=null,I=null,L=null,H=null,w=new Vt(0,0,0),O=0,V=!1,k=null,$=null,me=null,fe=null,te=null,dt.set(0,0,r.canvas.width,r.canvas.height),ft.set(0,0,r.canvas.width,r.canvas.height),c.reset(),d.reset(),h.reset()}return{buffers:{color:c,depth:d,stencil:h},enable:Te,disable:ke,bindFramebuffer:rt,drawBuffers:Ze,useProgram:en,setBlending:vt,setMaterial:ht,setFlipSided:sn,setCullFace:pn,setLineWidth:Wt,setPolygonOffset:rn,setScissorTest:qt,activeTexture:un,bindTexture:Q,unbindTexture:Ht,compressedTexImage2D:zt,compressedTexImage3D:P,texImage2D:de,texImage3D:pe,pixelStorei:Ge,getParameter:De,updateUBOMapping:Je,uniformBlockBinding:$e,texStorage2D:Re,texStorage3D:Oe,texSubImage2D:T,texSubImage3D:ee,compressedTexSubImage2D:se,compressedTexSubImage3D:he,scissor:Ie,viewport:Pe,reset:ot}}function h3(r,e,i,s,l,c,d){const h=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new Xt,_=new WeakMap,v=new Set;let g;const b=new WeakMap;let A=!1;try{A=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function D(P,T){return A?new OffscreenCanvas(P,T):rf("canvas")}function E(P,T,ee){let se=1;const he=zt(P);if((he.width>ee||he.height>ee)&&(se=ee/Math.max(he.width,he.height)),se<1)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap||typeof VideoFrame<"u"&&P instanceof VideoFrame){const Re=Math.floor(se*he.width),Oe=Math.floor(se*he.height);g===void 0&&(g=D(Re,Oe));const de=T?D(Re,Oe):g;return de.width=Re,de.height=Oe,de.getContext("2d").drawImage(P,0,0,Re,Oe),ut("WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+Re+"x"+Oe+")."),de}else return"data"in P&&ut("WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),P;return P}function M(P){return P.generateMipmaps}function z(P){r.generateMipmap(P)}function F(P){return P.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:P.isWebGL3DRenderTarget?r.TEXTURE_3D:P.isWebGLArrayRenderTarget||P.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function C(P,T,ee,se,he,Re=!1){if(P!==null){if(r[P]!==void 0)return r[P];ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let Oe;se&&(Oe=e.get("EXT_texture_norm16"),Oe||ut("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let de=T;if(T===r.RED&&(ee===r.FLOAT&&(de=r.R32F),ee===r.HALF_FLOAT&&(de=r.R16F),ee===r.UNSIGNED_BYTE&&(de=r.R8),ee===r.UNSIGNED_SHORT&&Oe&&(de=Oe.R16_EXT),ee===r.SHORT&&Oe&&(de=Oe.R16_SNORM_EXT)),T===r.RED_INTEGER&&(ee===r.UNSIGNED_BYTE&&(de=r.R8UI),ee===r.UNSIGNED_SHORT&&(de=r.R16UI),ee===r.UNSIGNED_INT&&(de=r.R32UI),ee===r.BYTE&&(de=r.R8I),ee===r.SHORT&&(de=r.R16I),ee===r.INT&&(de=r.R32I)),T===r.RG&&(ee===r.FLOAT&&(de=r.RG32F),ee===r.HALF_FLOAT&&(de=r.RG16F),ee===r.UNSIGNED_BYTE&&(de=r.RG8),ee===r.UNSIGNED_SHORT&&Oe&&(de=Oe.RG16_EXT),ee===r.SHORT&&Oe&&(de=Oe.RG16_SNORM_EXT)),T===r.RG_INTEGER&&(ee===r.UNSIGNED_BYTE&&(de=r.RG8UI),ee===r.UNSIGNED_SHORT&&(de=r.RG16UI),ee===r.UNSIGNED_INT&&(de=r.RG32UI),ee===r.BYTE&&(de=r.RG8I),ee===r.SHORT&&(de=r.RG16I),ee===r.INT&&(de=r.RG32I)),T===r.RGB_INTEGER&&(ee===r.UNSIGNED_BYTE&&(de=r.RGB8UI),ee===r.UNSIGNED_SHORT&&(de=r.RGB16UI),ee===r.UNSIGNED_INT&&(de=r.RGB32UI),ee===r.BYTE&&(de=r.RGB8I),ee===r.SHORT&&(de=r.RGB16I),ee===r.INT&&(de=r.RGB32I)),T===r.RGBA_INTEGER&&(ee===r.UNSIGNED_BYTE&&(de=r.RGBA8UI),ee===r.UNSIGNED_SHORT&&(de=r.RGBA16UI),ee===r.UNSIGNED_INT&&(de=r.RGBA32UI),ee===r.BYTE&&(de=r.RGBA8I),ee===r.SHORT&&(de=r.RGBA16I),ee===r.INT&&(de=r.RGBA32I)),T===r.RGB&&(ee===r.UNSIGNED_SHORT&&Oe&&(de=Oe.RGB16_EXT),ee===r.SHORT&&Oe&&(de=Oe.RGB16_SNORM_EXT),ee===r.UNSIGNED_INT_5_9_9_9_REV&&(de=r.RGB9_E5),ee===r.UNSIGNED_INT_10F_11F_11F_REV&&(de=r.R11F_G11F_B10F)),T===r.RGBA){const pe=Re?af:Pt.getTransfer(he);ee===r.FLOAT&&(de=r.RGBA32F),ee===r.HALF_FLOAT&&(de=r.RGBA16F),ee===r.UNSIGNED_BYTE&&(de=pe===$t?r.SRGB8_ALPHA8:r.RGBA8),ee===r.UNSIGNED_SHORT&&Oe&&(de=Oe.RGBA16_EXT),ee===r.SHORT&&Oe&&(de=Oe.RGBA16_SNORM_EXT),ee===r.UNSIGNED_SHORT_4_4_4_4&&(de=r.RGBA4),ee===r.UNSIGNED_SHORT_5_5_5_1&&(de=r.RGB5_A1)}return(de===r.R16F||de===r.R32F||de===r.RG16F||de===r.RG32F||de===r.RGBA16F||de===r.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function I(P,T){let ee;return P?T===null||T===Ea||T===tc?ee=r.DEPTH24_STENCIL8:T===_a?ee=r.DEPTH32F_STENCIL8:T===ec&&(ee=r.DEPTH24_STENCIL8,ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):T===null||T===Ea||T===tc?ee=r.DEPTH_COMPONENT24:T===_a?ee=r.DEPTH_COMPONENT32F:T===ec&&(ee=r.DEPTH_COMPONENT16),ee}function L(P,T){return M(P)===!0||P.isFramebufferTexture&&P.minFilter!==Xn&&P.minFilter!==Kn?Math.log2(Math.max(T.width,T.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?T.mipmaps.length:1}function H(P){const T=P.target;T.removeEventListener("dispose",H),O(T),T.isVideoTexture&&_.delete(T),T.isHTMLTexture&&v.delete(T)}function w(P){const T=P.target;T.removeEventListener("dispose",w),k(T)}function O(P){const T=s.get(P);if(T.__webglInit===void 0)return;const ee=P.source,se=b.get(ee);if(se){const he=se[T.__cacheKey];he.usedTimes--,he.usedTimes===0&&V(P),Object.keys(se).length===0&&b.delete(ee)}s.remove(P)}function V(P){const T=s.get(P);r.deleteTexture(T.__webglTexture);const ee=P.source,se=b.get(ee);delete se[T.__cacheKey],d.memory.textures--}function k(P){const T=s.get(P);if(P.depthTexture&&(P.depthTexture.dispose(),s.remove(P.depthTexture)),P.isWebGLCubeRen
vendor: 5,055 bytes, line 4126
4126derTarget)for(let se=0;se<6;se++){if(Array.isArray(T.__webglFramebuffer[se]))for(let he=0;he<T.__webglFramebuffer[se].length;he++)r.deleteFramebuffer(T.__webglFramebuffer[se][he]);else r.deleteFramebuffer(T.__webglFramebuffer[se]);T.__webglDepthbuffer&&r.deleteRenderbuffer(T.__webglDepthbuffer[se])}else{if(Array.isArray(T.__webglFramebuffer))for(let se=0;se<T.__webglFramebuffer.length;se++)r.deleteFramebuffer(T.__webglFramebuffer[se]);else r.deleteFramebuffer(T.__webglFramebuffer);if(T.__webglDepthbuffer&&r.deleteRenderbuffer(T.__webglDepthbuffer),T.__webglMultisampledFramebuffer&&r.deleteFramebuffer(T.__webglMultisampledFramebuffer),T.__webglColorRenderbuffer)for(let se=0;se<T.__webglColorRenderbuffer.length;se++)T.__webglColorRenderbuffer[se]&&r.deleteRenderbuffer(T.__webglColorRenderbuffer[se]);T.__webglDepthRenderbuffer&&r.deleteRenderbuffer(T.__webglDepthRenderbuffer)}const ee=P.textures;for(let se=0,he=ee.length;se<he;se++){const Re=s.get(ee[se]);Re.__webglTexture&&(r.deleteTexture(Re.__webglTexture),d.memory.textures--),s.remove(ee[se])}s.remove(P)}let $=0;function me(){$=0}function fe(){return $}function te(P){$=P}function B(){const P=$;return P>=l.maxTextures&&ut("WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+l.maxTextures),$+=1,P}function j(P){const T=[];return T.push(P.wrapS),T.push(P.wrapT),T.push(P.wrapR||0),T.push(P.magFilter),T.push(P.minFilter),T.push(P.anisotropy),T.push(P.internalFormat),T.push(P.format),T.push(P.type),T.push(P.generateMipmaps),T.push(P.premultiplyAlpha),T.push(P.flipY),T.push(P.unpackAlignment),T.push(P.colorSpace),T.join()}function Y(P,T){const ee=s.get(P);if(P.isVideoTexture&&Q(P),P.isRenderTargetTexture===!1&&P.isExternalTexture!==!0&&P.version>0&&ee.__version!==P.version){const se=P.image;if(se===null)ut("WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)ut("WebGLRenderer: Texture marked for update but image is incomplete");else{ke(ee,P,T);return}}else P.isExternalTexture&&(ee.__webglTexture=P.sourceTexture?P.sourceTexture:null);i.bindTexture(r.TEXTURE_2D,ee.__webglTexture,r.TEXTURE0+T)}function ce(P,T){const ee=s.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&ee.__version!==P.version){ke(ee,P,T);return}else P.isExternalTexture&&(ee.__webglTexture=P.sourceTexture?P.sourceTexture:null);i.bindTexture(r.TEXTURE_2D_ARRAY,ee.__webglTexture,r.TEXTURE0+T)}function Se(P,T){const ee=s.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&ee.__version!==P.version){ke(ee,P,T);return}i.bindTexture(r.TEXTURE_3D,ee.__webglTexture,r.TEXTURE0+T)}function Ce(P,T){const ee=s.get(P);if(P.isCubeDepthTexture!==!0&&P.version>0&&ee.__version!==P.version){rt(ee,P,T);return}i.bindTexture(r.TEXTURE_CUBE_MAP,ee.__webglTexture,r.TEXTURE0+T)}const Ae={[lp]:r.REPEAT,[ts]:r.CLAMP_TO_EDGE,[cp]:r.MIRRORED_REPEAT},je={[Xn]:r.NEAREST,[O1]:r.NEAREST_MIPMAP_NEAREST,[Eu]:r.NEAREST_MIPMAP_LINEAR,[Kn]:r.LINEAR,[Sh]:r.LINEAR_MIPMAP_NEAREST,[Er]:r.LINEAR_MIPMAP_LINEAR},dt={[F1]:r.NEVER,[k1]:r.ALWAYS,[z1]:r.LESS,[hm]:r.LEQUAL,[B1]:r.EQUAL,[pm]:r.GEQUAL,[H1]:r.GREATER,[G1]:r.NOTEQUAL};function ft(P,T){if(T.type===_a&&e.has("OES_texture_float_linear")===!1&&(T.magFilter===Kn||T.magFilter===Sh||T.magFilter===Eu||T.magFilter===Er||T.minFilter===Kn||T.minFilter===Sh||T.minFilter===Eu||T.minFilter===Er)&&ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(P,r.TEXTURE_WRAP_S,Ae[T.wrapS]),r.texParameteri(P,r.TEXTURE_WRAP_T,Ae[T.wrapT]),(P===r.TEXTURE_3D||P===r.TEXTURE_2D_ARRAY)&&r.texParameteri(P,r.TEXTURE_WRAP_R,Ae[T.wrapR]),r.texParameteri(P,r.TEXTURE_MAG_FILTER,je[T.magFilter]),r.texParameteri(P,r.TEXTURE_MIN_FILTER,je[T.minFilter]),T.compareFunction&&(r.texParameteri(P,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(P,r.TEXTURE_COMPARE_FUNC,dt[T.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(T.magFilter===Xn||T.minFilter!==Eu&&T.minFilter!==Er||T.type===_a&&e.has("OES_texture_float_linear")===!1)return;if(T.anisotropy>1||s.get(T).__currentAnisotropy){const ee=e.get("EXT_texture_filter_anisotropic");r.texParameterf(P,ee.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(T.anisotropy,l.getMaxAnisotropy())),s.get(T).__currentAnisotropy=T.anisotropy}}}function Z(P,T){let ee=!1;P.__webglInit===void 0&&(P.__webglInit=!0,T.addEventListener("dispose",H));const se=T.source;let he=b.get(se);he===void 0&&(he={},b.set(se,he));const Re=j(T);if(Re!==P.__cacheKey){he[Re]===void 0&&(he[Re]={texture:r.createTexture(),usedTimes:0},d.memory.textures++,ee=!0),he[Re].usedTimes++;const Oe=he[P.__cacheKey];Oe!==void 0&&(he[P.__cacheKey].usedTimes--,Oe.usedTimes===0&&V(T)),P.__cacheKey=Re,P.__webglTexture=he[Re].texture}return ee}function we(P,T,ee){return Math.floor(Math.floor(P/ee)/T)}function Te(P,T,ee,se){const Re=P.updateRanges;if(Re.length===0)i.texSubImage2D(r.TEXTURE_2D,0,0,0,T.width,T.height,ee,se,T.data);else{Re.sort((Ge,Ie)=>Ge.start-Ie.start);let Oe=0;for(let Ge=1;Ge<Re.length;
vendor: 5,933 bytes, line 4126
4126Ge++){const Ie=Re[Oe],Pe=Re[Ge],Je=Ie.start+Ie.count,$e=we(Pe.start,T.width,4),ot=we(Ie.start,T.width,4);Pe.start<=Je+1&&$e===ot&&we(Pe.start+Pe.count-1,T.width,4)===$e?Ie.count=Math.max(Ie.count,Pe.start+Pe.count-Ie.start):(++Oe,Re[Oe]=Pe)}Re.length=Oe+1;const de=i.getParameter(r.UNPACK_ROW_LENGTH),pe=i.getParameter(r.UNPACK_SKIP_PIXELS),De=i.getParameter(r.UNPACK_SKIP_ROWS);i.pixelStorei(r.UNPACK_ROW_LENGTH,T.width);for(let Ge=0,Ie=Re.length;Ge<Ie;Ge++){const Pe=Re[Ge],Je=Math.floor(Pe.start/4),$e=Math.ceil(Pe.count/4),ot=Je%T.width,q=Math.floor(Je/T.width),Ne=$e,xe=1;i.pixelStorei(r.UNPACK_SKIP_PIXELS,ot),i.pixelStorei(r.UNPACK_SKIP_ROWS,q),i.texSubImage2D(r.TEXTURE_2D,0,ot,q,Ne,xe,ee,se,T.data)}P.clearUpdateRanges(),i.pixelStorei(r.UNPACK_ROW_LENGTH,de),i.pixelStorei(r.UNPACK_SKIP_PIXELS,pe),i.pixelStorei(r.UNPACK_SKIP_ROWS,De)}}function ke(P,T,ee){let se=r.TEXTURE_2D;(T.isDataArrayTexture||T.isCompressedArrayTexture)&&(se=r.TEXTURE_2D_ARRAY),T.isData3DTexture&&(se=r.TEXTURE_3D);const he=Z(P,T),Re=T.source;i.bindTexture(se,P.__webglTexture,r.TEXTURE0+ee);const Oe=s.get(Re);if(Re.version!==Oe.__version||he===!0){if(i.activeTexture(r.TEXTURE0+ee),(typeof ImageBitmap<"u"&&T.image instanceof ImageBitmap)===!1){const xe=Pt.getPrimaries(Pt.workingColorSpace),Ue=T.colorSpace===ks?null:Pt.getPrimaries(T.colorSpace),Fe=T.colorSpace===ks||xe===Ue?r.NONE:r.BROWSER_DEFAULT_WEBGL;i.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,T.flipY),i.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,T.premultiplyAlpha),i.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Fe)}i.pixelStorei(r.UNPACK_ALIGNMENT,T.unpackAlignment);let pe=E(T.image,!1,l.maxTextureSize);pe=Ht(T,pe);const De=c.convert(T.format,T.colorSpace),Ge=c.convert(T.type);let Ie=C(T.internalFormat,De,Ge,T.normalized,T.colorSpace,T.isVideoTexture);ft(se,T);let Pe;const Je=T.mipmaps,$e=T.isVideoTexture!==!0,ot=Oe.__version===void 0||he===!0,q=Re.dataReady,Ne=L(T,pe);if(T.isDepthTexture)Ie=I(T.format===Tr,T.type),ot&&($e?i.texStorage2D(r.TEXTURE_2D,1,Ie,pe.width,pe.height):i.texImage2D(r.TEXTURE_2D,0,Ie,pe.width,pe.height,0,De,Ge,null));else if(T.isDataTexture)if(Je.length>0){$e&&ot&&i.texStorage2D(r.TEXTURE_2D,Ne,Ie,Je[0].width,Je[0].height);for(let xe=0,Ue=Je.length;xe<Ue;xe++)Pe=Je[xe],$e?q&&i.texSubImage2D(r.TEXTURE_2D,xe,0,0,Pe.width,Pe.height,De,Ge,Pe.data):i.texImage2D(r.TEXTURE_2D,xe,Ie,Pe.width,Pe.height,0,De,Ge,Pe.data);T.generateMipmaps=!1}else $e?(ot&&i.texStorage2D(r.TEXTURE_2D,Ne,Ie,pe.width,pe.height),q&&Te(T,pe,De,Ge)):i.texImage2D(r.TEXTURE_2D,0,Ie,pe.width,pe.height,0,De,Ge,pe.data);else if(T.isCompressedTexture)if(T.isCompressedArrayTexture){$e&&ot&&i.texStorage3D(r.TEXTURE_2D_ARRAY,Ne,Ie,Je[0].width,Je[0].height,pe.depth);for(let xe=0,Ue=Je.length;xe<Ue;xe++)if(Pe=Je[xe],T.format!==ta)if(De!==null)if($e){if(q)if(T.layerUpdates.size>0){const Fe=Hv(Pe.width,Pe.height,T.format,T.type);for(const be of T.layerUpdates){const qe=Pe.data.subarray(be*Fe/Pe.data.BYTES_PER_ELEMENT,(be+1)*Fe/Pe.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,be,Pe.width,Pe.height,1,De,qe)}T.clearLayerUpdates()}else i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,0,Pe.width,Pe.height,pe.depth,De,Pe.data)}else i.compressedTexImage3D(r.TEXTURE_2D_ARRAY,xe,Ie,Pe.width,Pe.height,pe.depth,0,Pe.data,0,0);else ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else $e?q&&i.texSubImage3D(r.TEXTURE_2D_ARRAY,xe,0,0,0,Pe.width,Pe.height,pe.depth,De,Ge,Pe.data):i.texImage3D(r.TEXTURE_2D_ARRAY,xe,Ie,Pe.width,Pe.height,pe.depth,0,De,Ge,Pe.data)}else{$e&&ot&&i.texStorage2D(r.TEXTURE_2D,Ne,Ie,Je[0].width,Je[0].height);for(let xe=0,Ue=Je.length;xe<Ue;xe++)Pe=Je[xe],T.format!==ta?De!==null?$e?q&&i.compressedTexSubImage2D(r.TEXTURE_2D,xe,0,0,Pe.width,Pe.height,De,Pe.data):i.compressedTexImage2D(r.TEXTURE_2D,xe,Ie,Pe.width,Pe.height,0,Pe.data):ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):$e?q&&i.texSubImage2D(r.TEXTURE_2D,xe,0,0,Pe.width,Pe.height,De,Ge,Pe.data):i.texImage2D(r.TEXTURE_2D,xe,Ie,Pe.width,Pe.height,0,De,Ge,Pe.data)}else if(T.isDataArrayTexture)if($e){if(ot&&i.texStorage3D(r.TEXTURE_2D_ARRAY,Ne,Ie,pe.width,pe.height,pe.depth),q)if(T.layerUpdates.size>0){const xe=Hv(pe.width,pe.height,T.format,T.type);for(const Ue of T.layerUpdates){const Fe=pe.data.subarray(Ue*xe/pe.data.BYTES_PER_ELEMENT,(Ue+1)*xe/pe.data.BYTES_PER_ELEMENT);i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,Ue,pe.width,pe.height,1,De,Ge,Fe)}T.clearLayerUpdates()}else i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,pe.width,pe.height,pe.depth,De,Ge,pe.data)}else i.texImage3D(r.TEXTURE_2D_ARRAY,0,Ie,pe.width,pe.height,pe.depth,0,De,Ge,pe.data);else if(T.isData3DTexture)$e?(ot&&i.texStorage3D(r.TEXTURE_3D,Ne,Ie,pe.width,pe.height,pe.depth),q&&i.texSubImage3D(r.TEXTURE_3D,0,0,0,0,pe.width,pe.height,pe.depth,De,Ge,pe.data)):i.texImage3D(r.TEXTURE_3D,0,Ie,pe.width,pe.height,pe.depth,0,De,Ge,pe.data);else if(T.isFramebufferTexture){if(ot)if($e)i.texStorage2D(r.TEXTURE_2D,Ne,Ie,pe.width,pe.height);else{let xe=pe.width,Ue=pe.height;for(let Fe=0;Fe<Ne;Fe++)i.texImage2D(r.TEXTURE_2D,Fe,Ie,xe,Ue,0,De,Ge,null),xe>>=1,Ue>>=1}}else if(T.isHTMLTexture){if("texElementImage2D"in r){const xe=r.canvas;if(xe.hasAttribute("layoutsubtree")||xe.setAttribute("layoutsubtree","true"),pe.parentNode!==xe){xe.appendChild(pe),v.add(T),xe.onpaint=Ue=>{const Fe=Ue.changedElements;for(const be of v)Fe.includes(be.image)&&(be.needsUpdate=!0)},xe.requestPaint();return}if(r.texElementImage2D.length===3)r.texElementImage2D(r.TEXTURE_2D,r.RGBA8,pe);else{const Fe=r.RGBA,be=r.RGBA,qe=r.UNSIGNED_BYTE;r.texElementImage2D(r.TEXTURE_2D,0,Fe,be,qe,pe)}r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}}else if(Je.length>0){if($e&&ot){const xe=zt(Je[0]);
vendor: 35,433 bytes, lines 4126-4150
4126i.texStorage2D(r.TEXTURE_2D,Ne,Ie,xe.width,xe.height)}for(let xe=0,Ue=Je.length;xe<Ue;xe++)Pe=Je[xe],$e?q&&i.texSubImage2D(r.TEXTURE_2D,xe,0,0,De,Ge,Pe):i.texImage2D(r.TEXTURE_2D,xe,Ie,De,Ge,Pe);T.generateMipmaps=!1}else if($e){if(ot){const xe=zt(pe);i.texStorage2D(r.TEXTURE_2D,Ne,Ie,xe.width,xe.height)}q&&i.texSubImage2D(r.TEXTURE_2D,0,0,0,De,Ge,pe)}else i.texImage2D(r.TEXTURE_2D,0,Ie,De,Ge,pe);M(T)&&z(se),Oe.__version=Re.version,T.onUpdate&&T.onUpdate(T)}P.__version=T.version}function rt(P,T,ee){if(T.image.length!==6)return;const se=Z(P,T),he=T.source;i.bindTexture(r.TEXTURE_CUBE_MAP,P.__webglTexture,r.TEXTURE0+ee);const Re=s.get(he);if(he.version!==Re.__version||se===!0){i.activeTexture(r.TEXTURE0+ee);const Oe=Pt.getPrimaries(Pt.workingColorSpace),de=T.colorSpace===ks?null:Pt.getPrimaries(T.colorSpace),pe=T.colorSpace===ks||Oe===de?r.NONE:r.BROWSER_DEFAULT_WEBGL;i.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,T.flipY),i.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,T.premultiplyAlpha),i.pixelStorei(r.UNPACK_ALIGNMENT,T.unpackAlignment),i.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,pe);const De=T.isCompressedTexture||T.image[0].isCompressedTexture,Ge=T.image[0]&&T.image[0].isDataTexture,Ie=[];for(let be=0;be<6;be++)!De&&!Ge?Ie[be]=E(T.image[be],!0,l.maxCubemapSize):Ie[be]=Ge?T.image[be].image:T.image[be],Ie[be]=Ht(T,Ie[be]);const Pe=Ie[0],Je=c.convert(T.format,T.colorSpace),$e=c.convert(T.type),ot=C(T.internalFormat,Je,$e,T.normalized,T.colorSpace),q=T.isVideoTexture!==!0,Ne=Re.__version===void 0||se===!0,xe=he.dataReady;let Ue=L(T,Pe);ft(r.TEXTURE_CUBE_MAP,T);let Fe;if(De){q&&Ne&&i.texStorage2D(r.TEXTURE_CUBE_MAP,Ue,ot,Pe.width,Pe.height);for(let be=0;be<6;be++){Fe=Ie[be].mipmaps;for(let qe=0;qe<Fe.length;qe++){const Ve=Fe[qe];T.format!==ta?Je!==null?q?xe&&i.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe,0,0,Ve.width,Ve.height,Je,Ve.data):i.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe,ot,Ve.width,Ve.height,0,Ve.data):ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):q?xe&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe,0,0,Ve.width,Ve.height,Je,$e,Ve.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe,ot,Ve.width,Ve.height,0,Je,$e,Ve.data)}}}else{if(Fe=T.mipmaps,q&&Ne){Fe.length>0&&Ue++;const be=zt(Ie[0]);i.texStorage2D(r.TEXTURE_CUBE_MAP,Ue,ot,be.width,be.height)}for(let be=0;be<6;be++)if(Ge){q?xe&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,0,0,Ie[be].width,Ie[be].height,Je,$e,Ie[be].data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,ot,Ie[be].width,Ie[be].height,0,Je,$e,Ie[be].data);for(let qe=0;qe<Fe.length;qe++){const cn=Fe[qe].image[be].image;q?xe&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe+1,0,0,cn.width,cn.height,Je,$e,cn.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe+1,ot,cn.width,cn.height,0,Je,$e,cn.data)}}else{q?xe&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,0,0,Je,$e,Ie[be]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,ot,Je,$e,Ie[be]);for(let qe=0;qe<Fe.length;qe++){const Ve=Fe[qe];q?xe&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe+1,0,0,Je,$e,Ve.image[be]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+be,qe+1,ot,Je,$e,Ve.image[be])}}}M(T)&&z(r.TEXTURE_CUBE_MAP),Re.__version=he.version,T.onUpdate&&T.onUpdate(T)}P.__version=T.version}function Ze(P,T,ee,se,he,Re){const Oe=c.convert(ee.format,ee.colorSpace),de=c.convert(ee.type),pe=C(ee.internalFormat,Oe,de,ee.normalized,ee.colorSpace),De=s.get(T),Ge=s.get(ee);if(Ge.__renderTarget=T,!De.__hasExternalTextures){const Ie=Math.max(1,T.width>>Re),Pe=Math.max(1,T.height>>Re);he===r.TEXTURE_3D||he===r.TEXTURE_2D_ARRAY?i.texImage3D(he,Re,pe,Ie,Pe,T.depth,0,Oe,de,null):i.texImage2D(he,Re,pe,Ie,Pe,0,Oe,de,null)}i.bindFramebuffer(r.FRAMEBUFFER,P),un(T)?h.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,se,he,Ge.__webglTexture,0,qt(T)):(he===r.TEXTURE_2D||he>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&he<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,se,he,Ge.__webglTexture,Re),i.bindFramebuffer(r.FRAMEBUFFER,null)}function en(P,T,ee){if(r.bindRenderbuffer(r.RENDERBUFFER,P),T.depthBuffer){const se=T.depthTexture,he=se&&se.isDepthTexture?se.type:null,Re=I(T.stencilBuffer,he),Oe=T.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;un(T)?h.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,qt(T),Re,T.width,T.height):ee?r.renderbufferStorageMultisample(r.RENDERBUFFER,qt(T),Re,T.width,T.height):r.renderbufferStorage(r.RENDERBUFFER,Re,T.width,T.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Oe,r.RENDERBUFFER,P)}else{const se=T.textures;for(let he=0;he<se.length;he++){const Re=se[he],Oe=c.convert(Re.format,Re.colorSpace),de=c.convert(Re.type),pe=C(Re.internalFormat,Oe,de,Re.normalized,Re.colorSpace);un(T)?h.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,qt(T),pe,T.width,T.height):ee?r.renderbufferStorageMultisample(r.RENDERBUFFER,qt(T),pe,T.width,T.height):r.renderbufferStorage(r.RENDERBUFFER,pe,T.width,T.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function yt(P,T,ee){const se=T.isWebGLCubeRenderTarget===!0;if(i.bindFramebuffer(r.FRAMEBUFFER,P),!(T.depthTexture&&T.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const he=s.get(T.depthTexture);if(he.__renderTarget=T,(!he.__webglTexture||T.depthTexture.image.width!==T.width||T.depthTexture.image.height!==T.height)&&(T.depthTexture.image.width=T.width,T.depthTexture.image.height=T.height,T.depthTexture.needsUpdate=!0),se){if(he.__webglInit===void 0&&(he.__webglInit=!0,T.depthTexture.addEventListener("dispose",H)),he.__webglTexture===void 0){he.__webglTexture=r.createTexture(),i.bindTexture(r.TEXTURE_CUBE_MAP,he.__webglTexture),ft(r.TEXTURE_CUBE_MAP,T.depthTexture);const De=c.convert(T.depthTexture.format),Ge=c.convert(T.depthTexture.type);let Ie;T.depthTexture.format===rs?Ie=r.DEPTH_COMPONENT24:T.depthTexture.format===Tr&&(Ie=r.DEPTH24_STENCIL8);for(let Pe=0;Pe<6;Pe++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Pe,0,Ie,T.width,T.height,0,De,Ge,null)}}else Y(T.depthTexture,0);const Re=he.__webglTexture,Oe=qt(T),de=se?r.TEXTURE_CUBE_MAP_POSITIVE_X+ee:r.TEXTURE_2D,pe=T.depthTexture.format===Tr?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;if(T.depthTexture.format===rs)un(T)?h.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,pe,de,Re,0,Oe):r.framebufferTexture2D(r.FRAMEBUFFER,pe,de,Re,0);else if(T.depthTexture.format===Tr)un(T)?h.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,pe,de,Re,0,Oe):r.framebufferTexture2D(r.FRAMEBUFFER,pe,de,Re,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function Et(P){const T=s.get(P),ee=P.isWebGLCubeRenderTarget===!0;if(T.__boundDepthTexture!==P.depthTexture){const se=P.depthTexture;if(T.__depthDisposeCallback&&T.__depthDisposeCallback(),se){const he=()=>{delete T.__boundDepthTexture,delete T.__depthDisposeCallback,se.removeEventListener("dispose",he)};se.addEventListener("dispose",he),T.__depthDisposeCallback=he}T.__boundDepthTexture=se}if(P.depthTexture&&!T.__autoAllocateDepthBuffer)if(ee)for(let se=0;se<6;se++)yt(T.__webglFramebuffer[se],P,se);else{const se=P.texture.mipmaps;se&&se.length>0?yt(T.__webglFramebuffer[0],P,0):yt(T.__webglFramebuffer,P,0)}else if(ee){T.__webglDepthbuffer=[];for(let se=0;se<6;se++)if(i.bindFramebuffer(r.FRAMEBUFFER,T.__webglFramebuffer[se]),T.__webglDepthbuffer[se]===void 0)T.__webglDepthbuffer[se]=r.createRenderbuffer(),en(T.__webglDepthbuffer[se],P,!1);else{const he=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Re=T.__webglDepthbuffer[se];r.bindRenderbuffer(r.RENDERBUFFER,Re),r.framebufferRenderbuffer(r.FRAMEBUFFER,he,r.RENDERBUFFER,Re)}}else{const se=P.texture.mipmaps;if(se&&se.length>0?i.bindFramebuffer(r.FRAMEBUFFER,T.__webglFramebuffer[0]):i.bindFramebuffer(r.FRAMEBUFFER,T.__webglFramebuffer),T.__webglDepthbuffer===void 0)T.__webglDepthbuffer=r.createRenderbuffer(),en(T.__webglDepthbuffer,P,!1);else{const he=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Re=T.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,Re),r.framebufferRenderbuffer(r.FRAMEBUFFER,he,r.RENDERBUFFER,Re)}}i.bindFramebuffer(r.FRAMEBUFFER,null)}function vt(P,T,ee){const se=s.get(P);T!==void 0&&Ze(se.__webglFramebuffer,P,P.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),ee!==void 0&&Et(P)}function ht(P){const T=P.texture,ee=s.get(P),se=s.get(T);P.addEventListener("dispose",w);const he=P.textures,Re=P.isWebGLCubeRenderTarget===!0,Oe=he.length>1;if(Oe||(se.__webglTexture===void 0&&(se.__webglTexture=r.createTexture()),se.__version=T.version,d.memory.textures++),Re){ee.__webglFramebuffer=[];for(let de=0;de<6;de++)if(T.mipmaps&&T.mipmaps.length>0){ee.__webglFramebuffer[de]=[];for(let pe=0;pe<T.mipmaps.length;pe++)ee.__webglFramebuffer[de][pe]=r.createFramebuffer()}else ee.__webglFramebuffer[de]=r.createFramebuffer()}else{if(T.mipmaps&&T.mipmaps.length>0){ee.__webglFramebuffer=[];for(let de=0;de<T.mipmaps.length;de++)ee.__webglFramebuffer[de]=r.createFramebuffer()}else ee.__webglFramebuffer=r.createFramebuffer();if(Oe)for(let de=0,pe=he.length;de<pe;de++){const De=s.get(he[de]);De.__webglTexture===void 0&&(De.__webglTexture=r.createTexture(),d.memory.textures++)}if(P.samples>0&&un(P)===!1){ee.__webglMultisampledFramebuffer=r.createFramebuffer(),ee.__webglColorRenderbuffer=[],i.bindFramebuffer(r.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let de=0;de<he.length;de++){const pe=he[de];ee.__webglColorRenderbuffer[de]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,ee.__webglColorRenderbuffer[de]);const De=c.convert(pe.format,pe.colorSpace),Ge=c.convert(pe.type),Ie=C(pe.internalFormat,De,Ge,pe.normalized,pe.colorSpace,P.isXRRenderTarget===!0),Pe=qt(P);r.renderbufferStorageMultisample(r.RENDERBUFFER,Pe,Ie,P.width,P.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+de,r.RENDERBUFFER,ee.__webglColorRenderbuffer[de])}r.bindRenderbuffer(r.RENDERBUFFER,null),P.depthBuffer&&(ee.__webglDepthRenderbuffer=r.createRenderbuffer(),en(ee.__webglDepthRenderbuffer,P,!0)),i.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Re){i.bindTexture(r.TEXTURE_CUBE_MAP,se.__webglTexture),ft(r.TEXTURE_CUBE_MAP,T);for(let de=0;de<6;de++)if(T.mipmaps&&T.mipmaps.length>0)for(let pe=0;pe<T.mipmaps.length;pe++)Ze(ee.__webglFramebuffer[de][pe],P,T,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+de,pe);else Ze(ee.__webglFramebuffer[de],P,T,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+de,0);M(T)&&z(r.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(Oe){for(let de=0,pe=he.length;de<pe;de++){const De=he[de],Ge=s.get(De);let Ie=r.TEXTURE_2D;(P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(Ie=P.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(Ie,Ge.__webglTexture),ft(Ie,De),Ze(ee.__webglFramebuffer,P,De,r.COLOR_ATTACHMENT0+de,Ie,0),M(De)&&z(Ie)}i.unbindTexture()}else{let de=r.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(de=P.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(de,se.__webglTexture),ft(de,T),T.mipmaps&&T.mipmaps.length>0)for(let pe=0;pe<T.mipmaps.length;pe++)Ze(ee.__webglFramebuffer[pe],P,T,r.COLOR_ATTACHMENT0,de,pe);else Ze(ee.__webglFramebuffer,P,T,r.COLOR_ATTACHMENT0,de,0);M(T)&&z(de),i.unbindTexture()}P.depthBuffer&&Et(P)}function sn(P){const T=P.textures;for(let ee=0,se=T.length;ee<se;ee++){const he=T[ee];if(M(he)){const Re=F(P),Oe=s.get(he).__webglTexture;i.bindTexture(Re,Oe),z(Re),i.unbindTexture()}}}const pn=[],Wt=[];function rn(P){if(P.samples>0){if(un(P)===!1){const T=P.textures,ee=P.width,se=P.height;let he=r.COLOR_BUFFER_BIT;const Re=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Oe=s.get(P),de=T.length>1;if(de)for(let De=0;De<T.length;De++)i.bindFramebuffer(r.FRAMEBUFFER,Oe.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+De,r.RENDERBUFFER,null),i.bindFramebuffer(r.FRAMEBUFFER,Oe.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+De,r.TEXTURE_2D,null,0);i.bindFramebuffer(r.READ_FRAMEBUFFER,Oe.__webglMultisampledFramebuffer);const pe=P.texture.mipmaps;pe&&pe.length>0?i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Oe.__webglFramebuffer[0]):i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Oe.__webglFramebuffer);for(let De=0;De<T.length;De++){if(P.resolveDepthBuffer&&(P.depthBuffer&&(he|=r.DEPTH_BUFFER_BIT),P.stencilBuffer&&P.resolveStencilBuffer&&(he|=r.STENCIL_BUFFER_BIT)),de){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Oe.__webglColorRenderbuffer[De]);const Ge=s.get(T[De]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Ge,0)}r.blitFramebuffer(0,0,ee,se,0,0,ee,se,he,r.NEAREST),p===!0&&(pn.length=0,Wt.length=0,pn.push(r.COLOR_ATTACHMENT0+De),P.depthBuffer&&P.resolveDepthBuffer===!1&&(pn.push(Re),Wt.push(Re),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,Wt)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,pn))}if(i.bindFramebuffer(r.READ_FRAMEBUFFER,null),i.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),de)for(let De=0;De<T.length;De++){i.bindFramebuffer(r.FRAMEBUFFER,Oe.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+De,r.RENDERBUFFER,Oe.__webglColorRenderbuffer[De]);const Ge=s.get(T[De]).__webglTexture;i.bindFramebuffer(r.FRAMEBUFFER,Oe.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+De,r.TEXTURE_2D,Ge,0)}i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Oe.__webglMultisampledFramebuffer)}else if(P.depthBuffer&&P.resolveDepthBuffer===!1&&p){const T=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[T])}}}function qt(P){return Math.min(l.maxSamples,P.samples)}function un(P){const T=s.get(P);return P.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&T.__useRenderToTexture!==!1}function Q(P){const T=d.render.frame;_.get(P)!==T&&(_.set(P,T),P.update())}function Ht(P,T){const ee=P.colorSpace,se=P.format,he=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||ee!==nf&&ee!==ks&&(Pt.getTransfer(ee)===$t?(se!==ta||he!==Gi)&&ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Bt("WebGLTextures: Unsupported texture color space:",ee)),T}function zt(P){return typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement?(m.width=P.naturalWidth||P.width,m.height=P.naturalHeight||P.height):typeof VideoFrame<"u"&&P instanceof VideoFrame?(m.width=P.displayWidth,m.height=P.displayHeight):(m.width=P.width,m.height=P.height),m}this.allocateTextureUnit=B,this.resetTextureUnits=me,this.getTextureUnits=fe,this.setTextureUnits=te,this.setTexture2D=Y,this.setTexture2DArray=ce,this.setTexture3D=Se,this.setTextureCube=Ce,this.rebindTextures=vt,this.setupRenderTarget=ht,this.updateRenderTargetMipmap=sn,this.updateMultisampleRenderTarget=rn,this.setupDepthRenderbuffer=Et,this.setupFrameBufferTexture=Ze,this.useMultisampledRTT=un,this.isReversedDepthBuffer=function(){return i.buffers.depth.getReversed()}}function p3(r,e){function i(s,l=ks){let c;const d=Pt.getTransfer(l);if(s===Gi)return r.UNSIGNED_BYTE;if(s===lm)return r.UNSIGNED_SHORT_4_4_4_4;if(s===cm)return r.UNSIGNED_SHORT_5_5_5_1;if(s===q_)return r.UNSIGNED_INT_5_9_9_9_REV;if(s===Y_)return r.UNSIGNED_INT_10F_11F_11F_REV;if(s===X_)return r.BYTE;if(s===W_)return r.SHORT;if(s===ec)return r.UNSIGNED_SHORT;if(s===om)return r.INT;if(s===Ea)return r.UNSIGNED_INT;if(s===_a)return r.FLOAT;if(s===ss)return r.HALF_FLOAT;if(s===Q_)return r.ALPHA;if(s===K_)return r.RGB;if(s===ta)return r.RGBA;if(s===rs)return r.DEPTH_COMPONENT;if(s===Tr)return r.DEPTH_STENCIL;if(s===Z_)return r.RED;if(s===um)return r.RED_INTEGER;if(s===Fr)return r.RG;if(s===fm)return r.RG_INTEGER;if(s===dm)return r.RGBA_INTEGER;if(s===Qu||s===Ku||s===Zu||s===Ju)if(d===$t)if(c=e.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===Qu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Ku)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Zu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Ju)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=e.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===Qu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Ku)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Zu)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Ju)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===up||s===fp||s===dp||s===hp)if(c=e.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===up)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===fp)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===dp)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===hp)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===pp||s===mp||s===gp||s===xp||s===vp||s===ef||s===_p)if(c=e.get("WEBGL_compressed_texture_etc"),c!==null){if(s===pp||s===mp)return d===$t?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===gp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC;if(s===xp)return c.COMPRESSED_R11_EAC;if(s===vp)return c.COMPRESSED_SIGNED_R11_EAC;if(s===ef)return c.COMPRESSED_RG11_EAC;if(s===_p)return c.COMPRESSED_SIGNED_RG11_EAC}else return null;if(s===yp||s===bp||s===Sp||s===Mp||s===Ep||s===Tp||s===Ap||s===wp||s===Cp||s===Rp||s===Np||s===Dp||s===Up||s===Lp)if(c=e.get("WEBGL_compressed_texture_astc"),c!==null){if(s===yp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===bp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Sp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Mp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ep)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Tp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Ap)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===wp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Cp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Rp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Np)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Dp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Up)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Lp)return d===$t?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Op||s===Pp||s===Ip)if(c=e.get("EXT_texture_compression_bptc"),c!==null){if(s===Op)return d===$t?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Pp)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Ip)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Fp||s===zp||s===tf||s===Bp)if(c=e.get("EXT_texture_compression_rgtc"),c!==null){if(s===Fp)return c.COMPRESSED_RED_RGTC1_EXT;if(s===zp)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===tf)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Bp)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===tc?r.UNSIGNED_INT_24_8:r[s]!==void 0?r[s]:null}return{convert:i}}const m3=`
4127void main() {
4128
4129	gl_Position = vec4( position, 1.0 );
4130
4131}`,g3=`
4132uniform sampler2DArray depthColor;
4133uniform float depthWidth;
4134uniform float depthHeight;
4135
4136void main() {
4137
4138	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4139
4140	if ( coord.x >= 1.0 ) {
4141
4142		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4143
4144	} else {
4145
4146		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4147
4148	}
4149
4150}`;class x3{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,i){if(this.texture===null){const s=new oy(e.texture);(e.depthNear!==i.depthNear||e.depthFar!==i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const i=e.cameras[0].viewport,s=new ia({vertexShader:m3,fragmentShader:g3,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Ta(new hc(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class v3 extends Br{constructor(e,i){super();const s=this;let l=null,c=1,d=null,h="local-floor",p=1,m=null,_=null,v=null,g=null,b=null,A=null;const D=typeof XRWebGLBinding<"u",E=new x3,M={},z=i.getContextAttributes();let F=null,C=null;const I=[],L=[],H=new Xt;let w=null;const O=new $i;O.viewport=new Sn;const V=new $i;V.viewport=new Sn;const k=[O,V],$=new wM;let me=null,fe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let we=I[Z];return we===void 0&&(we=new Nh,I[Z]=we),we.getTargetRaySpace()},this.getControllerGrip=function(Z){let we=I[Z];return we===void 0&&(we=new Nh,I[Z]=we),we.getGripSpace()},this.getHand=function(Z){let we=I[Z];return we===void 0&&(we=new Nh,I[Z]=we),we.getHandSpace()};function te(Z){const we=L.indexOf(Z.inputSource);if(we===-1)return;const Te=I[we];Te!==void 0&&(Te.update(Z.inputSource,Z.frame,m||d),Te.dispatchEvent({type:Z.type,data:Z.inputSource}))}function B(){l.removeEventListener("select",te),l.removeEventListener("selectstart",te),l.removeEventListener("selectend",te),l.removeEventListener("squeeze",te),l.removeEventListener("squeezestart",te),l.removeEventListener("squeezeend",te),l.removeEventListener("end",B),l.removeEventListener("inputsourceschange",j);for(let Z=0;Z<I.length;Z++){const we=L[Z];we!==null&&(L[Z]=null,I[Z].disconnect(we))}me=null,fe=null,E.reset();for(const Z in M)delete M[Z];e.setRenderTarget(F),b=null,g=null,v=null,l=null,C=null,ft.stop(),s.isPresenting=!1,e.setPixelRatio(w),e.setSize(H.width,H.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Z){c=Z,s.isPresenting===!0&&ut("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Z){h=Z,s.isPresenting===!0&&ut("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||d},this.setReferenceSpace=function(Z){m=Z},this.getBaseLayer=function(){return g!==null?g:b},this.getBinding=function(){return v===null&&D&&(v=new XRWebGLBinding(l,i)),v},this.getFrame=function(){return A},this.getSession=function(){return l},this.setSession=async function(Z){if(l=Z,l!==null){if(F=e.getRenderTarget(),l.addEventListener("select",te),l.addEventListener("selectstart",te),l.addEventListener("selectend",te),l.addEventListener("squeeze",te),l.addEventListener("squeezestart",te),l.addEventListener("squeezeend",te),l.addEventListener("end",B),l.addEventListener("inputsourceschange",j),z.xrCompatible!==!0&&await i.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(H),D&&"createProjectionLayer"in XRWebGLBinding.prototype){let Te=null,ke=null,rt=null;z.depth&&(rt=z.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,Te=z.stencil?Tr:rs,ke=z.stencil?tc:Ea);const Ze={colorFormat:i.RGBA8,depthFormat:rt,scaleFactor:c};v=this.getBinding(),g=v.createProjectionLayer(Ze),l.updateRenderState({layers:[g]}),e.setPixelRatio(1),e.setSize(g.textureWidth,g.textureHeight,!1),C=new Sa(g.textureWidth,g.textureHeight,{format:ta,type:Gi,depthTexture:new Zo(g.textureWidth,g.textureHeight,ke,void 0,void 0,void 0,void 0,void 0,void 0,Te),stencilBuffer:z.stencil,colorSpace:e.outputColorSpace,samples:z.antialias?4:0,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}else{const Te={antialias:z.antialias,alpha:!0,depth:z.depth,stencil:z.stencil,framebufferScaleFactor:c};b=new XRWebGLLayer(l,i,Te),l.updateRenderState({baseLayer:b}),e.setPixelRatio(1),e.setSize(b.framebufferWidth,b.framebufferHeight,!1),C=new Sa(b.framebufferWidth,b.framebufferHeight,{format:ta,type:Gi,colorSpace:e.outputColorSpace,stencilBuffer:z.stencil,resolveDepthBuffer:b.ignoreDepthValues===!1,resolveStencilBuffer:b.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(p),m=null,d=await l.requestReferenceSpace(h),ft.setContext(l),ft.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(l!==null)return l.environmentBlendMode},this.getDepthTexture=function(){return E.getDepthTexture()};function j(Z){for(let we=0;we<Z.removed.length;we++){const Te=Z.removed[we],ke=L.indexOf(Te);ke>=0&&(L[ke]=null,I[ke].disconnect(Te))}for(let we=0;we<Z.added.length;we++){const Te=Z.added[we];let ke=L.indexOf(Te);if(ke===-1){for(let Ze=0;Ze<I.length;Ze++)if(Ze>=L.length){L.push(Te),ke=Ze;break}else if(L[Ze]===null){L[Ze]=Te,ke=Ze;break}if(ke===-1)break}const rt=I[ke];rt&&rt.connect(Te)}}const Y=new le,ce=new le;function Se(Z,we,Te){Y.setFromMatrixPosition(we.matrixWorld),ce.setFromMatrixPosition(Te.matrixWorld);const ke=Y.distanceTo(ce),rt=we.projectionMatrix.elements,Ze=Te.projectionMatrix.elements,en=rt[14]/(rt[10]-1),yt=rt[14]/(rt[10]+1),Et=(rt[9]+1)/rt[5],vt=(rt[9]-1)/rt[5],ht=(rt[8]-1)/rt[0],sn=(Ze[8]+1)/Ze[0],pn=en*ht,Wt=en*sn,rn=ke/(-ht+sn),qt=rn*-ht;if(we.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(qt),Z.translateZ(rn),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert(),rt[10]===-1)Z.projectionMatrix.copy(we.projectionMatrix),Z.projectionMatrixInverse.copy(we.projectionMatrixInverse);else{const un=en+rn,Q=yt+rn,Ht=pn-qt,zt=Wt+(ke-qt),P=Et*yt/Q*un,T=vt*yt/Q*un;Z.projectionMatrix.makePerspective(Ht,zt,P,T,un,Q),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}}function Ce(Z,we){we===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(we.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(l===null)return;let we=Z.near,Te=Z.far;E.texture!==null&&(E.depthNear>0&&(we=E.depthNear),E.depthFar>0&&(Te=E.depthFar)),$.near=V.near=O.near=we,$.far=V.far=O.far=Te,(me!==$.near||fe!==$.far)&&(l.updateRenderState({depthNear:$.near,depthFar:$.far}),me=$.near,fe=$.far),$.layers.mask=Z.layers.mask|6,O.layers.mask=$.layers.mask&-5,V.layers.mask=$.layers.mask&-3;const ke=Z.parent,rt=$.cameras;Ce($,ke);for(let Ze=0;Ze<rt.length;Ze++)Ce(rt[Ze],ke);rt.length===2?Se($,O,V):$.projectionMatrix.copy(O.projectionMatrix),Ae(Z,$,ke)};function Ae(Z,we,Te){Te===null?Z.matrix.copy(we.matrixWorld):(Z.matrix.copy(Te.matrixWorld),Z.matrix.invert(),Z.matrix.multiply(we.matrixWorld)),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.updateMatrixWorld(!0),Z.projectionMatrix.copy(we.projectionMatrix),Z.projectionMatrixInverse.copy(we.projectionMatrixInverse),Z.isPerspectiveCamera&&(Z.fov=Hp*2*Math.atan(1/Z.projectionMatrix.elements[5]),Z.zoom=1)}this.getCamera=function(){return $},this.getFoveation=function(){if(!(g===null&&b===null))return p},this.setFoveation=function(Z){p=Z,g!==null&&(g.fixedFoveation=Z),b!==null&&b.fixedFoveation!==void 0&&(b.fixedFoveation=Z)},this.hasDepthSensing=function(){return E.texture!==null},this.getDepthSensingMesh=function(){return E.getMesh($)},this.getCameraTexture=function(Z){return M[Z]};let je=null;function dt(Z,we){if(_=we.getViewerPose(m||d),A=we,_!==null){const Te=_.views;b!==null&&(e.setRenderTargetFramebuffer(C,b.framebuffer),e.setRenderTarget(C));let ke=!1;Te.length!==$.cameras.length&&($.cameras.length=0,ke=!0);for(let yt=0;yt<Te.length;yt++){const Et=Te[yt];let vt=null;if(b!==null)vt=b.getViewport(Et);else{const sn=v.getViewSubImage(g,Et);vt=sn.viewport,yt===0&&(e.setRenderTargetTextures(C,sn.colorTexture,sn.depthStencilTexture),e.setRenderTarget(C))}let ht=k[yt];ht===void 0&&(ht=new $i,ht.layers.enable(yt),ht.viewport=new Sn,k[yt]=ht),ht.matrix.fromArray(Et.transform.matrix),ht.matrix.decompose(ht.position,ht.quaternion,ht.scale),ht.projectionMatrix.fromArray(Et.projectionMatrix),ht.projectionMatrixInverse.copy(ht.projectionMatrix).invert(),ht.viewport.set(vt.x,vt.y,vt.width,vt.height),yt===0&&($.matrix.copy(ht.matrix),$.matrix.decompose($.position,$.quaternion,$.scale)),ke===!0&&$.cameras.push(ht)}const rt=l.enabledFeatures;if(rt&&rt.includes("depth-sensing")&&l.depthUsage=="gpu-optimized"&&D){v=s.getBinding();const yt=v.getDepthInformation(Te[0]);yt&&yt.isValid&&yt.texture&&E.init(yt,l.renderState)}if(rt&&rt.includes("camera-access")&&D){e.state.unbindTexture(),v=s.getBinding();for(let yt=0;yt<Te.length;yt++){const Et=Te[yt].camera;if(Et){let vt=M[Et];vt||(vt=new oy,M[Et]=vt);const ht=v.getCameraImage(Et);vt.sourceTexture=ht}}}}for(let Te=0;Te<I.length;Te++){const ke=L[Te],rt=I[Te];ke!==null&&rt!==void 0&&rt.update(ke,we,m||d)}je&&je(Z,we),we.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:we}),A=null}const ft=new uy;ft.setAnimationLoop(dt),this.setAnimationLoop=function(Z){je=Z},this.dispose=function(){}}}const _3=new Dn,xy=new xt;xy.set(-1,0,0,0,1,0,0,0,1);function y3(r,e){function i(E,M){E.matrixAutoUpdate===!0&&E.updateMatrix(),M.value.copy(E.matrix)}function s(E,M){M.color.getRGB(E.fogColor.value,ly(r)),M.isFog?(E.fogNear.value=M.near,E.fogFar.value=M.far):M.isFogExp2&&(E.fogDensity.value=M.density)}function l(E,M,z,F,C){M.isNodeMaterial?M.uniformsNeedUpdate=!1:M.isMeshBasicMaterial?c(E,M):M.isMeshLambertMaterial?(c(E,M),M.envMap&&(E.envMapIntensity.value=M.envMapIntensity)):M.isMeshToonMaterial?(c(E,M),v(E,M)):M.isMeshPhongMaterial?(c(E,M),_(E,M),M.envMap&&(E.envMapIntensity.value=M.envMapIntensity)):M.isMeshStandardMaterial?(c(E,M),g(E,M),M.isMeshPhysicalMaterial&&b(E,M,C)):M.isMeshMatcapMaterial?(c(E,M),A(E,M)):M.isMeshDepthMaterial?c(E,M):M.isMeshDistanceMaterial?(c(E,M),D(E,M)):M.isMeshNormalMaterial?c(E,M):M.isLineBasicMaterial?(d(E,M),M.isLineDashedMaterial&&h(E,M)):M.isPointsMaterial?p(E,M,z,F):M.isSpriteMaterial?m(E,M):M.isShadowMaterial?(E.color.value.copy(M.color),E.opacity.value=M.opacity):M.isShaderMaterial&&(M.uniformsNeedUpdate=!1)}function c(E,M){E.opacity.value=M.opacity,M.color&&E.diffuse.value.copy(M.color),M.emissive&&E.emissive.value.copy(M.emissive).multiplyScalar(M.emissiveIntensity),M.map&&(E.map.value=M.map,i(M.map,E.mapTransform)),M.alphaMap&&(E.alphaMap.value=M.alphaMap,i(M.alphaMap,E.alphaMapTransform)),M.bumpMap&&(E.bumpMap.value=M.bumpMap,i(M.bumpMap,E.bumpMapTransform),E.bumpScale.value=M.bumpScale,M.side===hi&&(E.bumpScale.value*=-1)),M.normalMap&&(E.normalMap.value=M.normalMap,i(M.normalMap,E.normalMapTransform),E.normalScale.value.copy(M.normalScale),M.side===hi&&E.normalScale.value.negate()),M.displacementMap&&(E.displacementMap.value=M.displacementMap,i(M.displacementMap,E.displacementMapTransform),E.displacementScale.value=M.displacementScale,E.displacementBias.value=M.displacementBias),M.emissiveMap&&(E.emissiveMap.value=M.emissiveMap,i(M.emissiveMap,E.emissiveMapTransform)),M.specularMap&&(E.specularMap.value=M.specularMap,i(M.specularMap,E.specularMapTransform)),M.alphaTest>0&&(E.alphaTest.value=M.alphaTest);const z=e.get(M),F=z.envMap,C=z.envMapRotation;F&&(E.envMap.value=F,E.envMapRotation.value.setFromMatrix4(_3.makeRotationFromEuler(C)).transpose(),F.isCubeTexture&&F.isRenderTargetTexture===!1&&E.envMapRotation.value.premultiply(xy),E.reflectivity.value=M.reflectivity,E.ior.value=M.ior,E.refractionRatio.value=M.refractionRatio),M.lightMap&&(E.lightMap.value=M.lightMap,E.lightMapIntensity.value=M.lightMapIntensity,i(M.lightMap,E.lightMapTransform)),M.aoMap&&(E.aoMap.value=M.aoMap,E.aoMapIntensity.value=M.aoMapIntensity,i(M.aoMap,E.aoMapTransform))}function d(E,M){E.diffuse.value.copy(M.color),E.opacity.value=M.opacity,M.map&&(E.map.value=M.map,i(M.map,E.mapTransform))}function h(E,M){E.dashSize.value=M.dashSize,E.totalSize.value=M.dashSize+M.gapSize,E.scale.value=M.scale}function p(E,M,z,F){E.diffuse.value.copy(M.color),E.opacity.value=M.opacity,E.size.value=M.size*z,E.scale.value=F*.5,M.map&&(E.map.value=M.map,i(M.map,E.uvTransform)),M.alphaMap&&(E.alphaMap.value=M.alphaMap,i(M.alphaMap,E.alphaMapTransform)),M.alphaTest>0&&(E.alphaTest.value=M.alphaTest)}function m(E,M){E.diffuse.value.copy(M.color),E.opacity.value=M.opacity,E.rotation.value=M.rotation,M.map&&(E.map.value=M.map,i(M.map,E.mapTransform)),M.alphaMap&&(E.alphaMap.value=M.alphaMap,i(M.alphaMap,E.alphaMapTransform)),M.alphaTest>0&&(E.alphaTest.value=M.alphaTest)}function _(E,M){E.specular.value.copy(M.specular),E.shininess.value=Math.max(M.shininess,1e-4)}function v(E,M){M.gradientMap&&(E.gradientMap.value=M.gradientMap)}function g(E,M){E.metalness.value=M.metalness,M.metalnessMap&&(E.metalnessMap.value=M.metalnessMap,i(M.metalnessMap,E.metalnessMapTransform)),E.roughness.value=M.roughness,M.roughnessMap&&(E.roughnessMap.value=M.roughnessMap,i(M.roughnessMap,E.roughnessMapTransform)),M.envMap&&(E.envMapIntensity.value=M.envMapIntensity)}function b(E,M,z){E.ior.value=M.ior,M.sheen>0&&(E.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),E.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(E.sheenColorMap.value=M.sheenColorMap,i(M.sheenColorMap,E.sheenColorMapTransform)),M.sheenRoughnessMap&&(E.sheenRoughnessMap.value=M.sheenRoughnessMap,i(M.sheenRoughnessMap,E.sheenRoughnessMapTransform))),M.clearcoat>0&&(E.clearcoat.value=M.clearcoat,E.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(E.clearcoatMap.value=M.clearcoatMap,i(M.clearcoatMap,E.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(E.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,i(M.clearcoatRoughnessMap,E.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(E.clearcoatNormalMap.value=M.clearcoatNormalMap,i(M.clearcoatNormalMap,E.clearcoatNormalMapTransform),E.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===hi&&E.clearcoatNormalScale.value.negate())),M.dispersion>0&&(E.dispersion.value=M.dispersion),M.iridescence>0&&(E.iridescence.value=M.iridescence,E.iridescenceIOR.value=M.iridescenceIOR,E.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],E.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(E.iridescenceMap.value=M.iridescenceMap,i(M.iridescenceMap,E.iridescenceMapTransform)),M.iridescenceThicknessMap&&(E.iridescenceThicknessMap.value=M.iridescenceThicknessMap,i(M.iridescenceThicknessMap,E.iridescenceThicknessMapTransform))),M.transmission>0&&(E.transmission.value=M.transmission,E.transmissionSamplerMap.value=z.texture,E.transmissionSamplerSize.value.set(z.width,z.height),M.transmissionMap&&(E.transmissionMap.value=M.transmissionMap,i(M.transmissionMap,E.transmissionMapTransform)),E.thickness.value=M.thickness,M.thicknessMap&&(E.thicknessMap.value=M.thicknessMap,i(M.thicknessMap,E.thicknessMapTransform)),E.attenuationDistance.value=M.attenuationDistance,E.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(E.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(E.anisotropyMap.value=M.anisotropyMap,i(M.anisotropyMap,E.anisotropyMapTransform))),E.specularIntensity.value=M.specularIntensity,E.specularColor.value.copy(M.specularColor),M.specularColorMap&&(E.specularColorMap.value=M.specularColorMap,i(M.specularColorMap,E.specularColorMapTransform)),M.specularIntensityMap&&(E.specularIntensityMap.value=M.specularIntensityMap,i(M.specularIntensityMap,E.specularIntensityMapTransform))}
4150function A(E,M){M.matcap&&(E.matcap.value=M.matcap)}function D(E,M){const z=e.get(M).light;E.referencePosition.value.setFromMatrixPosition(z.matrixWorld),E.nearDistance.value=z.shadow.camera.near,E.farDistance.value=z.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:l}}function b3(r,e,i,s){let l={},c={},d=[];const h=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function p(C,I){const L=I.program;s.uniformBlockBinding(C,L)}function m(C,I){let L=l[C.id];L===void 0&&(E(C),L=_(C),l[C.id]=L,C.addEventListener("dispose",z));const H=I.program;s.updateUBOMapping(C,H);const w=e.render.frame;c[C.id]!==w&&(g(C),c[C.id]=w)}function _(C){const I=v();C.__bindingPointIndex=I;const L=r.createBuffer(),H=C.__size,w=C.usage;return r.bindBuffer(r.UNIFORM_BUFFER,L),r.bufferData(r.UNIFORM_BUFFER,H,w),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,I,L),L}function v(){for(let C=0;C<h;C++)if(d.indexOf(C)===-1)return d.push(C),C;return Bt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function g(C){const I=l[C.id],L=C.uniforms,H=C.__cache;r.bindBuffer(r.UNIFORM_BUFFER,I);for(let w=0,O=L.length;w<O;w++){const V=L[w];if(Array.isArray(V))for(let k=0,$=V.length;k<$;k++)b(V[k],w,k,H);else b(V,w,0,H)}r.bindBuffer(r.UNIFORM_BUFFER,null)}function b(C,I,L,H){if(D(C,I,L,H)===!0){const w=C.__offset,O=C.value;if(Array.isArray(O)){let V=0;for(let k=0;k<O.length;k++){const $=O[k],me=M($);A($,C.__data,V),typeof $!="number"&&typeof $!="boolean"&&!$.isMatrix3&&!ArrayBuffer.isView($)&&(V+=me.storage/Float32Array.BYTES_PER_ELEMENT)}}else A(O,C.__data,0);r.bufferSubData(r.UNIFORM_BUFFER,w,C.__data)}}function A(C,I,L){typeof C=="number"||typeof C=="boolean"?I[0]=C:C.isMatrix3?(I[0]=C.elements[0],I[1]=C.elements[1],I[2]=C.elements[2],I[3]=0,I[4]=C.elements[3],I[5]=C.elements[4],I[6]=C.elements[5],I[7]=0,I[8]=C.elements[6],I[9]=C.elements[7],I[10]=C.elements[8],I[11]=0):ArrayBuffer.isView(C)?I.set(new C.constructor(C.buffer,C.byteOffset,I.length)):C.toArray(I,L)}function D(C,I,L,H){const w=C.value,O=I+"_"+L;if(H[O]===void 0)return typeof w=="number"||typeof w=="boolean"?H[O]=w:ArrayBuffer.isView(w)?H[O]=w.slice():H[O]=w.clone(),!0;{const V=H[O];if(typeof w=="number"||typeof w=="boolean"){if(V!==w)return H[O]=w,!0}else{if(ArrayBuffer.isView(w))return!0;if(V.equals(w)===!1)return V.copy(w),!0}}return!1}function E(C){const I=C.uniforms;let L=0;const H=16;for(let O=0,V=I.length;O<V;O++){const k=Array.isArray(I[O])?I[O]:[I[O]];for(let $=0,me=k.length;$<me;$++){const fe=k[$],te=Array.isArray(fe.value)?fe.value:[fe.value];for(let B=0,j=te.length;B<j;B++){const Y=te[B],ce=M(Y),Se=L%H,Ce=Se%ce.boundary,Ae=Se+Ce;L+=Ce,Ae!==0&&H-Ae<ce.storage&&(L+=H-Ae),fe.__data=new Float32Array(ce.storage/Float32Array.BYTES_PER_ELEMENT),fe.__offset=L,L+=ce.storage}}}const w=L%H;return w>0&&(L+=H-w),C.__size=L,C.__cache={},this}function M(C){const I={boundary:0,storage:0};return typeof C=="number"||typeof C=="boolean"?(I.boundary=4,I.storage=4):C.isVector2?(I.boundary=8,I.storage=8):C.isVector3||C.isColor?(I.boundary=16,I.storage=12):C.isVector4?(I.boundary=16,I.storage=16):C.isMatrix3?(I.boundary=48,I.storage=48):C.isMatrix4?(I.boundary=64,I.storage=64):C.isTexture?ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(C)?(I.boundary=16,I.storage=C.byteLength):ut("WebGLRenderer: Unsupported uniform value type.",C),I}function z(C){const I=C.target;I.removeEventListener("dispose",z);const L=d.indexOf(I.__bindingPointIndex);d.splice(L,1),r.deleteBuffer(l[I.id]),delete l[I.id],delete c[I.id]}function F(){for(const C in l)r.deleteBuffer(l[C]);d=[],l={},c={}}return{bind:p,update:m,dispose:F}}const S3=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
vendor: 17,888 bytes, line 4150
4150751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let ha=null;function M3(){return ha===null&&(ha=new pM(S3,16,16,Fr,ss),ha.name="DFG_LUT",ha.minFilter=Kn,ha.magFilter=Kn,ha.wrapS=ts,ha.wrapT=ts,ha.generateMipmaps=!1,ha.needsUpdate=!0),ha}class E3{constructor(e={}){const{canvas:i=j1(),context:s=null,depth:l=!0,stencil:c=!1,alpha:d=!1,antialias:h=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:m=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:g=!1,outputBufferType:b=Gi}=e;this.isWebGLRenderer=!0;let A;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");A=s.getContextAttributes().alpha}else A=d;const D=b,E=new Set([dm,fm,um]),M=new Set([Gi,Ea,ec,tc,lm,cm]),z=new Uint32Array(4),F=new Int32Array(4),C=new le;let I=null,L=null;const H=[],w=[];let O=null;this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ba,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const V=this;let k=!1,$=null,me=null,fe=null,te=null;this._outputColorSpace=Bi;let B=0,j=0,Y=null,ce=-1,Se=null;const Ce=new Sn,Ae=new Sn;let je=null;const dt=new Vt(0);let ft=0,Z=i.width,we=i.height,Te=1,ke=null,rt=null;const Ze=new Sn(0,0,Z,we),en=new Sn(0,0,Z,we);let yt=!1;const Et=new sy;let vt=!1,ht=!1;const sn=new Dn,pn=new le,Wt=new Sn,rn={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let qt=!1;function un(){return Y===null?Te:1}let Q=s;function Ht(R,K){return i.getContext(R,K)}try{const R={alpha:!0,depth:l,stencil:c,antialias:h,premultipliedAlpha:p,preserveDrawingBuffer:m,powerPreference:_,failIfMajorPerformanceCaveat:v};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${rm}`),i.addEventListener("webglcontextlost",cn,!1),i.addEventListener("webglcontextrestored",At,!1),i.addEventListener("webglcontextcreationerror",Zn,!1),Q===null){const K="webgl2";if(Q=Ht(K,R),Q===null)throw Ht(K)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(R){throw Bt("WebGLRenderer: "+R.message),R}let zt,P,T,ee,se,he,Re,Oe,de,pe,De,Ge,Ie,Pe,Je,$e,ot,q,Ne,xe,Ue,Fe,be;function qe(){zt=new M2(Q),zt.init(),Ue=new p3(Q,zt),P=new m2(Q,zt,e,Ue),T=new d3(Q,zt),P.reversedDepthBuffer&&g&&T.buffers.depth.setReversed(!0),me=Q.createFramebuffer(),fe=Q.createFramebuffer(),te=Q.createFramebuffer(),ee=new A2(Q),se=new JA,he=new h3(Q,zt,T,se,P,Ue,ee),Re=new S2(V),Oe=new NM(Q),Fe=new h2(Q,Oe),de=new E2(Q,Oe,ee,Fe),pe=new C2(Q,de,Oe,Fe,ee),q=new w2(Q,P,he),Je=new g2(se),De=new ZA(V,Re,zt,P,Fe,Je),Ge=new y3(V,se),Ie=new e3,Pe=new r3(zt),ot=new d2(V,Re,T,pe,A,p),$e=new f3(V,pe,P),be=new b3(Q,ee,P,T),Ne=new p2(Q,zt,ee),xe=new T2(Q,zt,ee),ee.programs=De.programs,V.capabilities=P,V.extensions=zt,V.properties=se,V.renderLists=Ie,V.shadowMap=$e,V.state=T,V.info=ee}qe(),D!==Gi&&(O=new N2(D,i.width,i.height,h,l,c));const Ve=new v3(V,Q);this.xr=Ve,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const R=zt.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=zt.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return Te},this.setPixelRatio=function(R){R!==void 0&&(Te=R,this.setSize(Z,we,!1))},this.getSize=function(R){return R.set(Z,we)},this.setSize=function(R,K,ne=!0){if(Ve.isPresenting){ut("WebGLRenderer: Can't change size while VR device is presenting.");return}Z=R,we=K,i.width=Math.floor(R*Te),i.height=Math.floor(K*Te),ne===!0&&(i.style.width=R+"px",i.style.height=K+"px"),O!==null&&O.setSize(i.width,i.height),this.setViewport(0,0,R,K)},this.getDrawingBufferSize=function(R){return R.set(Z*Te,we*Te).floor()},this.setDrawingBufferSize=function(R,K,ne){Z=R,we=K,Te=ne,i.width=Math.floor(R*ne),i.height=Math.floor(K*ne),this.setViewport(0,0,R,K)},this.setEffects=function(R){if(D===Gi){Bt("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(R){for(let K=0;K<R.length;K++)if(R[K].isOutputPass===!0){ut("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}O.setEffects(R||[])},this.getCurrentViewport=function(R){return R.copy(Ce)},this.getViewport=function(R){return R.copy(Ze)},this.setViewport=function(R,K,ne,S){R.isVector4?Ze.set(R.x,R.y,R.z,R.w):Ze.set(R,K,ne,S),T.viewport(Ce.copy(Ze).multiplyScalar(Te).round())},this.getScissor=function(R){return R.copy(en)},this.setScissor=function(R,K,ne,S){R.isVector4?en.set(R.x,R.y,R.z,R.w):en.set(R,K,ne,S),T.scissor(Ae.copy(en).multiplyScalar(Te).round())},this.getScissorTest=function(){return yt},this.setScissorTest=function(R){T.setScissorTest(yt=R)},this.setOpaqueSort=function(R){ke=R},this.setTransparentSort=function(R){rt=R},this.getClearColor=function(R){return R.copy(ot.getClearColor())},this.setClearColor=function(){ot.setClearColor(...arguments)},this.getClearAlpha=function(){return ot.getClearAlpha()},this.setClearAlpha=function(){ot.setClearAlpha(...arguments)},this.clear=function(R=!0,K=!0,ne=!0){let S=0;if(R){let U=!1;if(Y!==null){const re=Y.texture.format;U=E.has(re)}if(U){const re=Y.texture.type,Ee=M.has(re),Me=ot.getClearColor(),ze=ot.getClearAlpha(),Be=Me.r,Qe=Me.g,lt=Me.b;Ee?(z[0]=Be,z[1]=Qe,z[2]=lt,z[3]=ze,Q.clearBufferuiv(Q.COLOR,0,z)):(F[0]=Be,F[1]=Qe,F[2]=lt,F[3]=ze,Q.clearBufferiv(Q.COLOR,0,F))}else S|=Q.COLOR_BUFFER_BIT}K&&(S|=Q.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),ne&&(S|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),S!==0&&Q.clear(S)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(R){R.setRenderer(this),$=R},this.dispose=function(){i.removeEventListener("webglcontextlost",cn,!1),i.removeEventListener("webglcontextrestored",At,!1),i.removeEventListener("webglcontextcreationerror",Zn,!1),ot.dispose(),Ie.dispose(),Pe.dispose(),se.dispose(),Re.dispose(),pe.dispose(),Fe.dispose(),be.dispose(),De.dispose(),Ve.dispose(),Ve.removeEventListener("sessionstart",mn),Ve.removeEventListener("sessionend",Un),Wn.stop()};function cn(R){R.preventDefault(),bv("WebGLRenderer: Context Lost."),k=!0}function At(){bv("WebGLRenderer: Context Restored."),k=!1;const R=ee.autoReset,K=$e.enabled,ne=$e.autoUpdate,S=$e.needsUpdate,U=$e.type;qe(),ee.autoReset=R,$e.enabled=K,$e.autoUpdate=ne,$e.needsUpdate=S,$e.type=U}function Zn(R){Bt("WebGLRenderer: A WebGL context could not be created. Reason: ",R.statusMessage)}function Jn(R){const K=R.target;K.removeEventListener("dispose",Jn),pi(K)}function pi(R){$n(R),se.remove(R)}function $n(R){const K=se.get(R).programs;K!==void 0&&(K.forEach(function(ne){De.releaseProgram(ne)}),R.isShaderMaterial&&De.releaseShaderCache(R))}this.renderBufferDirect=function(R,K,ne,S,U,re){K===null&&(K=rn);const Ee=U.isMesh&&U.matrixWorld.determinantAffine()<0,Me=ra(R,K,ne,S,U);T.setMaterial(S,Ee);let ze=ne.index,Be=1;if(S.wireframe===!0){if(ze=de.getWireframeAttribute(ne),ze===void 0)return;Be=2}const Qe=ne.drawRange,lt=ne.attributes.position;let Ye=Qe.start*Be,wt=(Qe.start+Qe.count)*Be;re!==null&&(Ye=Math.max(Ye,re.start*Be),wt=Math.min(wt,(re.start+re.count)*Be)),ze!==null?(Ye=Math.max(Ye,0),wt=Math.min(wt,ze.count)):lt!=null&&(Ye=Math.max(Ye,0),wt=Math.min(wt,lt.count));const it=wt-Ye;if(it<0||it===1/0)return;Fe.setup(U,S,Me,ne,ze);let gt,tt=Ne;if(ze!==null&&(gt=Oe.get(ze),tt=xe,tt.setIndex(gt)),U.isMesh)S.wireframe===!0?(T.setLineWidth(S.wireframeLinewidth*un()),tt.setMode(Q.LINES)):tt.setMode(Q.TRIANGLES);else if(U.isLine){let Ft=S.linewidth;Ft===void 0&&(Ft=1),T.setLineWidth(Ft*un()),U.isLineSegments?tt.setMode(Q.LINES):U.isLineLoop?tt.setMode(Q.LINE_LOOP):tt.setMode(Q.LINE_STRIP)}else U.isPoints?tt.setMode(Q.POINTS):U.isSprite&&tt.setMode(Q.TRIANGLES);if(U.isBatchedMesh)if(zt.get("WEBGL_multi_draw"))tt.renderMultiDraw(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount);else{const Ft=U._multiDrawStarts,Le=U._multiDrawCounts,Tt=U._multiDrawCount,pt=ze?Oe.get(ze).bytesPerElement:1,fn=se.get(S).currentProgram.getUniforms();for(let St=0;St<Tt;St++)fn.setValue(Q,"_gl_DrawID",St),tt.render(Ft[St]/pt,Le[St])}else if(U.isInstancedMesh)tt.renderInstances(Ye,it,U.count);else if(ne.isInstancedBufferGeometry){const Ft=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,Le=Math.min(ne.instanceCount,Ft);tt.renderInstances(Ye,it,Le)}else tt.render(Ye,it)};function Aa(R,K,ne){R.transparent===!0&&R.side===es&&R.forceSinglePass===!1?(R.side=hi,R.needsUpdate=!0,ki(R,K,ne),R.side=$s,R.needsUpdate=!0,ki(R,K,ne),R.side=es):ki(R,K,ne)}this.compile=function(R,K,ne=null){ne===null&&(ne=R),L=Pe.get(ne),L.init(K),w.push(L),ne.traverseVisible(function(U){U.isLight&&U.layers.test(K.layers)&&(L.pushLight(U),U.castShadow&&L.pushShadow(U))}),R!==ne&&R.traverseVisible(function(U){U.isLight&&U.layers.test(K.layers)&&(L.pushLight(U),U.castShadow&&L.pushShadow(U))}),L.setupLights();const S=new Set;return R.traverse(function(U){if(!(U.isMesh||U.isPoints||U.isLine||U.isSprite))return;const re=U.material;if(re)if(Array.isArray(re))for(let Ee=0;Ee<re.length;Ee++){const Me=re[Ee];Aa(Me,ne,U),S.add(Me)}else Aa(re,ne,U),S.add(re)}),L=w.pop(),S},this.compileAsync=function(R,K,ne=null){const S=this.compile(R,K,ne);return new Promise(U=>{function re(){if(S.forEach(function(Ee){se.get(Ee).currentProgram.isReady()&&S.delete(Ee)}),S.size===0){U(R);return}setTimeout(re,10)}zt.get("KHR_parallel_shader_compile")!==null?re():setTimeout(re,10)})};let ls=null;function wi(R){ls&&ls(R)}function mn(){Wn.stop()}function Un(){Wn.start()}const Wn=new uy;Wn.setAnimationLoop(wi),typeof self<"u"&&Wn.setContext(self),this.setAnimationLoop=function(R){ls=R,Ve.setAnimationLoop(R),R===null?Wn.stop():Wn.start()},Ve.addEventListener("sessionstart",mn),Ve.addEventListener("sessionend",Un),this.render=function(R,K){if(K!==void 0&&K.isCamera!==!0){Bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(k===!0)return;$!==null&&$.renderStart(R,K);const ne=Ve.enabled===!0&&Ve.isPresenting===!0,S=O!==null&&(Y===null||ne)&&O.begin(V,Y);if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),Ve.enabled===!0&&Ve.isPresenting===!0&&(O===null||O.isCompositing()===!1)&&(Ve.cameraAutoUpdate===!0&&Ve.updateCamera(K),K=Ve.getCamera()),R.isScene===!0&&R.onBeforeRender(V,R,K,Y),L=Pe.get(R,w.length),L.init(K),L.state.textureUnits=he.getTextureUnits(),w.push(L),sn.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),Et.setFromProjectionMatrix(sn,ya,K.reversedDepth),ht=this.localClippingEnabled,vt=Je.init(this.clippingPlanes,ht),I=Ie.get(R,H.length),I.init(),H.push(I),Ve.enabled===!0&&Ve.isPresenting===!0){const Ee=V.xr.getDepthSensingMesh();Ee!==null&&Ci(Ee,K,-1/0,V.sortObjects)}Ci(R,K,0,V.sortObjects),I.finish(),V.sortObjects===!0&&I.sort(ke,rt,K.reversedDepth),qt=Ve.enabled===!1||Ve.isPresenting===!1||Ve.hasDepthSensing()===!1,qt&&ot.addToRenderList(I,R),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),vt===!0&&Je.beginShadows();const U=L.state.shadowsArray;if($e.render(U,R,K),vt===!0&&Je.endShadows(),(S&&O.hasRenderPass())===!1){const Ee=I.opaque,Me=I.transmissive;if(L.setupLights(),K.isArrayCamera){const ze=K.cameras;if(Me.length>0)for(let Be=0,Qe=ze.length;Be<Qe;Be++){const lt=ze[Be];us(Ee,Me,R,lt)}qt&&ot.render(R);for(let Be=0,Qe=ze.length;Be<Qe;Be++){const lt=ze[Be];cs(I,R,lt,lt.viewport)}}else Me.length>0&&us(Ee,Me,R,K),qt&&ot.render(R),cs(I,R,K)}Y!==null&&j===0&&(he.updateMultisampleRenderTarget(Y),he.updateRenderTargetMipmap(Y)),S&&O.end(V),R.isScene===!0&&R.onAfterRender(V,R,K),Fe.resetDefaultState(),ce=-1,Se=null,w.pop(),w.length>0?(L=w[w.length-1],he.setTextureUnits(L.state.textureUnits),vt===!0&&Je.setGlobalState(V.clippingPlanes,L.state.camera)):L=null,H.pop(),H.length>0?I=H[H.length-1]:I=null,$!==null&&$.renderEnd()};function Ci(R,K,ne,S){if(R.visible===!1)return;if(R.layers.test(K.layers)){if(R.isGroup)ne=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(K);else if(R.isLightProbeGrid)L.pushLightProbeGrid(R);else if(R.isLight)L.pushLight(R),R.castShadow&&L.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||Et.intersectsSprite(R)){S&&Wt.setFromMatrixPosition(R.matrixWorld).applyMatrix4(sn);const Ee=pe.update(R),Me=R.material;Me.visible&&I.push(R,Ee,Me,ne,Wt.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||Et.intersectsObject(R))){const Ee=pe.update(R),Me=R.material;if(S&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),Wt.copy(R.boundingSphere.center)):(Ee.boundingSphere===null&&Ee.computeBoundingSphere(),Wt.copy(Ee.boundingSphere.center)),Wt.applyMatrix4(R.matrixWorld).applyMatrix4(sn)),Array.isArray(Me)){const ze=Ee.groups;for(let Be=0,Qe=ze.length;Be<Qe;Be++){const lt=ze[Be],Ye=Me[lt.materialIndex];Ye&&Ye.visible&&I.push(R,Ee,Ye,ne,Wt.z,lt)}}else Me.visible&&I.push(R,Ee,Me,ne,Wt.z,null)}}const re=R.children;for(let Ee=0,Me=re.length;Ee<Me;Ee++)Ci(re[Ee],K,ne,S)}function cs(R,K,ne,S){const{opaque:U,transmissive:re,transparent:Ee}=R;L.setupLightsView(ne),vt===!0&&Je.setGlobalState(V.clippingPlanes,ne),S&&T.viewport(Ce.copy(S)),U.length>0&&aa(U,K,ne),re.length>0&&aa(re,K,ne),Ee.length>0&&aa(Ee,K,ne),T.buffers.depth.setTest(!0),T.buffers.depth.setMask(!0),T.buffers.color.setMask(!0),T.setPolygonOffset(!1)}function us(R,K,ne,S){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;if(L.state.transmissionRenderTarget[S.id]===void 0){const Ye=zt.has("EXT_color_buffer_half_float")||zt.has("EXT_color_buffer_float");L.state.transmissionRenderTarget[S.id]=new Sa(1,1,{generateMipmaps:!0,type:Ye?ss:Gi,minFilter:Er,samples:Math.max(4,P.samples),stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Pt.workingColorSpace})}const re=L.state.transmissionRenderTarget[S.id],Ee=S.viewport||Ce;re.setSize(Ee.z*V.transmissionResolutionScale,Ee.w*V.transmissionResolutionScale);const Me=V.getRenderTarget(),ze=V.getActiveCubeFace(),Be=V.getActiveMipmapLevel();V.setRenderTarget(re),V.getClearColor(dt),ft=V.getClearAlpha(),ft<1&&V.setClearColor(16777215,.5),V.clear(),qt&&ot.render(ne);const Qe=V.toneMapping;V.toneMapping=ba;const lt=S.viewport;if(S.viewport!==void 0&&(S.viewport=void 0),L.setupLightsView(S),vt===!0&&Je.setGlobalState(V.clippingPlanes,S),aa(R,ne,S),he.updateMultisampleRenderTarget(re),he.updateRenderTargetMipmap(re),zt.has("WEBGL_multisampled_render_to_texture")===!1){let Ye=!1;for(let wt=0,it=K.length;wt<it;wt++){const gt=K[wt],{object:tt,geometry:Ft,material:Le,group:Tt}=gt;if(Le.side===es&&tt.layers.test(S.layers)){const pt=Le.side;Le.side=hi,Le.needsUpdate=!0,sa(tt,ne,S,Ft,Le,Tt),Le.side=pt,Le.needsUpdate=!0,Ye=!0}}Ye===!0&&(he.updateMultisampleRenderTarget(re),he.updateRenderTargetMipmap(re))}V.setRenderTarget(Me,ze,Be),V.setClearColor(dt,ft),lt!==void 0&&(S.viewport=lt),V.toneMapping=Qe}function aa(R,K,ne){const S=K.isScene===!0?K.overrideMaterial:null;for(let U=0,re=R.length;U<re;U++){const Ee=R[U],{object:Me,geometry:ze,group:Be}=Ee;let Qe=Ee.material;Qe.allowOverride===!0&&S!==null&&(Qe=S),Me.layers.test(ne.layers
vendor: 10,716 bytes, line 4150
4150)&&sa(Me,K,ne,ze,Qe,Be)}}function sa(R,K,ne,S,U,re){R.onBeforeRender(V,K,ne,S,U,re),R.modelViewMatrix.multiplyMatrices(ne.matrixWorldInverse,R.matrixWorld),R.normalMatrix.getNormalMatrix(R.modelViewMatrix),U.onBeforeRender(V,K,ne,S,R,re),U.transparent===!0&&U.side===es&&U.forceSinglePass===!1?(U.side=hi,U.needsUpdate=!0,V.renderBufferDirect(ne,K,S,U,R,re),U.side=$s,U.needsUpdate=!0,V.renderBufferDirect(ne,K,S,U,R,re),U.side=es):V.renderBufferDirect(ne,K,S,U,R,re),R.onAfterRender(V,K,ne,S,U,re)}function ki(R,K,ne){K.isScene!==!0&&(K=rn);const S=se.get(R),U=L.state.lights,re=L.state.shadowsArray,Ee=U.state.version,Me=De.getParameters(R,U.state,re,K,ne,L.state.lightProbeGridArray),ze=De.getProgramCacheKey(Me);let Be=S.programs;S.environment=R.isMeshStandardMaterial||R.isMeshLambertMaterial||R.isMeshPhongMaterial?K.environment:null,S.fog=K.fog;const Qe=R.isMeshStandardMaterial||R.isMeshLambertMaterial&&!R.envMap||R.isMeshPhongMaterial&&!R.envMap;S.envMap=Re.get(R.envMap||S.environment,Qe),S.envMapRotation=S.environment!==null&&R.envMap===null?K.environmentRotation:R.envMapRotation,Be===void 0&&(R.addEventListener("dispose",Jn),Be=new Map,S.programs=Be);let lt=Be.get(ze);if(lt!==void 0){if(S.currentProgram===lt&&S.lightsStateVersion===Ee)return ji(R,Me),lt}else Me.uniforms=De.getUniforms(R),$!==null&&R.isNodeMaterial&&$.build(R,ne,Me),R.onBeforeCompile(Me,V),lt=De.acquireProgram(Me,ze),Be.set(ze,lt),S.uniforms=Me.uniforms;const Ye=S.uniforms;return(!R.isShaderMaterial&&!R.isRawShaderMaterial||R.clipping===!0)&&(Ye.clippingPlanes=Je.uniform),ji(R,Me),S.needsLights=Hr(R),S.lightsStateVersion=Ee,S.needsLights&&(Ye.ambientLightColor.value=U.state.ambient,Ye.lightProbe.value=U.state.probe,Ye.directionalLights.value=U.state.directional,Ye.directionalLightShadows.value=U.state.directionalShadow,Ye.spotLights.value=U.state.spot,Ye.spotLightShadows.value=U.state.spotShadow,Ye.rectAreaLights.value=U.state.rectArea,Ye.ltc_1.value=U.state.rectAreaLTC1,Ye.ltc_2.value=U.state.rectAreaLTC2,Ye.pointLights.value=U.state.point,Ye.pointLightShadows.value=U.state.pointShadow,Ye.hemisphereLights.value=U.state.hemi,Ye.directionalShadowMatrix.value=U.state.directionalShadowMatrix,Ye.spotLightMatrix.value=U.state.spotLightMatrix,Ye.spotLightMap.value=U.state.spotLightMap,Ye.pointShadowMatrix.value=U.state.pointShadowMatrix),S.lightProbeGrid=L.state.lightProbeGridArray.length>0,S.currentProgram=lt,S.uniformsList=null,lt}function Vi(R){if(R.uniformsList===null){const K=R.currentProgram.getUniforms();R.uniformsList=$u.seqWithValue(K.seq,R.uniforms)}return R.uniformsList}function ji(R,K){const ne=se.get(R);ne.outputColorSpace=K.outputColorSpace,ne.batching=K.batching,ne.batchingColor=K.batchingColor,ne.instancing=K.instancing,ne.instancingColor=K.instancingColor,ne.instancingMorph=K.instancingMorph,ne.skinning=K.skinning,ne.morphTargets=K.morphTargets,ne.morphNormals=K.morphNormals,ne.morphColors=K.morphColors,ne.morphTargetsCount=K.morphTargetsCount,ne.numClippingPlanes=K.numClippingPlanes,ne.numIntersection=K.numClipIntersection,ne.vertexAlphas=K.vertexAlphas,ne.vertexTangents=K.vertexTangents,ne.toneMapping=K.toneMapping}function wa(R,K){if(R.length===0)return null;if(R.length===1)return R[0].texture!==null?R[0]:null;C.setFromMatrixPosition(K.matrixWorld);for(let ne=0,S=R.length;ne<S;ne++){const U=R[ne];if(U.texture!==null&&U.boundingBox.containsPoint(C))return U}return null}function ra(R,K,ne,S,U){K.isScene!==!0&&(K=rn),he.resetTextureUnits();const re=K.fog,Ee=S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial?K.environment:null,Me=Y===null?V.outputColorSpace:Y.isXRRenderTarget===!0?Y.texture.colorSpace:Pt.workingColorSpace,ze=S.isMeshStandardMaterial||S.isMeshLambertMaterial&&!S.envMap||S.isMeshPhongMaterial&&!S.envMap,Be=Re.get(S.envMap||Ee,ze),Qe=S.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,lt=!!ne.attributes.tangent&&(!!S.normalMap||S.anisotropy>0),Ye=!!ne.morphAttributes.position,wt=!!ne.morphAttributes.normal,it=!!ne.morphAttributes.color;let gt=ba;S.toneMapped&&(Y===null||Y.isXRRenderTarget===!0)&&(gt=V.toneMapping);const tt=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,Ft=tt!==void 0?tt.length:0,Le=se.get(S),Tt=L.state.lights;if(vt===!0&&(ht===!0||R!==Se)){const Yt=R===Se&&S.id===ce;Je.setState(S,R,Yt)}let pt=!1;S.version===Le.__version?(Le.needsLights&&Le.lightsStateVersion!==Tt.state.version||Le.outputColorSpace!==Me||U.isBatchedMesh&&Le.batching===!1||!U.isBatchedMesh&&Le.batching===!0||U.isBatchedMesh&&Le.batchingColor===!0&&U.colorTexture===null||U.isBatchedMesh&&Le.batchingColor===!1&&U.colorTexture!==null||U.isInstancedMesh&&Le.instancing===!1||!U.isInstancedMesh&&Le.instancing===!0||U.isSkinnedMesh&&Le.skinning===!1||!U.isSkinnedMesh&&Le.skinning===!0||U.isInstancedMesh&&Le.instancingColor===!0&&U.instanceColor===null||U.isInstancedMesh&&Le.instancingColor===!1&&U.instanceColor!==null||U.isInstancedMesh&&Le.instancingMorph===!0&&U.morphTexture===null||U.isInstancedMesh&&Le.instancingMorph===!1&&U.morphTexture!==null||Le.envMap!==Be||S.fog===!0&&Le.fog!==re||Le.numClippingPlanes!==void 0&&(Le.numClippingPlanes!==Je.numPlanes||Le.numIntersection!==Je.numIntersection)||Le.vertexAlphas!==Qe||Le.vertexTangents!==lt||Le.morphTargets!==Ye||Le.morphNormals!==wt||Le.morphColors!==it||Le.toneMapping!==gt||Le.morphTargetsCount!==Ft||!!Le.lightProbeGrid!=L.state.lightProbeGridArray.length>0)&&(pt=!0):(pt=!0,Le.__version=S.version);let fn=Le.currentProgram;pt===!0&&(fn=ki(S,K,U),$&&S.isNodeMaterial&&$.onUpdateProgram(S,fn,Le));let St=!1,Mn=!1,mi=!1;const Kt=fn.getUniforms(),gn=Le.uniforms;if(T.useProgram(fn.program)&&(St=!0,Mn=!0,mi=!0),S.id!==ce&&(ce=S.id,Mn=!0),Le.needsLights){const Yt=wa(L.state.lightProbeGridArray,U);Le.lightProbeGrid!==Yt&&(Le.lightProbeGrid=Yt,Mn=!0)}if(St||Se!==R){T.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),Kt.setValue(Q,"projectionMatrix",R.projectionMatrix),Kt.setValue(Q,"viewMatrix",R.matrixWorldInverse);const oa=Kt.map.cameraPosition;oa!==void 0&&oa.setValue(Q,pn.setFromMatrixPosition(R.matrixWorld)),P.logarithmicDepthBuffer&&Kt.setValue(Q,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(S.isMeshPhongMaterial||S.isMeshToonMaterial||S.isMeshLambertMaterial||S.isMeshBasicMaterial||S.isMeshStandardMaterial||S.isShaderMaterial)&&Kt.setValue(Q,"isOrthographic",R.isOrthographicCamera===!0),Se!==R&&(Se=R,Mn=!0,mi=!0)}if(Le.needsLights&&(Tt.state.directionalShadowMap.length>0&&Kt.setValue(Q,"directionalShadowMap",Tt.state.directionalShadowMap,he),Tt.state.spotShadowMap.length>0&&Kt.setValue(Q,"spotShadowMap",Tt.state.spotShadowMap,he),Tt.state.pointShadowMap.length>0&&Kt.setValue(Q,"pointShadowMap",Tt.state.pointShadowMap,he)),U.isSkinnedMesh){Kt.setOptional(Q,U,"bindMatrix"),Kt.setOptional(Q,U,"bindMatrixInverse");const Yt=U.skeleton;Yt&&(Yt.boneTexture===null&&Yt.computeBoneTexture(),Kt.setValue(Q,"boneTexture",Yt.boneTexture,he))}U.isBatchedMesh&&(Kt.setOptional(Q,U,"batchingTexture"),Kt.setValue(Q,"batchingTexture",U._matricesTexture,he),Kt.setOptional(Q,U,"batchingIdTexture"),Kt.setValue(Q,"batchingIdTexture",U._indirectTexture,he),Kt.setOptional(Q,U,"batchingColorTexture"),U._colorsTexture!==null&&Kt.setValue(Q,"batchingColorTexture",U._colorsTexture,he));const Xi=ne.morphAttributes;if((Xi.position!==void 0||Xi.normal!==void 0||Xi.color!==void 0)&&q.update(U,ne,fn),(Mn||Le.receiveShadow!==U.receiveShadow)&&(Le.receiveShadow=U.receiveShadow,Kt.setValue(Q,"receiveShadow",U.receiveShadow)),(S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial)&&S.envMap===null&&K.environment!==null&&(gn.envMapIntensity.value=K.environmentIntensity),gn.dfgLUT!==void 0&&(gn.dfgLUT.value=M3()),Mn){if(Kt.setValue(Q,"toneMappingExposure",V.toneMappingExposure),Le.needsLights&&mt(gn,mi),re&&S.fog===!0&&Ge.refreshFogUniforms(gn,re),Ge.refreshMaterialUniforms(gn,S,Te,we,L.state.transmissionRenderTarget[R.id]),Le.needsLights&&Le.lightProbeGrid){const Yt=Le.lightProbeGrid;gn.probesSH.value=Yt.texture,gn.probesMin.value.copy(Yt.boundingBox.min),gn.probesMax.value.copy(Yt.boundingBox.max),gn.probesResolution.value.copy(Yt.resolution)}$u.upload(Q,Vi(Le),gn,he)}if(S.isShaderMaterial&&S.uniformsNeedUpdate===!0&&($u.upload(Q,Vi(Le),gn,he),S.uniformsNeedUpdate=!1),S.isSpriteMaterial&&Kt.setValue(Q,"center",U.center),Kt.setValue(Q,"modelViewMatrix",U.modelViewMatrix),Kt.setValue(Q,"normalMatrix",U.normalMatrix),Kt.setValue(Q,"modelMatrix",U.matrixWorld),S.uniformsGroups!==void 0){const Yt=S.uniformsGroups;for(let oa=0,fs=Yt.length;oa<fs;oa++){const er=Yt[oa];be.update(er,fn),be.bind(er,fn)}}return fn}function mt(R,K){R.ambientLightColor.needsUpdate=K,R.lightProbe.needsUpdate=K,R.directionalLights.needsUpdate=K,R.directionalLightShadows.needsUpdate=K,R.pointLights.needsUpdate=K,R.pointLightShadows.needsUpdate=K,R.spotLights.needsUpdate=K,R.spotLightShadows.needsUpdate=K,R.rectAreaLights.needsUpdate=K,R.hemisphereLights.needsUpdate=K}function Hr(R){return R.isMeshLambertMaterial||R.isMeshToonMaterial||R.isMeshPhongMaterial||R.isMeshStandardMaterial||R.isShadowMaterial||R.isShaderMaterial&&R.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return j},this.getRenderTarget=function(){return Y},this.setRenderTargetTextures=function(R,K,ne){const S=se.get(R);S.__autoAllocateDepthBuffer=R.resolveDepthBuffer===!1,S.__autoAllocateDepthBuffer===!1&&(S.__useRenderToTexture=!1),se.get(R.texture).__webglTexture=K,se.get(R.depthTexture).__webglTexture=S.__autoAllocateDepthBuffer?void 0:ne,S.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(R,K){const ne=se.get(R);ne.__webglFramebuffer=K,ne.__useDefaultFramebuffer=K===void 0},this.setRenderTarget=function(R,K=0,ne=0){Y=R,B=K,j=ne;let S=null,U=!1,re=!1;if(R){const Me=se.get(R);if(Me.__useDefaultFramebuffer!==void 0){T.bindFramebuffer(Q.FRAMEBUFFER,Me.__webglFramebuffer),Ce.copy(R.viewport),Ae.copy(R.scissor),je=R.scissorTest,T.viewport(Ce),T.scissor(Ae),T.setScissorTest(je),ce=-1;return}else if(Me.__webglFramebuffer===void 0)he.setupRenderTarget(R);else if(Me.__hasExternalTextures)he.rebindTextures(R,se.get(R.texture).__webglTexture,se.get(R.depthTexture).__webglTexture);else if(R.depthBuffer){const Qe=R.depthTexture;if(Me.__boundDepthTexture!==Qe){if(Qe!==null&&se.has(Qe)&&(R.width!==Qe.image.width||R.height!==Qe.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");he.setupDepthRenderbuffer(R)}}const ze=R.texture;(ze.isData3DTexture||ze.isDataArrayTexture||ze.isCompressedArrayTexture)&&(re=!0);const Be=se.get(R).__webglFramebuffer;
vendor: 4,796 bytes, line 4150
4150R.isWebGLCubeRenderTarget?(Array.isArray(Be[K])?S=Be[K][ne]:S=Be[K],U=!0):R.samples>0&&he.useMultisampledRTT(R)===!1?S=se.get(R).__webglMultisampledFramebuffer:Array.isArray(Be)?S=Be[ne]:S=Be,Ce.copy(R.viewport),Ae.copy(R.scissor),je=R.scissorTest}else Ce.copy(Ze).multiplyScalar(Te).floor(),Ae.copy(en).multiplyScalar(Te).floor(),je=yt;if(ne!==0&&(S=me),T.bindFramebuffer(Q.FRAMEBUFFER,S)&&T.drawBuffers(R,S),T.viewport(Ce),T.scissor(Ae),T.setScissorTest(je),U){const Me=se.get(R.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+K,Me.__webglTexture,ne)}else if(re){const Me=K;for(let ze=0;ze<R.textures.length;ze++){const Be=se.get(R.textures[ze]);Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0+ze,Be.__webglTexture,ne,Me)}}else if(R!==null&&ne!==0){const Me=se.get(R.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,Me.__webglTexture,ne)}ce=-1},this.readRenderTargetPixels=function(R,K,ne,S,U,re,Ee,Me=0){if(!(R&&R.isWebGLRenderTarget)){Bt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ze=se.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ee!==void 0&&(ze=ze[Ee]),ze){T.bindFramebuffer(Q.FRAMEBUFFER,ze);try{const Be=R.textures[Me],Qe=Be.format,lt=Be.type;if(R.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+Me),!P.textureFormatReadable(Qe)){Bt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!P.textureTypeReadable(lt)){Bt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=R.width-S&&ne>=0&&ne<=R.height-U&&Q.readPixels(K,ne,S,U,Ue.convert(Qe),Ue.convert(lt),re)}finally{const Be=Y!==null?se.get(Y).__webglFramebuffer:null;T.bindFramebuffer(Q.FRAMEBUFFER,Be)}}},this.readRenderTargetPixelsAsync=async function(R,K,ne,S,U,re,Ee,Me=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ze=se.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ee!==void 0&&(ze=ze[Ee]),ze)if(K>=0&&K<=R.width-S&&ne>=0&&ne<=R.height-U){T.bindFramebuffer(Q.FRAMEBUFFER,ze);const Be=R.textures[Me],Qe=Be.format,lt=Be.type;if(R.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+Me),!P.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!P.textureTypeReadable(lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ye=Q.createBuffer();Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ye),Q.bufferData(Q.PIXEL_PACK_BUFFER,re.byteLength,Q.STREAM_READ),Q.readPixels(K,ne,S,U,Ue.convert(Qe),Ue.convert(lt),0);const wt=Y!==null?se.get(Y).__webglFramebuffer:null;T.bindFramebuffer(Q.FRAMEBUFFER,wt);const it=Q.fenceSync(Q.SYNC_GPU_COMMANDS_COMPLETE,0);return Q.flush(),await X1(Q,it,4),Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ye),Q.getBufferSubData(Q.PIXEL_PACK_BUFFER,0,re),Q.deleteBuffer(Ye),Q.deleteSync(it),re}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,K=null,ne=0){const S=Math.pow(2,-ne),U=Math.floor(R.image.width*S),re=Math.floor(R.image.height*S),Ee=K!==null?K.x:0,Me=K!==null?K.y:0;he.setTexture2D(R,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,ne,0,0,Ee,Me,U,re),T.unbindTexture()},this.copyTextureToTexture=function(R,K,ne=null,S=null,U=0,re=0){let Ee,Me,ze,Be,Qe,lt,Ye,wt,it;const gt=R.isCompressedTexture?R.mipmaps[re]:R.image;if(ne!==null)Ee=ne.max.x-ne.min.x,Me=ne.max.y-ne.min.y,ze=ne.isBox3?ne.max.z-ne.min.z:1,Be=ne.min.x,Qe=ne.min.y,lt=ne.isBox3?ne.min.z:0;else{const gn=Math.pow(2,-U);Ee=Math.floor(gt.width*gn),Me=Math.floor(gt.height*gn),R.isDataArrayTexture?ze=gt.depth:R.isData3DTexture?ze=Math.floor(gt.depth*gn):ze=1,Be=0,Qe=0,lt=0}S!==null?(Ye=S.x,wt=S.y,it=S.z):(Ye=0,wt=0,it=0);const tt=Ue.convert(K.format),Ft=Ue.convert(K.type);let Le;K.isData3DTexture?(he.setTexture3D(K,0),Le=Q.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(he.setTexture2DArray(K,0),Le=Q.TEXTURE_2D_ARRAY):(he.setTexture2D(K,0),Le=Q.TEXTURE_2D),T.activeTexture(Q.TEXTURE0),T.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,K.flipY),T.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),T.pixelStorei(Q.UNPACK_ALIGNMENT,K.unpackAlignment);const Tt=T.getParameter(Q.UNPACK_ROW_LENGTH),pt=T.getParameter(Q.UNPACK_IMAGE_HEIGHT),fn=T.getParameter(Q.UNPACK_SKIP_PIXELS),St=T.getParameter(Q.UNPACK_SKIP_ROWS),Mn=T.getParameter(Q.UNPACK_SKIP_IMAGES);T.pixelStorei(Q.UNPACK_ROW_LENGTH,gt.width),T.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,gt.he
4150ight),T.pixelStorei(Q.UNPACK_SKIP_PIXELS,Be),T.pixelStorei(Q.UNPACK_SKIP_ROWS,Qe),T.pixelStorei(Q.UNPACK_SKIP_IMAGES,lt);const mi=R.isDataArrayTexture||R.isData3DTexture,Kt=K.isDataArrayTexture||K.isData3DTexture;if(R.isDepthTexture){const gn=se.get(R),Xi=se.get(K),Yt=se.get(gn.__renderTarget),oa=se.get(Xi.__renderTarget);T.bindFramebuffer(Q.READ_FRAMEBUFFER,Yt.__webglFramebuffer),T.bindFramebuffer(Q.DRAW_FRAMEBUFFER,oa.__webglFramebuffer);for(let fs=0;fs<ze;fs++)mi&&(Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,se.get(R).__webglTexture,U,lt+fs),Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,se.get(K).__webglTexture,re,it+fs)),Q.blitFramebuffer(Be,Qe,Ee,Me,Ye,wt,Ee,Me,Q.DEPTH_BUFFER_BIT,Q.NEAREST);T.bindFramebuffer(Q.READ_FRAMEBUFFER,null),T.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else if(U!==0||R.isRenderTargetTexture||se.has(R)){const gn=se.get(R),Xi=se.get(K);T.bindFramebuffer(Q.READ_FRAMEBUFFER,fe),T.bindFramebuffer(Q.DRAW_FRAMEBUFFER,te);for(let Yt=0;Yt<ze;Yt++)mi?Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,gn.__webglTexture,U,lt+Yt):Q.framebufferTexture2D(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,gn.__webglTexture,U),Kt?Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Xi.__webglTexture,re,it+Yt):Q.framebufferTexture2D(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,Xi.__webglTexture,re),U!==0?Q.blitFramebuffer(Be,Qe,Ee,Me,Ye,wt,Ee,Me,Q.COLOR_BUFFER_BIT,Q.NEAREST):Kt?Q.copyTexSubImage3D(Le,re,Ye,wt,it+Yt,Be,Qe,Ee,Me):Q.copyTexSubImage2D(Le,re,Ye,wt,Be,Qe,Ee,Me);T.bindFramebuffer(Q.READ_FRAMEBUFFER,null),T.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else Kt?R.isDataTexture||R.isData3DTexture?Q.texSubImage3D(Le,re,Ye,wt,it,Ee,Me,ze,tt,Ft,gt.data):K.isCompressedArrayTexture?Q.compressedTexSubImage3D(Le,re,Ye,wt,it,Ee,Me,ze,tt,gt.data):Q.texSubImage3D(Le,re,Ye,wt,it,Ee,Me,ze,tt,Ft,gt):R.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,re,Ye,wt,Ee,Me,tt,Ft,gt.data):R.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,re,Ye,wt,gt.width,gt.height,tt,gt.data):Q.texSubImage2D(Q.TEXTURE_2D,re,Ye,wt,Ee,Me,tt,Ft,gt);T.pixelStorei(Q.UNPACK_ROW_LENGTH,Tt),T.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,pt),T.pixelStorei(Q.UNPACK_SKIP_PIXELS,fn),T.pixelStorei(Q.UNPACK_SKIP_ROWS,St),T.pixelStorei(Q.UNPACK_SKIP_IMAGES,Mn),re===0&&K.generateMipmaps&&Q.generateMipmap(Le),T.unbindTexture()},this.initRenderTarget=function(R){se.get(R).__webglFramebuffer===void 0&&he.setupRenderTarget(R)},this.initTexture=function(R){R.isCubeTexture?he.setTextureCube(R,0):R.isData3DTexture?he.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?he.setTexture2DArray(R,0):he.setTexture2D(R,0),T.unbindTexture()},this.resetState=function(){B=0,j=0,Y=null,T.reset(),Fe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ya}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const i=this.getContext();i.drawingBufferColorSpace=Pt._getDrawingBufferColorSpace(e),i.unpackColorSpace=Pt._getUnpackColorSpace()}}const T3=`
4151varying vec2 vUv;
4152varying vec3 vPosition;
4153
4154void main() {
4155  vPosition = position;
4156  vUv = uv;
4157  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4158}
4159`,A3=`
4160varying vec2 vUv;
4161varying vec3 vPosition;
4162
4163uniform float uTime;
4164uniform vec3  uColor;
4165uniform float uSpeed;
4166uniform float uScale;
4167uniform float uRotation;
4168uniform float uNoiseIntensity;
4169
4170const float e = 2.71828182845904523536;
4171
4172float noise(vec2 texCoord) {
4173  float G = e;
4174  vec2  r = (G * sin(G * texCoord));
4175  return fract(r.x * r.y * (1.0 + texCoord.x));
4176}
4177
4178vec2 rotateUvs(vec2 uv, float angle) {
4179  float c = cos(angle);
4180  float s = sin(angle);
4181  mat2  rot = mat2(c, -s, s, c);
4182  return rot * uv;
4183}
4184
4185void main() {
4186  float rnd        = noise(gl_FragCoord.xy);
4187  vec2  uv         = rotateUvs(vUv * uScale, uRotation);
4188  vec2  tex        = uv * uScale;
4189  float tOffset    = uSpeed * uTime;
4190
4191  tex.y += 0.03 * sin(8.0 * tex.x - tOffset);
4192
4193  float pattern = 0.6 +
4194                  0.4 * sin(5.0 * (tex.x + tex.y +
4195                                   cos(3.0 * tex.x + 5.0 * tex.y) +
4196                                   0.02 * tOffset) +
4197                           sin(20.0 * (tex.x + tex.y - 0.1 * tOffset)));
4198
4199  vec4 col = vec4(uColor, 1.0) * vec4(pattern) - rnd / 15.0 * uNoiseIntensity;
4200  col.a = 1.0;
4201  gl_FragColor = col;
4202}
4203`;function u_(r){try{const e=new Vt(r);return[e.r,e.g,e.b]}catch{return[.48,.45,.5]}}const w3=({speed:r=5,scale:e=1,color:i="#7B7481",noiseIntensity:s=1.5,rotation:l=0,className:c="",style:d={}})=>{const h=ye.useRef(null),p=ye.useRef(null);return ye.useEffect(()=>{p.current&&(p.current.uSpeed.value=r,p.current.uScale.value=e,p.current.uNoiseIntensity.value=s,p.current.uRotation.value=l,p.current.uColor.value.setRGB(...u_(i)))},[r,e,i,s,l]),ye.useEffect(()=>{const m=h.current;if(!m)return;const _=new E3({alpha:!0,antialias:!1,depth:!1,stencil:!1,powerPreference:"low-power",precision:"mediump"});_.setPixelRatio(Math.min(window.devicePixelRatio,1.25)),_.setSize(m.clientWidth||300,m.clientHeight||300),m.appendChild(_.domElement);const v=new oM,g=new xm(-.5,.5,.5,-.5,-1,1),b=u_(i),A={uSpeed:{value:r},uScale:{value:e},uNoiseIntensity:{value:s},uColor:{value:new Vt(...b)},uRotation:{value:l},uTime:{value:0}};p.current=A;const D=new hc(1,1,1,1),E=new ia({uniforms:A,vertexShader:T3,fragmentShader:A3,depthWrite:!1,depthTest:!1}),M=new Ta(D,E);v.add(M);const z=()=>{m&&_.setSize(m.clientWidth,m.clientHeight)},F=new ResizeObserver(z);F.observe(m);const C=new CM;let I=0,L=!0,H=0;const w=1e3/30,O=k=>{if(!L)return;I=requestAnimationFrame(O);const $=k-H;$>w&&(H=k-$%w,A.uTime.value+=.1*C.getDelta(),_.render(v,g))},V=new IntersectionObserver(([k])=>{L=k.isIntersecting,L&&(cancelAnimationFrame(I),I=requestAnimationFrame(O))},{threshold:.05});return V.observe(m),I=requestAnimationFrame(O),()=>{cancelAnimationFrame(I),V.disconnect(),F.disconnect(),D.dispose(),E.dispose(),_.dispose(),_.domElement.parentNode===m&&m.removeChild(_.domElement),p.current=null}},[]),x.jsx("div",{ref:h,className:`relative w-full h-full ${c}`,style:{overflow:"hidden",...d}})},C3=({onShopClick:r,onHomeClick:e,onFAQClick:i,onBlogsClick:s,onEventBlogsClick:l,onAdminClick:c,onJourneyClick:d,onPrivacyClick:h,onTermsClick:p,onRefundClick:m,onShippingClick:_,onDistributorClick:v})=>{const g=ye.useRef(null),[b,A]=ye.useState(null),D=z=>{window.innerWidth>=1024||A(b===z?null:z)},E=()=>{window.scrollTo({top:0,behavior:"smooth"})};ye.useEffect(()=>{const z=g.current;if(!z)return;const F=z.querySelectorAll(".marquee-horizontal-panel-alternate-01");F.length&&Za.to(F,{xPercent:-100,repeat:-1,duration:20,ease:"none"})},[]);const M=({title:z,id:F,children:C})=>{const I=b===F;return x.jsxs("div",{className:"lg:border-none w-full flex flex-col items-start px-0",children:[x.jsxs("button",{onClick:()=>D(F),className:"w-full flex items-center justify-start py-1.5 lg:py-0 lg:mb-4 text-left focus:outline-none group px-0 m-0",children:[x.jsx("div",{className:"font-bold !text-secondary text-xl lg:text-2xl uppercase tracking-wider [word-spacing:0.02em] font-anton leading-tight text-left p-0 m-0",children:z}),x.jsx("span",{className:`lg:hidden transition-transform duration-300 ml-2 ${I?"rotate-180":""}`,children:x.jsx("i",{className:"fa-solid fa-chevron-down text-white/50 text-xs"})})]}),x.jsx(na.div,{initial:!1,animate:{height:I?"auto":0,opacity:I?1:0},transition:{duration:.3,ease:"easeInOut"},className:"w-full overflow-hidden lg:!h-auto lg:!opacity-100",children:x.jsx("div",{className:"pt-3 lg:pt-4 flex flex-col items-start w-full p-0 m-0 pb-3 lg:pb-0",children:C})})]})};return x.jsxs("div",{className:"relative w-full overflow-hidden",children:[x.jsx("div",{className:"absolute inset-0 w-full h-full z-0 pointer-events-none opacity-100",children:x.jsx(w3,{speed:4,scale:1,color:"#188a67",noiseIntensity:1.2,rotation:0})}),x.jsx("div",{className:"relative z-30 w-full overflow-hidden pointer-events-none",style:{height:"140px",marginBottom:"-1px"},children:x.jsx(u1,{inverseBg:"#f2f2ec",className:"flex items-end h-full"})}),x.jsx("section",{className:"section relative z-20 overflow-hidden bg-transparent",children:x.jsxs("div",{className:"!bg-transparent !mt-0 !max-w-7xl mx-auto px-4 !pt-10 pb-28 lg:!pb-10 font-satoshi relative z-10 w-full text-left items-start",children:[x.jsxs("div",{className:"flex flex-col md:flex-row gap-x-12 lg:gap-x-24 gap-y-12 items-start text-left w-full relative",children:[x.jsxs("div",{className:"flex-shrink-0 flex flex-col items-start text-left gap-6 max-w-xs",children:[x.jsx("button",{onClick:e,className:"block h-12 lg:h-16 transition-transform hover:scale-105",children:x.jsx("img",{src:"/logos/Pinobite-logo.png",className:"h-full w-auto object-contain brightness-0 invert"})}),x.jsx("p",{className:"text-white/80 text-sm leading-relaxed text-left",children:"Pinobite is a group of modern healthy snack specialists transforming your daily energy intake with handcrafted, nutritious muesli and peanut butter."}),x.jsxs("div",{className:"flex gap-4 mt-2 justify-start w-full",children:[x.jsx("a",{href:"https://www.facebook.com/profile.php?id=61574254086582",target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full border border-white/20 flex items-center justify-center text-white hover:bg-secondary hover:text-slate-900 hover:border-secondary transition-all duration-300",children:x.jsx("i",{className:"fa-brands fa-facebook-f"})}),x.jsx("a",{href:"https://www.instagram.com/pino.bite/",target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full border border-white/20 flex items-center justify-center text-white hover:bg-secondary hover:text-slate-900 hover:border-secondary transition-all duration-300",children:x.jsx("i",{className:"fa-brands fa-instagram"})})]})]}),x.jsxs("div",{className:"flex-grow grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-x-8 lg:gap-x-12 gap-y-1 md:gap-y-8 lg:gap-y-12 text-left items-start",children:[x.jsx(M,{title:"Collections",id:"collections",children:x.jsxs("ul",{className:"flex flex-col items-start gap-4 text-sm text-white/70 font-medium list-none !p-0 !m-0 w-full text-left",children:[x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:()=>r(),className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Shop All"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:()=>r("Peanut Butter"),className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Peanut Butter"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:()=>r("Muesli"),className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Healthy Muesli"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:()=>r("Oats"),className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Healthy Oats"})})]})}),x.jsx(M,{title:"Resources",id:"resources",children:x.jsxs("ul",{className:"flex flex-col items-start gap-4 text-sm text-white/70 font-medium list-none !p-0 !m-0 w-full text-left",children:[x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:i,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"FAQ's"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:_,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Shipping Info"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:m,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Refund Policy"})})]})}),x.jsx(M,{title:"Partners",id:"partners",children:x.jsxs("ul",{className:"flex flex-col items-start gap-4 text-sm text-white/70 font-medium list-none !p-0 !m-0 w-full text-left",children:[x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:v,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Distributors"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:c,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Admin Login"})})]})}),x.jsx(M,{title:"Company",id:"company",children:x.jsxs("ul",{className:"flex flex-col items-start gap-4 text-sm text-white/70 font-medium list-none !p-0 !m-0 w-full text-left",children:[x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:d,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"About Us"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:s,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Healthy Blog"})}),x.jsx("li",{className:"w-full text-left !p-0 !m-0 flex",children:x.jsx("button",{onClick:l,className:"hover:text-secondary transition-colors cursor-pointer text-left uppercase tracking-tight block w-full mb-0 !p-0 !m-0 !pl-0",children:"Events & News"})})]})})]}),x.jsx("button",{onClick:E,className:"lg:hidden absolute bottom-[-4rem] right-4 w-12 h-12 bg-[#9cd92a] rounded-full flex items-center justify-center shadow-lg active:scale-90 transition-transform z-20",children:x.jsx("i",{className:"fa-solid fa-arrow-up text-[#228b44]"})})]}),x.jsx("div",{className:"border-t border-white/5 pt-10 pb-10",children:x.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-center gap-8 md:gap-16",children:[x.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-4 text-white hover:text-white/80 transition-colors text-sm md:text-base",children:[x.jsx("i",{className:"fa-solid fa-phone text-[#f9bc15] text-xl"}),x.jsx("a",{href:"tel:+919328173747",className:"font-medium tracking-wide",children:"+91 9328173747"})]}),x.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-4 text-white hover:text-white/80 transition-colors text-sm md:text-base text-center md:text-left",children:[x.jsx("i",{className:"fa-solid fa-location-dot text-[#f9bc15] text-xl"}),x.jsx("a",{href:"https://maps.app.goo.gl/m21Carqf53eYqKaVA",target:"_blank",rel:"noopener noreferrer",className:"font-medium tracking-wide hover:underline cursor-pointer text-center",children:"Tri-origin Ayurveda, Sathod Vasahat, Sathod Road, Dabhoi-391110, Vadodara - Gujarat"})]})]})}),x.jsxs("div",{className:"border-t border-white/5 pt-10 flex flex-col md:flex-row justify-between items-center gap-6 text-xs text-white/60",children:[x.jsx("p",{className:"text-center md:text-left",children:"© 2026 Pinobite. All Rights Reserved."}),x.jsxs("div",{className:"flex gap-6 sm:gap-8 justify-center",children:[x.jsx("button",{onClick:p,className:"hover:text-white transition-colors cursor-pointer",children:"Terms"}),x.jsx("button",{onClick:h,className:"hover:text-white transition-colors cursor-pointer",children:"Privacy"}),x.jsx("button",{className:"hover:text-white transition-colors cursor-pointer",children:"Cookies"}),x.jsx("button",{className:"hover:text-white transition-colors cursor-pointer",children:"Sitemap"})]})]})]})})]})},R3=()=>{const[r,e]=ye.useState([]);return ye.useEffect(()=>{const i=s=>{const l={id:Math.random().toString(36).substr(2,9),points:s.detail.points,message:s.detail.message||"Points Earned!"};e(c=>[...c,l]),setTimeout(()=>{e(c=>c.filter(d=>d.id!==l.id))},5e3)};return window.addEventListener("reward-earned",i),()=>window.removeEventListener("reward-earned",i)},[]),x.jsxs("
4203div",{className:"fixed top-6 right-6 z-[9999] flex flex-col gap-4 pointer-events-none",children:[x.jsx(Yo,{children:r.map(i=>x.jsxs(na.div,{initial:{opacity:0,x:50,scale:.8},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,scale:.5,transition:{duration:.2}},className:"bg-slate-900 text-white p-4 rounded-2xl shadow-2xl flex items-center gap-4 min-w-[200px] border border-white/10 pointer-events-auto overflow-hidden relative",children:[x.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/20 blur-3xl -mr-12 -mt-12 rounded-full"}),x.jsx("div",{className:"relative",children:x.jsx("div",{className:"w-12 h-12 bg-secondary text-slate-900 rounded-full flex items-center justify-center font-black text-xl shadow-lg ring-4 ring-secondary/20 animate-bounce",children:"🪙"})}),x.jsxs("div",{className:"flex-1",children:[x.jsx("p",{className:"text-[10px] font-bold text-secondary uppercase tracking-widest leading-none mb-1",children:"PinoPoints Reward"}),x.jsxs("h4",{className:"text-lg font-black leading-none",children:["+",i.points," PTS"]}),x.jsx("p",{className:"text-[10px] text-slate-400 font-medium mt-1 truncate max-w-[150px]",children:i.message})]}),x.jsx("div",{className:"absolute bottom-0 left-0 h-1 bg-secondary w-full origin-left animate-timer"})]},i.id))}),x.jsx("style",{dangerouslySetInnerHTML:{__html:`
4204        @keyframes timer {
4205          from { transform: scaleX(1); }
4206          to { transform: scaleX(0); }
4207        }
4208        .animate-timer {
4209          animation: timer 5s linear forwards;
4210        }
4211      `}})]})},N3=(r,e)=>{const i=new CustomEvent("reward-earned",{detail:{points:r,message:e}});window.dispatchEvent(i)},vy=ye.createContext(void 0),D3=()=>{const r=ye.useContext(vy);if(!r)throw new Error("useToast must be used within a ToastProvider");return r},U3=({children:r})=>{const[e,i]=ye.useState([]),s=(c,d="info")=>{const h=Date.now().toString();i(p=>[...p,{id:h,message:c,type:d}]),setTimeout(()=>{l(h)},5e3)},l=c=>{i(d=>d.filter(h=>h.id!==c))};return x.jsxs(vy.Provider,{value:{showToast:s},children:[r,x.jsx("div",{className:"fixed top-6 right-6 z-[9999] flex flex-col gap-3 pointer-events-none",children:x.jsx(Yo,{children:e.map(c=>x.jsxs(na.div,{initial:{opacity:0,x:50,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,scale:.9,transition:{duration:.2}},className:`pointer-events-auto min-w-[300px] max-w-md bg-white rounded-2xl shadow-2xl border-l-4 p-4 flex items-center gap-4 overflow-hidden relative group ${c.type==="success"?"border-green-500":c.type==="error"?"border-red-500":c.type==="warning"?"border-orange-500":"border-primary"}`,children:[x.jsx("div",{className:"absolute inset-0 bg-slate-50/50 -z-10 group-hover:bg-slate-100/50 transition-colors"}),x.jsx(na.div,{initial:{width:"100%"},animate:{width:"0%"},transition:{duration:5,ease:"linear"},className:`absolute bottom-0 left-0 h-1 ${c.type==="success"?"bg-green-500/30":c.type==="error"?"bg-red-500/30":c.type==="warning"?"bg-orange-500/30":"bg-primary/30"}`}),x.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 ${c.type==="success"?"bg-green-100 text-green-600":c.type==="error"?"bg-red-100 text-red-600":c.type==="warning"?"bg-orange-100 text-orange-600":"bg-blue-100 text-primary"}`,children:x.jsx("span",{className:"material-symbols-outlined text-xl",children:c.type==="success"?"check_circle":c.type==="error"?"error":c.type==="warning"?"warning":"info"})}),x.jsx("div",{className:"flex-1",children:x.jsx("p",{className:"text-sm font-bold text-slate-800 leading-tight",children:c.message})}),x.jsx("button",{onClick:()=>l(c.id),className:"text-slate-400 hover:text-slate-600 p-1 rounded-lg hover:bg-slate-100 transition-all",children:x.jsx("span",{className:"material-symbols-outlined text-sm",children:"close"})})]},c.id))})})]})},L3=({posts:r,onPostClick:e,onViewAllClick:i})=>{const s=r.slice(0,3);return!s||s.length===0?x.jsx("section",{className:"py-24 bg-whiteboard texture-overlay texture-speckles overflow-hidden",children:x.jsx("div",{className:"max-w-7xl mx-auto px-4",children:x.jsx("p",{className:"text-center text-slate-500",children:"No blog posts available."})})}):x.jsx("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles overflow-hidden",children:x.jsxs("div",{className:"max-w-7xl mx-auto px-4 relative z-10",children:[x.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end mb-16 gap-6",children:[x.jsxs("div",{className:"max-w-2xl",children:[x.jsx("span",{className:"font-handdrawn text-2xl text-primary transform -rotate-1 inline-block mb-2",children:"Knowledge Base"}),x.jsx("h2",{className:"text-textured-green-big",children:"The Wellness Journal"}),x.jsx("p",{className:"text-xl md:text-2xl text-slate-600 mt-6 font-medium max-w-xl",children:"Nutrition tips, chef-curated recipes, and stories from our kitchen to yours."})]}),x.jsxs("button",{onClick:i,className:"btn-greenboard group flex items-center gap-3 font-black uppercase tracking-widest text-sm px-10 py-5 rounded-full transition-all",children:["View All Articles",x.jsx("span",{className:"material-symbols-outlined group-hover:translate-x-1 transition-transform",children:"arrow_forward"})]})]}),x.jsx("div",{className:"flex md:grid overflow-x-auto md:overflow-visible snap-x snap-mandatory md:snap-none pb-8 md:pb-0 -mx-4 px-4 md:mx-0 md:px-0 gap-5 md:gap-8 md:grid-cols-3 hide-scrollbar",children:s.map(l=>x.jsxs("div",{className:"flex-shrink-0 w-[85vw] sm:w-[320px] md:w-auto snap-center group cursor-pointer bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 p-6",onClick:()=>e(l),children:[x.jsxs("div",{className:"flex justify-between items-center mb-5",children:[x.jsx("span",{className:"text-slate-400 font-bold text-[13px]",children:l.type==="Recipe"?"Article":l.type}),x.jsxs("div",{className:"flex items-center gap-1.5 text-slate-400 font-bold text-[13px]",children:[x.jsx("span",{className:"uppercase tracking-widest text-[10px]",children:"reading time:"}),l.readTime," mins"]})]}),x.jsx("h3",{className:"text-xl font-bold text-slate-900 leading-snug mb-5 group-hover:text-primary transition-colors min-h-[3.5rem]",children:l.title}),x.jsx("div",{className:"flex flex-wrap gap-2 mb-8",children:(l.tags||["Health","Nutrition"]).map((c,d)=>x.jsx("span",{className:"bg-slate-100 text-slate-600 px-3 py-1 rounded-md text-[11px] font-bold",children:c},d))}),x.jsx("div",{className:"mt-auto aspect-[16/9] rounded-xl overflow-hidden",children:x.jsx("img",{src:On(l.image),alt:l.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700"})})]},l.id))})]})})},O3=({events:r,onParticipateClick:e,onViewRecapsClick:i})=>{const s=r.slice(0,3);return x.jsx("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles overflow-hidden relative",children:x.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[x.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end mb-16 gap-6",children:[x.jsxs("div",{className:"max-w-2xl",children:[x.jsx("span",{className:"font-handdrawn text-2xl text-primary transform -rotate-2 inline-block mb-2",children:"Community & Vibes"}),x.jsx("h2",{className:"text-textured-green-big",children:"Events we've organized"}),x.jsx("p",{className:"text-xl md:text-2xl text-slate-600 mt-6 font-medium max-w-xl",children:"We don't just sell peanut butter; we build a community. Join us for workouts, workshops, and tasting sessions across the country."})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3 md:gap-4 w-full md:w-auto pb-2 md:pb-0",children:[x.jsx("button",{onClick:i,className:"btn-greenboard flex items-center justify-center w-full px-2 py-4 md:px-10 md:py-5 rounded-full font-black uppercase tracking-widest text-[11px] sm:text-xs md:text-sm transition-all",children:"View Recaps"}),x.jsxs("button",{onClick:e,className:"btn-greenboard flex items-center justify-center w-full px-2 py-4 md:px-10 md:py-5 rounded-full font-black uppercase tracking-widest text-[11px] sm:text-xs md:text-sm transition-all gap-1.5 md:gap-3 group",children:[x.jsx("span",{className:"truncate",children:"Participate"}),x.jsx("span",{className:"material-symbols-outlined text-[16px] md:text-[24px] group-hover:translate-x-1 transition-transform flex-shrink-0",children:"arrow_forward"})]})]})]}),x.jsx("div",{className:"flex md:grid overflow-x-auto md:overflow-visible snap-x snap-mandatory md:snap-none pb-8 md:pb-0 -mx-4 px-4 md:mx-0 md:px-0 gap-5 md:gap-8 md:grid-cols-3 hide-scrollbar",children:s.map(l=>x.jsxs("div",{className:"flex-shrink-0 w-[85vw] sm:w-[320px] md:w-auto snap-center group rounded-3xl overflow-hidden border-2 border-slate-100 hover:border-slate-900 transition-all hover:shadow-2xl bg-white relative cursor-pointer",onClick:i,children:[x.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:x.jsx("img",{src:On(l.image),alt:l.title,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-700"})}),x.jsxs("div",{className:"p-8",children:[x.jsxs("div",{className:"flex items-center gap-2 text-primary font-black text-xs uppercase tracking-widest mb-3",children:[x.jsx("span",{className:"material-symbols-outlined text-sm",children:"calendar_today"}),l.date]}),x.jsx("h3",{className:"font-black uppercase text-slate-900 leading-tight mb-2 group-hover:text-primary transition-colors",children:l.title}),x.jsxs("div",{className:"flex items-center gap-2 text-slate-500 font-medium text-sm",children:[x.jsx("span",{className:"material-symbols-outlined text-lg",children:"location_on"}),l.location]})]})]},l.id))})]})})},_y=r=>{if(!r)return null;const e=r.match(/(?:id=|file\/d\/|open\?id=|\/d\/)([\w-]+)/);return e?e[1]:null},f_=r=>{if(!r)return"";if(r.startsWith("/media/")||r.startsWith("media/"))return On(r);
4211const e=_y(r);return e?`https://drive.google.com/uc?export=download&id=${e}`:On(r)},P3=({story:r,product:e,onClose:i,onAddToCart:s})=>{const[l,c]=ye.useState(!0),d=ye.useRef(null),h=r.fullVideoUrl||r.mediaUrl||r.originalDriveUrl||"",p=r.mediaType==="video"||typeof h=="string"&&(h.toLowerCase().includes(".mp4")||h.toLowerCase().includes("drive.google.com")||h.includes("stories/")),m=_y(h);ye.useEffect(()=>{document.body.style.overflow="hidden";const g=A=>{A.key==="Escape"&&i()};window.addEventListener("keydown",g);const b=d.current;return b&&b.play().catch(A=>{console.warn("Autoplay blocked:",A),c(!0)}),()=>{document.body.style.overflow="",window.removeEventListener("keydown",g),b&&b.pause()}},[i]),ye.useEffect(()=>{const g=d.current;g&&!g.paused&&(g.muted=l)},[l]);const _=g=>{g.target===g.currentTarget&&i()},v=e!=null&&e.originalPrice?Math.round((e.originalPrice-e.price)/e.originalPrice*100):0;return x.jsxs("div",{className:"fixed inset-0 z-[999999] flex items-center justify-center bg-black/90 md:bg-black/80 backdrop-blur-sm md:p-4 animate-in fade-in duration-300",onClick:_,children:[x.jsx("button",{onClick:i,className:"hidden md:flex absolute top-6 right-6 text-white hover:text-orange-400 transition-colors z-[10]","aria-label":"Close story modal",children:x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),x.jsxs("div",{className:"bg-black md:bg-white rounded-none md:rounded-[32px] overflow-hidden flex flex-col md:flex-row w-full h-full md:max-w-5xl md:h-[80vh] shadow-2xl relative animate-in zoom-in-95 duration-300",children:[x.jsxs("div",{className:`absolute inset-0 md:relative md:inset-auto w-full h-full ${e?"md:w-1/2":"w-full"} bg-black flex items-center justify-center overflow-hidden cursor-pointer`,onClick:()=>c(!l),children:[p?x.jsx("video",{ref:d,src:f_(h),poster:r.posterUrl?On(r.posterUrl):m?`https://drive.google.com/thumbnail?id=${m}&sz=w800`:void 0,className:"w-full h-full object-cover",autoPlay:!0,loop:!0,muted:l,playsInline:!0,"aria-label":"Social story video",onError:g=>console.error("Modal video error:",g)}):x.jsx("img",{src:f_(r.mediaUrl),className:"w-full h-full object-cover",alt:"Story fallback",onError:g=>{console.error("Modal image error:",g),g.currentTarget.src="/placeholder-story.png"}}),x.jsxs("div",{className:"md:hidden absolute inset-0 pointer-events-none",children:[x.jsx("div",{className:"absolute top-0 left-0 w-full h-32 bg-gradient-to-b from-black/60 to-transparent"}),x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-64 bg-gradient-to-t from-black/80 to-transparent"}),x.jsx("div",{className:"absolute top-4 left-4 pointer-events-auto",children:x.jsx("button",{onClick:g=>{g.stopPropagation(),i()},className:"w-10 h-10 bg-white/20 backdrop-blur-md rounded-full flex items-center justify-center text-white border border-white/30",children:x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),x.jsx("div",{className:"absolute right-4 bottom-[200px] flex flex-col gap-4 pointer-events-auto items-center",children:x.jsx("button",{onClick:g=>{g.stopPropagation(),c(!l)},className:"w-11 h-11 bg-black/40 backdrop-blur-md text-white rounded-full flex items-center justify-center hover:bg-black/60 transition-all border border-white/20",children:l?x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),x.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),x.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),x.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"})]})})}),e&&x.jsx("div",{className:"absolute bottom-4 left-4 right-4 pointer-events-auto",children:x.jsxs("div",{className:"bg-white/95 backdrop-blur-xl rounded-[20px] p-3 flex flex-col gap-3 shadow-2xl",children:[x.jsxs("div",{className:"flex gap-4 items-center px-1",children:[x.jsx("div",{className:"w-[60px] h-[60px] bg-slate-50 rounded-xl flex items-center justify-center flex-shrink-0 p-1 border border-slate-100",children:x.jsx("img",{src:On(e.image),className:"w-full h-full object-contain",alt:e.name})}),x.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[x.jsx("h4",{className:"font-satoshi font-semibold text-slate-800 text-[15px] leading-none line-clamp-1",children:e.name}),x.jsxs("div",{className:"flex items-center gap-2 -mt-0.5",children:[x.jsxs("span",{className:"text-[14px] font-black text-slate-900 leading-none",children:["₹",e.price.toLocaleStr
4211ing()]}),e.originalPrice&&x.jsxs("span",{className:"text-[14px] text-slate-500 line-through",children:["₹",e.originalPrice.toLocaleString()]})]})]})]}),x.jsx("button",{onClick:g=>{g.stopPropagation(),s(e),i()},className:"w-full bg-[#282828] text-white font-bold py-3.5 rounded-xl text-[15px] hover:bg-black transition-colors",children:"Add to Cart"})]})})]}),x.jsx("div",{className:"hidden md:flex absolute inset-0 items-center justify-center pointer-events-none",children:l&&x.jsxs("div",{className:"bg-black/40 backdrop-blur-md px-6 py-3 rounded-full flex items-center gap-3 animate-pulse",children:[x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white",children:[x.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),x.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),x.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}),x.jsx("span",{className:"text-white font-bold text-sm uppercase tracking-wider",children:"Tap for sound"})]})}),x.jsx("div",{className:"hidden md:flex absolute right-4 bottom-4 flex-col gap-4 pointer-events-auto",children:x.jsx("button",{onClick:g=>{g.stopPropagation(),c(!l)},className:"w-12 h-12 bg-black/40 backdrop-blur-md text-white rounded-full flex items-center justify-center hover:bg-black/60 transition-all hover:scale-110 z-20","aria-label":l?"Unmute video":"Mute video",children:l?x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),x.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),x.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),x.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"})]})})})]}),e&&x.jsxs("div",{className:"hidden md:flex w-full md:w-1/2 h-full flex-col bg-white",children:[x.jsxs("div",{className:"flex-1 overflow-y-auto hide-scrollbar p-6 md:p-8",children:[x.jsx("div",{className:"bg-[#fff9f5] rounded-2xl p-6 flex justify-center items-center mb-6",children:x.jsx("img",{src:On(e.image),className:"w-48 h-48 object-contain transform hover:scale-105 transition-transform duration-500",alt:e.name})}),x.jsx("h2",{className:"text-xl md:text-2xl font-black text-[#0b3d2e] leading-tight mb-3",children:e.name}),x.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[x.jsxs("span",{className:"text-xl font-black text-slate-900",children:["₹",e.price.toLocaleString()]}),e.originalPrice&&x.jsxs(x.Fragment,{children:[x.jsxs("span",{className:"text-base text-slate-400 line-through decoration-slate-300",children:["₹",e.originalPrice.toLocaleString()]}),x.jsxs("span",{className:"bg-[#cdf0e1] text-[#00a862] text-xs font-bold px-2.5 py-1 rounded-md",children:[v,"% off"]})]})]}),x.jsxs("p",{className:"text-sm font-bold text-slate-900 mb-2",children:["Why Choose ",e.name,"?"]}),x.jsx("p",{className:"text-sm text-slate-600 leading-relaxed mb-6",children:e.description}),e.benefits&&e.benefits.length>0&&x.jsxs(x.Fragment,{children:[x.jsx("p",{className:"text-sm font-bold text-slate-900 mb-3",children:"Key Features:"}),x.jsx("ul",{className:"space-y-2 mb-6 text-sm text-slate-700",children:e.benefits.map((g,b)=>x.jsxs("li",{className:"flex gap-2 items-start",children:[x.jsx("svg",{className:"w-4 h-4 text-green-500 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:x.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),x.jsx("span",{children:g})]},b))})]})]}),x.jsx("div",{className:"p-4 md:p-6 bg-slate-50 border-t border-slate-100",children:x.jsx("button",{onClick:()=>{s(e),i()},className:"w-full bg-[#1b263b] hover:bg-primary text-white font-bold py-4 rounded-xl transition-colors duration-300 shadow-xl shadow-[#1b263b]/20",children:"Add to Cart"})})]})]})]})},I3=et.memo(P3),yy=r=>{if(!r)return null;const e=r.match(/(?:id=|file\/d\/|open\?id=)([\w-]+)/);return e?e[1]:null},d_=r=>{if(!r)return"";if(r.startsWith("/media/")||r.startsWith("media/"))return On(r);const e=yy(r);return e?`https://drive.google.com/uc?export=download&id=${e}
4211`:On(r)},F3=et.memo(({story:r,product:e,onClick:i,onProductClick:s})=>{const l=ye.useRef(null),[c,d]=ye.useState(!1),h=ye.useRef(null);ye.useEffect(()=>{const A=h.current;if(A)if(c){const D=setTimeout(()=>{const E=A.play();E!==void 0&&E.catch(()=>{})},100);return()=>clearTimeout(D)}else A.pause()},[c]),ye.useEffect(()=>{const A=new IntersectionObserver(([D])=>{d(D.isIntersecting)},{threshold:.1,rootMargin:"0px"});return l.current&&A.observe(l.current),()=>A.disconnect()},[]);const p=r.mediaUrl||r.originalDriveUrl||"",m=r.mediaType==="video"||(p||"").toLowerCase().includes(".mp4")||(p||"").includes("drive.google.com"),_=d_(p),v=yy(p),g=r.posterUrl?On(r.posterUrl):v?`https://drive.google.com/thumbnail?id=${v}&sz=w600`:void 0,b=e!=null&&e.originalPrice&&e.originalPrice>e.price?Math.round((e.originalPrice-e.price)/e.originalPrice*100):null;return x.jsxs("div",{ref:l,onClick:()=>i(r),className:"w-[300px] md:w-[320px] aspect-[9/16] rounded-[24px] overflow-hidden relative group snap-center flex-shrink-0 cursor-pointer shadow-lg hover:shadow-2xl transition-all duration-500 bg-slate-200",children:[m?x.jsx("video",{ref:h,src:_,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-700 group-hover:scale-105",muted:!0,loop:!0,playsInline:!0,autoPlay:c,poster:g,preload:"auto","aria-label":"Social story video preview",onCanPlay:A=>{A.currentTarget.style.opacity="1"},onError:A=>{const D=A.currentTarget;D.networkState===D.NETWORK_NO_SOURCE&&(console.warn("Story video source not found"),D.style.opacity="0")}}):x.jsx("img",{src:d_(r.mediaUrl),className:"absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",alt:"Social Story",onError:A=>{console.error("Image load error:",A),A.currentTarget.src="/placeholder-story.png"}}),x.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent opacity-90"}),e&&x.jsx("div",{onClick:A=>{A.stopPropagation(),s(e)},className:"absolute bottom-5 left-3 right-3 bg-white rounded-xl p-2.5 shadow-2xl transform transition-all duration-500 group-hover:-translate-y-1 hover:scale-[1.01] border border-slate-100",children:x.jsxs("div",{className:"flex gap-3.5 items-center",children:[x.jsxs("div",{className:"w-20 h-20 rounded-xl flex-shrink-0 flex items-center justify-center relative bg-slate-50",children:[x.jsx("img",{src:On(e.image),className:"w-18 h-18 object-contain",alt:"Product"}),b&&x.jsxs("div",{className:"absolute -top-2 -left-2 bg-[#008a45] text-white text-[7px] font-black px-1.5 py-0.5 rounded-sm uppercase tracking-wider rotate-[-5deg] shadow-sm z-10",children:[b,"% OFF"]})]}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("h4",{className:"force-anton leading-[1.2] line-clamp-3 uppercase tracking-wider [word-spacing:0.05em] mb-1 md:mb-0",style:{color:"#008a45",fontSize:"16px"},children:e.name.split("(")[0]||e.name}),x.jsxs("div",{className:"flex items-center gap-2 mt-0 md:-mt-1",children:[x.jsxs("span",{className:"text-[15px] font-black text-slate-900",children:["₹",e.price.toLocaleString()]}),e.originalPrice&&e.originalPrice>e.price&&x.jsxs("span",{className:"text-[11px] text-slate-400 line-through decoration-slate-300",children:["₹",e.originalPrice.toLocaleString()]})]})]})]})})]})}),z3=({stories:r,products:e,onProductClick:i,onAddToCart:s})=>{const l=ye.useRef(null),[c,d]=ye.useState(null),h=ye.useCallback(m=>e.find(_=>String(_.id)===String(m)),[e]),p=ye.useCallback(m=>{const _=h(m.productId);d({story:m,product:_||null})},[h]);return x.jsxs("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles overflow-hidden",children:[x.jsxs("div",{className:"max-w-7xl mx-auto px-4 relative flex flex-col items-center",children:[x.jsxs("div",{className:"text-center mb-8 md:mb-16 relative w-full flex flex-col items-center",children:[x.jsx("span",{className:"font-handdrawn text-xl md:text-3xl text-secondary transform -rotate-3 inline-block z-10 whitespace-nowrap mb-0 md:mb-[-0.5rem] md:ml-[-12rem]",children:"@pinobitehealth"}),x.jsx("div",{className:"relative inline-block",children:x.jsx("h2",{className:"font-normal tracking-normal [word-spacing:0.05em] leading-[1.1] !font-anton uppercase text-textured-green text-[40px] lg:text-[100px] lg:leading-[110px] lg:-mb-[12px] lg:pb-[12px] lg:font-bold",style:{textTransform:"uppercase"},children:"Social stories"})})]}),x.jsx("div",{ref:l,className:"flex gap-4 overflow-x-auto hide-scrollbar pb-8 snap-x snap-mandatory w-full px-4 md:px-0",
4211style:{justifyContent:r.length<=2?"center":"flex-start"},children:r.map(m=>x.jsx("div",{className:"snap-center",children:x.jsx(F3,{story:m,product:h(m.productId),onClick:p,onProductClick:i})},m.id))})]}),c&&x.jsx(I3,{story:c.story,product:c.product,onAddToCart:s,onClose:()=>d(null)})]})},vm="admin_access_token",Vp="admin_refresh_token";function by(){return localStorage.getItem(vm)}async function Sy(){const r=localStorage.getItem(Vp);if(!r)return null;try{const e=await fetch(`${ct}/api/token/refresh/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh:r})});if(!e.ok)return null;const i=await e.json();return localStorage.setItem(vm,i.access),i.refresh&&localStorage.setItem(Vp,i.refresh),i.access}catch{return null}}function jp(){localStorage.removeItem(vm),localStorage.removeItem(Vp),window.dispatchEvent(new CustomEvent("admin:logout"))}async function ln(r,e={}){const i=by();if(!i)throw jp(),new Error("No admin token found");const s=new Headers(e.headers||{});s.set("Authorization",`Bearer ${i}`);let l=await fetch(r,{...e,headers:s});if(l.status===401){const c=await Sy();if(c)s.set("Authorization",`Bearer ${c}`),l=await fetch(r,{...e,headers:s});else throw jp(),new Error("Admin session expired")}return l}async function yC(r,e={}){const i=by(),s=i||localStorage.getItem("access_token");if(!s)throw new Error("No authentication token found");const l=new Headers(e.headers||{});l.set("Authorization",`Bearer ${s}`);let c=await fetch(r,{...e,headers:l});if(c.status===401&&i){const d=await Sy();if(d)l.set("Authorization",`Bearer ${d}`),c=await fetch(r,{...e,headers:l});else throw jp(),new Error("Admin session expired")}return c}const B3=[{id:1,mediaHouse:"Business Standard",logo:"/logos/press/business-standard-logo.svg",quote:"Business Standard highlighted PinoBite's commitment to premium ingredients and its growing presence in India's healthy snacking market.",date:"2024"},{id:2,mediaHouse:"ANI (Asian News International)",logo:"/logos/press/ani-logo.svg",quote:"ANI covered PinoBite's expansion and its mission to provide healthier food choices to Indian consumers.",date:"2024"},{id:3,mediaHouse:"News18",logo:"/logos/press/news18-logo.svg",quote:"News18 recognized PinoBite as a rapidly growing premium food brand focused on nutrition and quality.",date:"2024"},{id:4,mediaHouse:"The Tribune",logo:"/logos/press/the-tribune-logo.png",quote:"The Tribune featured PinoBite's premium peanut butter products and consumer-first approach.",date:"2024"},{id:9,mediaHouse:"TV9 Gujarati",logo:"/logos/press/tv9-gujarati-logo.svg",quote:"TV9 Gujarati covers regional business developments, startups, and consumer-focused stories across Gujarat.",date:"2024"},{id:10,mediaHouse:"ABP Asmita",logo:"/logos/press/abp-asmita-logo.svg",quote:"ABP Asmita is one of Gujarat's leading television news channels, trusted for regional news and business coverage.",date:"2024"},{id:11,mediaHouse:"VTV Gujarati",logo:"/logos/press/vtv-gujarati-logo.png",quote:"VTV Gujarati is a prominent regional news platform covering business, innovation, and consumer trends.",date:"2024"},{id:12,mediaHouse:"India Global Live",logo:"/logos/press/india-global-live-logo.png",quote:"India Global Live featured PinoBite's vision of making premium nutrition accessible to Indian consumers.",date:"2024"}],H3=({pressUpdates:r})=>{const e=B3,i=ye.useRef(null),[s,l]=ye.useState(!1),[c,d]=ye.useState(!0),h=()=>{const p=i.current;p&&(l(p.scrollLeft>4),d(p.scrollLeft<p.scrollWidth-p.clientWidth-4))};return ye.useEffect(()=>{h();const p=i.current;return p&&p.addEventListener("scroll",h,{passive:!0}),()=>p==null?void 0:p.removeEventListener("scroll",h)},[]),ye.useEffect(()=>{const p=i.current;if(!p)return;let m,_=!1;const v=()=>{_||(p.scrollLeft+=1,p.scrollLeft>=p.scrollWidth-p.clientWidth-1&&(p.scrollLeft=0)),m=requestAnimationFrame(v)};m=requestAnimationFrame(v);const g=()=>{_=!0},b=()=>{_=!1};return p.addEventListener("mouseenter",g),p.addEventListener("mouseleave",b),p.addEventListener("touchstart",g,{passive:!0}),p.addEventListener("touchend",b),()=>{cancelAnimationFrame(m),p.removeEventListener("mouseenter",g),p.removeEventListener("mouseleave",b),p.removeEventListener("touchstart",g),p.removeEventListener("touchend",b)}},[]),e.length?x.jsxs("section",{className:"py-[60px] bg-whiteboard texture-overlay texture-speckles relative overflow-hidden",children:[x.jsxs("div",{className:"max-w-7xl mx-auto px-4 text-center mb-16",children:[x.jsx("span",{className:"font-handdrawn text-3xl text-primary transform -rotate-2 inline-block mb-2",children:"Trusted by the Media"}),x.jsx("h2",{className:"text-5xl md:text-6xl font-black text-slate-900 uppercase tracking-tight leading-none",children:"Coverage That Speaks for Itself"})]}),x.jsx("div",{className:"relative w-full",children:x.jsx("div",{ref:i,className:"flex gap-6 overflow-x-auto px-4 md:px-8 xl:px-16 pb-12 pt-4 hide-scrollbar",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[...e,...e].map((p,m)=>x.jsx("div",{className:"flex-shrink-0 w-[300px] sm:w-[340px]",children:x.jsxs("div",{className:"bg-white rounded-3xl p-8 h-full flex flex-col items-center text-center shadow-[0_8px_30px_rgb(0,0,0,0.04)] hover:shadow-[0_20px_40px_rgb(0,0,0,0.08)] transition-all duration-300 border border-slate-50 hover:border-slate-100 group relative overflow-hidden",children:[x.jsx("span",{className:"absolute top-4 right-6 text-7xl font-serif text-slate-100 leading-none select-none pointer-events-none group-hover:text-primary/10 transition-colors",children:'"'}),x.jsx("div",{className:"h-10 sm:h-12 flex items-center justify-center mb-6 flex-shrink-0 w-full",children:x.jsx("img",{src:p.logo,alt:`${p.mediaHouse} logo`,className:"h-full w-auto max-w-[80%] object-contain opacity-90 hover:opacity-100 transition-opacity",loading:"lazy"})}),x.jsx("p",{className:"text-slate-700 font-medium leading-relaxed text-[15px] flex-1 relative z-10",children:p.quote})]})},`${p.id}-${m}`))})}),x.jsx("style",{children:`
4212        .hide-scrollbar::-webkit-scrollbar { display: none; }
4213      `})]}):null},G3=({currentView:r,onHomeClick:e,onShopClick:i,onCartClick:s,onAccountClick:l,cartCount:c,isCartOpen:d=!1,isAuthOpen:h=!1,isMenuOpen:p=!1,isHidden:m=!1})=>{const{scrollY:_}=O_(),[v,g]=ye.useState(!1);if(P_(_,"change",F=>{const C=_.getPrevious()||0;F>C&&F>150?g(!0):g(!1)}),p||m||d||h)return null;const b=d,A=(h||r==="dashboard")&&!d,D=(r==="shop"||r==="product")&&!d&&!h,E=r==="home"&&!d&&!h,M=F=>`
4214        flex items-center justify-center h-12 rounded-full transition-all duration-500 relative overflow-hidden
4215        ${F?"bg-[#0b3d2e] texture-overlay texture-speckles !text-white px-5 shadow-lg":"!text-[#0b3d2e] hover:bg-black/5 w-12"}
4216    `,z=F=>`
4217        font-black text-[11px] tracking-widest uppercase transition-all duration-500 font-satoshi overflow-hidden whitespace-nowrap
4218        ${F?"max-w-[100px] ml-2 opacity-100 !text-white":"max-w-0 opacity-0"}
4219    `;return x.jsx(na.div,{initial:{y:100},animate:{y:v?150:0},transition:{type:"spring",stiffness:300,damping:30},className:"lg:hidden fixed bottom-[env(safe-area-inset-bottom,12px)] left-0 right-0 z-[99999] flex justify-center px-4",children:x.jsxs("div",{className:"w-full max-w-[440px] bg-white/90 backdrop-blur-xl rounded-[32px] p-2 shadow-[0_8px_32px_rgba(0,0,0,0.12)] border border-white/50 flex items-center justify-between",children:[x.jsxs("button",{onClick:e,className:M(E),children:[x.jsx("span",{className:`material-symbols-outlined text-[24px] ${E?"!text-white":"!text-[#0b3d2e]"}`,children:"home"}),x.jsx("span",{className:z(E),children:"Home"})]}),x.jsxs("button",{onClick:i,className:M(D),children:[x.jsx("span",{className:`material-symbols-outlined text-[24px] ${D?"!text-white":"!text-[#0b3d2e]"}`,children:"shopping_bag"}),x.jsx("span",{className:z(D),children:"Shop"})]}),x.jsxs("div",{className:"relative",children:[x.jsxs("button",{onClick:s,className:M(b),children:[x.jsx("span",{className:`material-symbols-outlined text-[24px] ${b?"!text-white":"!text-[#0b3d2e]"}`,children:"shopping_cart"}),x.jsx("span",{className:z(b),children:"Cart"})]}),!b&&c>0&&x.jsx("span",{className:"absolute -top-1 -right-1 z-20 bg-[#008a45] text-white text-[10px] font-black w-5 h-5 rounded-full flex items-center justify-center border-2 border-white animate-in zoom-in duration-300 pointer-events-none shadow-sm",children:c})]}),x.jsxs("button",{onClick:l,className:M(A),children:[x.jsx("span",{className:`material-symbols-outlined text-[24px] ${A?"!text-white":"!text-[#0b3d2e]"}`,children:"person"}),x.jsx("span",{className:z(A),children:"Profile"})]})]})})},My=ye.createContext(void 0),k3=({children:r})=>{const[e,i]=ye.useState(null),[s,l]=ye.useState(!0),c=ye.useCallback(()=>{localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token"),i(null)},[]),d=ye.useCallback(async()=>
4219{l(!0);const _=localStorage.getItem("access_token");if(!_){i(null),l(!1);return}try{const v=await fetch(`${ct}/api/users/me/`,{headers:{Authorization:`Bearer ${_}`}});if(v.ok){const g=await v.json();i(g)}else c()}catch(v){console.error("Auth check failed:",v),c()}finally{l(!1)}},[c]),h=ye.useCallback((_,v)=>{localStorage.setItem("access_token",_),localStorage.setItem("refresh_token",v),d()},[d]),p=ye.useCallback(async _=>{try{const v=await fetch(`${ct}/api/register/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(v.ok){const g=await v.json();g.points_earned>0&&N3(g.points_earned,"Welcome to the Pinobite Club!");const b=await fetch(`${ct}/api/token/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_.email,password:_.password})});if(b.ok){const A=await b.json();return h(A.access,A.refresh),!0}}return!1}catch(v){return console.error("Registration failed:",v),!1}},[h]);ye.useEffect(()=>{d()},[d]);const m=ye.useMemo(()=>({user:e,isLoading:s,login:h,register:p,logout:c,checkAuth:d}),[e,s,h,p,c,d]);return x.jsx(My.Provider,{value:m,children:r})},V3=()=>{const r=ye.useContext(My);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r};var pc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wr,Vs,Io,E_,j3=(E_=class extends pc{constructor(){super();st(this,wr);st(this,Vs);st(this,Io);Xe(this,Io,e=>{if(typeof window<"u"&&window.addEventListener){const i=()=>e();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){W(this,Vs)||this.setEventListener(W(this,Io))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Vs))==null||e.call(this),Xe(this,Vs,void 0))}setEventListener(e){var i;Xe(this,Io,e),(i=W(this,Vs))==null||i.call(this),Xe(this,Vs,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){W(this,wr)!==e&&(Xe(this,wr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(i=>{i(e)})}isFocused(){var e;return typeof W(this,wr)=="boolean"?W(this,wr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},wr=new WeakMap,Vs=new WeakMap,Io=new WeakMap,E_),_m=new j3,X3={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r),setInterval:(r,e)=>setInterval(r,e),clearInterval:r=>clearInterval(r)},js,sm,T_,W3=(T_=class{constructor(){st(this,js,X3);st(this,sm,!1)}setTimeoutProvider(r){Xe(this,js,r)}setTimeout(r,e){return W(this,js).setTimeout(r,e)}clearTimeout(r){W(this,js).clearTimeout(r)}setInterval(r,e){return W(this,js).setInterval(r,e)}clearInterval(r){W(this,js).clearInterval(r)}},js=new WeakMap,sm=new WeakMap,T_),Ar=new W3;function q3(r){setTimeout(r,0)}var Y3=typeof window>"u"||"Deno"in globalThis;function di(){}function Q3(r,e){return typeof r=="function"?r(e):r}function Xp(r){return typeof r=="number"&&r>=0&&r!==1/0}function Ey(r,e){return Math.max(r+(e||0)-Date.now(),0)}function Js(r,e){return typeof r=="function"?r(e):r}function Hi(r,e){return typeof r=="function"?r(e):r}function h_(r,e){const{type:i="all",exact:s,fetchStatus:l,predicate:c,queryKey:d,stale:h}=r;if(d){if(s){if(e.queryHash!==ym(d,e.options))return!1}else if(!ic(e.queryKey,d))return!1}if(i!=="all"){const p=e.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&e.isStale()!==h||l&&l!==e.state.fetchStatus||c&&!c(e))}function p_(r,e){const{exact:i,status:s,predicate:l,mutationKey:c}=r;if(c){if(!e.options.mutationKey)return!1;if(i){if(nc(e.options.mutationKey)!==nc(c))return!1}else if(!ic(e.options.mutationKey,c))return!1}return!(s&&e.state.status!==s||l&&!l(e))}function ym(r,e){return((e==null?void 0:e.queryKeyHashFn)||nc)(r)}function nc(r){return JSON.stringify(r,(e,i)=>qp(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function ic(r,e){return r===e?!0:typeof r!=typeof e?!1:r&&e&&typeof r=="object"&&typeof e=="object"?Object.keys(e).every(i=>ic(r[i],e[i])):!1}var K3=Object.prototype.hasOwnProperty;function Ty(r,e,i=0){if(r===e)return r;if(i>500)return e;const s=m_(r)&&m_(e);if(!s&&!(qp(r)&&qp(e)))return e;const c=(s?r:Object.keys(r)).length,d=s?e:Object.keys(e),h=d.length,p=s?new Array(h):{};let m=0;for(let _=0;_<h;_++){const v=s?_:d[_],g=r[v],b=e[v];if(g===b){p[v]=g,(s?_<c:K3.call(r,v))&&m++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){p[v]=b;continue}const A=Ty(g,b,i+1);p[v]=A,A===g&&m++}return c===h&&m===c?r:p}function Wp(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(r[i]!==e[i])return!1;return!0}function m_(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function qp(r){if(!g_(r))return!1;const e=r.constructor;if(e===void 0)return!0;const i=e.prototype;return!(!g_(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function g_(r){return Object.prototype.toString.call(r)==="[object Object]"}function Z3(r){return new Promise(e=>{Ar.setTimeout(e,r)})}function Yp(r,e,i){return typeof i.structuralSharing=="function"?i.structuralSharing(r,e):i.structuralSharing!==!1?Ty(r,e):e}function J3(r,e,i=0){const s=[...r,e];return i&&s.length>i?s.slice(1):s}function $3(r,e,i=0){const s=[e,...r];return i&&s.length>i?s.slice(0,-1):s}var bm=Symbol();function Ay(r,e){return!r.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!r.queryFn||r.queryFn===bm?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function wy(r,e){return typeof r=="function"?r(...e):!!r}function ew(r,e,i){let s=!1,l;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(l??(l=e()),s||(s=!0,l.aborted?i():l.addEventListener("abort",i,{once:!0})),l)}),r}var ac=(()=>{let r=()=>Y3;return{isServer(){return r()},setIsServer(e){r=e}}})();function Qp(){let r,e;const i=new Promise((l,c)=>{r=l,e=c}
4219);i.status="pending",i.catch(()=>{});function s(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{s({status:"fulfilled",value:l}),r(l)},i.reject=l=>{s({status:"rejected",reason:l}),e(l)},i}var tw=q3;function nw(){let r=[],e=0,i=h=>{h()},s=h=>{h()},l=tw;const c=h=>{e?r.push(h):l(()=>{i(h)})},d=()=>{const h=r;r=[],h.length&&l(()=>{s(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;e++;try{p=h()}finally{e--,e||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var jn=nw(),Fo,Xs,zo,A_,iw=(A_=class extends pc{constructor(){super();st(this,Fo,!0);st(this,Xs);st(this,zo);Xe(this,zo,e=>{if(typeof window<"u"&&window.addEventListener){const i=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}})}onSubscribe(){W(this,Xs)||this.setEventListener(W(this,zo))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Xs))==null||e.call(this),Xe(this,Xs,void 0))}setEventListener(e){var i;Xe(this,zo,e),(i=W(this,Xs))==null||i.call(this),Xe(this,Xs,e(this.setOnline.bind(this)))}setOnline(e){W(this,Fo)!==e&&(Xe(this,Fo,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return W(this,Fo)}},Fo=new WeakMap,Xs=new WeakMap,zo=new WeakMap,A_),of=new iw;function aw(r){return Math.min(1e3*2**r,3e4)}function Cy(r){return(r??"online")==="online"?of.isOnline():!0}var Kp=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function Ry(r){let e=!1,i=0,s;const l=Qp(),c=()=>l.status!=="pending",d=D=>{var E;if(!c()){const M=new Kp(D);g(M),(E=r.onCancel)==null||E.call(r,M)}},h=()=>{e=!0},p=()=>{e=!1},m=()=>_m.isFocused()&&(r.networkMode==="always"||of.isOnline())&&r.canRun(),_=()=>Cy(r.networkMode)&&r.canRun(),v=D=>{c()||(s==null||s(),l.resolve(D))},g=D=>{c()||(s==null||s(),l.reject(D))},b=()=>new Promise(D=>{var E;s=M=>{(c()||m())&&D(M)},(E=r.onPause)==null||E.call(r)}).then(()=>{var D;s=void 0,c()||(D=r.onContinue)==null||D.call(r)}),A=()=>{if(c())return;let D;const E=i===0?r.initialPromise:void 0;try{D=E??r.fn()}catch(M){D=Promise.reject(M)}Promise.resolve(D).then(v).catch(M=>{var L;if(c())return;const z=r.retry??(ac.isServer()?0:3),F=r.retryDelay??aw,C=typeof F=="function"?F(i,M):F,I=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,M);if(e||!I){g(M);return}i++,(L=r.onFail)==null||L.call(r,i,M),Z3(C).then(()=>m()?void 0:b()).then(()=>{e?g(M):A()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(s==null||s(),l),cancelRetry:h,continueRetry:p,canStart:_,start:()=>(_()?A():b().then(A),l)}}var Cr,w_,Ny=(w_=class{constructor(){st(this,Cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xp(this.gcTime)&&Xe(this,Cr,Ar.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(ac.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,Cr)!==void 0&&(Ar.clearTimeout(W(this,Cr)),Xe(this,Cr,void 0))}},Cr=new WeakMap,w_),Rr,Bo,zi,Nr,Bn,sc,Dr,Ti,Dy,Ka,C_,sw=(C_=class extends Ny{constructor(e){super();st(this,Ti);st(this,Rr);st(this,Bo);st(this,zi);st(this,Nr);st(this,Bn);st(this,sc);st(this,Dr);Xe(this,Dr,!1),Xe(this,sc,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,Nr,e.client),Xe(this,zi,W(this,Nr).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,Rr,v_(this.options)),this.state=e.state??W(this,Rr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=W(this,Bn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,sc),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=v_(this.options);i.data!==void 0&&(this.setState(x_(i.data,i.dataUpdatedAt)),Xe(this,Rr,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,zi).remove(this)}setData(e,i){const s=Yp(this.state.data,e,this.options);return Ut(this,Ti,Ka).call(this,{data:s,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),s}setState(e,i){Ut(this,Ti,Ka).call(this,{type:"setState",state:e,setStateOptions:i})}cancel(e){var s,l;const i=(s=W(this,Bn))==null?void 0:s.promise;return(l=W(this,Bn))==null||l.cancel(e),i?i.then(di).catch(di):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,Rr)}
4219reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Hi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Js(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ey(this.state.dataUpdatedAt,e)}onFocus(){var i;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(i=W(this,Bn))==null||i.continue()}onOnline(){var i;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(i=W(this,Bn))==null||i.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,zi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(i=>i!==e),this.observers.length||(W(this,Bn)&&(W(this,Dr)||Ut(this,Ti,Dy).call(this)?W(this,Bn).cancel({revert:!0}):W(this,Bn).cancelRetry()),this.scheduleGc()),W(this,zi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ut(this,Ti,Ka).call(this,{type:"invalidate"})}async fetch(e,i){var p,m,_,v,g,b,A,D,E,M,z,F;if(this.state.fetchStatus!=="idle"&&((p=W(this,Bn))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(W(this,Bn))return W(this,Bn).continueRetry(),W(this,Bn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const C=this.observers.find(I=>I.options.queryFn);C&&this.setOptions(C.options)}const s=new AbortController,l=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(Xe(this,Dr,!0),s.signal)})},c=()=>{const C=Ay(this.options,i),L=(()=>{const H={client:W(this,Nr),queryKey:this.queryKey,meta:this.meta};return l(H),H})();return Xe(this,Dr,!1),this.options.persister?this.options.persister(C,L,this):C(L)},h=(()=>{const C={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:W(this,Nr),state:this.state,fetchFn:c};return l(C),C})();(m=this.options.behavior)==null||m.onFetch(h,this),Xe(this,Bo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=h.fetchOptions)==null?void 0:_.meta))&&Ut(this,Ti,Ka).call(this,{type:"fetch",meta:(v=h.fetchOptions)==null?void 0:v.meta}),Xe(this,Bn,Ry({initialPromise:i==null?void 0:i.initialPromise,fn:h.fetchFn,onCancel:C=>{C instanceof Kp&&C.revert&&this.setState({...W(this,Bo),fetchStatus:"idle"}),s.abort()},onFail:(C,I)=>{Ut(this,Ti,Ka).call(this,{type:"failed",failureCount:C,error:I})},onPause:()=>{Ut(this,Ti,Ka).call(this,{type:"pause"})},onContinue:()=>{Ut(this,Ti,Ka).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const C=await W(this,Bn).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(g=W(this,zi).config).onSuccess)==null||b.call(g,C,this),(D=(A=W(this,zi).config).onSettled)==null||D.call(A,C,this.state.error,this),C}catch(C){if(C instanceof Kp){if(C.silent)return W(this,Bn).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ut(this,Ti,Ka).call(this,{type:"error",error:C}),(M=(E=W(this,zi).config).onError)==null||M.call(E,C,this),(F=(z=W(this,zi).config).onSettled)==null||F.call(z,this.state.data,C,this),C}finally{this.scheduleGc()}}},Rr=new WeakMap,Bo=new WeakMap,zi=new WeakMap,Nr=new WeakMap,Bn=new WeakMap,sc=new WeakMap,Dr=new WeakMap,Ti=new WeakSet,Dy=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ka=function(e){const i=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Uy(s.data,this.options),fetchMeta:e.meta??null};case"success":const l={...s,...x_(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Xe(this,Bo,e.manual?l:void 0),l;case"error":const c=e.error;
vendor: 9,610 bytes, line 4219
4219return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=i(this.state),jn.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),W(this,zi).notify({query:this,type:"updated",action:e})})},C_);function Uy(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Cy(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function x_(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v_(r){const e=typeof r.initialData=="function"?r.initialData():r.initialData,i=e!==void 0,s=i?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var fi,Ot,rc,ni,Ur,Ho,Ja,Ws,oc,Go,ko,Lr,Or,qs,Vo,Qt,$l,Zp,Jp,$p,em,tm,nm,im,Ly,R_,rw=(R_=class extends pc{constructor(e,i){super();st(this,Qt);st(this,fi);st(this,Ot);st(this,rc);st(this,ni);st(this,Ur);st(this,Ho);st(this,Ja);st(this,Ws);st(this,oc);st(this,Go);st(this,ko);st(this,Lr);st(this,Or);st(this,qs);st(this,Vo,new Set);this.options=i,Xe(this,fi,e),Xe(this,Ws,null),Xe(this,Ja,Qp()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Ot).addObserver(this),__(W(this,Ot),this.options)?Ut(this,Qt,$l).call(this):this.updateResult(),Ut(this,Qt,em).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return am(W(this,Ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return am(W(this,Ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ut(this,Qt,tm).call(this),Ut(this,Qt,nm).call(this),W(this,Ot).removeObserver(this)}setOptions(e){const i=this.options,s=W(this,Ot);if(this.options=W(this,fi).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hi(this.options.enabled,W(this,Ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ut(this,Qt,im).call(this),W(this,Ot).setOptions(this.options),i._defaulted&&!Wp(this.options,i)&&W(this,fi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Ot),observer:this});const l=this.hasListeners();l&&y_(W(this,Ot),s,this.options,i)&&Ut(this,Qt,$l).call(this),this.updateResult(),l&&(W(this,Ot)!==s||Hi(this.options.enabled,W(this,Ot))!==Hi(i.enabled,W(this,Ot))||Js(this.options.staleTime,W(this,Ot))!==Js(i.staleTime,W(this,Ot)))&&Ut(this,Qt,Zp).call(this);const c=Ut(this,Qt,Jp).call(this);l&&(W(this,Ot)!==s||Hi(this.options.enabled,W(this,Ot))!==Hi(i.enabled,W(this,Ot))||c!==W(this,qs))&&Ut(this,Qt,$p).call(this,c)}getOptimisticResult(e){const i=W(this,fi).getQueryCache().build(W(this,fi),e),s=this.createResult(i,e);return lw(this,s)&&(Xe(this,ni,s),Xe(this,Ho,this.options),Xe(this,Ur,W(this,Ot).state)),s}getCurrentResult(){return W(this,ni)}trackResult(e,i){return new Proxy(e,{get:(s,l)=>(this.trackProp(l),i==null||i(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Ja).status==="pending"&&W(this,Ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(e){W(this,Vo).add(e)}getCurrentQuery(){return W(this,Ot)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const i=W(this,fi).defaultQueryOptions(e),s=W(this,fi).getQueryCache().build(W(this,fi),i);return s.fetch().then(()=>this.createResult(s,i))}fetch(e){return Ut(this,Qt,$l).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,ni)))}createResult(e,i){var O;const s=W(this,Ot),l=this.options,c=W(this,ni),d=W(this,Ur),h=W(this,Ho),m=e!==s?e.state:W(this,rc),{state:_}=e;let v={..._},g=!1,b;if(i._optimisticResults){const V=this.hasListeners(),k=!V&&__(e,i),$=V&&y_(e,s,i,l);(k||$)&&(v={...v,...Uy(_.data,e.options)}),i._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:A,errorUpdatedAt:D,status:E}=v;b=v.data;let M=!1;if(i.placeholderData!==void 0&&b===void 0&&E==="pending"){let V;c!=null&&c.isPlaceholderData&&i.placeholderData===(h==null?void 0:h.placeholderData)?(V=c.data,M=!0):V=typeof i.placeholderData=="function"?i.placeholderData((O=W(this,ko))==null?void 0:O.state.data,W(this,ko)):i.placeholderData,V!==void 0&&(E="success",b=Yp(c==null?void 0:c.data,V,i),g=!0)}if(i.select&&b!==void 0&&!M)if(c&&b===(d==null?void 0:d.data)&&i.select===W(this,oc))b=W(this,Go);else try{Xe(this,oc,i.select),b=i.select(b),b=Yp(c==null?void 0:c.data,b,i),Xe(this,Go,b),Xe(this,Ws,null)}catch(V){Xe(this,Ws,V)}W(this,Ws)&&(A=W(this,Ws),b=W(this,Go),D=Date.now(),E="error");const z=v.fetchStatus==="fetching",F=E==="pending",C=E==="error",I=F&&z,L=b!==void 0,w={status:E,fetchStatus:v.fetchStatus,isPending:F,isSuccess:E==="success",isError:C,isInitialLoading:I,isLoading:I,data:b,dataUpdatedAt:v.dataUpdatedAt,error:A,errorUpdatedAt:D,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:z,isRefetching:z&&!F,isLoadingError:C&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:C&&L,isStale:Sm(e,i),refetch:this.refetch,promise:W(this,Ja),isEnabled:Hi(i.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=w.data!==void 0,k=w.status==="error"&&!V,$=te=>{k?te.reject(w.error):V&&te.resolve(w.data)},me=()=>{const te=Xe(this,Ja,w.promise=Qp());$(te)},fe=W(this,Ja);switch(fe.status){case"pending":e.queryHash===s.queryHash&&$(fe);break;case"fulfilled":(k||w.data!==fe.value)&&me();break;case"rejected":(!k||w.error!==fe.reason)&&me();break}}return w}updateResult(){const e=W(this,ni),i=this.createResult(W(this,Ot),this.options);if(Xe(this,Ur,W(this,Ot).state),Xe(this,Ho,this.options),W(this,Ur).data!==void 0&&Xe(this,ko,W(this,Ot)),Wp(i,e))return;Xe(this,ni,i);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!W(this,Vo).size)return!0;const d=new Set(c??W(this,Vo));return this.options.throwOnError&&d.add("error"),Object.keys(W(this,ni)).some(h=>{const p=h;return W(this,ni)[p]!==e[p]&&d.has(p)})};Ut(this,Qt,Ly).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ut(this,Qt,em).call(this)}},fi=new WeakMap,Ot=new WeakMap,rc=new WeakMap,ni=new WeakMap,Ur=new WeakMap,Ho=new WeakMap,Ja=new WeakMap,Ws=new WeakMap,oc=new WeakMap,Go=new WeakMap,ko=new WeakMap,Lr=new WeakMap,Or=new WeakMap,qs=new WeakMap,Vo=new WeakMap,Qt=new WeakSet,$l=function(e){Ut(this,Qt,im).call(this);let i=W(this,Ot).fetch(this.options,e);return e!=null&&e.throwOnError||(i=i.catch(di)),i},Zp=function(){Ut(this,Qt,tm).call(this);const e=Js(this.options.staleTime,W(this,Ot));if(ac.isServer()||W(this,ni).isStale||!Xp(e))return;const s=Ey(W(this,ni).dataUpdatedAt,e)+1;Xe(this,Lr,Ar.setTimeout(()=>{W(this,ni).isStale||this.updateResult()},s))},Jp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Ot)):this.options.refetchInterval)??!1},$p=function(e){Ut(this,Qt,nm).call(this),Xe(this,qs,e),!(ac.isServer()||Hi(this.options.enabled,W(this,Ot))===!1||!Xp(W(this,qs))||W(this,qs)===0)&&Xe(this,Or,Ar.setInterval(()=>{(this.options.refetchIntervalInBackground||_m.isFocused())&&Ut(this,Qt,$l).call(this)},W(this,qs)))},em=function(){Ut(this,Qt,Zp).call(this),Ut(this,Qt,$p).call(this,Ut(this,Qt,Jp).call(this))},tm=function(){W(this,Lr)!==void 0&&(Ar.clearTimeout(W(this,Lr)),Xe(this,Lr,void 0))},nm=function(){W(this,Or)!==void 0&&(Ar.clearInterval(W(this,Or)),Xe(this,Or,void 0))},im=function(){const e=W(this,fi).getQueryCache().build(W(this,fi),this.options);if(e===W(this,Ot))return;const i=W(this,Ot);Xe(this,Ot,e),Xe(this,rc,e.state),this.hasListeners()&&(i==null||i.removeObserver(this),e.addObserver(this))},Ly=function(e){jn.batch(()=>{e.listeners&&this.listeners.forEach(i=>{i(W(this,ni))}),W(this,fi).getQueryCache().notify({query:W(this,Ot),type:"observerResultsUpdated"})})},R_);function ow(r,e){return Hi(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&e.retryOnMount===!1)}function __(r,e){return ow(r,e)||r.state.data!==void 0&&am(r,e,e.refetchOnMount)}function am(r,e,i){if(Hi(e.enabled,r)!==!1&&Js(e.staleTime,r)!=="static"){const s=typeof i=="function"?i(r):i;return s==="always"||s!==!1&&Sm(r,e)}return!1}function y_(r,e,i,s){return(r!==e||Hi(s.enabled,r)===!1)&&(!i.suspense||r.state.status!=="error")&&Sm(r,i)}function Sm(r,e){return Hi(e.enabled,r)!==!1&&r.isStaleByTime(Js(e.staleTime,r))}function lw(r,e){return!Wp(r.getCurrentResult(),e)}function b_(r){return{onFetch:(e,i)=>{var _,v,g,b,A;const s=e.options,l=(g=(v=(_=e.fetchOptions)==null?void 0:_.meta)==null?void 0:v.fetchMore)==null?void 0:g.direction,c=((b=e.state.data)==null?void 0:b.pages)||[],d=((A=e.state.data)==null?void 0:A.pageParams)||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let D=!1;const E=F=>{ew(F,()=>e.signal,()=>D=!0)},M=Ay(e.options,e.fetchOptions),z=async(F,C,I)=>
vendor: 4,289 bytes, line 4219
4219{if(D)return Promise.reject();if(C==null&&F.pages.length)return Promise.resolve(F);const H=(()=>{const k={client:e.client,queryKey:e.queryKey,pageParam:C,direction:I?"backward":"forward",meta:e.options.meta};return E(k),k})(),w=await M(H),{maxPages:O}=e.options,V=I?$3:J3;return{pages:V(F.pages,w,O),pageParams:V(F.pageParams,C,O)}};if(l&&c.length){const F=l==="backward",C=F?cw:S_,I={pages:c,pageParams:d},L=C(s,I);h=await z(I,L,F)}else{const F=r??c.length;do{const C=p===0?d[0]??s.initialPageParam:S_(s,h);if(p>0&&C==null)break;h=await z(h,C),p++}while(p<F)}return h};e.options.persister?e.fetchFn=()=>{var D,E;return(E=(D=e.options).persister)==null?void 0:E.call(D,m,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i)}:e.fetchFn=m}}}function S_(r,{pages:e,pageParams:i}){const s=e.length-1;return e.length>0?r.getNextPageParam(e[s],e,i[s],i):void 0}function cw(r,{pages:e,pageParams:i}){var s;return e.length>0?(s=r.getPreviousPageParam)==null?void 0:s.call(r,e[0],e,i[0],i):void 0}var lc,ma,Qn,Pr,ga,Gs,N_,uw=(N_=class extends Ny{constructor(e){super();st(this,ga);st(this,lc);st(this,ma);st(this,Qn);st(this,Pr);Xe(this,lc,e.client),this.mutationId=e.mutationId,Xe(this,Qn,e.mutationCache),Xe(this,ma,[]),this.state=e.state||fw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,ma).includes(e)||(W(this,ma).push(e),this.clearGcTimeout(),W(this,Qn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,ma,W(this,ma).filter(i=>i!==e)),this.scheduleGc(),W(this,Qn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,ma).length||(this.state.status==="pending"?this.scheduleGc():W(this,Qn).remove(this))}continue(){var e;return((e=W(this,Pr))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,h,p,m,_,v,g,b,A,D,E,M,z,F,C,I,L,H;const i=()=>{Ut(this,ga,Gs).call(this,{type:"continue"})},s={client:W(this,lc),meta:this.options.meta,mutationKey:this.options.mutationKey};Xe(this,Pr,Ry({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(w,O)=>{Ut(this,ga,Gs).call(this,{type:"failed",failureCount:w,error:O})},onPause:()=>{Ut(this,ga,Gs).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Qn).canRun(this)}));const l=this.state.status==="pending",c=!W(this,Pr).canStart();try{if(l)i();else{Ut(this,ga,Gs).call(this,{type:"pending",variables:e,isPaused:c}),W(this,Qn).config.onMutate&&await W(this,Qn).config.onMutate(e,this,s);const O=await((h=(d=this.options).onMutate)==null?void 0:h.call(d,e,s));O!==this.state.context&&Ut(this,ga,Gs).call(this,{type:"pending",context:O,variables:e,isPaused:c})}const w=await W(this,Pr).start();return await((m=(p=W(this,Qn).config).onSuccess)==null?void 0:m.call(p,w,e,this.state.context,this,s)),await((v=(_=this.options).onSuccess)==null?void 0:v.call(_,w,e,this.state.context,s)),await((b=(g=W(this,Qn).config).onSettled)==null?void 0:b.call(g,w,null,this.state.variables,this.state.context,this,s)),await((D=(A=this.options).onSettled)==null?void 0:D.call(A,w,null,e,this.state.context,s)),Ut(this,ga,Gs).call(this,{type:"success",data:w}),w}catch(w){try{await((M=(E=W(this,Qn).config).onError)==null?void 0:M.call(E,w,e,this.state.context,this,s))}catch(O){Promise.reject(O)}try{await((F=(z=this.options).onError)==null?void 0:F.call(z,w,e,this.state.context,s))}catch(O){Promise.reject(O)}try{await((I=(C=W(this,Qn).config).onSettled)==null?void 0:I.call(C,void 0,w,this.state.variables,this.state.context,this,s))}catch(O){Promise.reject(O)}try{await((H=(L=this.options).onSettled)==null?void 0:H.call(L,void 0,w,e,this.state.context,s))}catch(O){Promise.reject(O)}throw Ut(this,ga,Gs).call(this,{type:"error",error:w}),w}finally{W(this,Qn).runNext(this)}}},lc=new WeakMap,ma=new WeakMap,Qn=new WeakMap,Pr=new WeakMap,ga=new WeakSet,Gs=function(e){const i=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};
4219case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=i(this.state),jn.batch(()=>{W(this,ma).forEach(s=>{s.onMutationUpdate(e)}),W(this,Qn).notify({mutation:this,type:"updated",action:e})})},N_);function fw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $a,Ji,cc,D_,dw=(D_=class extends pc{constructor(e={}){super();st(this,$a);st(this,Ji);st(this,cc);this.config=e,Xe(this,$a,new Set),Xe(this,Ji,new Map),Xe(this,cc,0)}build(e,i,s){const l=new uw({client:e,mutationCache:this,mutationId:++Mu(this,cc)._,options:e.defaultMutationOptions(i),state:s});return this.add(l),l}add(e){W(this,$a).add(e);const i=qu(e);if(typeof i=="string"){const s=W(this,Ji).get(i);s?s.push(e):W(this,Ji).set(i,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,$a).delete(e)){const i=qu(e);if(typeof i=="string"){const s=W(this,Ji).get(i);if(s)if(s.length>1){const l=s.indexOf(e);l!==-1&&s.splice(l,1)}else s[0]===e&&W(this,Ji).delete(i)}}this.notify({type:"removed",mutation:e})}canRun(e){const i=qu(e);if(typeof i=="string"){const s=W(this,Ji).get(i),l=s==null?void 0:s.find(c=>c.state.status==="pending");return!l||l===e}else return!0}runNext(e){var s;const i=qu(e);if(typeof i=="string"){const l=(s=W(this,Ji).get(i))==null?void 0:s.find(c=>c!==e&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jn.batch(()=>{W(this,$a).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,$a).clear(),W(this,Ji).clear()})}getAll(){return Array.from(W(this,$a))}find(e){const i={exact:!0,...e};return this.getAll().find(s=>p_(i,s))}findAll(e={}){return this.getAll().filter(i=>p_(e,i))}notify(e){jn.batch(()=>{this.listeners.forEach(i=>{i(e)})})}resumePausedMutations(){const e=this.getAll().filter(i=>i.state.isPaused);return jn.batch(()=>Promise.all(e.map(i=>i.continue().catch(di))))}},$a=new WeakMap,Ji=new WeakMap,cc=new WeakMap,D_);function qu(r){var e;return(e=r.options.scope)==null?void 0:e.id}var xa,U_,hw=(U_=class extends pc{constructor(e={}){super();st(this,xa);this.config=e,Xe(this,xa,new Map)}build(e,i,s){const l=i.queryKey,c=i.queryHash??ym(l,i);let d=this.get(c);return d||(d=new sw({client:e,queryKey:l,queryHash:c,options:e.defaultQueryOptions(i),state:s,defaultOptions:e.getQueryDefaults(l)}),this.add(d)),d}add(e){W(this,xa).has(e.queryHash)||(W(this,xa).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const i=W(this,xa).get(e.queryHash);i&&(e.destroy(),i===e&&W(this,xa).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,xa).get(e)}getAll(){return[...W(this,xa).values()]}find(e){const i={exact:!0,...e};return this.getAll().find(s=>h_(i,s))}findAll(e={}){const i=this.getAll();return Object.keys(e).length>0?i.filter(s=>h_(e,s)):i}notify(e){jn.batch(()=>{this.listeners.forEach(i=>{i(e)})})}onFocus(){jn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xa=new WeakMap,U_),bn,Ys,Qs,jo,Xo,Ks,Wo,qo,L_,pw=(L_=class{constructor(r={}){st(this,bn);st(this,Ys);st(this,Qs);st(this,jo);st(this,Xo);st(this,Ks);st(this,Wo);st(this,qo);Xe(this,bn,r.queryCache||new hw),Xe(this,Ys,r.mutationCache||new dw),Xe(this,Qs,r.defaultOptions||{}),Xe(this,jo,new Map),Xe(this,Xo,new Map),Xe(this,Ks,0)}mount(){Mu(this,Ks)._++,W(this,Ks)===1&&(Xe(this,Wo,_m.subscribe(async r=>{r&&(await this.resumePausedMutations(),W(this,bn).onFocus())})),Xe(this,qo,of.subscribe(async r=>{r&&(await this.resumePausedMutations(),W(this,bn).onOnline())})))}unmount(){var r,e;Mu(this,Ks)._--,W(this,Ks)===0&&((r=W(this,Wo))==null||r.call(this),Xe(this,Wo,void 0),(e=W(this,qo))==null||e.call(this),Xe(this,qo,void 0))}isFetching(r){return W(this,bn).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return W(this,Ys).findAll({...r,status:"pending"}).length}getQueryData(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=W(this,bn).get(e.queryHash))==null?void 0:i.state.data}ensureQueryData(r){const e=this.defaultQueryOptions(r),i=W(this,bn).build(this,e),s=i.state.data;return s===void 0?this.fetchQuery(r):(r.revalidateIfStale&&i.isStaleByTime(Js(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(r){return W(this,bn).findAll(r).map(({queryKey:e,state:i})=>{const s=i.data;return[e,s]})}setQueryData(r,e,i){const s=this.defaultQueryOptions({queryKey:r}),l=W(this,bn).get(s.queryHash),c=l==null?void 0:l.state.data,d=Q3(e,c);if(d!==void 0)return W(this,bn).build(this,s).setData(d,{...i,manual:!0})}
4219setQueriesData(r,e,i){return jn.batch(()=>W(this,bn).findAll(r).map(({queryKey:s})=>[s,this.setQueryData(s,e,i)]))}getQueryState(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=W(this,bn).get(e.queryHash))==null?void 0:i.state}removeQueries(r){const e=W(this,bn);jn.batch(()=>{e.findAll(r).forEach(i=>{e.remove(i)})})}resetQueries(r,e){const i=W(this,bn);return jn.batch(()=>(i.findAll(r).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){const i={revert:!0,...e},s=jn.batch(()=>W(this,bn).findAll(r).map(l=>l.cancel(i)));return Promise.all(s).then(di).catch(di)}invalidateQueries(r,e={}){return jn.batch(()=>(W(this,bn).findAll(r).forEach(i=>{i.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},e)))}refetchQueries(r,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},s=jn.batch(()=>W(this,bn).findAll(r).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,i);return i.throwOnError||(c=c.catch(di)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(di)}fetchQuery(r){const e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);const i=W(this,bn).build(this,e);return i.isStaleByTime(Js(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(di).catch(di)}fetchInfiniteQuery(r){return r.behavior=b_(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(di).catch(di)}ensureInfiniteQueryData(r){return r.behavior=b_(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return of.isOnline()?W(this,Ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,bn)}getMutationCache(){return W(this,Ys)}getDefaultOptions(){return W(this,Qs)}setDefaultOptions(r){Xe(this,Qs,r)}setQueryDefaults(r,e){W(this,jo).set(nc(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){const e=[...W(this,jo).values()],i={};return e.forEach(s=>{ic(r,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(r,e){W(this,Xo).set(nc(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){const e=[...W(this,Xo).values()],i={};return e.forEach(s=>{ic(r,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(r){if(r._defaulted)return r;const e={...W(this,Qs).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=ym(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===bm&&(e.enabled=!1),e}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...W(this,Qs).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){W(this,bn).clear(),W(this,Ys).clear()}},bn=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,jo=new WeakMap,Xo=new WeakMap,Ks=new WeakMap,Wo=new WeakMap,qo=new WeakMap,L_),Oy=ye.createContext(void 0),Py=r=>{const e=ye.useContext(Oy);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},mw=({client:r,children:e})=>(ye.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),x.jsx(Oy.Provider,{value:r,children:e})),Iy=ye.createContext(!1),gw=()=>ye.useContext(Iy);Iy.Provider;function xw(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var vw=ye.createContext(xw()),_w=()=>ye.useContext(vw),yw=(r,e,i)=>{const s=i!=null&&i.state.error&&typeof r.throwOnError=="function"?wy(r.throwOnError,[i.state.error,i]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||s)&&(e.isReset()||(r.retryOnMount=!1))},bw=r=>{ye.useEffect(()=>{r.clearReset()},[r])},Sw=({result:r,errorResetBoundary:e,throwOnError:i,query:s,suspense:l})=>r.isError&&!e.isReset()&&!r.isFetching&&s&&(l&&r.data===void 0||wy(i,[r.error,s])),Mw=r=>{if(r.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),s=r.staleTime;r.staleTime=typeof s=="function"?(...l)=>i(s(...l)):i(s),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},Ew=(r,e)=>r.isLoading&&r.isFetching&&!e,Tw=(r,e)=>(r==null?void 0:r.suspense)&&e.isPending,M_=(r,e,i)=>e.fetchOptimistic(r).catch(()=>{i.clearReset()});function Aw(r,e,i){var g,b,A,D;const s=gw(),l=_w(),c=Py(),d=c.defaultQueryOptions(r);(b=(g=c.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,d);const h=c.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",Mw(d),yw(d,l,h),bw(l);const p=!c.getQueryCache().get(d.queryHash),[m]=ye.useState(()=>new e(c,d)),_=m.getOptimisticResult(d),v=!s&&r.subscribed!==!1;if(ye.useSyncExternalStore(ye.useCallback(E=>{const M=v?m.subscribe(jn.batchCalls(E)):di;return m.updateResult(),M},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),ye.useEffect(()=>{m.setOptions(d)},[d,m]),Tw(d,_))throw M_(d,m,l);if(Sw({result:_,errorResetBoundary:l,throwOnError:d.throwOnError,query:h,suspense:d.suspense}))throw _.error;if((D=(A=c.getDefaultOptions().queries)==null?void 0:A._experimental_afterQuery)==null||D.call(A,d,_),d.experimental_prefetchInRender&&!ac.isServer()&&Ew(_,s)){const E=p?M_(d,m,l):h==null?void 0:h.promise;E==null||E.catch(di).finally(()=>{m.updateResult()})}return d.notifyOnChangeProps?_:m.trackResult(_)}function pa(r,e){return Aw(r,rw)}const ww=et.lazy(()=>vn(()=>import("./CartDrawer-3GZs0giw.js"),__vite__mapDeps([0,1,2]))),Cw=et.lazy(()=>vn(()=>import("./AuthModal-DmN7z9X5.js"),__vite__mapDeps([3,1,4,5]))),Rw=et.lazy(()=>vn(()=>import("./ProductPage-GdFo4Vrv.js"),__vite__mapDeps([6,1,5,2,4]))),Nw=et.lazy(()=>vn(()=>import("./ShopPage-DygP303R.js"),__vite__mapDeps([7,1,4,5]))),Dw=et.lazy(()=>vn(()=>import("./CheckoutPage-B4SzS6og.js"),__vite__mapDeps([8,1,4,5]))),Uw=et.lazy(()=>vn(()=>import("./Dashboard-Bp8qIar0.js"),__vite__mapDeps([9,1,4,5]))),Lw=et.lazy(()=>vn(()=>import("./FAQPage--cNBFvA6.js"),__vite__mapDeps([10,1]))),Ow=et.lazy(()=>vn(()=>import("./BlogsPage-zN7oHJdw.js"),__vite__mapDeps([11,1,4,5]))),Pw=et.lazy(()=>vn(()=>import("./DistributorPage-Cv7nPbuJ.js"),__vite__mapDeps([12,1,4,5]))),Iw=et.lazy(()=>vn(()=>
4219import("./BlogDetailPage-D41Eg4b0.js"),__vite__mapDeps([13,1,4,5]))),Fw=et.lazy(()=>vn(()=>import("./EventBlogsPage-BUM4r-aC.js"),__vite__mapDeps([14,1,4,5]))),zw=et.lazy(()=>vn(()=>import("./EventDetailsPage-DYpleLks.js"),__vite__mapDeps([15,1,4,5]))),Bw=et.lazy(()=>vn(()=>import("./AdminLoginPage-0o_NtH6d.js"),__vite__mapDeps([16,1,4,5]))),Hw=et.lazy(()=>vn(()=>import("./AdminDashboard-_iDphIBr.js"),__vite__mapDeps([17,1,4,5]))),Gw=et.lazy(()=>vn(()=>import("./VisitorFormPage-CFMam66i.js"),__vite__mapDeps([18,1,4,5,19]))),kw=et.lazy(()=>vn(()=>import("./JourneyPage-D3uhwk0Q.js"),__vite__mapDeps([20,1]))),Vw=et.lazy(()=>vn(()=>import("./PrivacyPolicyPage-DqHGwksm.js"),__vite__mapDeps([21,1]))),jw=et.lazy(()=>vn(()=>import("./TermsAndConditionsPage-DeI9v_qW.js"),__vite__mapDeps([22,1]))),Xw=et.lazy(()=>vn(()=>import("./RefundPolicyPage-CZfSNR9T.js"),__vite__mapDeps([23,1]))),Ww=et.lazy(()=>vn(()=>import("./ShippingPolicyPage-CNlOGWvX.js"),__vite__mapDeps([24,1]))),qw=et.lazy(()=>vn(()=>import("./SharedWishlistPage-VWhs_5d5.js"),__vite__mapDeps([25,1,4,5]))),Yw=et.lazy(()=>vn(()=>import("./NotFoundPage-BWQN-cTR.js"),__vite__mapDeps([26,1]))),Qw=et.lazy(()=>vn(()=>import("./EventModal-BI_BVbUC.js"),__vite__mapDeps([27,1]))),Kw=et.lazy(()=>vn(()=>import("./SnaxxoProductWheel-Ym-N_u5r.js"),__vite__mapDeps([28,1,5,4]))),Zw=[],Jw=[],$w=[],eC=[],tC=[],nC=[],iC=async()=>{const r=await fetch(`${ct}/api/products/`);if(!r.ok)throw new Error("Failed to fetch products");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>{var l,c,d,h,p,m,_,v,g,b,A;return{...s,id:String(s.id),slug:s.slug||"",price:parseFloat(s.price),original_price:s.original_price?parseFloat(s.original_price):s.originalPrice?parseFloat(s.originalPrice):void 0,originalPrice:s.original_price?parseFloat(s.original_price):s.originalPrice?parseFloat(s.originalPrice):void 0,reviewCount:s.review_count||0,isTopRated:s.is_top_rated,model3d:s.model_3d||null,themeColor:s.theme_color,orientation:s.orientation?s.orientation.replace(/[Oo]/g,"0"):"0deg 0deg 0deg",benefits:(s.benefits||[]).filter(D=>D&&String(D).trim()!==""),nutrients:s.nutrients||[],nutrition:(l=s.nutrients)!=null&&l.length?Object.fromEntries(s.nutrients.map(D=>{var E;return[(E=D.label)==null?void 0:E.toLowerCase().replace(/\s+/g,""),D.value]})):void 0,ingredients:s.ingredients||"",ingredientsList:s.ingredients_list||[],detailedNutrition:s.detailed_nutrition||[],usageIdeas:(s.usage_ideas||[]).map(D=>
4219({id:String(D.id),productId:String(D.product),title:D.title,description:D.description,image:D.image||"",order:D.order||0})),gallery:s.gallery||[],mainIngredient:s.main_ingredient||((c=s.name)!=null&&c.toLowerCase().includes("peanut")?"100% Roasted Peanuts":(d=s.name)!=null&&d.toLowerCase().includes("almond")?"Premium Roasted Almonds":(h=s.name)!=null&&h.toLowerCase().includes("chocolate")?"Dark Belgian Chocolate":(p=s.name)!=null&&p.toLowerCase().includes("strawberry")?"Fresh Strawberries":(m=s.name)!=null&&m.toLowerCase().includes("chia")?"Organic Chia Seeds":"Premium Ingredients"),mainIngredientImage:s.main_ingredient_image||((_=s.name)!=null&&_.toLowerCase().includes("peanut")?"https://images.unsplash.com/photo-1590301157890-4810ed352733?q=80&w=800&auto=format&fit=crop":(v=s.name)!=null&&v.toLowerCase().includes("almond")?"https://images.unsplash.com/photo-1508029091899-59990abc4b8d?q=80&w=800&auto=format&fit=crop":(g=s.name)!=null&&g.toLowerCase().includes("chocolate")?"https://images.unsplash.com/photo-1511381939415-322199ae53d5?q=80&w=800&auto=format&fit=crop":(b=s.name)!=null&&b.toLowerCase().includes("strawberry")?"https://images.unsplash.com/photo-1518635017498-87afc0455a43?q=80&w=800&auto=format&fit=crop":(A=s.name)!=null&&A.toLowerCase().includes("chia")?"https://images.unsplash.com/photo-1588600030303-920aa942828b?q=80&w=800&auto=format&fit=crop":void 0)}})},aC=async()=>{const r=await fetch(`${ct}/api/categories/`);if(!r.ok)throw new Error("Failed to fetch categories");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id)}))},sC=async()=>{const r=await fetch(`${ct}/api/announcements/`);if(!r.ok)throw new Error("Failed to fetch announcements");const e=await r.json();return Array.isArray(e)?e:[]},rC=async()=>{const r=await fetch(`${ct}/api/visitor-forms/`);if(!r.ok)throw new Error("Failed to fetch visitor forms");const e=await r.json();return Array.isArray(e)?e:[]},oC=async()=>{const r=await fetch(`${ct}/api/hero-slides/`);if(!r.ok)throw new Error("Failed to fetch hero slides");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id),ctaLink:s.cta_link,secondaryCta:s.secondary_cta,secondaryCtaLink:s.secondary_cta_link,bgColor:s.bg_color,accentColor:s.accent_color,blobColor:s.blob_color,backgroundImage:s.background_image,productId:s.product_id,transitionType:s.transition_type,isActive:s.is_active,order:s.order,mobileImage:s.mobile_image,displayDuration:s.display_duration})).sort((s,l)=>(s.order||0)-(l.order||0))},lC=async()=>{const r=await fetch(`${ct}/api/events/`);if(!r.ok)throw new Error("Failed to fetch events");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id),fullStory:s.full_story||[],featuredProducts:(s.featured_products||[]).map(String),gallery:s.gallery||[],impactParticipants:s.impact_participants,fuelBarsShared:s.fuel_bars_shared,vibeEnergy:s.vibe_energy,scheduledDate:s.scheduled_date,isActive:s.is_active}))},cC=async()=>{const r=await fetch(`${ct}/api/blog-posts/`);if(!r.ok)throw new Error("Failed to fetch blogs");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id),slug:s.slug||"",type:s.post_type,content:Array.isArray(s.content)?s.content.join(`
4220
4221`):s.content||"",tags:s.tags||[],isActive:s.is_active}))},uC=async()=>{const r=await fetch(`${ct}/api/stories/`);if(!r.ok)throw new Error("Failed to fetch stories");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id),mediaUrl:s.media_url||s.mediaUrl,posterUrl:s.poster_url||s.posterUrl,mediaType:s.media_type||s.mediaType,fullVideoUrl:s.full_video_url||s.fullVideoUrl,originalDriveUrl:s.original_drive_url||s.originalDriveUrl,productId:s.product_id?String(s.product_id):void 0}))},fC=async()=>{const r=await fetch(`${ct}/api/reviews/`);if(!r.ok)throw new Error("Failed to fetch reviews");const e=await r.json();return(Array.isArray(e)?e:e.results||[]).map(s=>({...s,id:String(s.id),productId:String(s.product_id_str||s.product),userName:s.user_name,userRole:s.user_role}))},dC=()=>{const[r,e]=ye.useState(!1),[i,s]=ye.useState(!1),[l,c]=ye.useState(()=>{var U;const S=window.location.pathname;return S.startsWith("/product/")?"product":S.startsWith("/blog/")?"blog-detail":S.startsWith("/blogs")?"blogs":S.startsWith("/shop")?"shop":S.startsWith("/dashboard")?"dashboard":S.startsWith("/faq")?"faq":S.startsWith("/distributor")?"distributor":S.startsWith("/journey")?"journey":S.startsWith("/checkout")?"checkout":S.startsWith("/events")?"event-blogs":S.startsWith("/event/")?"event-detail":S.startsWith("/privacy-policy")?"privacy-policy":S.startsWith("/terms-and-conditions")?"terms-and-conditions":S.startsWith("/refund-policy")?"refund-policy":S.startsWith("/shipping-policy")?"shipping-policy":S.startsWith("/admin/login")?"admin-login":S.startsWith("/admin")?"admin-dashboard":S.startsWith("/forms/")?"visitor-form":S.startsWith("/wishlist/shared/")?"shared-wishlist":((U=window.history.state)==null?void 0:U.view)||"not-found"}),[d,h]=ye.useState(!1),[p,m]=ye.useState(!1),[_,v]=ye.useState(!1),[g,b]=ye.useState(null),[A,D]=ye.useState(null),[E,M]=ye.useState(null),[z,F]=ye.useState(null),[C,I]=ye.useState(null),[L,H]=ye.useState(()=>{var S;return((S=window.history.state)==null?void 0:S.query)||""}),[w,O]=ye.useState(()=>{var S;return((S=window.history.state)==null?void 0:S.category)||"All"}),[V,k]=ye.useState(!1),[$,me]=ye.useState(!1),{user:fe,logout:te,checkAuth:B,isLoading:j}=V3(),{showToast:Y}=D3(),ce=Py(),Se=pa({queryKey:["products"],queryFn:iC,staleTime:120*1e3}),Ce=pa({queryKey:["reviews"],queryFn:fC,staleTime:300*1e3}),Ae=pa({queryKey:["categories"],queryFn:aC,staleTime:120*1e3}),je=pa({queryKey:["announcements"],queryFn:sC,staleTime:300*1e3}),dt=pa({queryKey:["visitor-forms"],queryFn:rC,staleTime:300*1e3}
4221),ft=pa({queryKey:["hero-slides"],queryFn:oC,staleTime:300*1e3}),Z=pa({queryKey:["events"],queryFn:lC,staleTime:300*1e3}),we=pa({queryKey:["blog-posts"],queryFn:cC,staleTime:300*1e3}),Te=pa({queryKey:["stories"],queryFn:uC,staleTime:300*1e3}),ke=Se.data||Zw,rt=Ce.data||$w,Ze=Ae.data||nC,en=je.data||[],yt=dt.data||[],Et=ft.data||tC,vt=Z.data||eC,ht=we.data||[],sn=Te.data||Jw,pn=pa({queryKey:["customers"],queryFn:async()=>{const S=await ln(`${ct}/api/customers/`);if(!S.ok)throw new Error("Failed to fetch customers");return S.json()},enabled:r}),[Wt,rn]=ye.useState([]),qt=et.useRef(!1);ye.useEffect(()=>{if(!qt.current)try{const S=localStorage.getItem("pinobite_cart");if(S&&ke.length>0){const re=JSON.parse(S).map(Ee=>{const Me=ke.find(ze=>String(ze.id)===String(Ee.id));return Me?{...Me,...Ee}:null}).filter(Boolean);re.length>0&&(rn(re),qt.current=!0)}}catch(S){console.error("Initial hydration failed:",S)}},[ke]),ye.useEffect(()=>{if(!(Wt.length===0&&!qt.current))try{const S=Wt.map(U=>({id:U.id,quantity:U.quantity,selectedSize:U.selectedSize,selectedFlavour:U.selectedFlavour}));localStorage.setItem("pinobite_cart",JSON.stringify(S))}catch(S){console.error("Failed to save cart:",S)}},[Wt]);const un=ht.filter(S=>S.isActive!==!1),Q=vt.filter(S=>{if(S.isActive===!1)return!1;if(!S.scheduledDate)return!0;try{const U=new Date(S.scheduledDate);U.setUTCHours(0,0,0,0);const re=new Date;return re.setUTCHours(0,0,0,0),U<=re}catch{return!0}}),Ht=Se.isLoading||Ae.isLoading;ye.useEffect(()=>{var Ee,Me,ze,Be,Qe,lt,Ye,wt;const S=window.location.pathname,U=new URLSearchParams(window.location.search),re=it=>{let gt=!0;return fetch(`${ct}/api/products/${it}/`).then(tt=>tt.json()).then(tt=>{const Ft={...tt,id:String(tt.id),slug:tt.slug||it,price:parseFloat(tt.price),themeColor:tt.theme_color,model3d:tt.model_3d,orientation:tt.orientation?tt.orientation.replace(/[Oo]/g,"0"):"0deg 0deg -15deg",benefits:(tt.benefits||[]).filter(Le=>Le&&String(Le).trim()!==""),nutrients:tt.nutrients||[],ingredients:tt.ingredients||"",ingredientsList:tt.ingredients_list||[],detailedNutrition:tt.detailed_nutrition||[],usageIdeas:(tt.usage_ideas||[]).map(Le=>({id:String(Le.id),productId:String(Le.product),title:Le.title,description:Le.description,image:Le.image||"",order:Le.order||0}))};b(Ft),c("product"),window.scrollTo(0,0)}),gt};if(S==="/"||S==="")c("home");else if(S.startsWith("/forms/")){const it=S.split("/forms/")[1];it&&(F(it),c("visitor-form"))}else if(S.startsWith("/wishlist/shared/")){const it=S.split("/wishlist/shared/")[1];it&&(I(it),c("shared-wishlist"))}else if(S.startsWith("/product/")){const it=(Me=(Ee=S.split("/product/")[1])==null?void 0:Ee.split("/")[0])==null?void 0:Me.split("?")[0];if(it){const gt=ke.find(tt=>tt.slug===it);gt?(b(gt),c("product"),window.scrollTo(0,0)):re(it)}}else if(S.startsWith("/blog/")){const it=(Be=(ze=S.split("/blog/")[1])==null?void 0:ze.split("/")[0])==null?void 0:Be.split("?")[0];if(it){const gt=ht.find(tt=>tt.slug===it);gt&&(M(gt),c("blog-detail"),window.scrollTo(0,0))}}else if(S.startsWith("/blogs"))c("blogs");else if(S.startsWith("/shop/")){const it=(lt=(Qe=S.split("/shop/")[1])==null?void 0:Qe.split("/")[0])==null?void 0:lt.split("?")[0],gt=U.get("search");gt&&H(gt),it&&O(decodeURIComponent(it)),c("shop")}else if(S==="/shop"){const it=U.get("search");it&&H(it),c("shop")}else if(S.startsWith("/event/")){const it=(wt=(Ye=S.split("/event/")[1])==null?void 0:Ye.split("/")[0])==null?void 0:wt.split("?")[0];if(it){const gt=vt.find(tt=>String(tt.id)===String(it));gt&&(D(gt),c("event-detail"),window.scrollTo(0,0))}}else c(S==="/events"?"event-blogs":S==="/dashboard"?"dashboard":S==="/faq"?"faq":S==="/distributor"?"distributor":S==="/journey"?"journey":S==="/checkout"?"checkout":S==="/privacy-policy"?"privacy-policy":S==="/terms-and-conditions"?"terms-and-conditions":S==="/refund-policy"?"refund-policy":S==="/shipping-policy"?"shipping-policy":S==="/admin/login"?"admin-login":S==="/admin"?"admin-dashboard":"not-found")},[]),ye.useEffect(()=>()=>{},[]),ye.useEffect(()=>{const S=async re=>{var Me,ze,Be,Qe,lt,Ye,wt,it,gt,tt,Ft,Le;let Ee=re==null?void 0:re.view;if(!Ee){const Tt=window.location.pathname;Tt==="/"||Tt===""?Ee="home":Tt.startsWith("/product/")?Ee="product":Tt.startsWith("/shop")?Ee="shop":Tt.startsWith("/blog/")?Ee="blog-detail":Tt.startsWith("/blogs")?
4221Ee="blogs":Tt.startsWith("/event/")?Ee="event-detail":Tt.startsWith("/events")?Ee="event-blogs":Tt.startsWith("/dashboard")?Ee="dashboard":Tt.startsWith("/checkout")?Ee="checkout":Ee="home"}if(c(Tt=>Tt!==Ee?Ee:Tt),re.slug&&!(g&&g.slug===re.slug&&(((Me=g.benefits)==null?void 0:Me.length)||0)>0)){const pt=ke.find(fn=>fn.slug===re.slug);if(pt){b(pt);try{const fn=await fetch(`${ct}/api/products/${pt.slug}/`);if(fn.ok){const St=await fn.json();b({...St,id:String(St.id),slug:St.slug,price:parseFloat(St.price),themeColor:St.theme_color,model3d:St.model_3d,orientation:St.orientation?St.orientation.replace(/[Oo]/g,"0"):"0deg 0deg -15deg",benefits:(St.benefits||[]).filter(Mn=>Mn&&String(Mn).trim()!==""),nutrients:St.nutrients||[],ingredients:St.ingredients||"",ingredientsList:St.ingredients_list||[],detailedNutrition:St.detailed_nutrition||[],usageIdeas:(St.usage_ideas||[]).map(Mn=>({id:String(Mn.id),productId:String(Mn.product),title:Mn.title,description:Mn.description,image:Mn.image||"",order:Mn.order||0})),mainIngredient:St.main_ingredient||((ze=St.name)!=null&&ze.toLowerCase().includes("peanut")?"100% Roasted Peanuts":(Be=St.name)!=null&&Be.toLowerCase().includes("almond")?"Premium Roasted Almonds":(Qe=St.name)!=null&&Qe.toLowerCase().includes("chocolate")?"Dark Belgian Chocolate":(lt=St.name)!=null&&lt.toLowerCase().includes("strawberry")?"Fresh Strawberries":(Ye=St.name)!=null&&Ye.toLowerCase().includes("chia")?"Organic Chia Seeds":"Premium Ingredients"),mainIngredientImage:St.main_ingredient_image||((wt=St.name)!=null&&wt.toLowerCase().includes("peanut")?"https://images.unsplash.com/photo-1590301157890-4810ed352733?q=80&w=800&auto=format&fit=crop":(it=St.name)!=null&&it.toLowerCase().includes("almond")?"https://images.unsplash.com/photo-1508029091899-59990abc4b8d?q=80&w=800&auto=format&fit=crop":(gt=St.name)!=null&&gt.toLowerCase().includes("chocolate")?"https://images.unsplash.com/photo-1511381939415-322199ae53d5?q=80&w=800&auto=format&fit=crop":(tt=St.name)!=null&&tt.toLowerCase().includes("strawberry")?"https://images.unsplash.com/photo-1518635017498-87afc0455a43?q=80&w=800&auto=format&fit=crop":(Ft=St.name)!=null&&Ft.toLowerCase().includes("chia")?"https://images.unsplash.com/photo-1588600030303-920aa942828b?q=80&w=800&auto=format&fit=crop":void 0)})}}catch{}}}if(re.eventId){const Tt=vt.find(pt=>String(pt.id)===String(re.eventId));Tt&&(!A||A.id!==Tt.id)&&D(Tt)}if(re.slug&&!((Le=re.view)!=null&&Le.startsWith("product"))){const Tt=ht.find(pt=>pt.slug===re.slug);Tt&&(!E||E.slug!==Tt.slug)&&M(Tt)}},U=re=>{S(re.state)};return window.addEventListener("popstate",U),window.history.state&&window.history.state.slug&&!g&&S(window.history.state),()=>window.removeEventListener("popstate",U)},[ke,vt,ht]),ye.useEffect(()=>{s(!!fe)},[fe]),ye.useEffect(()=>{localStorage.getItem("admin_access_token")&&e(!0)},[]),ye.useEffect(()=>{const S=()=>{Y("Session expired. Please log in again.","warning"),e(!1),localStorage.removeItem("admin_access_token"),localStorage.removeItem("admin_refresh_token"),c("home"),window.history.pushState({view:"home"},"","/")};return window.addEventListener("admin:logout",S),()=>window.removeEventListener("admin:logout",S)},[Y]),ye.useEffect(()=>{!fe&&!j&&l==="dashboard"&&(c("home"),window.history.pushState({view:"home"},"","/"))},[fe,j,l]),ye.useEffect(()=>{l==="admin-dashboard"&&(async()=>{try{(await ln(`${ct}/api/visitor-forms/`)).ok&&ce.invalidateQueries({queryKey:["visitor-forms"]}),(await ln(`${ct}/api/announcements/`)).ok&&ce.invalidateQueries({queryKey:["announcements"]})}catch(U){console.error("Failed to refresh admin data:",U)}})()},[l]),ye.useEffect(()=>{window.scrollTo(0,0)},[l,g,A,E]),ye.useEffect(()=>{const S={home:"PinoBite - Fuel Your Body Naturally",shop:"Shop | PinoBite",product:g?`${g.name} | PinoBite`:"Product | PinoBite",blogs:"Blogs | PinoBite","blog-detail":E?`${E.title} | PinoBite`:"Blog | PinoBite","event-blogs":"Events | PinoBite","event-detail":A?`${A.title} | PinoBite`:"Event | PinoBite",dashboard:"My Dashboard | PinoBite",faq:"FAQ | PinoBite",distributor:"Become a Distributor | PinoBite",journey:"Our Journey | PinoBite",checkout:"Checkout | PinoBite","privacy-policy":"Privacy Policy | PinoBite","terms-and-conditions":"Terms & Conditions | PinoBite","refund-policy":"Refund Policy | PinoBite","shipping-policy":"Shipping Policy | PinoBite","admin-login":"Admin Login | PinoBite","admin-dashboard":"Admin Dashboard | PinoBite","visitor-form":"Visitor Form | PinoBite","shared-wishlist":"Shared Wishlist | PinoBite","not-found":"Page Not Found | PinoBite"};document.title=S[l]||"PinoBite"},[l,g,E,A]);
4221const zt=async S=>{try{const U=await ln(`${ct}/api/products/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.name,price:S.price,rating:S.rating,review_count:S.reviewCount,image:S.image,benefits:S.benefits,nutrients:S.nutrients,ingredients:S.ingredients,ingredients_list:S.ingredientsList,detailed_nutrition:S.detailedNutrition,is_top_rated:S.isTopRated,category:S.category,stock:S.stock,model_3d:S.model3d,theme_color:S.themeColor,orientation:S.orientation,usage_ideas:S.usageIdeas})});if(U.status===401){ne();return}if(U.ok)ce.invalidateQueries({queryKey:["products"]}),Y("Product added successfully!","success");else{const re=await U.json().catch(()=>({}));Y(`Failed to add product: ${re.detail||"Unknown error"}`,"error")}}catch(U){console.error("Failed to add product",U)}},P=async S=>{try{const U=await ln(`${ct}/api/products/${S.id}/`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.name,price:S.price,description:S.description||"",rating:S.rating,review_count:S.reviewCount,image:S.image,benefits:S.benefits,nutrients:S.nutrients,ingredients:S.ingredients,ingredients_list:S.ingredientsList,detailed_nutrition:S.detailedNutrition,is_top_rated:S.isTopRated,category:S.category,stock:S.stock,model_3d:S.model3d,theme_color:S.themeColor,orientation:S.orientation,usage_ideas:S.usageIdeas})});if(U.status===401){ne();return}U.ok?(ce.invalidateQueries({queryKey:["products"]}),Y("Product updated successfully!","success")):Y("Failed to update product","error")}catch(U){console.error("Failed to update product",U)}},T=async S=>{try{const U=await ln(`${ct}/api/products/${S}/`,{method:"DELETE"});if(U.status===401){ne();return}U.ok?(ce.invalidateQueries({queryKey:["products"]}),Y("Product deleted successfully!","success")):Y("Failed to delete product","error")}catch(U){console.error("Failed to delete product",U)}},ee=async S=>{try{const U=await ln(`${ct}/api/visitor-forms/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S.title,event_name:S.event_name,status:S.status,form_schema:S.form_schema,require_email_verification:S.require_email_verification})});if(U.ok){const re=await U.json();return ce.invalidateQueries({queryKey:["visitor-forms"]}),re}else{const re=await U.json().catch(()=>({}));Y(re.detail||"Failed to create form","error")}}catch(U){console.error("Failed to add visitor form",U),Y("Failed to create form","error")}return null},se=async(S,U)=>{try{(await ln(`${ct}/api/visitor-forms/${S}/`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(U)})).ok?(ce.invalidateQueries({queryKey:["visitor-forms"]}),Y("Form updated successfully!","success")):Y("Failed to update form","error")}catch(re){console.error("Failed to update visitor form",re)}},he=async S=>{try{const U=await ln(`${ct}/api/visitor-forms/${S}/`,{method:"DELETE"});if(U.status===401){ne();return}U.ok?ce.invalidateQueries({queryKey:["visitor-forms"]}):Y("Failed to delete form","error")}catch(U){console.error("Failed to delete visitor form",U)}},Re=async S=>{try{const U=await ln(`${ct}/api/categories/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if(U.status===401){Y("Session expired. Please log in again.","warning"),ne();return}U.ok&&ce.invalidateQueries({queryKey:["categories"]})}catch(U){console.error("Failed to add category",U)}},Oe=async S=>{try{const U=await ln(`${ct}/api/categories/${S}/`,{method:"DELETE"});if(U.status===401){Y("Session expired. Please log in again.","warning"),ne();return}if(!U.ok)throw new Error("Failed to delete category");ce.invalidateQueries({queryKey:["categories"]})}catch(U){console.error("Failed to delete category",U)}},de=async S=>{try{(await ln(`${ct}/api/events/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S.title,location:S.location,image:S.image,summary:S.summary,full_story:S.fullStory,gallery:S.gallery,featured_products:S.featuredProducts,date:S.date,impact_participants:S.impactParticipants,fuel_bars_shared:S.fuelBarsShared,vibe_energy:S.vibeEnergy,scheduled_date:S.scheduledDate||null,is_active:S.isActive!==!1})})).ok?(ce.invalidateQueries({queryKey:["events"]}),Y("Event story published successfully!","success")):Y("Failed to publish event story","error")}catch(U){console.error("Failed to add event",U),Y("An error occurred while publishing the event","error")}},pe=async S=>{try{(await ln(`${ct}/api/events/${S.id}/`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S.title,location:S.location,image:S.image,summary:S.summary,full_story:S.fullStory,gallery:S.gallery,featured_products:S.featuredProducts,date:S.date,impact_participants:S.impactParticipants,fuel_bars_shared:S.fuelBarsShared,vibe_energy:S.vibeEnergy,scheduled_date:S.scheduledDate||null,is_active:S.isActive!==!1})})).ok?(ce.invalidateQueries({queryKey:["events"]}),Y("Event story updated successfully!","success")):Y("Failed to update event story","error")}catch(U){console.error("Failed to update event",U),Y("An error occurred while updating the event","error")}},De=async S=>{try{(await ln(`${ct}/api/events/${S}/`,{method:"DELETE"})).ok?(ce.invalidateQueries({queryKey:["events"]}),Y("Event story deleted successfully!","success")):Y("Failed to delete event story","error")}catch(U){console.error("Failed to delete event",U),Y("An error occurred while deleting the event","error")}},Ge=async S=>{try{(await ln(`${ct}/api/customers/${S}/toggle_active/`,{method:"POST"})).ok&&(ce.invalidateQueries({queryKey:["customers"]}),Y("Customer status updated","success"))}catch(U){console.error(U)}},Ie=async S=>{if(window.confirm("Are you sure you want to permanently delete this customer?"))try{(await ln(`${ct}/api/customers/${S}/`,{method:"DELETE"})).ok&&(ce.invalidateQueries({queryKey:["customers"]}),Y("Customer deleted successfully","success"))}catch(U){console.error(U)}},Pe=async S=>{try{const U=await ln(`${ct}/api/hero-slides/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:S.category,headline:S.headline,image:S.image,cta:S.cta,cta_link:S.ctaLink,secondary_cta:S.secondaryCta,secondary_cta_link:S.secondaryCtaLink,bg_color:S.bgColor,accent_color:S.accentColor,blob_color:S.blobColor,background_image:S.backgroundImage,product_id:S.productId,transition_type:S.transitionType,is_active:S.isActive,order:S.order||0,mobile_image:S.mobileImage,display_duration:S.displayDuration||5})});U.ok?(ce.invalidateQueries({queryKey:["hero-slides"]}),Y("Slide added successfully!","success")):console.error("Failed to add slide response:",await U.text())}catch(U){console.error("Failed to add slide caught:",U)}},Je=async S=>{try{const U=await ln(`${ct}/api/hero-slides/${S.id}/`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:S.category,headline:S.headline,image:S.image,cta:S.cta,cta_link:S.ctaLink,secondary_cta:S.secondaryCta,secondary_cta_link:S.secondaryCtaLink,bg_color:S.bgColor,accent_color:S.accentColor,blob_color:S.blobColor,background_image:S.backgroundImage,product_id:S.productId,transition_type:S.transitionType,is_active:S.isActive,order:S.order||0,mobile_image:S.mobileImage,display_duration:S.displayDuration||5})});U.ok?ce.invalidateQueries({queryKey:["hero-slides"]}):console.error("Failed to update slide response:",await U.text())}catch(U){console.error("Failed to update slide caught:",U)}},$e=async S=>{try{await ln(`${ct}/api/hero-slides/${S}/`,{method:"DELETE"}),ce.invalidateQueries({queryKey:["hero-slides"]})}catch(U){console.error("Failed to delete slide",U)}},ot=S=>{const U=new FormData;return U.append("post_type",S.type),U.append("title",S.title),U.append("excerpt",S.excerpt),U.append("date",S.date?new Date(S.date).toISOString().split("T")[0]:new Date().toISOString().split("T")[0]),U.append("author",S.author),U.append("content",S.content),U.append("is_active",String(S.isActive!==!1)),U.append("subtitle",S.subtitle||""),U.append("intro_heading",S.intro_heading||""),U.append("featured_quote",S.featured_quote||""),U.append("tags",S.tags?S.tags.join(","):""),U.append("facts_list",JSON.stringify(S.facts_list||[])),U.append("key_points",JSON.stringify(S.key_points||[])),U.append("health_benefits",JSON.stringify(S.health_benefits||[])),U.append("usage_recipes",JSON.stringify(S.usage_recipes||[])),U},q=async S=>{try{const U={};let re;if(S.imageFile){const Me=ot(S);Me.append("image",S.imageFile),re=Me}else U["Content-Type"]="application/json",re=JSON.stringify({post_type:S.type,title:S.title,excerpt:S.excerpt,image:S.image,date:S.date?new Date(S.date).toISOString().split("T")[0]:new Date().toISOString().split("T")[0],author:S.author,content:S.content,tags:S.tags,is_active:S.isActive!==!1,subtitle:S.subtitle||null,intro_heading:S.intro_heading||null,featured_quote:S.featured_quote||null,facts_list:S.facts_list||[],key_points:S.key_points||[],health_benefits:S.health_benefits||[],usage_recipes:S.usage_recipes||[]});(await ln(`${ct}/api/blog-posts/`,{method:"POST",headers:U,body:re})).ok&&ce.invalidateQueries({queryKey:["blog-posts"]})}catch(U){console.error("Failed to add blog",U)}},Ne=async S=>{try{(await ln(`${ct}/api/announcements/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S.message,start_date:S.start_date,end_date:S.end_date,is_active:S.is_active})})).ok&&ce.invalidateQueries({queryKey:["announcements"]})}catch(U){console.error("Failed to add announcement",U)}},xe=async S=>{try{(await ln(`${ct}/api/announcements/${S.id}/`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S.message,start_date:S.start_date,end_date:S.end_date,is_active:S.is_active})})).ok&&ce.invalidateQueries({queryKey:["announcements"]})}catch(U){console.error("Failed to update announcement",U)}},Ue=async S=>{try{(await ln(`${ct}/api/announcements/${S}/`,{method:"DELETE"})).ok&&ce.invalidateQueries({queryKey:["announcements"]})}catch(U){console.error("Failed to delete announcement",U)}},Fe=async S=>{try{const U={};let re;if(S.imageFile){const Me=ot(S);Me.append("image",S.imageFile),re=Me}else U["Content-Type"]="application/json",re=JSON.stringify({post_type:S.type,title:S.title,excerpt:S.excerpt,image:S.image,date:S.date?new Date(S.date).toISOString().split("T")[0]:new Date().toISOString().split("T")[0],author:S.author,content:S.content,tags:S.tags,is_active:S.isActive!==!1,subtitle:S.subtitle||null,intro_heading:S.intro_heading||null,featured_quote:S.featured_quote||null,facts_list:S.facts_list||[],key_points:S.key_points||[],health_benefits:S.health_benefits||[],usage_recipes:S.usage_recipes||[]});(await ln(`${ct}/api/blog-posts/${S.id}/`,{method:"PUT",headers:U,body:re})).ok&&ce.invalidateQueries({queryKey:["blog-posts"]})}catch(U){console.error("Failed to update blog",U)}},be=async S=>{try{(await ln(`${ct}/api/blog-posts/${S}/`,{method:"DELETE"})).ok&&ce.invalidateQueries({queryKey:["blog-posts"]})}catch(U){console.error("Failed to delete blog",U)}},qe=S=>{ce.invalidateQueries({queryKey:["reviews"]}),B()},Ve=async S=>{try{const U=await ln(`${ct}/api/stories/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({media_url:S.mediaUrl,poster_url:S.posterUrl,media_type:S.mediaType,original_drive_url:S.originalDriveUrl,full_video_url:S.fullVideoUrl,product_id:S.productId})});if(U.ok)ce.invalidateQueries({queryKey:["stories"]}),Y("Story added successfully!","success");else{const re=await U.json().catch(()=>({}));Y(`Failed to add story: ${re.detail||re.error||U.statusText}`,"error")}}catch(U){console.error("Failed to add story",U),Y("Error adding story. The image might be too large or the server is busy.","error")}},cn=async S=>{try{(await ln(`${ct}/api/stories/${S}/`,{method:"DELETE"})).ok?(ce.invalidateQueries({queryKey:["stories"]}),Y("Story deleted successfully!","success")):Y("Failed to delete story","error")}catch(U){console.error("Failed to delete story",U),Y("Error deleting story","error")}},At=et.useCallback(S=>{rn(U=>U.find(Ee=>Ee.id===S.id)?U.map(Ee=>Ee.id===S.id?{...Ee,quantity:Ee.quantity+1}:Ee):[...U,{...S,quantity:1}]),h(!0)},[]),Zn=et.useCallback(S=>{rn(U=>U.filter(re=>re.id!==S))},[]),Jn=et.useCallback((S,U)=>{rn(re=>re.map(Ee=>{if(Ee.id===S){const Me=Math.max(1,Ee.quantity+U);return{...Ee,quantity:Me}}return Ee}))},[]),pi=et.useCallback(async S=>{b(S),c("product"),window.history.pushState({view:"product",slug:S.slug},"",`/product/${S.slug}`),window.scrollTo(0,0);try{const U=await fetch(`${ct}/api/products/${S.slug}/`);
4221if(U.ok){const re=await U.json(),Ee={...re,id:String(re.id),price:parseFloat(re.price),themeColor:re.theme_color,model3d:re.model_3d,orientation:re.orientation?re.orientation.replace(/[Oo]/g,"0"):"0deg 0deg -15deg",benefits:(re.benefits||[]).filter(Me=>Me&&String(Me).trim()!==""),nutrients:re.nutrients||[],ingredients:re.ingredients||"",ingredientsList:re.ingredients_list||[],detailedNutrition:re.detailed_nutrition||[],usageIdeas:(re.usage_ideas||[]).map(Me=>({id:String(Me.id),productId:String(Me.product),title:Me.title,description:Me.description,image:Me.image||"",order:Me.order||0})),gallery:re.gallery||[],mainIngredient:re.main_ingredient||(re.name.toLowerCase().includes("peanut")?"100% Roasted Peanuts":re.name.toLowerCase().includes("almond")?"Premium Roasted Almonds":re.name.toLowerCase().includes("chocolate")?"Dark Belgian Chocolate":re.name.toLowerCase().includes("strawberry")?"Fresh Strawberries":re.name.toLowerCase().includes("chia")?"Organic Chia Seeds":"Premium Ingredients"),mainIngredientImage:re.main_ingredient_image||(re.name.toLowerCase().includes("peanut")?"https://images.unsplash.com/photo-1590301157890-4810ed352733?q=80&w=800&auto=format&fit=crop":re.name.toLowerCase().includes("almond")?"https://images.unsplash.com/photo-1508029091899-59990abc4b8d?q=80&w=800&auto=format&fit=crop":re.name.toLowerCase().includes("chocolate")?"https://images.unsplash.com/photo-1511381939415-322199ae53d5?q=80&w=800&auto=format&fit=crop":re.name.toLowerCase().includes("strawberry")?"https://images.unsplash.com/photo-1518635017498-87afc0455a43?q=80&w=800&auto=format&fit=crop":re.name.toLowerCase().includes("chia")?"https://images.unsplash.com/photo-1588600030303-920aa942828b?q=80&w=800&auto=format&fit=crop":void 0)};b(Ee)}}catch(U){console.error("Failed to fetch full product details",U)}},[]),$n=et.useCallback(()=>{O("All"),c("shop"),b(null),H(""),h(!1),m(!1),window.history.pushState({view:"shop",category:"All",query:""},"","/shop")},[]),Aa=et.useCallback(S=>{O(S),c("shop"),H(""),b(null),window.history.pushState({view:"shop",category:S,query:""},"",`/shop/${S}`)},[]),ls=et.useCallback(S=>{H(S),O("All"),c("shop"),b(null),window.history.pushState({view:"shop",category:"All",query:S},"",`/shop?search=${encodeURIComponent(S)}`)},[]),wi=et.useCallback(()=>{if(!i){localStorage.setItem("redirect_after_login","checkout"),m(!0),h(!1);return}c("checkout"),h(!1),b(null),window.history.pushState({view:"checkout"},"","/checkout")},[i]),mn=et.useCallback(()=>{c("dashboard"),b(null),window.history.pushState({view:"dashboard"},"","/dashboard")},[]),Un=et.useCallback(()=>{c("faq"),b(null),window.history.pushState({view:"faq"},"","/faq")},[]),Wn=et.useCallback(()=>{c("distributor"),b(null),window.history.pushState({view:"distributor"},"","/distributor")},[]),Ci=et.useCallback(()=>{c("blogs"),b(null),window.history.pushState({view:"blogs"},"","/blogs")},[]),cs=et.useCallback(S=>{M(S),c("blog-detail"),window.history.pushState({view:"blog-detail",slug:S.slug},"",`/blog/${S.slug}`)},[]),us=et.useCallback(()=>{c("event-blogs"),b(null),D(null),window.history.pushState({view:"event-blogs"},"","/events")},[]),aa=et.useCallback(S=>{D(S),c("event-detail"),window.history.pushState({view:"event-detail",eventId:S.id},"",`/event/${S.id}`)},[]),sa=et.useCallback(()=>{r?(c("admin-dashboard"),window.history.pushState({view:"admin-dashboard"},"","/admin")):(c("admin-login"),window.history.pushState({view:"admin-login"},"","/admin/login"))},[r]),ki=et.useCallback(()=>{c("journey"),b(null),D(null),window.history.pushState({view:"journey"},"","/journey")},[]),Vi=et.useCallback(()=>{c("privacy-policy"),b(null),window.history.pushState({view:"privacy-policy"},"","/privacy-policy")},[]),ji=et.useCallback(()=>{c("terms-and-conditions"),b(null),window.history.pushState({view:"terms-and-conditions"},"","/terms-and-conditions")},[]),wa=et.useCallback(()=>{c("refund-policy"),b(null),window.history.pushState({view:"refund-policy"},"","/refund-policy")},[]),ra=et.useCallback(()=>{c("shipping-policy"),b(null),window.history.pushState({view:"shipping-policy"},"","/shipping-policy")},[]),mt=et.useCallback(()=>{c("home"),b(null),D(null),M(null),H(""),h(!1),m(!1),window.history.pushState({view:"home"},"","/")},[]),Hr=()=>{m(!1),localStorage.getItem("redirect_after_login")==="checkout"?(localStorage.removeItem("redirect_after_login"),c("checkout"),window.history.pushState({view:"checkout"},"","/checkout")):(c("dashboard"),window.history.pushState({view:"dashboard"},"","/dashboard"))},R=()=>{te(),c("home"),window.history.pushState({view:"home"},"","/")},K=()=>{e(!0),c("admin-dashboard"),window.history.pushState({view:"admin-dashboard"},"","/admin")},ne=()=>{e(!1),localStorage.removeItem("admin_access_token"),localStorage.removeItem("admin_refresh_token"),c("home"),window.history.pushState({view:"home"},"","/")};return l==="admin-login"?x.jsx(Bw,{onLoginSuccess:K,onBackToSite:mt}):l==="admin-dashboard"?x.jsx(Hw,{onLogout:ne,onBackToSite:mt,products:ke,onAddProduct:zt,onUpdateProduct:P,onDeleteProduct:T,categories:Ze,onAddCategory:Re,onDeleteCategory:Oe,events:vt,onAddEvent:de,onUpdateEvent:pe,onDeleteEvent:De,slides:Et,onAddSlide:Pe,onUpdateSlide:Je,onDeleteSlide:$e,blogPosts:ht,onAddBlog:q,onUpdateBlog:Fe,onDeleteBlog:be,stories:sn,onAddStory:Ve,onDeleteStory:cn,visitorForms:yt,onAddVisitorForm:ee,onUpdateVisitorForm:se,onDeleteVisitorForm:he,announcements:en,onAddAnnouncement:Ne,onUpdateAnnouncement:xe,onDeleteAnnouncement:Ue,customers:pn.data||[],onToggleCustomerActive:Ge,onDeleteCustomer:Ie}):x.jsxs("div",{className:`min-h-screen selection:bg-primary/20 ${["dashboard","shop"].includes(l)?"bg-[#f2f2ec]":"bg-background-light"}`,children:[x.jsx(Yo,{children:Ht&&x.jsx(na.div,{initial:{opacity:1},exit:{opacity:0}
4221,transition:{duration:.8,ease:"easeInOut"},className:"fixed inset-0 z-[10000] bg-white flex flex-col items-center justify-center",children:x.jsx("div",{className:"relative w-32 h-32",children:x.jsx(na.img,{src:"/logos/Pinobite-logo.png",animate:{scale:[1,1.1,1]},transition:{duration:2,repeat:1/0},className:"w-full h-full object-contain",alt:"Pinobite Logo"})})})}),l!=="checkout"&&l!=="visitor-form"&&x.jsx(ZS,{cartCount:Wt.reduce((S,U)=>S+U.quantity,0),isLoggedIn:i,onCartClick:()=>h(!0),onAccountClick:()=>i?mn():m(!0),onLogoClick:mt,onProductsClick:()=>$n(),onCategoryClick:Aa,onDashboardClick:()=>mn(),onStoriesClick:Ci,onJourneyClick:ki,onSearch:ls,products:ke,blogPosts:ht,events:Q,onProductClick:pi,onBlogClick:cs,onEventClick:aa,categories:Ze,onMenuStateChange:k,announcements:(en||[]).filter(S=>{if(!S||!S.is_active||!S.start_date||!S.end_date)return!1;const U=new Date,re=U.getFullYear(),Ee=String(U.getMonth()+1).padStart(2,"0"),Me=String(U.getDate()).padStart(2,"0"),ze=`${re}-${Ee}-${Me}`,Be=S.start_date.split("T")[0],Qe=S.end_date.split("T")[0];return ze>=Be&&ze<=Qe}).map(S=>S.message)}),x.jsx(Yo,{mode:"wait",children:x.jsx(na.main,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.35,ease:[.25,1,.5,1]},className:"w-full min-h-screen",children:x.jsxs(et.Suspense,{fallback:x.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white",children:x.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})}),children:[l==="home"&&x.jsxs(x.Fragment,{children:[Et.length>0&&x.jsx(e1,{slides:Et}),ke.length>0&&x.jsx(n1,{onCategoryClick:Aa,products:ke}),sn.length>0&&x.jsx(z3,{stories:[...sn].reverse().slice(0,5),products:ke,onProductClick:pi,onAddToCart:At}),ke.length>0&&x.jsx("div",{className:"snaxxo-wrapper relative w-full overflow-hidden bg-whiteboard-alt texture-overlay texture-speckles",children:x.jsx(Kw,{products:ke,onAddToCart:At,onProductClick:pi,isLoading:Ht,onShopClick:$n})}),x.jsx(a1,{product:ke[0]}),x.jsx(r1,{}),rt.length>0&&x.jsx(l1,{reviews:rt}),ht.length>0&&x.jsx(L3,{posts:un,onPostClick:cs,onViewAllClick:Ci}),vt.length>0&&x.jsx(O3,{events:Q,onParticipateClick:()=>v(!0),onViewRecapsClick:us}),x.jsx(H3,{pressUpdates:[]}),x.jsx(c1,{})]}),l==="distributor"&&x.jsx(Pw,{onHomeClick:mt}),l==="shared-wishlist"&&C&&x.jsx(qw,{token:C,onBack:mt,onAddToCart:At}),l==="shop"&&x.jsx(Nw,{onProductClick:pi,onAddToCart:At,searchQuery:L,selectedCategory:w,onHomeClick:mt}),l==="product"&&g&&x.jsx(Rw,{product:g,products:ke,stories:sn,onProductClick:pi,onShopClick:$n,onAddToCart:At,onBack:$n,reviews:rt,onAddReview:qe,isLoggedIn:i,onLoginClick:()=>m(!0),onPopupToggle:me,onHomeClick:mt}),l==="checkout"&&x.jsx(Dw,{items:Wt,onBack:$n,onOrderSuccess:()=>{rn([]),mt()},onLoginRequired:()=>{localStorage.setItem("redirect_after_login","checkout"),m(!0)},checkAuth:B}),l==="dashboard"&&x.jsx(Uw,{onLogout:R,onHomeClick:mt,onAddToCart:At,onProductClick:pi}),l==="faq"&&x.jsx(Lw,{onHomeClick:mt}),l==="blogs"&&x.jsx(Ow,{posts:un,onBlogClick:cs,onHomeClick:mt}),l==="blog-detail"&&E&&x.jsx(Iw,{post:E,onBack:Ci,onHomeClick:mt}),l==="event-blogs"&&x.jsx(Fw,{events:Q,onEventClick:aa,onHomeClick:mt}),l==="event-detail"&&A&&x.jsx(zw,{event:A,onBack:us,onHomeClick:mt,products:ke,onProductClick:pi,onAddToCart:At}),l==="journey"&&x.jsx(kw,{onShopClick:$n,onHomeClick:mt}),l==="privacy-policy"&&x.jsx(Vw,{onHomeClick:mt}
4221),l==="terms-and-conditions"&&x.jsx(jw,{onHomeClick:mt}),l==="refund-policy"&&x.jsx(Xw,{onHomeClick:mt}),l==="shipping-policy"&&x.jsx(Ww,{onHomeClick:mt}),l==="visitor-form"&&z&&x.jsx(Gw,{formId:z,onHomeClick:mt}),l==="not-found"&&x.jsx(Yw,{onHomeClick:mt})]})},l+(l==="product"&&(g==null?void 0:g.id)||"")+(l==="blog-detail"&&(E==null?void 0:E.id)||"")+(l==="event-detail"&&(A==null?void 0:A.id)||""))}),l!=="checkout"&&l!=="visitor-form"&&l!=="dashboard"&&x.jsx(C3,{onShopClick:S=>S?Aa(S):$n(),onHomeClick:mt,onFAQClick:Un,onBlogsClick:Ci,onEventBlogsClick:us,onAdminClick:sa,onJourneyClick:ki,onPrivacyClick:Vi,onTermsClick:ji,onRefundClick:wa,onShippingClick:ra,onDistributorClick:Wn}),x.jsx(R3,{}),x.jsx(ww,{isOpen:d,onClose:()=>h(!1),items:Wt,products:Se.data||[],onRemove:Zn,onUpdateQty:Jn,onAddToCart:At,onCheckout:wi,onShopClick:$n}),x.jsx(Cw,{isOpen:p,onClose:()=>m(!1),onLogin:Hr}),x.jsx(Qw,{isOpen:_,onClose:()=>v(!1),events:vt}),l!=="checkout"&&l!=="visitor-form"&&!Ht&&x.jsx(G3,{currentView:l,onHomeClick:mt,onShopClick:$n,onCartClick:()=>{h(!0),m(!1)},onAccountClick:()=>{i?(mn(),m(!1),h(!1)):(m(!0),h(!1))},cartCount:Wt.reduce((S,U)=>S+U.quantity,0),isCartOpen:d,isAuthOpen:p,isMenuOpen:V,isHidden:$})]})},hC=()=>x.jsx(U3,{children:x.jsx(k3,{children:x.jsx(dC,{})})}),pC=new pw({defaultOptions:{queries:{staleTime:0,gcTime:1e3*60*30,retry:1,refetchOnWindowFocus:!1}}}),Fy=document.getElementById("root");if(!Fy)throw new Error("Could not find root element to mount to");const mC=YS.createRoot(Fy);mC.render(x.jsx(et.StrictMode,{children:x.jsx(mw,{client:pC,children:x.jsx(hC,{})})}));export{ct as A,u1 as M,c1 as N,z3 as S,l1 as T,D3 as a,$S as b,yC as c,ln as d,On as g,N3 as t,V3 as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.